@camera.ui/browser 0.0.44 → 0.0.45
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/{client → packages/client}/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +2 -2
- package/dist/{client → packages/client}/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +2 -2
- package/dist/{client → packages/client}/node/src/proxy/deviceManager.d.ts +3 -2
- package/dist/{client → packages/client}/node/src/proxy/pluginsManager.d.ts +3 -2
- package/dist/{client → packages/client}/node/src/proxy/systemManager.d.ts +3 -2
- package/dist/{client → packages/client}/node/src/socket.d.ts +1 -1
- package/dist/{client → packages/client}/node/src/types.d.ts +3 -3
- package/dist/server/bin/python.d.ts +26 -0
- package/dist/{src → server/src}/api/database/index.d.ts +1 -1
- package/dist/{src → server/src}/api/database/types.d.ts +1 -1
- package/dist/{src → server/src}/api/go2rtc/api/streams.d.ts +1 -1
- package/dist/{src → server/src}/api/schemas/cameras.schema.d.ts +39 -39
- package/dist/{src → server/src}/api/schemas/users.schema.d.ts +84 -84
- package/dist/{src → server/src}/api/services/cameras.service.d.ts +1 -1
- package/dist/{src → server/src}/api/types/index.d.ts +8 -7
- package/dist/{src → server/src}/api/ws/nsp/logs.d.ts +1 -1
- package/dist/{src → server/src}/api/ws/nsp/main.d.ts +1 -1
- package/dist/{src → server/src}/api/ws/nsp/metrics.d.ts +2 -2
- package/dist/{src → server/src}/api/ws/nsp/notifications.d.ts +1 -1
- package/dist/{src → server/src}/api/ws/nsp/plugins.d.ts +2 -2
- package/dist/{src → server/src}/api/ws/nsp/status.d.ts +2 -2
- package/dist/{src → server/src}/api/ws/nsp/streams.d.ts +1 -1
- package/dist/{src → server/src}/api.d.ts +4 -6
- package/dist/{src → server/src}/camera/index.d.ts +3 -4
- package/dist/{src → server/src}/camera/streaming/browser/browser-peer-connection.d.ts +1 -1
- package/dist/{src → server/src}/camera/streaming/browser/browser-streaming-session.d.ts +1 -1
- package/dist/{src → server/src}/camera/streaming/browser/webrtc-browser-connection.d.ts +1 -1
- package/dist/{src → server/src}/camera/streaming/peer-connection.d.ts +3 -3
- package/dist/{src → server/src}/camera/streaming/streaming-session.d.ts +2 -2
- package/dist/{src → server/src}/camera/streaming/webrtc-connection.d.ts +1 -1
- package/dist/{src → server/src}/camera/types.d.ts +3 -3
- package/dist/{src → server/src}/go2rtc/index.d.ts +2 -1
- package/dist/{src → server/src}/plugins/index.d.ts +4 -9
- package/dist/{src/plugins → server/src/plugins/node}/api.d.ts +13 -7
- package/dist/{src/plugins → server/src/plugins/node}/cameraStorage.d.ts +3 -3
- package/dist/{src/plugins → server/src/plugins/node}/config.d.ts +1 -10
- package/dist/server/src/plugins/node/logger.d.ts +11 -0
- package/dist/{src/proxy/client → server/src/plugins/node/proxy}/cameraDevice.d.ts +8 -7
- package/dist/server/src/plugins/node/proxy/deviceManager.d.ts +45 -0
- package/dist/server/src/plugins/node/proxy/pluginsManager.d.ts +36 -0
- package/dist/{src/proxy/client → server/src/plugins/node/proxy}/queue.d.ts +4 -3
- package/dist/server/src/plugins/node/proxy/systemManager.d.ts +34 -0
- package/dist/{src/plugins → server/src/plugins/node}/schema.d.ts +4 -4
- package/dist/{src/plugins → server/src/plugins/node}/storageController.d.ts +3 -3
- package/dist/{src → server/src}/plugins/plugin.d.ts +13 -8
- package/dist/{src → server/src}/plugins/types.d.ts +14 -8
- package/dist/server/src/plugins/worker-ipc.d.ts +16 -0
- package/dist/{src → server/src}/plugins/worker.d.ts +5 -1
- package/dist/{src/proxy/proxies/server.d.ts → server/src/proxy/api.d.ts} +5 -5
- package/dist/{src/proxy/proxies → server/src/proxy}/camera.d.ts +5 -6
- package/dist/{src → server/src}/proxy/constants.d.ts +1 -1
- package/dist/{src → server/src}/proxy/index.d.ts +8 -8
- package/dist/{src/proxy/proxies → server/src/proxy}/plugin.d.ts +4 -4
- package/dist/{src → server/src}/proxy/types.d.ts +1 -6
- package/dist/{src/proxy/ws/index.d.ts → server/src/proxy/ws.d.ts} +2 -2
- package/dist/{src → server/src}/services/config/constants.d.ts +1 -1
- package/dist/{src → server/src}/services/config/index.d.ts +2 -4
- package/dist/{src → server/src}/services/logger/index.d.ts +0 -12
- package/dist/shared/common/utils.d.ts +2 -2
- package/dist/shared/types/index.d.ts +10 -10
- package/package.json +7 -6
- package/dist/src/plugins/base.d.ts +0 -15
- package/dist/src/proxy/client/deviceManager.d.ts +0 -35
- package/dist/src/proxy/client/pluginsManager.d.ts +0 -26
- package/dist/src/proxy/client/systemManager.d.ts +0 -24
- package/dist/{client → packages/client}/node/src/api.d.ts +0 -0
- package/dist/{client → packages/client}/node/src/client.d.ts +0 -0
- package/dist/{client → packages/client}/node/src/index.d.ts +1 -1
- package/dist/{client → packages/client}/node/src/proxy/cameraDevice/cameraDevice.mock.d.ts +0 -0
- package/dist/{client → packages/client}/node/src/proxy/cameraDevice/index.d.ts +0 -0
- package/dist/{client → packages/client}/node/src/proxy/index.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/api/application.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/api/config.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/api/index.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/api/snapshot.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/index.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/queue.d.ts +0 -0
- package/dist/{src → server/src}/api/go2rtc/types.d.ts +0 -0
- package/dist/{src → server/src}/api/middlewares/socketAuth.middleware.d.ts +0 -0
- package/dist/{src → server/src}/api/schemas/backup.schema.d.ts +36 -36
- package/dist/{src → server/src}/api/schemas/config.schema.d.ts +2 -2
- package/dist/{src → server/src}/api/schemas/go2rtc.schema.d.ts +16 -16
- package/dist/{src → server/src}/api/services/auth.service.d.ts +0 -0
- package/dist/{src → server/src}/api/services/plugins.service.d.ts +0 -0
- package/dist/{src → server/src}/api/services/users.service.d.ts +0 -0
- package/dist/{src → server/src}/api/utils/constants.d.ts +0 -0
- package/dist/{src → server/src}/api/ws/index.d.ts +0 -0
- package/dist/{src → server/src}/api/ws/types.d.ts +0 -0
- package/dist/{src → server/src}/camera/utils/subscribed.d.ts +0 -0
- package/dist/{src → server/src}/go2rtc/types.d.ts +0 -0
- package/dist/{src/proxy/client → server/src/plugins/node/proxy}/index.d.ts +0 -0
- package/dist/{src → server/src}/proxy/queue.d.ts +1 -1
- /package/dist/{src → server/src}/proxy/utils/generateKeys.d.ts +0 -0
- /package/dist/{src → server/src}/services/config/types.d.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
2
|
import { MediaStreamTrack, RTCSessionDescription } from 'werift';
|
|
3
3
|
import { Subscribed } from '../utils/subscribed';
|
|
4
|
-
import type {
|
|
5
|
-
import type { BasicPeerConnection, BaseLogger, CameraDevice } from '../types';
|
|
4
|
+
import type { RTCIceCandidate, RtcpPacket, RtpPacket } from 'werift';
|
|
6
5
|
import type { IceServer } from '../../services/config/types';
|
|
6
|
+
import type { BaseLogger, BasicPeerConnection, CameraDevice } from '../types';
|
|
7
7
|
export declare class WeriftPeerConnection extends Subscribed implements BasicPeerConnection {
|
|
8
8
|
onAudioRtp: Subject<RtpPacket>;
|
|
9
9
|
onAudioRtcp: Subject<RtcpPacket>;
|
|
10
10
|
onVideoRtp: Subject<RtpPacket>;
|
|
11
11
|
onVideoRtcp: Subject<RtcpPacket>;
|
|
12
12
|
onIceCandidate: Subject<RTCIceCandidate>;
|
|
13
|
-
onConnectionState: ReplaySubject<"closed" | "
|
|
13
|
+
onConnectionState: ReplaySubject<"closed" | "connected" | "connecting" | "disconnected" | "failed" | "new">;
|
|
14
14
|
returnAudioTrack: MediaStreamTrack;
|
|
15
15
|
private onRequestKeyFrame;
|
|
16
16
|
private cameraDevice;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RtpPacket } from 'werift';
|
|
2
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
|
+
import { RtpPacket } from 'werift';
|
|
3
3
|
import { Subscribed } from '../utils/subscribed';
|
|
4
|
+
import type { BaseLogger, CameraDevice, FfmpegOptions, SpawnInput } from '../types';
|
|
4
5
|
import type { WebrtcConnection } from './webrtc-connection';
|
|
5
|
-
import type { FfmpegOptions, SpawnInput, BaseLogger, CameraDevice } from '../types';
|
|
6
6
|
export declare class StreamingSession extends Subscribed {
|
|
7
7
|
readonly onCallEnded: ReplaySubject<void>;
|
|
8
8
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReplaySubject, Subject, type Observable } from 'rxjs';
|
|
2
2
|
import { Subscribed } from '../utils/subscribed';
|
|
3
3
|
import type { RtpPacket } from 'werift';
|
|
4
|
-
import type { StreamingConnectionOptions, BaseLogger, CameraDevice } from '../types';
|
|
5
4
|
import type { IceServer } from '../../services/config/types';
|
|
5
|
+
import type { BaseLogger, CameraDevice, StreamingConnectionOptions } from '../types';
|
|
6
6
|
export declare class WebrtcConnection extends Subscribed {
|
|
7
7
|
readonly onCameraConnected: ReplaySubject<void>;
|
|
8
8
|
readonly onCallAnswered: ReplaySubject<string>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="pouchdb-core" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { Observable, Subject } from 'rxjs';
|
|
4
|
-
import type { ConnectionState, RTCIceCandidate as WeriftRTCICECandidate
|
|
5
|
-
import type { Camera,
|
|
4
|
+
import type { ConnectionState, RTCSessionDescription, RTCIceCandidate as WeriftRTCICECandidate } from 'werift';
|
|
5
|
+
import type { Camera, CameraInformation, CameraInput, CameraInputSettings, CameraPublicProperties, CameraType, CameraZone } from '../api/database/types';
|
|
6
6
|
import type { IceServer } from '../services/config/types';
|
|
7
|
-
import type { StreamingSession } from './streaming/streaming-session';
|
|
8
7
|
import type { BrowserStreamingSession } from './streaming/browser/browser-streaming-session';
|
|
8
|
+
import type { StreamingSession } from './streaming/streaming-session';
|
|
9
9
|
export type SpawnInput = string | number;
|
|
10
10
|
export type PrebufferType = 'recording' | 'stream';
|
|
11
11
|
export interface CameraSource extends CameraInput {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RUNTIME_STATUS } from '../services/config/types';
|
|
2
2
|
export declare class Go2Rtc {
|
|
3
3
|
private go2rtcProcess?;
|
|
4
|
+
private prefix;
|
|
5
|
+
private api;
|
|
4
6
|
private logger;
|
|
5
7
|
private configService;
|
|
6
8
|
version?: string;
|
|
@@ -14,7 +16,6 @@ export declare class Go2Rtc {
|
|
|
14
16
|
constructor();
|
|
15
17
|
start(): Promise<void>;
|
|
16
18
|
stop(): Promise<void>;
|
|
17
|
-
teardown(): Promise<void>;
|
|
18
19
|
restart(): Promise<void>;
|
|
19
20
|
getPID(): number;
|
|
20
21
|
private kill;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* @url https://github.com/homebridge/homebridge/blob/src/pluginManager.ts
|
|
4
|
-
* (c) Homebridge <https://github.com/homebridge>
|
|
5
|
-
*
|
|
6
|
-
**/
|
|
1
|
+
import 'reflect-metadata';
|
|
7
2
|
import { Plugin } from './plugin';
|
|
8
3
|
import { PluginWorker } from './worker';
|
|
9
4
|
import type { IPackageJson } from '../api/types';
|
|
@@ -12,6 +7,7 @@ export declare class PluginManager {
|
|
|
12
7
|
plugins: Map<string, Plugin>;
|
|
13
8
|
pluginWorkers: Map<string, PluginWorker>;
|
|
14
9
|
searchPaths: Set<string>;
|
|
10
|
+
private api;
|
|
15
11
|
private configService;
|
|
16
12
|
constructor();
|
|
17
13
|
static isQualifiedPluginIdentifier(pluginName: string): boolean;
|
|
@@ -20,15 +16,14 @@ export declare class PluginManager {
|
|
|
20
16
|
static transformDisplaName(pluginName: string): string;
|
|
21
17
|
static loadPackageJSON(installPath: string): IPackageJson;
|
|
22
18
|
initializeInstalledPlugins(): Promise<void>;
|
|
23
|
-
initializeInstalledPlugin(plugin: Plugin
|
|
19
|
+
initializeInstalledPlugin(plugin: Plugin): Promise<void>;
|
|
24
20
|
loadPlugin(absolutePath: string, pluginId?: string, storagePath?: string): Promise<Plugin>;
|
|
25
21
|
removePlugin(plugin: Plugin, removeFromDb?: boolean, removeStorage?: boolean): Promise<void>;
|
|
26
|
-
startPluginChilds(): Promise<void>;
|
|
27
22
|
startPluginChild(pluginName: string): Promise<void>;
|
|
28
23
|
stopPluginChild(pluginName: string): Promise<void>;
|
|
24
|
+
private initializePlugins;
|
|
29
25
|
private loadInstalledPlugins;
|
|
30
26
|
private removeOrphanedPlugins;
|
|
31
27
|
private loadDefaultPaths;
|
|
32
28
|
private addNpmPrefixToSearchPaths;
|
|
33
|
-
private isDependencyForOthers;
|
|
34
29
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
|
-
import { DeviceManager, PluginsManager, SystemManager } from '
|
|
3
|
+
import { DeviceManager, PluginsManager, SystemManager } from './proxy';
|
|
4
4
|
import { StorageController } from './storageController';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { PluginLogger } from '../services/logger';
|
|
8
|
-
import type { BasePlugin } from './base';
|
|
5
|
+
import type { Plugin } from '../plugin';
|
|
6
|
+
import type { BasePlugin, ProxyInfo } from '../types';
|
|
9
7
|
import type { PluginConfigService } from './config';
|
|
10
|
-
|
|
8
|
+
import type { PluginLogger } from './logger';
|
|
9
|
+
export declare interface API {
|
|
11
10
|
on(event: 'finishLaunching', listener: () => void): this;
|
|
12
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;
|
|
13
19
|
readonly deviceManager: DeviceManager;
|
|
14
20
|
readonly pluginsManager: PluginsManager;
|
|
15
21
|
readonly systemManager: SystemManager;
|
|
@@ -27,5 +33,5 @@ export declare class PluginAPI extends EventEmitter implements API {
|
|
|
27
33
|
readonly storagePath: string;
|
|
28
34
|
readonly configFile: string;
|
|
29
35
|
readonly plugin: BasePlugin;
|
|
30
|
-
constructor(plugin: Plugin, logger: PluginLogger, proxyData:
|
|
36
|
+
constructor(plugin: Plugin, logger: PluginLogger, proxyData: ProxyInfo);
|
|
31
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '../types';
|
|
2
|
+
import type { PluginAPI } from './api';
|
|
3
3
|
export declare class CameraStorage {
|
|
4
4
|
private cameraId;
|
|
5
5
|
private instance;
|
|
@@ -8,7 +8,7 @@ export declare class CameraStorage {
|
|
|
8
8
|
private _schema;
|
|
9
9
|
private _values;
|
|
10
10
|
get values(): Record<string, any>;
|
|
11
|
-
constructor(api:
|
|
11
|
+
constructor(api: PluginAPI, instance: any, cameraId: string, schema?: PluginJsonSchemaForm);
|
|
12
12
|
/**
|
|
13
13
|
* Initialize the storage.
|
|
14
14
|
* This will load the configuration from the database.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Path } from 'object-path';
|
|
2
|
-
import type { JSONValue, PluginConfig } from '
|
|
2
|
+
import type { JSONValue, PluginConfig } from '../types';
|
|
3
3
|
export declare class PluginConfigService {
|
|
4
4
|
private config;
|
|
5
5
|
private configFile;
|
|
@@ -98,16 +98,7 @@ export declare class PluginConfigService {
|
|
|
98
98
|
* @param write - Optional parameter, if true, the changes will be written to the file.
|
|
99
99
|
*/
|
|
100
100
|
replaceOrAddItem(path: string, searchKey: string, searchValue: any, newItem: any, write?: boolean): void;
|
|
101
|
-
/**
|
|
102
|
-
* Initialize config.json
|
|
103
|
-
*/
|
|
104
101
|
private init;
|
|
105
|
-
/**
|
|
106
|
-
* Read config.json
|
|
107
|
-
*/
|
|
108
102
|
private read;
|
|
109
|
-
/**
|
|
110
|
-
* Write config.json
|
|
111
|
-
*/
|
|
112
103
|
private write;
|
|
113
104
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class PluginLogger {
|
|
2
|
+
private _loggerPrefix;
|
|
3
|
+
private get prefix();
|
|
4
|
+
constructor(prefix: string);
|
|
5
|
+
log(...args: any[]): void;
|
|
6
|
+
error(...args: any[]): void;
|
|
7
|
+
warn(...args: any[]): void;
|
|
8
|
+
attention(...args: any[]): void;
|
|
9
|
+
debug(...args: any[]): void;
|
|
10
|
+
trace(...args: any[]): void;
|
|
11
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { CameraController } from '
|
|
2
|
-
import type { Camera } from '
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
1
|
+
import { CameraController } from '../../../camera';
|
|
2
|
+
import type { Camera } from '../../../api/database/types';
|
|
3
|
+
import type { CameraSource, OnSetEvent, StateValues } from '../../../camera/types';
|
|
4
|
+
import type { IceServer } from '../../../services/config/types';
|
|
5
|
+
import type { ProxyInfo } from '../../types';
|
|
6
|
+
import type { PluginAPI } from '../api';
|
|
7
|
+
import type { PluginLogger } from '../logger';
|
|
7
8
|
export declare class CameraDeviceClientProxy extends CameraController {
|
|
8
9
|
private api;
|
|
9
10
|
private logger;
|
|
@@ -16,7 +17,7 @@ export declare class CameraDeviceClientProxy extends CameraController {
|
|
|
16
17
|
private routerAddress;
|
|
17
18
|
private publisherAddress;
|
|
18
19
|
get sources(): CameraSource[];
|
|
19
|
-
constructor(api: PluginAPI, camera: Camera, pluginId: string, pluginName: string, proxy:
|
|
20
|
+
constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, pluginId: string, pluginName: string, proxy: ProxyInfo);
|
|
20
21
|
connect(): Promise<void>;
|
|
21
22
|
disconnect(): Promise<void>;
|
|
22
23
|
reboot(): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { CameraDeviceClientProxy } from './cameraDevice';
|
|
4
|
+
import type { CameraConfig, CameraDevice } from '../../../camera/types';
|
|
5
|
+
import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../proxy/types';
|
|
6
|
+
import type { ProxyInfo } from '../../types';
|
|
7
|
+
import type { PluginAPI } from '../api';
|
|
8
|
+
import type { PluginLogger } from '../logger';
|
|
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 DeviceManagerClient extends EventEmitter implements DeviceManager {
|
|
17
|
+
private api;
|
|
18
|
+
private logger;
|
|
19
|
+
private dealer;
|
|
20
|
+
private subscriber;
|
|
21
|
+
private messageQueue;
|
|
22
|
+
private proxy;
|
|
23
|
+
private pluginId;
|
|
24
|
+
private pluginName;
|
|
25
|
+
private dealerId;
|
|
26
|
+
private subscriberIds;
|
|
27
|
+
private devices;
|
|
28
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxy: ProxyInfo);
|
|
29
|
+
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
30
|
+
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
31
|
+
createCamera(cameraConfig: CameraConfig): Promise<CameraDevice>;
|
|
32
|
+
removeCameraByName(name: string): Promise<void>;
|
|
33
|
+
removeCameraById(id: string): Promise<void>;
|
|
34
|
+
emit(): boolean;
|
|
35
|
+
on<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
36
|
+
once<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
37
|
+
off<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
38
|
+
removeListener<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
|
|
39
|
+
removeAllListeners<E extends keyof DeviceManagerProxyEventCallbacks>(event?: E): this;
|
|
40
|
+
configureCameras(cameraDevices: CameraDeviceClientProxy[]): void;
|
|
41
|
+
private handleRouterRequest;
|
|
42
|
+
private listenToSubscriberEvents;
|
|
43
|
+
private onRequest;
|
|
44
|
+
private addOrGetCamera;
|
|
45
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../proxy/types';
|
|
4
|
+
import type { ProxyInfo } from '../../types';
|
|
5
|
+
import type { PluginAPI } from '../api';
|
|
6
|
+
import type { PluginLogger } from '../logger';
|
|
7
|
+
export declare interface PluginsManager extends PluginsManagerProxyMethods {
|
|
8
|
+
on<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
9
|
+
once<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
10
|
+
off<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
11
|
+
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
12
|
+
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(event?: E): this;
|
|
13
|
+
}
|
|
14
|
+
export declare class PluginsManagerClient extends EventEmitter implements PluginsManager {
|
|
15
|
+
private api;
|
|
16
|
+
private logger;
|
|
17
|
+
private dealer;
|
|
18
|
+
private subscriber;
|
|
19
|
+
private messageQueue;
|
|
20
|
+
private pluginId;
|
|
21
|
+
private pluginName;
|
|
22
|
+
private dealerId;
|
|
23
|
+
private subscriberIds;
|
|
24
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxy: ProxyInfo);
|
|
25
|
+
emit(): boolean;
|
|
26
|
+
on<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
27
|
+
once<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
28
|
+
off<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
29
|
+
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(event: E, listener: PluginsManagerProxyEventCallbacks[E]): this;
|
|
30
|
+
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(event?: E): this;
|
|
31
|
+
private handleRouterRequest;
|
|
32
|
+
private listenToSubscriberEvents;
|
|
33
|
+
private onRequest;
|
|
34
|
+
private isPluginMessage;
|
|
35
|
+
private isStorageMessage;
|
|
36
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Dealer } from 'zeromq';
|
|
2
|
-
import type { ProxyMessageStructure } from '
|
|
1
|
+
import { Dealer } from '@seydx/zeromq';
|
|
2
|
+
import type { ProxyMessageStructure } from '../../../proxy/types';
|
|
3
|
+
import type { PluginLogger } from '../logger';
|
|
3
4
|
export declare class ClientMessageQueue {
|
|
4
5
|
private logger;
|
|
5
6
|
private dealer;
|
|
@@ -8,7 +9,7 @@ export declare class ClientMessageQueue {
|
|
|
8
9
|
private isProcessing;
|
|
9
10
|
private queue;
|
|
10
11
|
private pendingResponses;
|
|
11
|
-
constructor(requestHandler: (message: ProxyMessageStructure) => void, dealer: Dealer);
|
|
12
|
+
constructor(logger: PluginLogger, requestHandler: (message: ProxyMessageStructure) => void, dealer: Dealer);
|
|
12
13
|
abortQueue(): void;
|
|
13
14
|
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
14
15
|
private processQueue;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../proxy/types';
|
|
4
|
+
import type { ProxyInfo } from '../../types';
|
|
5
|
+
import type { PluginAPI } from '../api';
|
|
6
|
+
import type { PluginLogger } from '../logger';
|
|
7
|
+
export declare interface SystemManager extends SystemManagerProxyMethods {
|
|
8
|
+
on<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
9
|
+
once<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
10
|
+
off<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
11
|
+
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
12
|
+
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(event?: E): this;
|
|
13
|
+
}
|
|
14
|
+
export declare class SystemManagerClient extends EventEmitter implements SystemManager {
|
|
15
|
+
private api;
|
|
16
|
+
private logger;
|
|
17
|
+
private dealer;
|
|
18
|
+
private subscriber;
|
|
19
|
+
private messageQueue;
|
|
20
|
+
private pluginId;
|
|
21
|
+
private pluginName;
|
|
22
|
+
private dealerId;
|
|
23
|
+
private subscriberIds;
|
|
24
|
+
constructor(api: PluginAPI, logger: PluginLogger, pluginId: string, pluginName: string, proxy: ProxyInfo);
|
|
25
|
+
emit(): boolean;
|
|
26
|
+
on<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
27
|
+
once<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
28
|
+
off<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
29
|
+
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(event: E, listener: SystemManagerProxyEventCallbacks[E]): this;
|
|
30
|
+
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(event?: E): this;
|
|
31
|
+
private handleRouterRequest;
|
|
32
|
+
private listenToSubscriberEvents;
|
|
33
|
+
private onRequest;
|
|
34
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ZodTypeAny
|
|
2
|
-
import type {
|
|
1
|
+
import { z, type ZodTypeAny } from 'zod';
|
|
2
|
+
import type { JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectWithButtons, JsonSchemaString, PluginJsonSchema, PluginJsonSchemaForm, PluginRootSchema, RootSchema } from '../types';
|
|
3
3
|
type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
}, {
|
|
@@ -115,14 +115,14 @@ export declare const generateZodSchema: (jsonSchema: JsonSchema) => ZodAny;
|
|
|
115
115
|
* @param value - The number for which the JSON schema should be generated.
|
|
116
116
|
* @returns - The generated JSON schema for the number.
|
|
117
117
|
*/
|
|
118
|
-
export declare const generateNumberSchema: (
|
|
118
|
+
export declare const generateNumberSchema: () => JsonSchemaNumber;
|
|
119
119
|
/**
|
|
120
120
|
* Generates a JSON schema for a boolean.
|
|
121
121
|
*
|
|
122
122
|
* @param value - The boolean for which the JSON schema should be generated.
|
|
123
123
|
* @returns - The generated JSON schema for the boolean.
|
|
124
124
|
*/
|
|
125
|
-
export declare const genereateBooleanSchema: (
|
|
125
|
+
export declare const genereateBooleanSchema: () => JsonSchemaBoolean;
|
|
126
126
|
/**
|
|
127
127
|
* Generates a JSON schema for a string.
|
|
128
128
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CameraStorage } from './cameraStorage';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { PluginJsonSchemaForm } from '../types';
|
|
3
|
+
import type { PluginAPI } from './api';
|
|
4
4
|
export declare class StorageController {
|
|
5
5
|
private api;
|
|
6
6
|
private cameraStorages;
|
|
7
|
-
constructor(api:
|
|
7
|
+
constructor(api: PluginAPI);
|
|
8
8
|
/**
|
|
9
9
|
* Create a camera storage instance
|
|
10
10
|
*
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* (c) Homebridge <https://github.com/homebridge>
|
|
5
5
|
*
|
|
6
6
|
**/
|
|
7
|
-
import {
|
|
7
|
+
import { PythonInstaller } from '../../bin/python';
|
|
8
|
+
import { PluginConfigService } from './node/config';
|
|
8
9
|
import type { PluginConstructor } from '../api';
|
|
9
|
-
import type {
|
|
10
|
+
import type { CameraUiPlugin, IPackageJson } from '../api/types';
|
|
10
11
|
import type { PluginContract } from './types';
|
|
11
12
|
export interface Context {
|
|
12
13
|
engines?: Record<string, string>;
|
|
@@ -16,24 +17,27 @@ export interface Context {
|
|
|
16
17
|
* Represents a loaded camera.ui plugin.
|
|
17
18
|
*/
|
|
18
19
|
export declare class Plugin {
|
|
19
|
-
private _disabled;
|
|
20
20
|
private logger;
|
|
21
21
|
private configService;
|
|
22
|
+
private _disabled;
|
|
22
23
|
private _info;
|
|
23
24
|
private _contract;
|
|
25
|
+
readonly main: string;
|
|
24
26
|
readonly id: string;
|
|
25
27
|
readonly pluginName: string;
|
|
26
28
|
readonly displayName: string;
|
|
27
29
|
readonly scope?: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
readonly isPython: boolean;
|
|
31
|
+
readonly isESM: boolean;
|
|
30
32
|
readonly isSymLink: boolean;
|
|
31
33
|
readonly installPath: string;
|
|
34
|
+
readonly pythonInstallPath: string;
|
|
32
35
|
readonly configFile: string;
|
|
33
36
|
readonly storagePath: string;
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
readonly py: PythonInstaller;
|
|
38
|
+
readonly config: PluginConfigService;
|
|
36
39
|
pluginConstructor?: PluginConstructor;
|
|
40
|
+
private loadContext?;
|
|
37
41
|
get contract(): PluginContract;
|
|
38
42
|
get info(): CameraUiPlugin;
|
|
39
43
|
set info(value: CameraUiPlugin);
|
|
@@ -41,6 +45,7 @@ export declare class Plugin {
|
|
|
41
45
|
set disabled(value: boolean);
|
|
42
46
|
constructor(pluginName: string, installPath: string, packageJSON: IPackageJson, pluginId: string, scope?: string, storagePath?: string);
|
|
43
47
|
load(): Promise<void>;
|
|
44
|
-
reparsePackageJson():
|
|
48
|
+
reparsePackageJson(): void;
|
|
45
49
|
private parsePackageJson;
|
|
50
|
+
private parseContract;
|
|
46
51
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Camera } from '../api/database/types';
|
|
2
|
-
|
|
3
|
-
export type PluginCycles = Map<string, string[]>;
|
|
4
|
-
export type PluginGroups = Map<string, string[]>;
|
|
2
|
+
import type { CameraDevice } from '../camera/types';
|
|
5
3
|
export interface SchemaConfig {
|
|
6
4
|
rootSchema: PluginRootSchema;
|
|
7
5
|
config: Record<string, any>;
|
|
@@ -26,6 +24,7 @@ export interface PluginContractBase {
|
|
|
26
24
|
pluginName: string;
|
|
27
25
|
builtIns?: Exclude<CameraExtension, 'hub'>[];
|
|
28
26
|
dependencies?: string[];
|
|
27
|
+
pythonVersion?: string;
|
|
29
28
|
}
|
|
30
29
|
export type PluginContract = PluginContractBase & ExtensionOrSupport;
|
|
31
30
|
export declare const enum PLUGIN_STATUS {
|
|
@@ -45,14 +44,15 @@ export type ProcessErrorMessage = string;
|
|
|
45
44
|
export interface PluginStorage {
|
|
46
45
|
installPath: string;
|
|
47
46
|
storagePath: string;
|
|
47
|
+
configFile: string;
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
export interface ProxyInfo {
|
|
50
|
+
routerAddress: string;
|
|
51
|
+
pubAddress: string;
|
|
52
|
+
publicKey: string;
|
|
53
53
|
}
|
|
54
54
|
export interface ProcessLoadMessage {
|
|
55
|
-
|
|
55
|
+
proxyInfo: ProxyInfo;
|
|
56
56
|
cameras: Camera[];
|
|
57
57
|
pluginId: string;
|
|
58
58
|
storage: PluginStorage;
|
|
@@ -160,4 +160,10 @@ export interface RootSchema {
|
|
|
160
160
|
export interface PluginRootSchema {
|
|
161
161
|
schema: PluginJsonSchemaForm;
|
|
162
162
|
}
|
|
163
|
+
export interface BasePlugin {
|
|
164
|
+
onFormSubmit(actionId: string, payload: any): Promise<{
|
|
165
|
+
toast?: string;
|
|
166
|
+
} | void>;
|
|
167
|
+
configureCameras(cameras: CameraDevice[]): void;
|
|
168
|
+
}
|
|
163
169
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import type { ProcessMessage, ProcessResponse } from './types';
|
|
4
|
+
export declare interface WorkerIPC {
|
|
5
|
+
on(event: 'message', listener: (message: ProcessResponse) => void): this;
|
|
6
|
+
}
|
|
7
|
+
export declare class WorkerIPC extends EventEmitter {
|
|
8
|
+
private ipc?;
|
|
9
|
+
private id;
|
|
10
|
+
get address(): string | null | undefined;
|
|
11
|
+
constructor(id: string);
|
|
12
|
+
listen(): Promise<void>;
|
|
13
|
+
close(): Promise<void>;
|
|
14
|
+
sendMessage(message: ProcessMessage): Promise<void>;
|
|
15
|
+
private listenToChild;
|
|
16
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { PLUGIN_STATUS } from './types';
|
|
2
1
|
import type { Plugin } from './plugin';
|
|
2
|
+
import { PLUGIN_STATUS } from './types';
|
|
3
3
|
export declare class PluginWorker {
|
|
4
4
|
plugin: Plugin;
|
|
5
5
|
private pluginWorker?;
|
|
6
|
+
private proxyServer;
|
|
7
|
+
private ipc;
|
|
6
8
|
private api;
|
|
7
9
|
private logger;
|
|
8
10
|
private configService;
|
|
@@ -22,5 +24,7 @@ export declare class PluginWorker {
|
|
|
22
24
|
private setStatus;
|
|
23
25
|
private sendMessage;
|
|
24
26
|
private handleClose;
|
|
27
|
+
private reset;
|
|
25
28
|
private cleanedProcessEnv;
|
|
29
|
+
private isLineVisible;
|
|
26
30
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export declare class
|
|
1
|
+
import type { Camera } from '../api/database/types';
|
|
2
|
+
import type { CameraConfig } from '../camera/types';
|
|
3
|
+
import type { MessageQueue } from './queue';
|
|
4
|
+
import type { ApiProxyMethods, ProxyMessageStructure } from './types';
|
|
5
|
+
export declare class ApiProxy implements ApiProxyMethods {
|
|
6
6
|
private camerasService;
|
|
7
7
|
private pluginsService;
|
|
8
8
|
private messageQueue;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="pouchdb-core" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type { Camera } from '../../api/database/types';
|
|
3
|
+
import type { Camera } from '../api/database/types';
|
|
4
|
+
import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions, OnSetEvent, PrebufferType, StateValues, StreamInfo } from '../camera/types';
|
|
5
|
+
import type { IceServer } from '../services/config/types';
|
|
6
|
+
import type { MessageQueue } from './queue';
|
|
7
|
+
import type { CameraDeviceProxyMethods, ProxyMessageStructure } from './types';
|
|
9
8
|
export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
10
9
|
private api;
|
|
11
10
|
private configService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Dealer, Publisher, Reply, Request, Router, SocketOptions, Subscriber } from '@seydx/zeromq';
|
|
2
2
|
export declare const ROUTER_OPTIONS: SocketOptions<Router>;
|
|
3
3
|
export declare const REPLY_OPTIONS: SocketOptions<Reply>;
|
|
4
4
|
export declare const PUBLISHER_OPTIONS: SocketOptions<Publisher>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CameraDeviceProxy } from './
|
|
4
|
-
import { PluginProxy } from './
|
|
5
|
-
import type { ProxyBridge } from './ws';
|
|
1
|
+
import { Publisher, Router } from '@seydx/zeromq';
|
|
2
|
+
import { ApiProxy } from './api';
|
|
3
|
+
import { CameraDeviceProxy } from './camera';
|
|
4
|
+
import { PluginProxy } from './plugin';
|
|
6
5
|
import type { StateValues } from '../camera/types';
|
|
7
|
-
import type {
|
|
6
|
+
import type { CameraDeviceListenerMessagePayload, DeviceManagerProxyEvents, PluginsManagerProxyEvents, SystemManagerProxyEvents } from './types';
|
|
7
|
+
import type { ProxyBridge } from './ws';
|
|
8
8
|
export declare class ProxyServer {
|
|
9
|
-
|
|
9
|
+
api?: ApiProxy;
|
|
10
10
|
camera?: CameraDeviceProxy;
|
|
11
11
|
plugin?: PluginProxy;
|
|
12
|
-
private configService;
|
|
13
12
|
router: Router;
|
|
14
13
|
publisher: Publisher;
|
|
15
14
|
socketBridge?: ProxyBridge;
|
|
15
|
+
publicKey?: string;
|
|
16
16
|
private messageQueue;
|
|
17
17
|
constructor();
|
|
18
18
|
initialize(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CameraStorage } from '
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { CameraStorage } from '../plugins/node/cameraStorage';
|
|
2
|
+
import { type BasePlugin } from '../plugins/types';
|
|
3
|
+
import type { MessageQueue } from './queue';
|
|
4
|
+
import type { MethodKeys, ProxyMessageStructure } from './types';
|
|
5
5
|
export declare class PluginProxy {
|
|
6
6
|
private pluginsService;
|
|
7
7
|
private messageQueue;
|