@camera.ui/browser 0.0.73 → 0.0.74
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 -1
- package/dist/types/packages/client/browser/src/types.d.ts +2 -2
- package/dist/types/server/src/api/index.d.ts +13 -7
- package/dist/types/server/src/api.d.ts +4 -4
- package/dist/types/server/src/{devices/camera → camera}/cameraDevice.d.ts +1 -1
- package/dist/types/server/src/{devices/camera → camera}/controller/index.d.ts +7 -4
- package/dist/types/server/src/{devices/camera → camera}/controller/types.d.ts +28 -16
- package/dist/types/server/src/{devices/camera → camera}/index.d.ts +22 -13
- package/dist/types/server/src/{devices/camera → camera}/streaming/peer-connection.d.ts +2 -2
- package/dist/types/server/src/{devices/camera → camera}/streaming/streaming-session.d.ts +1 -1
- package/dist/types/server/src/{devices/camera → camera}/streaming/webrtc-connection.d.ts +2 -2
- package/dist/types/server/src/decoder/ffmpeg.d.ts +2 -1
- package/dist/types/server/src/decoder/index.d.ts +2 -2
- package/dist/types/server/src/decoder/types.d.ts +15 -4
- package/dist/types/server/src/decoder/{worker/index.d.ts → worker.d.ts} +3 -3
- package/dist/types/server/src/nats/index.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +8 -15
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +1 -1
- package/dist/types/server/src/nats/types.d.ts +11 -16
- package/dist/types/server/src/nats/websocket.d.ts +1 -1
- package/dist/types/server/src/plugins/base.d.ts +1 -1
- package/dist/types/server/src/plugins/plugin.d.ts +1 -1
- package/dist/types/server/src/plugins/worker.d.ts +5 -1
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/api.d.ts +2 -2
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/cameraStorage.d.ts +1 -1
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/config.d.ts +1 -1
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/cameraDevice.d.ts +5 -5
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/deviceManager.d.ts +3 -3
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/pluginsManager.d.ts +1 -1
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/queue.d.ts +2 -2
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/systemManager.d.ts +1 -1
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/schema.d.ts +2 -2
- package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/storageController.d.ts +1 -1
- package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
- package/dist/types/shared/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/server/src/api/plugins/logger.plugin.d.ts +0 -7
- package/dist/types/server/src/plugins/worker-ipc.d.ts +0 -25
- /package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/logger.d.ts +0 -0
- /package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseCameraDevice } from '../../../../../server/src/
|
|
1
|
+
import { BaseCameraDevice } from '../../../../../server/src/camera/index.js';
|
|
2
2
|
import { StreamingSession } from '../streaming/streaming-session.js';
|
|
3
3
|
import type { BaseLogger, Camera, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
|
|
4
4
|
import type { SocketService } from '../socket.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Observable, Subject } from 'rxjs';
|
|
2
|
-
import type { BaseCameraDevice } from '../../../../server/src/
|
|
2
|
+
import type { BaseCameraDevice } from '../../../../server/src/camera/index.js';
|
|
3
3
|
import type { BaseLogger } from '../../../../shared/types/index.js';
|
|
4
4
|
import type { StreamingSession } from './streaming/streaming-session.js';
|
|
5
|
+
export type { AudioState, BaseDetection, BaseLogger, Camera, CameraConfig, CameraInput, DoorbellState, FfmpegOptions, Go2RtcAnswerMessage, Go2RtcIceCandidateMessage, Go2RtcIncomingMessage, Go2RtcOfferMessage, Go2RtcOutgoingMessage, LightState, MotionDetection, MotionState, ObjectDetection, ObjectState, SirenState, } from '../../../../shared/types/index.js';
|
|
5
6
|
export type { BasicPeerConnection } from './streaming/peer-connection.js';
|
|
6
7
|
export type { StreamingSession } from './streaming/streaming-session.js';
|
|
7
8
|
export type { WebrtcConnection } from './streaming/webrtc-connection.js';
|
|
8
|
-
export type { AudioState, BaseDetection, BaseLogger, Camera, CameraConfig, CameraInput, DoorbellState, FfmpegOptions, Go2RtcAnswerMessage, Go2RtcIceCandidateMessage, Go2RtcIncomingMessage, Go2RtcOfferMessage, Go2RtcOutgoingMessage, LightState, MotionDetection, MotionState, ObjectDetection, ObjectState, SirenState, } from '../../../../shared/types/index.js';
|
|
9
9
|
export type CameraUiClientConfig = WithCredentials | WithToken;
|
|
10
10
|
export interface BasicBrowserPeerConnection {
|
|
11
11
|
enableMicrophone(track: MediaStreamTrack): void;
|
|
@@ -8,11 +8,17 @@ export declare class Server {
|
|
|
8
8
|
register(): Promise<void>;
|
|
9
9
|
listen(): Promise<void>;
|
|
10
10
|
close(): Promise<void>;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
11
|
+
private setupSecureAppListeners;
|
|
12
|
+
private setupInsecureAppListeners;
|
|
13
|
+
private registerSecureAppPlugins;
|
|
14
|
+
private registerInsecureAppPlugins;
|
|
15
|
+
private registerRouters;
|
|
16
|
+
private get corsOptions();
|
|
17
|
+
private get helmetOptions();
|
|
18
|
+
private get multipartOptions();
|
|
19
|
+
private get rateLimitOptions();
|
|
20
|
+
private get insecureServerOptions();
|
|
21
|
+
private get secureServerOptions();
|
|
22
|
+
private get socketOptions();
|
|
23
|
+
private get staticOptions();
|
|
18
24
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
|
-
import { CameraController } from './
|
|
4
|
+
import { CameraController } from './camera/controller/index.js';
|
|
5
5
|
import type { Camera, CameraExtensions } from './api/database/types.js';
|
|
6
|
-
import type { FrameWorker } from './decoder/worker
|
|
6
|
+
import type { FrameWorker } from './decoder/worker.js';
|
|
7
7
|
import type { BasePlugin } from './plugins/base.js';
|
|
8
|
-
import type { API } from './plugins/node/api.js';
|
|
9
|
-
import type { PluginLogger } from './plugins/node/logger.js';
|
|
10
8
|
import type { CameraExtension } from './plugins/types.js';
|
|
9
|
+
import type { API } from './polyglot/node/plugins/api.js';
|
|
10
|
+
import type { PluginLogger } from './polyglot/node/plugins/logger.js';
|
|
11
11
|
export interface PluginConstructor {
|
|
12
12
|
new (logger: PluginLogger, api: API): BasePlugin;
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCameraDevice } from './index.js';
|
|
2
2
|
import { StreamingSession } from './streaming/streaming-session.js';
|
|
3
|
-
import type { VideoFrame } from '
|
|
3
|
+
import type { VideoFrame } from '../decoder/types.js';
|
|
4
4
|
import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions } from './controller/types.js';
|
|
5
5
|
import type { StreamingConnectionOptions } from './streaming/peer-connection.js';
|
|
6
6
|
export declare abstract class CameraDevice extends BaseCameraDevice {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { CameraDevice } from '../cameraDevice.js';
|
|
2
|
-
import type { Camera } from '
|
|
3
|
-
import type { VideoFrame } from '
|
|
4
|
-
import type { ProxyServer } from '
|
|
5
|
-
import type { IceServer } from '
|
|
2
|
+
import type { Camera } from '../../api/database/types.js';
|
|
3
|
+
import type { VideoFrame } from '../../decoder/types.js';
|
|
4
|
+
import type { ProxyServer } from '../../nats/index.js';
|
|
5
|
+
import type { IceServer } from '../../services/config/types.js';
|
|
6
6
|
import type { BaseLogger } from './types.js';
|
|
7
7
|
export declare class CameraController extends CameraDevice {
|
|
8
8
|
private proxy;
|
|
9
9
|
private motionTimeout?;
|
|
10
10
|
private doorbellTimeout?;
|
|
11
11
|
private doorbellTimeoutDuration;
|
|
12
|
+
private prebufferStateSubscriptions;
|
|
12
13
|
constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
|
|
13
14
|
connect(): Promise<void>;
|
|
14
15
|
disconnect(): Promise<void>;
|
|
@@ -19,9 +20,11 @@ export declare class CameraController extends CameraDevice {
|
|
|
19
20
|
updateCamera(updatedCamera: Camera): void;
|
|
20
21
|
cleanup(): void;
|
|
21
22
|
private subscribeToCameraState;
|
|
23
|
+
private subscribeToCameraSourcesState;
|
|
22
24
|
private subscribeToMotionState;
|
|
23
25
|
private subscribeToDoorbellState;
|
|
24
26
|
private subscribeToCameraChanges;
|
|
25
27
|
private subscribeToStateChanges;
|
|
26
28
|
private triggerProxyEvent;
|
|
29
|
+
private isCameraEvent;
|
|
27
30
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export type PrebufferType = 'recording' | 'stream';
|
|
5
|
-
export interface CameraSource extends CameraInput {
|
|
6
|
-
isPrebuffering(type: PrebufferType): Promise<boolean>;
|
|
7
|
-
getPrebufferRawUrl(type: PrebufferType): Promise<string | undefined>;
|
|
8
|
-
getStreamInfo(): Promise<StreamInfo | undefined>;
|
|
9
|
-
}
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import type { CameraInformation, CameraInput, CameraInputSettings } from '../../api/database/types.js';
|
|
10
4
|
export interface BaseLogger {
|
|
11
5
|
log: (...args: any[]) => void;
|
|
12
6
|
error: (...args: any[]) => void;
|
|
@@ -14,12 +8,35 @@ export interface BaseLogger {
|
|
|
14
8
|
debug: (...args: any[]) => void;
|
|
15
9
|
trace: (...args: any[]) => void;
|
|
16
10
|
}
|
|
11
|
+
export type SpawnInput = string | number;
|
|
17
12
|
export interface FfmpegOptions {
|
|
18
13
|
input?: SpawnInput[];
|
|
19
14
|
video?: SpawnInput[] | false;
|
|
20
15
|
audio?: SpawnInput[];
|
|
21
16
|
output: SpawnInput[];
|
|
22
17
|
}
|
|
18
|
+
export type PrebufferContainer = 'mp4' | 'mpegts';
|
|
19
|
+
export interface BasePrebufferState {
|
|
20
|
+
maxDuration: number;
|
|
21
|
+
availableDuration: number;
|
|
22
|
+
}
|
|
23
|
+
export interface PrebufferStateTrue extends BasePrebufferState {
|
|
24
|
+
state: true;
|
|
25
|
+
url: string;
|
|
26
|
+
}
|
|
27
|
+
export interface PrebufferStateFalse extends BasePrebufferState {
|
|
28
|
+
state: false;
|
|
29
|
+
}
|
|
30
|
+
export type PrebufferState = PrebufferStateTrue | PrebufferStateFalse;
|
|
31
|
+
export interface CameraSource extends CameraInput {
|
|
32
|
+
updatePrebufferingState(container: PrebufferContainer, state: PrebufferState): Promise<void>;
|
|
33
|
+
getPrebufferingState(container: PrebufferContainer): PrebufferState;
|
|
34
|
+
onPrebuffering(container: PrebufferContainer): Observable<PrebufferState>;
|
|
35
|
+
getStreamInfo(): Promise<StreamInfo | undefined>;
|
|
36
|
+
}
|
|
37
|
+
export interface CameraPrebufferDelegate {
|
|
38
|
+
getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
39
|
+
}
|
|
23
40
|
export interface CameraDelegate {
|
|
24
41
|
snapshotRequest(requestId: string): Promise<Buffer>;
|
|
25
42
|
prepareStream(requestId: string): Promise<void>;
|
|
@@ -27,10 +44,9 @@ export interface CameraDelegate {
|
|
|
27
44
|
onCandidates(requestId: string, candidates: string): Promise<void>;
|
|
28
45
|
reboot(): Promise<void>;
|
|
29
46
|
}
|
|
30
|
-
export interface
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
47
|
+
export interface StreamInfo {
|
|
48
|
+
audio: AudioStreamOptions;
|
|
49
|
+
video: VideoStreamOptions;
|
|
34
50
|
}
|
|
35
51
|
export interface AudioStreamOptions {
|
|
36
52
|
enabled?: boolean;
|
|
@@ -46,10 +62,6 @@ export interface VideoStreamOptions {
|
|
|
46
62
|
fps?: number;
|
|
47
63
|
idrInterval?: number;
|
|
48
64
|
}
|
|
49
|
-
export interface StreamInfo {
|
|
50
|
-
audio: AudioStreamOptions;
|
|
51
|
-
video: VideoStreamOptions;
|
|
52
|
-
}
|
|
53
65
|
export type Sdp = string;
|
|
54
66
|
export type IceCandiate = string;
|
|
55
67
|
export interface Go2RtcOfferMessage {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import type { Observable, Subscription } from 'rxjs';
|
|
4
|
-
import type { Camera, CameraInformation, CameraPublicProperties, CameraType, CameraZone } from '
|
|
5
|
-
import type { IceServer } from '
|
|
6
|
-
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraSource, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, Sets, SirenSetEvent, SirenState, StateValues, States } from './controller/types.js';
|
|
4
|
+
import type { Camera, CameraInformation, CameraPublicProperties, CameraType, CameraZone } from '../api/database/types.js';
|
|
5
|
+
import type { IceServer } from '../services/config/types.js';
|
|
6
|
+
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraSource, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, PrebufferContainer, PrebufferState, SetValues, Sets, SirenSetEvent, SirenState, StateValues, States } from './controller/types.js';
|
|
7
7
|
declare class Subscribed {
|
|
8
8
|
private readonly subscriptions;
|
|
9
9
|
private readonly additionalSubscriptions;
|
|
@@ -24,18 +24,23 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
24
24
|
protected doorbellState: BehaviorSubject<DoorbellState>;
|
|
25
25
|
protected sirenState: BehaviorSubject<SirenState>;
|
|
26
26
|
protected batteryState: BehaviorSubject<BatteryState>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
protected prebufferStateSubjects: {
|
|
28
|
+
[sourceId: string]: {
|
|
29
|
+
[container: string]: BehaviorSubject<PrebufferState>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly onConnected: Observable<boolean>;
|
|
33
|
+
readonly onLightSwitched: Observable<LightState>;
|
|
34
|
+
readonly onMotionDetected: Observable<MotionState>;
|
|
35
|
+
readonly onAudioDetected: Observable<AudioState>;
|
|
36
|
+
readonly onObjectDetected: Observable<ObjectState>;
|
|
37
|
+
readonly onDoorbellPressed: Observable<DoorbellState>;
|
|
38
|
+
readonly onSirenDetected: Observable<SirenState>;
|
|
39
|
+
readonly onBatteryChanged: Observable<BatteryState>;
|
|
35
40
|
get id(): string;
|
|
36
41
|
get nativeId(): string | undefined;
|
|
37
42
|
get pluginId(): string;
|
|
38
|
-
get
|
|
43
|
+
get connected(): boolean;
|
|
39
44
|
get disabled(): boolean;
|
|
40
45
|
get name(): string;
|
|
41
46
|
get type(): CameraType;
|
|
@@ -83,9 +88,13 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
83
88
|
protected getLightState(event: LightSetEvent | LightState): LightState;
|
|
84
89
|
protected getSirenState(event: SirenSetEvent): SirenState;
|
|
85
90
|
protected getBatteryState(event: BatterySetEvent): BatteryState;
|
|
86
|
-
private createStateObservable;
|
|
87
91
|
protected updateCamera(updatedCamera: Camera): void;
|
|
92
|
+
protected updatePrebuffer(sourceId: string, container: PrebufferContainer, state: PrebufferState): Promise<void>;
|
|
93
|
+
protected updateCameraSourcesState(): void;
|
|
88
94
|
protected updateCameraState(state: boolean): void;
|
|
95
|
+
protected cameraSourcePrebufferState(sourceId: string, container: PrebufferContainer): PrebufferState;
|
|
96
|
+
private createStateObservable;
|
|
97
|
+
protected createPrebufferStateObservable(sourceId: string, container: PrebufferContainer): Observable<PrebufferState>;
|
|
89
98
|
protected stateChanged<T extends keyof SetValues>(oldState?: SetValues[T], newState?: SetValues[T]): boolean;
|
|
90
99
|
protected isAudioState(state: Sets): state is AudioSetEvent;
|
|
91
100
|
protected isMotionState(state: Sets): state is MotionSetEvent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
2
|
import { MediaStreamTrack } from 'werift';
|
|
3
|
-
import { Subscribed } from '
|
|
3
|
+
import { Subscribed } from '../../utils/subscribed.js';
|
|
4
4
|
import type { Observable } from 'rxjs';
|
|
5
5
|
import type { ConnectionState, RTCIceCandidate, RTCSessionDescription, RtcpPacket, RtpPacket, RTCIceCandidate as WeriftRTCICECandidate } from 'werift';
|
|
6
|
-
import type { IceServer } from '
|
|
6
|
+
import type { IceServer } from '../../services/config/types.js';
|
|
7
7
|
import type { CameraDevice } from '../cameraDevice.js';
|
|
8
8
|
import type { BaseLogger } from '../controller/types.js';
|
|
9
9
|
export interface BasicPeerConnection {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
2
|
import { RtpPacket } from 'werift';
|
|
3
|
-
import { Subscribed } from '
|
|
3
|
+
import { Subscribed } from '../../utils/subscribed.js';
|
|
4
4
|
import type { CameraDevice } from '../cameraDevice.js';
|
|
5
5
|
import type { BaseLogger, FfmpegOptions, SpawnInput } from '../controller/types.js';
|
|
6
6
|
import type { WebrtcConnection } from './webrtc-connection.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReplaySubject, Subject, type Observable } from 'rxjs';
|
|
2
|
-
import { Subscribed } from '
|
|
2
|
+
import { Subscribed } from '../../utils/subscribed.js';
|
|
3
3
|
import type { RtpPacket } from 'werift';
|
|
4
|
-
import type { IceServer } from '
|
|
4
|
+
import type { IceServer } from '../../services/config/types.js';
|
|
5
5
|
import type { CameraDevice } from '../cameraDevice.js';
|
|
6
6
|
import type { BaseLogger } from '../controller/types.js';
|
|
7
7
|
import type { StreamingConnectionOptions } from './peer-connection.js';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { FfmpegArgs } from './types.js';
|
|
2
|
+
export declare const getHwaccelInfo: (port: number) => Promise<FfmpegArgs>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FrameWorker } from './worker
|
|
2
|
-
import type { CameraController } from '../
|
|
1
|
+
import { FrameWorker } from './worker.js';
|
|
2
|
+
import type { CameraController } from '../camera/controller/index.js';
|
|
3
3
|
export declare class FrameManager {
|
|
4
4
|
frameWorkers: Map<string, FrameWorker>;
|
|
5
5
|
private initialized;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import type { ChildProcess } from 'node:child_process';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Sharp } from 'sharp';
|
|
5
5
|
export interface FrameMetadata {
|
|
6
6
|
format: string;
|
|
7
7
|
frameSize: number;
|
|
@@ -19,14 +19,12 @@ export interface ImageCrop {
|
|
|
19
19
|
export interface ImageResize {
|
|
20
20
|
width?: number;
|
|
21
21
|
height?: number;
|
|
22
|
-
options?: ResizeOptions;
|
|
23
22
|
}
|
|
24
23
|
export interface ImageRotate {
|
|
25
24
|
angle: number;
|
|
26
|
-
options?: RotateOptions;
|
|
27
25
|
}
|
|
28
26
|
export interface ImageFormat {
|
|
29
|
-
|
|
27
|
+
to: 'rgba' | 'gray';
|
|
30
28
|
}
|
|
31
29
|
export interface ImageOptions {
|
|
32
30
|
format?: ImageFormat;
|
|
@@ -98,3 +96,16 @@ export interface PongMessage {
|
|
|
98
96
|
type: 'pong';
|
|
99
97
|
requestId: string;
|
|
100
98
|
}
|
|
99
|
+
export interface HardwareSource {
|
|
100
|
+
name: string;
|
|
101
|
+
url: string;
|
|
102
|
+
}
|
|
103
|
+
export interface HardwareResponse {
|
|
104
|
+
sources: HardwareSource[];
|
|
105
|
+
}
|
|
106
|
+
export interface FfmpegArgs {
|
|
107
|
+
hwaccel: string;
|
|
108
|
+
hwaccelArgs: string[];
|
|
109
|
+
hwaccelFilter: string;
|
|
110
|
+
threads: string;
|
|
111
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Subscribed } from '
|
|
2
|
-
import type { CameraController } from '
|
|
3
|
-
import type { FrameMetadata } from '
|
|
1
|
+
import { Subscribed } from '../utils/subscribed.js';
|
|
2
|
+
import type { CameraController } from '../camera/controller/index.js';
|
|
3
|
+
import type { FrameMetadata } from './types.js';
|
|
4
4
|
interface FrameWorkerClient {
|
|
5
5
|
pluginId: string;
|
|
6
6
|
requestIds: string[];
|
|
@@ -2,7 +2,7 @@ import { type NatsConnection, type Subscription } from 'nats';
|
|
|
2
2
|
import { CameraDeviceProxy } from './proxy/cameraDevice.js';
|
|
3
3
|
import { DeviceManagerProxy, PluginsManagerProxy, SystemManagerProxy } from './proxy/index.js';
|
|
4
4
|
import { NatsServer } from './server.js';
|
|
5
|
-
import type { StateValues } from '../
|
|
5
|
+
import type { StateValues } from '../camera/controller/types.js';
|
|
6
6
|
import type { CameraDeviceListenerMessagePayload, DeviceManagerProxyEvents, PluginsManagerProxyEvents, ProxyAuth, SystemManagerProxyEvents } from './types.js';
|
|
7
7
|
import type { WebsocketProxy } from './websocket.js';
|
|
8
8
|
export declare class ProxyServer {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { Camera } from '../../api/database/types.js';
|
|
3
|
+
import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions, PrebufferContainer, PrebufferState, SetValues, StateValues, StreamInfo } from '../../camera/controller/types.js';
|
|
3
4
|
import type { FrameMetadata } from '../../decoder/types.js';
|
|
4
|
-
import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions, PrebufferType, SetValues, StateValues, StreamInfo } from '../../devices/camera/controller/types.js';
|
|
5
5
|
import type { IceServer } from '../../services/config/types.js';
|
|
6
6
|
import type { MessageQueue } from '../queue.js';
|
|
7
7
|
import type { CameraDeviceProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
@@ -30,18 +30,6 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
30
30
|
cameraId: string;
|
|
31
31
|
pluginId: string;
|
|
32
32
|
}): Promise<StreamInfo | undefined>;
|
|
33
|
-
isPrebuffering(data: {
|
|
34
|
-
sourceName: string;
|
|
35
|
-
type: PrebufferType;
|
|
36
|
-
cameraId: string;
|
|
37
|
-
pluginId: string;
|
|
38
|
-
}): Promise<boolean>;
|
|
39
|
-
getPrebufferRawUrl(data: {
|
|
40
|
-
sourceName: string;
|
|
41
|
-
type: PrebufferType;
|
|
42
|
-
cameraId: string;
|
|
43
|
-
pluginId: string;
|
|
44
|
-
}): Promise<string | undefined>;
|
|
45
33
|
getFrameMetadata(data: {
|
|
46
34
|
cameraId: string;
|
|
47
35
|
pluginId: string;
|
|
@@ -72,6 +60,13 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
72
60
|
cameraId: string;
|
|
73
61
|
pluginId: string;
|
|
74
62
|
}): Promise<void>;
|
|
63
|
+
updatePrebufferState(data: {
|
|
64
|
+
sourceId: string;
|
|
65
|
+
container: PrebufferContainer;
|
|
66
|
+
state: PrebufferState;
|
|
67
|
+
cameraId: string;
|
|
68
|
+
pluginId: string;
|
|
69
|
+
}): Promise<void>;
|
|
75
70
|
refreshStates(data: {
|
|
76
71
|
cameraId: string;
|
|
77
72
|
pluginId: string;
|
|
@@ -82,8 +77,6 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
82
77
|
};
|
|
83
78
|
onRequestReboot(pluginId: string, cameraId: string, ...args: Parameters<CameraDelegate['reboot']>): Promise<Buffer>;
|
|
84
79
|
onRequestGetStreamInfo(pluginId: string, cameraId: string, ...args: Parameters<CameraPrebufferDelegate['getStreamInfo']>): Promise<StreamInfo | undefined>;
|
|
85
|
-
onRequestIsPrebuffering(pluginId: string, cameraId: string, ...args: Parameters<CameraPrebufferDelegate['isPrebuffering']>): Promise<boolean>;
|
|
86
|
-
onRequestGetRawUrl(pluginId: string, cameraId: string, ...args: Parameters<CameraPrebufferDelegate['getPrebufferRawUrl']>): Promise<string | undefined>;
|
|
87
80
|
onRequestSnapshotRequest(pluginId: string, cameraId: string, ...args: Parameters<CameraDelegate['snapshotRequest']>): Promise<Buffer>;
|
|
88
81
|
onRequestPrepareStream(pluginId: string, cameraId: string, ...args: Parameters<CameraDelegate['prepareStream']>): Promise<void>;
|
|
89
82
|
onRequestWebRTCOffer(pluginId: string, cameraId: string, ...args: Parameters<CameraDelegate['onOffer']>): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Camera } from '../../api/database/types.js';
|
|
2
|
-
import type { CameraConfig } from '../../
|
|
2
|
+
import type { CameraConfig } from '../../camera/controller/types.js';
|
|
3
3
|
import type { MessageQueue } from '../queue.js';
|
|
4
4
|
import type { DeviceManagerServerProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
5
5
|
export declare class DeviceManagerProxy implements DeviceManagerServerProxyMethods {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BasePlugin } from '../../plugins/base.js';
|
|
2
|
-
import type { CameraStorage } from '../../
|
|
2
|
+
import type { CameraStorage } from '../../polyglot/node/plugins/cameraStorage.js';
|
|
3
3
|
import type { MessageQueue } from '../queue.js';
|
|
4
4
|
import type { CallablePluginMethods, CallablePluginStorageMethods, PluginsManagerServerProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
5
5
|
export declare class PluginsManagerProxy implements PluginsManagerServerProxyMethods {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Camera } from '../api/database/types.js';
|
|
2
|
+
import type { CameraDevice } from '../camera/cameraDevice.js';
|
|
3
|
+
import type { CameraConfig, FfmpegOptions, PrebufferContainer, PrebufferState, SetValues, StateValues, StreamInfo } from '../camera/controller/types.js';
|
|
2
4
|
import type { FrameMetadata } from '../decoder/types.js';
|
|
3
|
-
import type { CameraDevice } from '../devices/camera/cameraDevice.js';
|
|
4
|
-
import type { CameraConfig, FfmpegOptions, PrebufferType, SetValues, StateValues, StreamInfo } from '../devices/camera/controller/types.js';
|
|
5
5
|
import type { BasePlugin } from '../plugins/base.js';
|
|
6
|
-
import type { CameraStorage } from '../plugins/node/cameraStorage.js';
|
|
7
6
|
import type { CameraExtension } from '../plugins/types.js';
|
|
7
|
+
import type { CameraStorage } from '../polyglot/node/plugins/cameraStorage.js';
|
|
8
8
|
import type { IceServer } from '../services/config/types.js';
|
|
9
9
|
export type MethodKeys<T> = {
|
|
10
10
|
[K in keyof T]: T[K] extends Function ? K : never;
|
|
@@ -92,18 +92,6 @@ export interface CameraDeviceProxyMethods {
|
|
|
92
92
|
cameraId: string;
|
|
93
93
|
pluginId: string;
|
|
94
94
|
}): Promise<void>;
|
|
95
|
-
isPrebuffering(data: {
|
|
96
|
-
sourceName: string;
|
|
97
|
-
type: PrebufferType;
|
|
98
|
-
cameraId: string;
|
|
99
|
-
pluginId: string;
|
|
100
|
-
}): Promise<boolean>;
|
|
101
|
-
getPrebufferRawUrl(data: {
|
|
102
|
-
sourceName: string;
|
|
103
|
-
type: PrebufferType;
|
|
104
|
-
cameraId: string;
|
|
105
|
-
pluginId: string;
|
|
106
|
-
}): Promise<string | undefined>;
|
|
107
95
|
getStreamInfo(data: {
|
|
108
96
|
sourceName: string;
|
|
109
97
|
cameraId: string;
|
|
@@ -145,6 +133,13 @@ export interface CameraDeviceProxyMethods {
|
|
|
145
133
|
cameraId: string;
|
|
146
134
|
pluginId: string;
|
|
147
135
|
}): void;
|
|
136
|
+
updatePrebufferState(data: {
|
|
137
|
+
sourceId: string;
|
|
138
|
+
container: PrebufferContainer;
|
|
139
|
+
state: PrebufferState;
|
|
140
|
+
cameraId: string;
|
|
141
|
+
pluginId: string;
|
|
142
|
+
}): Promise<void>;
|
|
148
143
|
refreshStates(data: {
|
|
149
144
|
cameraId: string;
|
|
150
145
|
pluginId: string;
|
|
@@ -237,6 +232,6 @@ export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
|
237
232
|
};
|
|
238
233
|
}
|
|
239
234
|
export interface CameraDeviceListenerMessagePayload {
|
|
240
|
-
type: 'removed' | 'updated' | 'cameraState';
|
|
235
|
+
type: 'removed' | 'updated' | 'cameraState' | 'prebufferState';
|
|
241
236
|
data?: any;
|
|
242
237
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Namespace, Server } from 'socket.io';
|
|
2
2
|
import type { SocketNsp } from '../api/websocket/types.js';
|
|
3
|
-
import type { StateValues } from '../
|
|
3
|
+
import type { StateValues } from '../camera/controller/types.js';
|
|
4
4
|
import type { CameraDeviceListenerMessagePayload } from './types.js';
|
|
5
5
|
export declare class WebsocketProxy {
|
|
6
6
|
nsp: Namespace;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PluginConfigService } from '../polyglot/node/plugins/config.js';
|
|
1
2
|
import { PythonInstaller } from '../utils/pythonInstaller.js';
|
|
2
|
-
import { PluginConfigService } from './node/config.js';
|
|
3
3
|
import type { PluginConstructor } from '../api.js';
|
|
4
4
|
import type { CameraUiPlugin, IPackageJson } from '../api/types/index.js';
|
|
5
5
|
import type { PluginContract } from './types.js';
|
|
@@ -4,11 +4,14 @@ export declare class PluginWorker {
|
|
|
4
4
|
plugin: Plugin;
|
|
5
5
|
private pluginWorker?;
|
|
6
6
|
private proxyServer;
|
|
7
|
-
private ipc;
|
|
8
7
|
private api;
|
|
9
8
|
private logger;
|
|
10
9
|
private configService;
|
|
11
10
|
private socketService;
|
|
11
|
+
private publisher?;
|
|
12
|
+
private subscriber?;
|
|
13
|
+
private subject;
|
|
14
|
+
private targetSubject;
|
|
12
15
|
private started;
|
|
13
16
|
private shuttingDown;
|
|
14
17
|
private _status;
|
|
@@ -26,5 +29,6 @@ export declare class PluginWorker {
|
|
|
26
29
|
private handleClose;
|
|
27
30
|
private reset;
|
|
28
31
|
private updatePython;
|
|
32
|
+
private listenToMessages;
|
|
29
33
|
private cleanedProcessEnv;
|
|
30
34
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
3
|
import { DeviceManager, PluginsManager, SystemManager } from './proxy/index.js';
|
|
4
4
|
import { StorageController } from './storageController.js';
|
|
5
|
-
import type { BasePlugin } from '
|
|
6
|
-
import type { Plugin } from '
|
|
5
|
+
import type { BasePlugin } from '../../../plugins/base.js';
|
|
6
|
+
import type { Plugin } from '../../../plugins/plugin.js';
|
|
7
7
|
import type { PluginConfigService } from './config.js';
|
|
8
8
|
import type { PluginLogger } from './logger.js';
|
|
9
9
|
export declare interface API {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '
|
|
1
|
+
import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '../../../plugins/types.js';
|
|
2
2
|
import type { PluginAPI } from './api.js';
|
|
3
3
|
export declare class CameraStorage {
|
|
4
4
|
private cameraId;
|
package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/cameraDevice.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CameraDevice } from '
|
|
2
|
-
import type { Camera } from '
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { IceServer } from '
|
|
1
|
+
import { CameraDevice } from '../../../../camera/cameraDevice.js';
|
|
2
|
+
import type { Camera } from '../../../../api/database/types.js';
|
|
3
|
+
import type { CameraSource, SetValues } from '../../../../camera/controller/types.js';
|
|
4
|
+
import type { VideoFrame } from '../../../../decoder/types.js';
|
|
5
|
+
import type { IceServer } from '../../../../services/config/types.js';
|
|
6
6
|
import type { PluginAPI } from '../api.js';
|
|
7
7
|
import type { PluginLogger } from '../logger.js';
|
|
8
8
|
export declare class CameraDeviceProxy extends CameraDevice {
|
package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/deviceManager.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
3
|
import { CameraDeviceProxy } from './cameraDevice.js';
|
|
4
|
-
import type { CameraDevice } from '
|
|
5
|
-
import type { CameraConfig } from '
|
|
6
|
-
import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '
|
|
4
|
+
import type { CameraDevice } from '../../../../camera/cameraDevice.js';
|
|
5
|
+
import type { CameraConfig } from '../../../../camera/controller/types.js';
|
|
6
|
+
import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../../nats/types.js';
|
|
7
7
|
import type { PluginAPI } from '../api.js';
|
|
8
8
|
import type { PluginLogger } from '../logger.js';
|
|
9
9
|
export declare interface DeviceManager extends DeviceManagerProxyMethods {
|
package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/pluginsManager.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
|
-
import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '
|
|
3
|
+
import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../../nats/types.js';
|
|
4
4
|
import type { PluginAPI } from '../api.js';
|
|
5
5
|
import type { PluginLogger } from '../logger.js';
|
|
6
6
|
export declare interface PluginsManager extends PluginsManagerProxyMethods {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NatsConnection, Subscription } from 'nats';
|
|
2
|
-
import type { BaseLogger } from '
|
|
3
|
-
import type { ProxyMessageStructure } from '
|
|
2
|
+
import type { BaseLogger } from '../../../../camera/controller/types.js';
|
|
3
|
+
import type { ProxyMessageStructure } from '../../../../nats/types.js';
|
|
4
4
|
export declare class ClientMessageQueue {
|
|
5
5
|
private logger;
|
|
6
6
|
private publisher;
|
package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/systemManager.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
|
-
import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '
|
|
3
|
+
import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../../nats/types.js';
|
|
4
4
|
import type { PluginAPI } from '../api.js';
|
|
5
5
|
import type { PluginLogger } from '../logger.js';
|
|
6
6
|
export declare interface SystemManager extends SystemManagerProxyMethods {
|