@camera.ui/browser 0.0.69 → 0.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -2
- package/dist/types/server/bin/python.d.ts +43 -0
- package/dist/types/server/src/api/database/index.d.ts +24 -0
- package/dist/types/server/src/api/database/types.d.ts +12 -34
- package/dist/types/server/src/api/go2rtc/api/application.d.ts +9 -0
- package/dist/types/server/src/api/go2rtc/api/config.d.ts +9 -0
- package/dist/types/server/src/api/go2rtc/api/index.d.ts +2 -0
- package/dist/types/server/src/api/go2rtc/api/snapshot.d.ts +8 -0
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +11 -0
- package/dist/types/server/src/api/go2rtc/index.d.ts +13 -0
- package/dist/types/server/src/api/go2rtc/queue.d.ts +10 -0
- package/dist/types/server/src/api/middlewares/socketAuth.middleware.d.ts +41 -0
- package/dist/types/server/src/api/services/auth.service.d.ts +20 -0
- package/dist/types/server/src/api/services/cameras.service.d.ts +54 -0
- package/dist/types/server/src/api/services/plugins.service.d.ts +25 -0
- package/dist/types/server/src/api/services/users.service.d.ts +13 -0
- package/dist/types/server/src/api/utils/constants.d.ts +15 -0
- package/dist/types/server/src/api/websocket/index.d.ts +15 -0
- package/dist/types/server/src/api/websocket/nsp/frame.d.ts +10 -0
- package/dist/types/server/src/api/websocket/nsp/logs.d.ts +11 -0
- package/dist/types/server/src/api/websocket/nsp/metrics.d.ts +33 -0
- package/dist/types/server/src/api/websocket/nsp/notifications.d.ts +11 -0
- package/dist/types/server/src/api/websocket/nsp/plugins.d.ts +13 -0
- package/dist/types/server/src/api/websocket/nsp/server.d.ts +9 -0
- package/dist/types/server/src/api/websocket/nsp/status.d.ts +20 -0
- package/dist/types/server/src/api/websocket/nsp/streams.d.ts +15 -0
- package/dist/types/server/src/api/{ws → websocket}/types.d.ts +1 -1
- package/dist/types/server/src/api.d.ts +44 -0
- package/dist/types/server/src/camera/base/cameraDevice.d.ts +1 -0
- package/dist/types/server/src/camera/base/cameraDeviceBrowser.d.ts +1 -0
- package/dist/types/server/src/camera/base/index.d.ts +16 -1
- package/dist/types/server/src/camera/controller.d.ts +27 -0
- package/dist/types/server/src/camera/types.d.ts +27 -20
- package/dist/types/server/src/decoder/index.d.ts +11 -0
- package/dist/types/server/src/decoder/types.d.ts +4 -0
- package/dist/types/server/src/decoder/worker/index.d.ts +3 -0
- package/dist/types/server/src/decoder/worker/runtime/base/index.d.ts +36 -0
- package/dist/types/server/src/decoder/worker/runtime/child-process/index.d.ts +17 -0
- package/dist/types/server/src/decoder/worker/runtime/worker-thread/index.d.ts +22 -0
- package/dist/types/server/src/go2rtc/index.d.ts +25 -0
- package/dist/types/server/src/nats/constants.d.ts +1 -0
- package/dist/types/server/src/nats/index.d.ts +34 -0
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +96 -0
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +31 -0
- package/dist/types/server/src/nats/proxy/index.d.ts +4 -0
- package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +12 -0
- package/dist/types/server/src/nats/proxy/systemManager.d.ts +8 -0
- package/dist/types/server/src/nats/queue.d.ts +17 -0
- package/dist/types/server/src/nats/server.d.ts +33 -0
- package/dist/types/server/src/nats/types.d.ts +15 -7
- package/dist/types/server/src/nats/utils.d.ts +4 -0
- package/dist/types/server/src/nats/websocket.d.ts +22 -0
- package/dist/types/server/src/plugins/base.d.ts +7 -0
- package/dist/types/server/src/plugins/index.d.ts +29 -0
- package/dist/types/server/src/plugins/node/api.d.ts +42 -0
- package/dist/types/server/src/plugins/node/cameraStorage.d.ts +108 -0
- package/dist/types/server/src/plugins/node/config.d.ts +104 -0
- package/dist/types/server/src/plugins/node/logger.d.ts +14 -0
- package/dist/types/server/src/plugins/node/proxy/cameraDevice.d.ts +44 -0
- package/dist/types/server/src/plugins/node/proxy/deviceManager.d.ts +47 -0
- package/dist/types/server/src/plugins/node/proxy/index.d.ts +4 -0
- package/dist/types/server/src/plugins/node/proxy/pluginsManager.d.ts +38 -0
- package/dist/types/server/src/plugins/node/proxy/queue.d.ts +18 -0
- package/dist/types/server/src/plugins/node/proxy/systemManager.d.ts +36 -0
- package/dist/types/server/src/plugins/node/schema.d.ts +268 -0
- package/dist/types/server/src/plugins/node/storageController.d.ts +28 -0
- package/dist/types/server/src/plugins/plugin.d.ts +42 -0
- package/dist/types/server/src/plugins/types.d.ts +2 -2
- package/dist/types/server/src/plugins/worker-ipc.d.ts +22 -0
- package/dist/types/server/src/plugins/worker.d.ts +30 -0
- package/dist/types/server/src/services/config/constants.d.ts +6 -0
- package/dist/types/server/src/services/config/index.d.ts +60 -0
- package/dist/types/server/src/services/logger/index.d.ts +28 -0
- package/dist/types/server/src/utils/index.d.ts +6 -0
- package/dist/types/shared/types/index.d.ts +1 -1
- package/package.json +2 -1
- package/.eslintrc.cjs +0 -44
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Plugin } from './plugin.js';
|
|
3
|
+
import { PluginWorker } from './worker.js';
|
|
4
|
+
import type { IPackageJson } from '../api/types/index.js';
|
|
5
|
+
export declare class PluginManager {
|
|
6
|
+
private logger;
|
|
7
|
+
private api;
|
|
8
|
+
private configService;
|
|
9
|
+
plugins: Map<string, Plugin>;
|
|
10
|
+
pluginWorkers: Map<string, PluginWorker>;
|
|
11
|
+
searchPaths: Set<string>;
|
|
12
|
+
constructor();
|
|
13
|
+
static isQualifiedPluginIdentifier(pluginName: string): boolean;
|
|
14
|
+
static extractPluginScope(pluginName: string): string;
|
|
15
|
+
static extractPluginName(pluginName: string): string;
|
|
16
|
+
static transformDisplaName(pluginName: string): string;
|
|
17
|
+
static loadPackageJSON(installPath: string): IPackageJson;
|
|
18
|
+
initializeInstalledPlugins(): Promise<void>;
|
|
19
|
+
initializeInstalledPlugin(plugin: Plugin): Promise<void>;
|
|
20
|
+
loadPlugin(absolutePath: string, pluginId?: string, storagePath?: string): Promise<Plugin>;
|
|
21
|
+
removePlugin(plugin: Plugin, removeFromDb?: boolean, removeStorage?: boolean): Promise<void>;
|
|
22
|
+
startPluginChild(pluginName: string): Promise<void>;
|
|
23
|
+
stopPluginChild(pluginName: string): Promise<void>;
|
|
24
|
+
initializePlugins(): Promise<void>;
|
|
25
|
+
private loadInstalledPlugins;
|
|
26
|
+
private removeOrphanedPlugins;
|
|
27
|
+
private loadDefaultPaths;
|
|
28
|
+
private addNpmPrefixToSearchPaths;
|
|
29
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import { DeviceManager, PluginsManager, SystemManager } from './proxy/index.js';
|
|
4
|
+
import { StorageController } from './storageController.js';
|
|
5
|
+
import type { BasePlugin } from '../base.js';
|
|
6
|
+
import type { Plugin } from '../plugin.js';
|
|
7
|
+
import type { PluginConfigService } from './config.js';
|
|
8
|
+
import type { PluginLogger } from './logger.js';
|
|
9
|
+
export declare interface API {
|
|
10
|
+
on(event: 'finishLaunching', listener: () => void): this;
|
|
11
|
+
on(event: 'shutdown', listener: () => void): this;
|
|
12
|
+
once(event: 'finishLaunching', listener: () => void): this;
|
|
13
|
+
once(event: 'shutdown', listener: () => void): this;
|
|
14
|
+
off(event: 'finishLaunching', listener: () => void): this;
|
|
15
|
+
off(event: 'shutdown', listener: () => void): this;
|
|
16
|
+
removeListener(event: 'finishLaunching', listener: () => void): this;
|
|
17
|
+
removeListener(event: 'shutdown', listener: () => void): this;
|
|
18
|
+
removeAllListeners(event?: string): this;
|
|
19
|
+
readonly deviceManager: DeviceManager;
|
|
20
|
+
readonly pluginsManager: PluginsManager;
|
|
21
|
+
readonly systemManager: SystemManager;
|
|
22
|
+
readonly storageController: StorageController;
|
|
23
|
+
readonly configService: PluginConfigService;
|
|
24
|
+
readonly storagePath: string;
|
|
25
|
+
readonly configFile: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class PluginAPI extends EventEmitter implements API {
|
|
28
|
+
private initialized;
|
|
29
|
+
readonly deviceManager: DeviceManager;
|
|
30
|
+
readonly pluginsManager: PluginsManager;
|
|
31
|
+
readonly systemManager: SystemManager;
|
|
32
|
+
readonly storageController: StorageController;
|
|
33
|
+
readonly configService: PluginConfigService;
|
|
34
|
+
readonly storagePath: string;
|
|
35
|
+
readonly configFile: string;
|
|
36
|
+
readonly plugin: BasePlugin;
|
|
37
|
+
constructor(plugin: Plugin, logger: PluginLogger, auth: {
|
|
38
|
+
user: string;
|
|
39
|
+
pass: string;
|
|
40
|
+
});
|
|
41
|
+
init(): Promise<void>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '../types.js';
|
|
2
|
+
import type { PluginAPI } from './api.js';
|
|
3
|
+
export declare class CameraStorage {
|
|
4
|
+
private cameraId;
|
|
5
|
+
private instance;
|
|
6
|
+
private api;
|
|
7
|
+
private db;
|
|
8
|
+
private _schema;
|
|
9
|
+
private _values;
|
|
10
|
+
get values(): Record<string, any>;
|
|
11
|
+
constructor(api: PluginAPI, instance: any, cameraId: string, schema?: PluginJsonSchemaForm);
|
|
12
|
+
/**
|
|
13
|
+
* Initialize the storage.
|
|
14
|
+
* This will load the configuration from the database.
|
|
15
|
+
*/
|
|
16
|
+
initializeStorage(): Promise<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: Record<string, any>): 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: PluginJsonSchemaForm): Promise<void>;
|
|
67
|
+
addSchema(path: string, schema: PluginJsonSchema): 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): Promise<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<PluginJsonSchema>): 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 removeDb;
|
|
107
|
+
private close;
|
|
108
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type Path } from 'object-path';
|
|
2
|
+
import type { JSONValue, PluginConfig } from '../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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class PluginLogger {
|
|
2
|
+
private _prefix;
|
|
3
|
+
private _loggerPrefix;
|
|
4
|
+
private _disableTimestamps;
|
|
5
|
+
private get prefix();
|
|
6
|
+
constructor(prefix: string, disableTimestamps: boolean);
|
|
7
|
+
log(...args: any[]): void;
|
|
8
|
+
error(...args: any[]): void;
|
|
9
|
+
warn(...args: any[]): void;
|
|
10
|
+
attention(...args: any[]): void;
|
|
11
|
+
debug(...args: any[]): void;
|
|
12
|
+
trace(...args: any[]): void;
|
|
13
|
+
private formatDateTime;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CameraDevice } from '../../../camera/base/cameraDevice.js';
|
|
2
|
+
import type { Camera } from '../../../api/database/types.js';
|
|
3
|
+
import type { CameraSource, OnSetEvent, StateValues } from '../../../camera/types.js';
|
|
4
|
+
import type { Frame } from '../../../decoder/types.js';
|
|
5
|
+
import type { IceServer } from '../../../services/config/types.js';
|
|
6
|
+
import type { PluginAPI } from '../api.js';
|
|
7
|
+
import type { PluginLogger } from '../logger.js';
|
|
8
|
+
export declare class CameraDeviceProxy extends CameraDevice {
|
|
9
|
+
private api;
|
|
10
|
+
private initialized;
|
|
11
|
+
private publisher;
|
|
12
|
+
private client;
|
|
13
|
+
private cameraSubscriber;
|
|
14
|
+
private cameraPluginSubscriber;
|
|
15
|
+
private frameSubscriber?;
|
|
16
|
+
private activeSockets;
|
|
17
|
+
private messageQueue;
|
|
18
|
+
private auth;
|
|
19
|
+
private pluginID;
|
|
20
|
+
private pluginName;
|
|
21
|
+
private clientSubject;
|
|
22
|
+
private cameraSubscriberSubject;
|
|
23
|
+
private cameraPluginSubscriberSubject;
|
|
24
|
+
private frameSubject;
|
|
25
|
+
get sources(): CameraSource[];
|
|
26
|
+
constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, pluginId: string, pluginName: string, auth: {
|
|
27
|
+
user: string;
|
|
28
|
+
pass: string;
|
|
29
|
+
});
|
|
30
|
+
init(): Promise<void>;
|
|
31
|
+
connect(): Promise<void>;
|
|
32
|
+
disconnect(): Promise<void>;
|
|
33
|
+
reboot(): Promise<void>;
|
|
34
|
+
generateFrames(): AsyncIterableIterator<Frame>;
|
|
35
|
+
getFfmpegPath(): Promise<string>;
|
|
36
|
+
getIceServers(): Promise<IceServer[]>;
|
|
37
|
+
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
|
|
38
|
+
refreshStates(): Promise<void>;
|
|
39
|
+
cleanup(): Promise<void>;
|
|
40
|
+
private connectToServer;
|
|
41
|
+
private requestHandler;
|
|
42
|
+
private listenToMessages;
|
|
43
|
+
private onRequest;
|
|
44
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import { CameraDeviceProxy } from './cameraDevice.js';
|
|
4
|
+
import type { CameraDevice } from '../../../camera/base/cameraDevice.js';
|
|
5
|
+
import type { CameraConfig } from '../../../camera/types.js';
|
|
6
|
+
import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../nats/types.js';
|
|
7
|
+
import type { PluginAPI } from '../api.js';
|
|
8
|
+
import type { PluginLogger } from '../logger.js';
|
|
9
|
+
export declare interface DeviceManager extends DeviceManagerProxyMethods {
|
|
10
|
+
on<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
11
|
+
once<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
12
|
+
off<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
13
|
+
removeListener<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
14
|
+
removeAllListeners<E extends keyof DeviceManagerProxyEventCallbacks>(event?: E): this;
|
|
15
|
+
}
|
|
16
|
+
export declare class DeviceManager extends EventEmitter implements DeviceManager {
|
|
17
|
+
private api;
|
|
18
|
+
private logger;
|
|
19
|
+
private initialized;
|
|
20
|
+
private publisher;
|
|
21
|
+
private client;
|
|
22
|
+
private subscriber;
|
|
23
|
+
private messageQueue;
|
|
24
|
+
private auth;
|
|
25
|
+
private pluginId;
|
|
26
|
+
private pluginName;
|
|
27
|
+
private clientSubject;
|
|
28
|
+
private subscriberSubject;
|
|
29
|
+
private devices;
|
|
30
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, auth: {
|
|
31
|
+
user: string;
|
|
32
|
+
pass: string;
|
|
33
|
+
});
|
|
34
|
+
init(): Promise<void>;
|
|
35
|
+
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
36
|
+
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
37
|
+
createCamera(cameraConfig: CameraConfig): Promise<CameraDevice>;
|
|
38
|
+
removeCameraByName(name: string): Promise<void>;
|
|
39
|
+
removeCameraById(id: string): Promise<void>;
|
|
40
|
+
emit(): boolean;
|
|
41
|
+
configureCameras(cameraDevices: CameraDeviceProxy[]): void;
|
|
42
|
+
private requestHandler;
|
|
43
|
+
private listenToMessages;
|
|
44
|
+
private onRequest;
|
|
45
|
+
private addOrGetCamera;
|
|
46
|
+
private close;
|
|
47
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../nats/types.js';
|
|
4
|
+
import type { PluginAPI } from '../api.js';
|
|
5
|
+
import type { PluginLogger } from '../logger.js';
|
|
6
|
+
export declare interface PluginsManager extends PluginsManagerProxyMethods {
|
|
7
|
+
on<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
8
|
+
once<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
9
|
+
off<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
10
|
+
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
11
|
+
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(event?: E): this;
|
|
12
|
+
}
|
|
13
|
+
export declare class PluginsManager extends EventEmitter implements PluginsManager {
|
|
14
|
+
private api;
|
|
15
|
+
private logger;
|
|
16
|
+
private initialized;
|
|
17
|
+
private publisher;
|
|
18
|
+
private client;
|
|
19
|
+
private subscriber;
|
|
20
|
+
private messageQueue;
|
|
21
|
+
private auth;
|
|
22
|
+
private pluginId;
|
|
23
|
+
private pluginName;
|
|
24
|
+
private clientSubject;
|
|
25
|
+
private subscriberSubject;
|
|
26
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, auth: {
|
|
27
|
+
user: string;
|
|
28
|
+
pass: string;
|
|
29
|
+
});
|
|
30
|
+
init(): Promise<void>;
|
|
31
|
+
emit(): boolean;
|
|
32
|
+
private requestHandler;
|
|
33
|
+
private listenToMessages;
|
|
34
|
+
private onRequest;
|
|
35
|
+
private isPluginMessage;
|
|
36
|
+
private isStorageMessage;
|
|
37
|
+
private close;
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type NatsConnection, type Subscription } from 'nats';
|
|
2
|
+
import type { BaseLogger } from '../../../camera/types.js';
|
|
3
|
+
import type { ProxyMessageStructure } from '../../../nats/types.js';
|
|
4
|
+
export declare class ClientMessageQueue {
|
|
5
|
+
private logger;
|
|
6
|
+
private publisher;
|
|
7
|
+
private subscriber;
|
|
8
|
+
private requestHandler;
|
|
9
|
+
private aborted;
|
|
10
|
+
private isProcessing;
|
|
11
|
+
private queue;
|
|
12
|
+
private pendingResponses;
|
|
13
|
+
constructor(logger: BaseLogger, publisher: NatsConnection, subscriber: Subscription, requestHandler: (message: ProxyMessageStructure) => void);
|
|
14
|
+
abortQueue(): void;
|
|
15
|
+
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
16
|
+
private processQueue;
|
|
17
|
+
private listenToMessages;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../nats/types.js';
|
|
4
|
+
import type { PluginAPI } from '../api.js';
|
|
5
|
+
import type { PluginLogger } from '../logger.js';
|
|
6
|
+
export declare interface SystemManager extends SystemManagerProxyMethods {
|
|
7
|
+
on<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
8
|
+
once<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
9
|
+
off<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
10
|
+
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
11
|
+
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(event?: E): this;
|
|
12
|
+
}
|
|
13
|
+
export declare class SystemManager extends EventEmitter implements SystemManager {
|
|
14
|
+
private api;
|
|
15
|
+
private logger;
|
|
16
|
+
private initialized;
|
|
17
|
+
private publisher;
|
|
18
|
+
private client;
|
|
19
|
+
private subscriber;
|
|
20
|
+
private messageQueue;
|
|
21
|
+
private auth;
|
|
22
|
+
private pluginId;
|
|
23
|
+
private pluginName;
|
|
24
|
+
private clientSubject;
|
|
25
|
+
private subscriberSubject;
|
|
26
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, auth: {
|
|
27
|
+
user: string;
|
|
28
|
+
pass: string;
|
|
29
|
+
});
|
|
30
|
+
init(): Promise<void>;
|
|
31
|
+
emit(): boolean;
|
|
32
|
+
private requestHandler;
|
|
33
|
+
private listenToMessages;
|
|
34
|
+
private onRequest;
|
|
35
|
+
private close;
|
|
36
|
+
}
|