@camera.ui/browser 0.0.111 → 0.0.113
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/LICENSE.md +1 -1
- package/README.md +10 -1
- package/dist/index.d.ts +1269 -0
- package/dist/index.js +4179 -0
- package/package.json +55 -39
- package/CHANGELOG.md +0 -8
- package/dist/bundle.js +0 -2
- package/dist/bundle.js.LICENSE.txt +0 -14
- package/dist/types/packages/client/browser/src/api.d.ts +0 -8
- package/dist/types/packages/client/browser/src/client.d.ts +0 -21
- package/dist/types/packages/client/browser/src/index.d.ts +0 -2
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +0 -26
- package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +0 -14
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +0 -16
- package/dist/types/packages/client/browser/src/proxy/index.d.ts +0 -3
- package/dist/types/packages/client/browser/src/proxy.d.ts +0 -7
- package/dist/types/packages/client/browser/src/streaming/config.d.ts +0 -21
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +0 -286
- package/dist/types/packages/client/browser/src/streaming/types.d.ts +0 -38
- package/dist/types/packages/client/browser/src/types.d.ts +0 -56
- package/dist/types/packages/client/browser/src/utils.d.ts +0 -12
- package/dist/types/packages/common/src/utils/subscribed.d.ts +0 -18
- package/dist/types/packages/types/src/index.d.ts +0 -812
- package/dist/types/server/src/api/database/types.d.ts +0 -80
- package/dist/types/server/src/api/go2rtc/types.d.ts +0 -147
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +0 -211
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +0 -1864
- package/dist/types/server/src/api/schemas/config.schema.d.ts +0 -102
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +0 -735
- package/dist/types/server/src/api/schemas/plugins.schema.d.ts +0 -72
- package/dist/types/server/src/api/schemas/storage.schema.d.ts +0 -22
- package/dist/types/server/src/api/schemas/system.schema.d.ts +0 -185
- package/dist/types/server/src/api/schemas/users.schema.d.ts +0 -857
- package/dist/types/server/src/api/types/index.d.ts +0 -612
- package/dist/types/server/src/api/websocket/types.d.ts +0 -43
- package/dist/types/server/src/camera/classes.d.ts +0 -2
- package/dist/types/server/src/camera/index.d.ts +0 -92
- package/dist/types/server/src/camera/interfaces.d.ts +0 -17
- package/dist/types/server/src/camera/iou.d.ts +0 -2
- package/dist/types/server/src/camera/polygon.d.ts +0 -4
- package/dist/types/server/src/camera/types.d.ts +0 -17
- package/dist/types/server/src/go2rtc/types.d.ts +0 -15
- package/dist/types/server/src/manager/types.d.ts +0 -15
- package/dist/types/server/src/plugins/schema.d.ts +0 -27
- package/dist/types/server/src/plugins/types.d.ts +0 -49
- package/dist/types/server/src/rpc/namespaces.d.ts +0 -35
- package/dist/types/server/src/rpc/types.d.ts +0 -111
- package/dist/types/server/src/services/config/defaults.d.ts +0 -12
- package/dist/types/server/src/services/config/types.d.ts +0 -162
- package/dist/types/server/src/types.d.ts +0 -34
- package/dist/types/shared/types/index.d.ts +0 -22
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Subscribed } from '@camera.ui/common/utils';
|
|
2
|
-
import { CameraDeviceCapability } from '@camera.ui/types';
|
|
3
|
-
import TTLCache from '@isaacs/ttlcache';
|
|
4
|
-
import { BehaviorSubject } from 'rxjs';
|
|
5
|
-
import type { AudioState, BatteryState, Camera, CameraDetectionSettings, CameraFrameWorkerSettings, CameraInformation, CameraSource, CameraType, DetectionZone, DoorbellState, LightState, LoggerService, MotionState, ObjectState, SetValues, SirenState, StateValues } from '@camera.ui/types';
|
|
6
|
-
import type { Observable } from 'rxjs';
|
|
7
|
-
import type { CameraInterfaces, PluginCapabilities } from './types.js';
|
|
8
|
-
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
9
|
-
#private;
|
|
10
|
-
readonly logger: LoggerService;
|
|
11
|
-
protected snapshotCache: TTLCache<string, ArrayBuffer>;
|
|
12
|
-
readonly cameraSubject: BehaviorSubject<Camera>;
|
|
13
|
-
readonly cameraState: BehaviorSubject<boolean>;
|
|
14
|
-
readonly frameWorkerState: BehaviorSubject<boolean>;
|
|
15
|
-
readonly lightState: BehaviorSubject<LightState>;
|
|
16
|
-
readonly motionState: BehaviorSubject<MotionState>;
|
|
17
|
-
readonly audioState: BehaviorSubject<AudioState>;
|
|
18
|
-
readonly objectState: BehaviorSubject<ObjectState>;
|
|
19
|
-
readonly doorbellState: BehaviorSubject<DoorbellState>;
|
|
20
|
-
readonly sirenState: BehaviorSubject<SirenState>;
|
|
21
|
-
readonly batteryState: BehaviorSubject<BatteryState>;
|
|
22
|
-
readonly capabilities: BehaviorSubject<PluginCapabilities[]>;
|
|
23
|
-
readonly onConnected: Observable<boolean>;
|
|
24
|
-
readonly onFrameWorkerConnected: Observable<boolean>;
|
|
25
|
-
readonly onLightSwitched: Observable<LightState>;
|
|
26
|
-
readonly onMotionDetected: Observable<MotionState>;
|
|
27
|
-
readonly onAudioDetected: Observable<AudioState>;
|
|
28
|
-
readonly onObjectDetected: Observable<ObjectState>;
|
|
29
|
-
readonly onDoorbellPressed: Observable<DoorbellState>;
|
|
30
|
-
readonly onSirenDetected: Observable<SirenState>;
|
|
31
|
-
readonly onBatteryChanged: Observable<BatteryState>;
|
|
32
|
-
protected abstract cameraInterfaces: CameraInterfaces;
|
|
33
|
-
protected get cameraObject(): Camera;
|
|
34
|
-
get id(): string;
|
|
35
|
-
get nativeId(): string | undefined;
|
|
36
|
-
get pluginId(): string;
|
|
37
|
-
get connected(): boolean;
|
|
38
|
-
get frameWorkerConnected(): boolean;
|
|
39
|
-
get disabled(): boolean;
|
|
40
|
-
get name(): string;
|
|
41
|
-
get type(): CameraType;
|
|
42
|
-
get info(): CameraInformation;
|
|
43
|
-
get isCloud(): boolean;
|
|
44
|
-
get hasLight(): boolean;
|
|
45
|
-
get hasSiren(): boolean;
|
|
46
|
-
get hasDoorbell(): boolean;
|
|
47
|
-
get hasBattery(): boolean;
|
|
48
|
-
get hasAudioDetector(): boolean;
|
|
49
|
-
get hasMotionDetector(): boolean;
|
|
50
|
-
get hasObjectDetector(): boolean;
|
|
51
|
-
get hasPtz(): boolean;
|
|
52
|
-
get snapshotTTL(): number;
|
|
53
|
-
get detectionZones(): DetectionZone[];
|
|
54
|
-
get detectionSettings(): CameraDetectionSettings;
|
|
55
|
-
get frameWorkerSettings(): CameraFrameWorkerSettings;
|
|
56
|
-
get streamSource(): CameraSource;
|
|
57
|
-
get snapshotSource(): CameraSource | undefined;
|
|
58
|
-
get highResolutionSource(): CameraSource | undefined;
|
|
59
|
-
get midResolutionSource(): CameraSource | undefined;
|
|
60
|
-
get lowResolutionSource(): CameraSource | undefined;
|
|
61
|
-
get interfaces(): CameraInterfaces;
|
|
62
|
-
abstract get sources(): CameraSource[];
|
|
63
|
-
constructor(camera: Camera, logger: LoggerService);
|
|
64
|
-
getCapabilities(): CameraDeviceCapability[];
|
|
65
|
-
hasCapability(capability: CameraDeviceCapability): boolean;
|
|
66
|
-
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
67
|
-
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
68
|
-
newState: StateValues[T];
|
|
69
|
-
oldState: StateValues[T];
|
|
70
|
-
}>;
|
|
71
|
-
onPropertyChange<T extends keyof Camera>(property: T | T[]): Observable<{
|
|
72
|
-
property: T;
|
|
73
|
-
oldData: Camera[T];
|
|
74
|
-
newData: Camera[T];
|
|
75
|
-
}>;
|
|
76
|
-
onCapabilitiesChange(): Observable<{
|
|
77
|
-
oldCapabilities: CameraDeviceCapability[];
|
|
78
|
-
newCapabilities: CameraDeviceCapability[];
|
|
79
|
-
}>;
|
|
80
|
-
protected abstract cleanup(): void;
|
|
81
|
-
protected removeAllListeners(): void;
|
|
82
|
-
protected updateCamera(updatedCamera: Camera): void;
|
|
83
|
-
protected updateCameraState(state: boolean): void;
|
|
84
|
-
protected updateFrameWorkerState(state: boolean): void;
|
|
85
|
-
protected updateCapabilities(capabilities: PluginCapabilities[]): void;
|
|
86
|
-
protected updateStateInternal<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], skipCheck?: boolean, skipDetectionsCheck?: boolean): void;
|
|
87
|
-
protected checkStateInternal<T extends keyof SetValues>(stateName: T, event: SetValues[T], skipDetectionsCheck?: boolean): {
|
|
88
|
-
changed: boolean;
|
|
89
|
-
event: StateValues[T];
|
|
90
|
-
};
|
|
91
|
-
protected stateChanged<T extends keyof SetValues>(oldState?: SetValues[T], newState?: SetValues[T], type?: keyof StateValues): boolean;
|
|
92
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RPCConnection } from '@camera.ui/rpc-common';
|
|
2
|
-
import type { PTZCommand, PTZInterface, SnapshotInterface, StreamingInterface } from '@camera.ui/types';
|
|
3
|
-
import type { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import type { CameraInterfaces, PluginCapabilities } from './types.js';
|
|
5
|
-
interface ProxyInstance {
|
|
6
|
-
createRPCConnection(namespace: string): Promise<RPCConnection>;
|
|
7
|
-
}
|
|
8
|
-
export declare class CameraInterface implements CameraInterfaces {
|
|
9
|
-
#private;
|
|
10
|
-
interfaces?: PTZInterface | SnapshotInterface | StreamingInterface;
|
|
11
|
-
constructor(proxy: ProxyInstance, capabilities: BehaviorSubject<PluginCapabilities[]>, cameraId: string, pluginId?: string);
|
|
12
|
-
streamUrl(sourceName: string): Promise<string>;
|
|
13
|
-
snapshot(sourceId: string, forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
14
|
-
ptzCommand(command: PTZCommand): Promise<void>;
|
|
15
|
-
disconnect(): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CameraDetectionSettings, Detection, DetectionZone } from '@camera.ui/types';
|
|
2
|
-
export declare const convertZonePointsToPixels: (zone: DetectionZone, detection: Detection) => DetectionZone;
|
|
3
|
-
export declare const convertBoundingBoxToPixels: (detection: Detection) => Detection;
|
|
4
|
-
export declare const areDetectionsValid: (detections: Detection[], zones: DetectionZone[], activitySettings: CameraDetectionSettings) => Detection[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AudioSetEvent, AudioState, BatterySetEvent, BatteryState, CameraDevice, CameraDeviceCapability, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, ProbeConfig, ProbeStream, PTZInterface, SirenSetEvent, SirenState, SnapshotInterface, StreamingInterface } from '@camera.ui/types';
|
|
2
|
-
import type { RefreshedStates } from '../rpc/types.js';
|
|
3
|
-
import type { FunctionPropertyNames } from '../types.js';
|
|
4
|
-
export type States = LightState | MotionState | AudioState | ObjectState | DoorbellState | SirenState | BatteryState;
|
|
5
|
-
export type Sets = LightSetEvent | MotionSetEvent | AudioSetEvent | ObjectSetEvent | DoorbellSetEvent | SirenSetEvent | BatterySetEvent;
|
|
6
|
-
export interface CameraDeviceInterface extends Omit<Pick<CameraDevice, FunctionPropertyNames<CameraDevice>>, 'extend' | 'addCapabilities' | 'removeCapabilities' | 'getFrames' | 'onStateChange' | 'onPropertyChange' | 'onCapabilitiesChange'> {
|
|
7
|
-
refreshStates(): Promise<RefreshedStates>;
|
|
8
|
-
snapshot(sourceId: string, forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
9
|
-
probeStream(sourceId: string, probeConfig?: ProbeConfig, refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
10
|
-
addPluginCapabilities(pluginId: string, capabilities: CameraDeviceCapability[]): void;
|
|
11
|
-
removePluginCapabilities(pluginId: string, capabilities: CameraDeviceCapability[]): void;
|
|
12
|
-
}
|
|
13
|
-
export type CameraInterfaces = PTZInterface & SnapshotInterface & StreamingInterface;
|
|
14
|
-
export interface PluginCapabilities {
|
|
15
|
-
pluginId: string;
|
|
16
|
-
capabilities: CameraDeviceCapability[];
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const sourcePrefixes: readonly ["bubble://", "doorbird://", "dvrip://", "echo:", "eseecloud://", "exec:", "expr:", "ffmpeg:", "flussonic://", "gopro://", "hass:", "homekit://", "http://", "https://", "httpx://", "isapi://", "ivideon:", "kasa://", "nest:", "onvif://", "ring:", "roborock://", "rtmp://", "rtsp://", "rtspx://", "tapo://", "tcp://", "webrtc:", "webtorrent:"];
|
|
2
|
-
export declare const rtspPresets: readonly ["#backchannel=", "#header=", "#media=audio", "#media=video", "#timeout=10", "#timeout=20", "#timeout=30", "#transport="];
|
|
3
|
-
export declare const ffmpegPresets: readonly ["#audio=aac", "#audio=aac/16000", "#audio=mp3", "#audio=opus", "#audio=pcm", "#audio=pcm/8000", "#audio=pcm/16000", "#audio=pcm/48000", "#audio=pcma", "#audio=pcma/8000", "#audio=pcma/16000", "#audio=pcma/48000", "#audio=pcml", "#audio=pcml/8000", "#audio=pcml/44100", "#audio=pcmu", "#audio=pcmu/8000", "#audio=pcmu/16000", "#audio=pcmu/48000", "#drawtext", "#hardware", "#hardware=cuda", "#hardware=dxva2", "#hardware=rkmpp", "#hardware=v4l2m2m", "#hardware=vaapi", "#hardware=videotoolbox", "#height=", "#raw=", "#rotate=-90", "#rotate=90", "#rotate=180", "#rotate=270", "#video=copy", "#video=h264", "#video=h265", "#video=mjpeg", "#width="];
|
|
4
|
-
export declare const homekitPresets: readonly ["client_id=", "client_private=", "device_id=", "device_public="];
|
|
5
|
-
export declare const httpPresets: readonly ["#header="];
|
|
6
|
-
export declare const nestPresets: readonly ["client_id=", "client_secret=", "refresh_token=", "project_id=", "device_id="];
|
|
7
|
-
export declare const ringPresets: readonly ["device_id=", "refresh_token="];
|
|
8
|
-
export declare const webrtcPresets: readonly ["#client_id=", "#format=openipc", "#format=wyze", "#format=kinesis", "#ice_servers="];
|
|
9
|
-
export type SourcePrefixes = (typeof sourcePrefixes)[number];
|
|
10
|
-
export type RtspPresets = (typeof rtspPresets)[number];
|
|
11
|
-
export type FFmpegPresets = (typeof ffmpegPresets)[number];
|
|
12
|
-
export type HomekitPresets = (typeof homekitPresets)[number];
|
|
13
|
-
export type HttpPresets = (typeof httpPresets)[number];
|
|
14
|
-
export type NestPresets = (typeof nestPresets)[number];
|
|
15
|
-
export type WebrtcPresets = (typeof webrtcPresets)[number];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Camera, CameraConfig, CoreManager, DeviceManager, FfmpegArgs, HWAccelOptions, IceServer } from '@camera.ui/types';
|
|
2
|
-
import type { PluginInfo } from '../plugins/types.js';
|
|
3
|
-
export interface CoreManagerInterface extends Omit<CoreManager, keyof CoreManager> {
|
|
4
|
-
getFFmpegPath(): Promise<string>;
|
|
5
|
-
getHwaccelInfo(options: HWAccelOptions): Promise<FfmpegArgs[]>;
|
|
6
|
-
getServerAddresses(): Promise<string[]>;
|
|
7
|
-
getIceServers(): Promise<IceServer[]>;
|
|
8
|
-
getPlugin(pluginName: string): Promise<PluginInfo | undefined>;
|
|
9
|
-
}
|
|
10
|
-
export interface DeviceManagerInterface extends Omit<DeviceManager, keyof DeviceManager> {
|
|
11
|
-
createCamera(cameraConfig: CameraConfig, pluginId: string): Promise<Camera>;
|
|
12
|
-
updateCamera(cameraNameOrId: string, cameraConfig: Partial<CameraConfig>, pluginId: string): Promise<Camera>;
|
|
13
|
-
getCamera(cameraNameOrId: string, pluginId: string): Promise<Camera | undefined>;
|
|
14
|
-
removeCamera(cameraNameOrId: string, pluginId: string): Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as zod from 'zod';
|
|
2
|
-
import type { JsonSchema, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaNumber, JsonSchemaString, JsonSchemaSubmit, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey } from '@camera.ui/types';
|
|
3
|
-
export declare const isStringType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaString;
|
|
4
|
-
export declare const isNumberType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaNumber;
|
|
5
|
-
export declare const isBooleanType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaBoolean;
|
|
6
|
-
export declare const isEnumType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaEnum;
|
|
7
|
-
export declare const isArrayType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaArray;
|
|
8
|
-
export declare const isButtonType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaButton;
|
|
9
|
-
export declare const isSubmitType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaSubmit;
|
|
10
|
-
export declare const isValidableStringType: (schema: JsonSchemaWithoutKey) => schema is JsonSchemaString;
|
|
11
|
-
export declare const isConfigDefault: (config: Record<string, any>, schemas: JsonSchema[]) => boolean;
|
|
12
|
-
export declare const generateDefaultValue: (schema: JsonSchema) => any;
|
|
13
|
-
export declare const generateConfigFromSchemas: (schemas: JsonSchema[]) => Record<string, any>;
|
|
14
|
-
export declare const getValueByKey: (config: Record<string, any> | undefined, key: string) => any;
|
|
15
|
-
export declare const setValueByKey: (config: Record<string, any>, key: string, value: any) => void;
|
|
16
|
-
export declare const findSchemaByKey: (schemas: JsonSchema[], key: string) => JsonSchema | undefined;
|
|
17
|
-
export declare const removeCallbacksFromSchema: (schema: JsonSchemaWithoutKey) => JsonSchemaWithoutCallbacks;
|
|
18
|
-
export declare const removeCallbacksFromSchemas: (schemas: JsonSchema[]) => JsonSchemaWithoutCallbacks[];
|
|
19
|
-
export declare const generateStorableConfig: (schemas: JsonSchema[], config: Record<string, any>) => Record<string, any>;
|
|
20
|
-
export declare const getSchemasByGroup: (schemas: JsonSchema[], group: string) => JsonSchema[];
|
|
21
|
-
export declare const schemaGroupIsReadonly: (schemas: JsonSchema[], group: string) => boolean;
|
|
22
|
-
export declare const schemaGroupIsStorable: (schemas: JsonSchema[], group: string) => boolean;
|
|
23
|
-
export declare const isValidFormat: (value: string, format?: string) => boolean;
|
|
24
|
-
export declare const validateValue: (value: any, schema: JsonSchemaWithoutKey) => boolean;
|
|
25
|
-
export declare const validateConfig: (config: Record<string, any>, schemas: JsonSchema[]) => Record<string, string[]>;
|
|
26
|
-
export declare const generateZodSchemaField: (schema: JsonSchema) => zod.ZodTypeAny;
|
|
27
|
-
export declare const generateZodSchema: (schemas: JsonSchema[]) => zod.ZodObject<any>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Camera, CameraExtension } from '@camera.ui/types';
|
|
2
|
-
export interface Context {
|
|
3
|
-
engines?: Record<string, string>;
|
|
4
|
-
dependencies?: Record<string, string>;
|
|
5
|
-
}
|
|
6
|
-
export declare const PLUGIN_IDENTIFIER_PATTERN: RegExp;
|
|
7
|
-
export declare const CAMERA_EXTENSIONS: CameraExtension[];
|
|
8
|
-
export interface ProcessLoadMessage {
|
|
9
|
-
cameras: Camera[];
|
|
10
|
-
plugin: PluginInfo;
|
|
11
|
-
storage: PluginStorage;
|
|
12
|
-
}
|
|
13
|
-
export interface ProcessMessage {
|
|
14
|
-
type: PLUGIN_COMMAND;
|
|
15
|
-
data?: ProcessLoadMessage;
|
|
16
|
-
}
|
|
17
|
-
export interface ProcessResponse {
|
|
18
|
-
type: PLUGIN_STATUS;
|
|
19
|
-
error?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare enum PLUGIN_STATUS {
|
|
22
|
-
READY = "ready",
|
|
23
|
-
STARTING = "starting",
|
|
24
|
-
STARTED = "started",
|
|
25
|
-
STOPPING = "stopping",
|
|
26
|
-
STOPPED = "stopped",
|
|
27
|
-
ERROR = "error",
|
|
28
|
-
UNKNOWN = "unknown",
|
|
29
|
-
DISABLED = "disabled"
|
|
30
|
-
}
|
|
31
|
-
export declare enum PLUGIN_COMMAND {
|
|
32
|
-
START = "start",
|
|
33
|
-
STOP = "stop"
|
|
34
|
-
}
|
|
35
|
-
export interface PluginStorage {
|
|
36
|
-
installPath: string;
|
|
37
|
-
storagePath: string;
|
|
38
|
-
}
|
|
39
|
-
export interface PluginInfo {
|
|
40
|
-
id: string;
|
|
41
|
-
name: string;
|
|
42
|
-
contract: PluginContract;
|
|
43
|
-
}
|
|
44
|
-
export interface PluginContract {
|
|
45
|
-
extensions: CameraExtension[];
|
|
46
|
-
dependencies?: string[];
|
|
47
|
-
pythonVersion?: string;
|
|
48
|
-
bundled?: boolean;
|
|
49
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export interface CoreManagerNamespaces {
|
|
2
|
-
coreManagerSubject: string;
|
|
3
|
-
coreManagerRpc: string;
|
|
4
|
-
}
|
|
5
|
-
export interface DeviceManagerNamespaces {
|
|
6
|
-
deviceManagerSubject: string;
|
|
7
|
-
deviceManagerRpc: string;
|
|
8
|
-
}
|
|
9
|
-
export interface FrameWorkerNamespaces {
|
|
10
|
-
frameWorkerChildRpc: string;
|
|
11
|
-
frameWorkerChild: string;
|
|
12
|
-
}
|
|
13
|
-
export interface PluginNamespaces {
|
|
14
|
-
pluginDeviceManagerSubject: string;
|
|
15
|
-
pluginChildRpc: string;
|
|
16
|
-
pluginChild: string;
|
|
17
|
-
pluginStorageRpc: string;
|
|
18
|
-
}
|
|
19
|
-
export interface CameraNamespaces {
|
|
20
|
-
cameraSubject: string;
|
|
21
|
-
cameraControllerRpc: string;
|
|
22
|
-
cameraMotionFrameSubject: string;
|
|
23
|
-
}
|
|
24
|
-
export interface PluginCameraNamespaces {
|
|
25
|
-
cameraInterfacesRpc: string;
|
|
26
|
-
cameraStorageRpc: string;
|
|
27
|
-
}
|
|
28
|
-
export declare class NamespaceManager {
|
|
29
|
-
static coreManagerNamespaces(): CoreManagerNamespaces;
|
|
30
|
-
static deviceManagerNamespaces(): DeviceManagerNamespaces;
|
|
31
|
-
static frameWorkerNamespaces(cameraId: string): FrameWorkerNamespaces;
|
|
32
|
-
static pluginNamespaces(pluginId: string): PluginNamespaces;
|
|
33
|
-
static cameraNamespaces(cameraId: string): CameraNamespaces;
|
|
34
|
-
static pluginCameraNamespaces(pluginId: string, cameraId: string): PluginCameraNamespaces;
|
|
35
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type { AuthConfig } from '@camera.ui/rpc-common';
|
|
2
|
-
import type { Camera, CameraDevice, CameraExtension, StateValues } from '@camera.ui/types';
|
|
3
|
-
import type { PluginCapabilities } from '../camera/types.js';
|
|
4
|
-
export interface ProxyAuth {
|
|
5
|
-
cluster: AuthConfig;
|
|
6
|
-
server: AuthConfig;
|
|
7
|
-
}
|
|
8
|
-
export interface NatsAuthConfig {
|
|
9
|
-
timeout: number;
|
|
10
|
-
user: string;
|
|
11
|
-
password: string;
|
|
12
|
-
}
|
|
13
|
-
export interface NatsTLSConfig {
|
|
14
|
-
cert_file: string;
|
|
15
|
-
key_file: string;
|
|
16
|
-
ca_file: string;
|
|
17
|
-
timeout: number;
|
|
18
|
-
verify?: boolean;
|
|
19
|
-
insecure?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface NatsWsAuthConfig {
|
|
22
|
-
timeout: number;
|
|
23
|
-
username: string;
|
|
24
|
-
password: string;
|
|
25
|
-
}
|
|
26
|
-
export interface NatsWsTLSConfig {
|
|
27
|
-
cert_file: string;
|
|
28
|
-
key_file: string;
|
|
29
|
-
}
|
|
30
|
-
export interface NatsClusterConfig {
|
|
31
|
-
host: string;
|
|
32
|
-
port: number;
|
|
33
|
-
name: string;
|
|
34
|
-
routes: string[];
|
|
35
|
-
tls: NatsTLSConfig;
|
|
36
|
-
authorization: NatsAuthConfig;
|
|
37
|
-
}
|
|
38
|
-
export interface NatsWebsocketConfig {
|
|
39
|
-
host: string;
|
|
40
|
-
port: number;
|
|
41
|
-
authorization: NatsWsAuthConfig;
|
|
42
|
-
tls: NatsWsTLSConfig;
|
|
43
|
-
}
|
|
44
|
-
export interface NatsConfig {
|
|
45
|
-
host: string;
|
|
46
|
-
port: number;
|
|
47
|
-
http?: number;
|
|
48
|
-
server_name: string;
|
|
49
|
-
cluster: NatsClusterConfig;
|
|
50
|
-
authorization: NatsAuthConfig;
|
|
51
|
-
tls: NatsTLSConfig;
|
|
52
|
-
websocket?: NatsWebsocketConfig;
|
|
53
|
-
max_pending?: number;
|
|
54
|
-
max_payload?: number;
|
|
55
|
-
max_control_line?: number;
|
|
56
|
-
disable_sublist_cache?: boolean;
|
|
57
|
-
no_fast_producer_stall?: boolean;
|
|
58
|
-
write_deadline?: string;
|
|
59
|
-
}
|
|
60
|
-
export interface DeviceManagerListenerMessagePayload {
|
|
61
|
-
type: keyof DeviceManagerProxyEventCallbacks;
|
|
62
|
-
data: DeviceManagerProxyEvents[keyof DeviceManagerProxyEvents];
|
|
63
|
-
}
|
|
64
|
-
export interface DeviceManagerProxyEvents {
|
|
65
|
-
cameraSelected: {
|
|
66
|
-
camera: Camera;
|
|
67
|
-
extension: CameraExtension;
|
|
68
|
-
};
|
|
69
|
-
cameraDeselected: {
|
|
70
|
-
camera: Camera;
|
|
71
|
-
extension: CameraExtension;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export interface DeviceManagerProxyEventCallbacks {
|
|
75
|
-
cameraSelected: (camera: CameraDevice, extension: CameraExtension) => void;
|
|
76
|
-
cameraDeselected: (cameraId: string, extension: CameraExtension) => void;
|
|
77
|
-
}
|
|
78
|
-
export interface DeviceManagerProxyGenericEvent<K extends keyof DeviceManagerProxyEvents> {
|
|
79
|
-
type: K;
|
|
80
|
-
data: DeviceManagerProxyEvents[K];
|
|
81
|
-
}
|
|
82
|
-
export interface CoreManagerListenerMessagePayload {
|
|
83
|
-
type: keyof CoreManagerProxyEventCallbacks;
|
|
84
|
-
data: CoreManagerProxyEvents[keyof CoreManagerProxyEvents];
|
|
85
|
-
}
|
|
86
|
-
export interface CoreManagerProxyEvents {
|
|
87
|
-
}
|
|
88
|
-
export interface CoreManagerProxyEventCallbacks {
|
|
89
|
-
}
|
|
90
|
-
export interface CoreManagerProxyGenericEvent<K extends keyof CoreManagerProxyEvents> {
|
|
91
|
-
type: K;
|
|
92
|
-
data: CoreManagerProxyEvents[K];
|
|
93
|
-
}
|
|
94
|
-
export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
95
|
-
stateName: K;
|
|
96
|
-
data: {
|
|
97
|
-
newEvent: StateValues[K];
|
|
98
|
-
oldEvent: StateValues[K];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export interface CameraDeviceListenerMessagePayload {
|
|
102
|
-
type: 'removed' | 'updated' | 'cameraState' | 'frameWorkerState' | 'capabilities';
|
|
103
|
-
data?: any;
|
|
104
|
-
}
|
|
105
|
-
export interface RefreshedStates {
|
|
106
|
-
camera: Camera;
|
|
107
|
-
states: StateValues;
|
|
108
|
-
cameraState: boolean;
|
|
109
|
-
frameWorkerState: boolean;
|
|
110
|
-
capabilities: PluginCapabilities[];
|
|
111
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { API, Ffmpeg, IConfigSSL, Log, Logger, PluginsSettings, RTMP, RTSP, SRTP, Webrtc } from './types.js';
|
|
2
|
-
export declare const DEFAULT_CONFIG_PORT = 3443;
|
|
3
|
-
export declare const DEFAULT_CONFIG_SSL: IConfigSSL;
|
|
4
|
-
export declare const DEFAULT_CONFIG_LOGGER: Logger;
|
|
5
|
-
export declare const DEFAULT_CONFIG_PLUGINS: PluginsSettings;
|
|
6
|
-
export declare const DEFAULT_GO2RTC_CONFIG_LOGGER: Partial<Log>;
|
|
7
|
-
export declare const DEFAULT_GO2RTC_CONFIG_API: API;
|
|
8
|
-
export declare const DEFAULT_GO2RTC_CONFIG_RTSP: RTSP;
|
|
9
|
-
export declare const DEFAULT_GO2RTC_CONFIG_SRTP: SRTP;
|
|
10
|
-
export declare const DEFAULT_GO2RTC_CONFIG_RTMP: RTMP;
|
|
11
|
-
export declare const DEFAULT_GO2RTC_CONFIG_WEBRTC: Webrtc;
|
|
12
|
-
export declare const DEFAULT_GO2RTC_CONFIG_FFMPEG: Ffmpeg;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import type { IceServer } from '@camera.ui/types';
|
|
2
|
-
export interface EnvironmentInfo {
|
|
3
|
-
development: boolean;
|
|
4
|
-
docker: boolean;
|
|
5
|
-
electron: boolean;
|
|
6
|
-
homeassistant: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface Secrets {
|
|
9
|
-
jwtAccessKey: string;
|
|
10
|
-
jwtRefreshKey: string;
|
|
11
|
-
}
|
|
12
|
-
export interface RuntimeInfo {
|
|
13
|
-
name: string;
|
|
14
|
-
status: RUNTIME_STATUS;
|
|
15
|
-
}
|
|
16
|
-
export declare const enum RUNTIME_STATUS {
|
|
17
|
-
READY = "ready",
|
|
18
|
-
RESTARTING = "restarting",
|
|
19
|
-
STARTING = "starting",
|
|
20
|
-
STARTED = "started",
|
|
21
|
-
STOPPED = "stopped",
|
|
22
|
-
ERROR = "error",
|
|
23
|
-
UNKNOWN = "unknown"
|
|
24
|
-
}
|
|
25
|
-
export interface PluginsSettings {
|
|
26
|
-
disabledPlugins: string[];
|
|
27
|
-
}
|
|
28
|
-
export interface IConfig {
|
|
29
|
-
port: number;
|
|
30
|
-
ssl: IConfigSSL;
|
|
31
|
-
logger: Logger;
|
|
32
|
-
plugins: PluginsSettings;
|
|
33
|
-
}
|
|
34
|
-
export type LoggingLevel = 'info' | 'debug' | 'warn' | 'error' | 'trace';
|
|
35
|
-
export interface Logger {
|
|
36
|
-
level: LoggingLevel;
|
|
37
|
-
disableTimestamps?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface Mqtt {
|
|
40
|
-
enabled?: boolean;
|
|
41
|
-
host?: string;
|
|
42
|
-
port?: number;
|
|
43
|
-
topicPrefix?: string;
|
|
44
|
-
clientId?: string;
|
|
45
|
-
user?: string;
|
|
46
|
-
password?: string;
|
|
47
|
-
tls?: MqttTLS;
|
|
48
|
-
}
|
|
49
|
-
export interface MqttTLS {
|
|
50
|
-
enabled?: boolean;
|
|
51
|
-
cert?: string;
|
|
52
|
-
key?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface IConfigSSL {
|
|
55
|
-
certFile: string;
|
|
56
|
-
keyFile: string;
|
|
57
|
-
caFile: string;
|
|
58
|
-
addresses?: string[];
|
|
59
|
-
}
|
|
60
|
-
export interface Go2RtcConfig {
|
|
61
|
-
log: Partial<Log>;
|
|
62
|
-
api: API;
|
|
63
|
-
rtsp: RTSP;
|
|
64
|
-
srtp: SRTP;
|
|
65
|
-
rtmp: RTMP;
|
|
66
|
-
webrtc: Webrtc;
|
|
67
|
-
ffmpeg: Ffmpeg;
|
|
68
|
-
streams?: Partial<Streams>;
|
|
69
|
-
homekit?: Partial<HomeKit>;
|
|
70
|
-
hass?: Partial<Hass>;
|
|
71
|
-
webtorrent?: Partial<Webtorrent>;
|
|
72
|
-
ngrok?: Partial<Ngrok>;
|
|
73
|
-
}
|
|
74
|
-
export type LogLevel = 'info' | 'debug' | 'trace' | 'warn' | 'error' | 'fatal';
|
|
75
|
-
export interface Log {
|
|
76
|
-
format: string;
|
|
77
|
-
level: LogLevel;
|
|
78
|
-
api: LogLevel;
|
|
79
|
-
exec: LogLevel;
|
|
80
|
-
ngrok: LogLevel;
|
|
81
|
-
rtsp: LogLevel;
|
|
82
|
-
rtmp: LogLevel;
|
|
83
|
-
homekit: LogLevel;
|
|
84
|
-
webtorrent: LogLevel;
|
|
85
|
-
hass: LogLevel;
|
|
86
|
-
mp4: LogLevel;
|
|
87
|
-
hls: LogLevel;
|
|
88
|
-
mjpeg: LogLevel;
|
|
89
|
-
streams: LogLevel;
|
|
90
|
-
webrtc: LogLevel;
|
|
91
|
-
}
|
|
92
|
-
export interface API {
|
|
93
|
-
origin: string;
|
|
94
|
-
listen: string;
|
|
95
|
-
username?: string;
|
|
96
|
-
password?: string;
|
|
97
|
-
tls_listen: string;
|
|
98
|
-
tls_cert: string;
|
|
99
|
-
tls_key: string;
|
|
100
|
-
tls_ca: string;
|
|
101
|
-
}
|
|
102
|
-
export type Streams = Record<string, string | string[]>;
|
|
103
|
-
export interface SRTP {
|
|
104
|
-
listen: string;
|
|
105
|
-
}
|
|
106
|
-
export interface RTMP {
|
|
107
|
-
listen: string;
|
|
108
|
-
}
|
|
109
|
-
export interface RTSP {
|
|
110
|
-
listen: string;
|
|
111
|
-
username?: string;
|
|
112
|
-
password?: string;
|
|
113
|
-
default_query: string;
|
|
114
|
-
}
|
|
115
|
-
export interface Webrtc {
|
|
116
|
-
listen: string;
|
|
117
|
-
candidates?: string[];
|
|
118
|
-
ice_servers?: IceServer[];
|
|
119
|
-
filters?: WebrtcFilter;
|
|
120
|
-
}
|
|
121
|
-
export interface WebrtcFilter {
|
|
122
|
-
candidates?: string[];
|
|
123
|
-
networks?: string[];
|
|
124
|
-
interfaces?: string[];
|
|
125
|
-
ips?: string[];
|
|
126
|
-
udp_ports?: string[];
|
|
127
|
-
}
|
|
128
|
-
export interface Ffmpeg {
|
|
129
|
-
bin: string;
|
|
130
|
-
global: string;
|
|
131
|
-
file: string;
|
|
132
|
-
http: string;
|
|
133
|
-
rtsp: string;
|
|
134
|
-
output: string;
|
|
135
|
-
[key: string]: string;
|
|
136
|
-
}
|
|
137
|
-
export type HomeKit = Record<string, Partial<HomeKitSettings> | null | undefined>;
|
|
138
|
-
export interface Hass {
|
|
139
|
-
config: string;
|
|
140
|
-
}
|
|
141
|
-
export interface HomeKitSettings {
|
|
142
|
-
pin: number;
|
|
143
|
-
name: string;
|
|
144
|
-
device_id: string;
|
|
145
|
-
device_private: string;
|
|
146
|
-
}
|
|
147
|
-
export interface Webtorrent {
|
|
148
|
-
shares: Shares;
|
|
149
|
-
}
|
|
150
|
-
export type Shares = Record<string, Partial<ShareSettings>>;
|
|
151
|
-
export interface ShareSettings {
|
|
152
|
-
pwd: string;
|
|
153
|
-
src: string;
|
|
154
|
-
}
|
|
155
|
-
export interface Ngrok {
|
|
156
|
-
command: string;
|
|
157
|
-
}
|
|
158
|
-
export interface SSLConfig {
|
|
159
|
-
cert: Buffer;
|
|
160
|
-
key: Buffer;
|
|
161
|
-
ca: Buffer;
|
|
162
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type MethodKeys<T> = keyof {
|
|
2
|
-
[K in keyof T as T[K] extends (...args: any) => any ? K : never]: any;
|
|
3
|
-
};
|
|
4
|
-
export type MethodType<T, K extends keyof T> = T[K] extends (...args: any) => any ? T[K] : never;
|
|
5
|
-
export type DeepPartial<T> = T extends object ? {
|
|
6
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
7
|
-
} : T;
|
|
8
|
-
export type FunctionPropertyNames<T> = {
|
|
9
|
-
[K in keyof T]: T[K] extends Function ? K : never;
|
|
10
|
-
}[keyof T];
|
|
11
|
-
export interface UpdateStartedMessage {
|
|
12
|
-
type: 'UPDATE_STARTED';
|
|
13
|
-
version: string;
|
|
14
|
-
}
|
|
15
|
-
export interface UpdateOutputMessage {
|
|
16
|
-
type: 'UPDATE_OUTPUT';
|
|
17
|
-
data: string;
|
|
18
|
-
}
|
|
19
|
-
export interface UpdateErrorMessage {
|
|
20
|
-
type: 'UPDATE_ERROR';
|
|
21
|
-
data: string;
|
|
22
|
-
}
|
|
23
|
-
export interface UpdateCompleteMessage {
|
|
24
|
-
type: 'UPDATE_COMPLETE';
|
|
25
|
-
version: string;
|
|
26
|
-
}
|
|
27
|
-
export interface UpdateFailedMessage {
|
|
28
|
-
type: 'UPDATE_FAILED';
|
|
29
|
-
error: string;
|
|
30
|
-
}
|
|
31
|
-
export interface RestartRequiredMessage {
|
|
32
|
-
type: 'RESTART_REQUIRED';
|
|
33
|
-
}
|
|
34
|
-
export type CLIMessage = UpdateStartedMessage | UpdateOutputMessage | UpdateErrorMessage | UpdateCompleteMessage | UpdateFailedMessage | RestartRequiredMessage;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { Subscribed as SubscribedImp, SubscribedPublic } from '../../packages/common/src/utils/subscribed.js';
|
|
2
|
-
export type * from '../../packages/types/src/index.js';
|
|
3
|
-
export type * from '../../server/src/api/database/types.js';
|
|
4
|
-
export type * from '../../server/src/api/go2rtc/types.js';
|
|
5
|
-
export * from '../../server/src/api/schemas/cameras.schema.js';
|
|
6
|
-
export * from '../../server/src/api/schemas/plugins.schema.js';
|
|
7
|
-
export * from '../../server/src/api/schemas/storage.schema.js';
|
|
8
|
-
export * from '../../server/src/api/schemas/system.schema.js';
|
|
9
|
-
export * from '../../server/src/api/schemas/users.schema.js';
|
|
10
|
-
export type * from '../../server/src/api/types/index.js';
|
|
11
|
-
export type * from '../../server/src/api/websocket/types.js';
|
|
12
|
-
export * from '../../server/src/camera/classes.js';
|
|
13
|
-
export * from '../../server/src/camera/polygon.js';
|
|
14
|
-
export * from '../../server/src/camera/types.js';
|
|
15
|
-
export * from '../../server/src/go2rtc/types.js';
|
|
16
|
-
export type * from '../../server/src/manager/types.js';
|
|
17
|
-
export * from '../../server/src/plugins/schema.js';
|
|
18
|
-
export * from '../../server/src/plugins/types.js';
|
|
19
|
-
export * from '../../server/src/rpc/namespaces.js';
|
|
20
|
-
export type * from '../../server/src/rpc/types.js';
|
|
21
|
-
export * from '../../server/src/services/config/types.js';
|
|
22
|
-
export type * from '../../server/src/types.js';
|