@camera.ui/browser 0.0.91 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +6 -6
- package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +2 -1
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +1 -2
- package/dist/types/packages/client/browser/src/types.d.ts +11 -3
- package/dist/types/packages/common/src/messaging/index.d.ts +48 -0
- package/dist/types/packages/common/src/nats/index.d.ts +30 -0
- package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/index.d.ts +4 -5
- package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/camera.d.ts +8 -0
- package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/interfaces/prebuffer.d.ts +3 -5
- package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/interfaces/ptz.d.ts +3 -5
- package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/iou.d.ts +1 -1
- package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/polygon.d.ts +1 -2
- package/dist/types/{server → packages/plugineer}/src/polyglot/node/plugins/schema.d.ts +1 -1
- package/dist/types/server/src/api/database/constants.d.ts +8 -0
- package/dist/types/server/src/api/database/index.d.ts +0 -8
- package/dist/types/server/src/api/database/types.d.ts +6 -6
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +117 -117
- package/dist/types/server/src/api/schemas/config.schema.d.ts +6 -6
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +84 -84
- package/dist/types/server/src/api/schemas/users.schema.d.ts +150 -150
- package/dist/types/server/src/api/types/index.d.ts +1 -1
- package/dist/types/server/src/api.d.ts +1 -7
- package/dist/types/server/src/camera/controller.d.ts +4 -5
- package/dist/types/server/src/camera/types.d.ts +24 -11
- package/dist/types/server/src/decoder/worker.d.ts +1 -1
- package/dist/types/server/src/nats/index.d.ts +3 -4
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +2 -2
- package/dist/types/server/src/nats/proxy/coreManager.d.ts +3 -3
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +5 -5
- package/dist/types/server/src/nats/types.d.ts +5 -34
- package/dist/types/server/src/plugins/interfaces/base.d.ts +1 -1
- package/dist/types/server/src/plugins/plugin.d.ts +1 -1
- package/dist/types/server/src/plugins/types.d.ts +36 -3
- package/dist/types/server/src/services/config/index.d.ts +2 -0
- package/dist/types/server/src/services/logger/index.d.ts +4 -16
- package/dist/types/shared/types/index.d.ts +5 -3
- package/package.json +1 -1
- package/dist/types/server/src/camera/device.d.ts +0 -29
- package/dist/types/server/src/camera/interfaces/camera.d.ts +0 -10
- package/dist/types/server/src/camera/streaming/peer-connection.d.ts +0 -55
- package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +0 -35
- package/dist/types/server/src/camera/streaming/werift-session.d.ts +0 -41
- package/dist/types/server/src/camera/videoFrame.d.ts +0 -24
- package/dist/types/server/src/nats/connection.d.ts +0 -17
- package/dist/types/server/src/nats/constants.d.ts +0 -1
- package/dist/types/server/src/nats/error.d.ts +0 -9
- package/dist/types/server/src/nats/messageQueue.d.ts +0 -20
- package/dist/types/server/src/nats/subscription.d.ts +0 -12
- package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +0 -107
- package/dist/types/server/src/polyglot/node/plugins/configService.d.ts +0 -104
- package/dist/types/server/src/polyglot/node/plugins/pluginApi.d.ts +0 -35
- package/dist/types/server/src/polyglot/node/plugins/pluginLogger.d.ts +0 -18
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +0 -69
- package/dist/types/server/src/polyglot/node/plugins/proxy/coreManager.d.ts +0 -40
- package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +0 -47
- package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +0 -30
- package/dist/types/server/src/utils/ffmpeg.d.ts +0 -2
- package/dist/types/server/src/utils/network.d.ts +0 -12
- package/dist/types/server/src/utils/npm.d.ts +0 -4
- package/dist/types/server/src/utils/pythonInstaller.d.ts +0 -48
- package/dist/types/server/src/utils/utils.d.ts +0 -10
- /package/dist/types/{server/src/utils/packer.d.ts → packages/common/src/packer/index.d.ts} +0 -0
- /package/dist/types/{server → packages/common}/src/utils/subscribed.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { BaseLogger } from '../../../../../shared/types/index.js';
|
|
2
1
|
import type { SocketService } from '../socket.js';
|
|
3
|
-
import type { CameraDevice } from '../types.js';
|
|
2
|
+
import type { BaseLogger, CameraDevice } from '../types.js';
|
|
4
3
|
interface DeviceManagerBrowserProxyMethods {
|
|
5
4
|
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
6
5
|
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Observable, Subject } from 'rxjs';
|
|
2
|
-
import type { BaseCameraDevice } from '../../../../
|
|
3
|
-
import type {
|
|
2
|
+
import type { BaseCameraDevice } from '../../../../packages/plugineer/src/polyglot/node/camera/index.js';
|
|
3
|
+
import type { VideoStreamingMode } from '../../../../shared/types/index.js';
|
|
4
4
|
import type { Go2RTCSession } from './streaming/go2rts-session.js';
|
|
5
|
-
export type { AudioSetEvent, AudioState,
|
|
5
|
+
export type { AudioSetEvent, AudioState, BatterySetEvent, BatteryState, CameraActivitySettings, CameraSource, CameraZone, Container, Detection, DetectionZone, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, Point, PrebufferState, SirenSetEvent, SirenState, ZoneFilter, ZoneType, } from '../../../../shared/types/index.js';
|
|
6
6
|
export type { Go2RTCSession } from './streaming/go2rts-session.js';
|
|
7
7
|
export type CameraUiClientConfig = WithCredentials | WithToken;
|
|
8
8
|
export interface BasicBrowserPeerConnection {
|
|
@@ -31,6 +31,14 @@ export interface Go2RTCSessionOptions {
|
|
|
31
31
|
videoElement: HTMLVideoElement;
|
|
32
32
|
reconnectInterval?: number;
|
|
33
33
|
}
|
|
34
|
+
export interface BaseLogger {
|
|
35
|
+
log: (...args: any[]) => void;
|
|
36
|
+
error: (...args: any[]) => void;
|
|
37
|
+
warn: (...args: any[]) => void;
|
|
38
|
+
debug: (...args: any[]) => void;
|
|
39
|
+
trace: (...args: any[]) => void;
|
|
40
|
+
attention: (...args: any[]) => void;
|
|
41
|
+
}
|
|
34
42
|
interface BaseConfig {
|
|
35
43
|
endpoint: string;
|
|
36
44
|
skipCheck?: boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CameraDelegates, PluginLogger } from '@camera.ui/types';
|
|
2
|
+
import type { ProxyConnection, ProxySubscription } from '../nats/index.js';
|
|
3
|
+
export declare const NATS_SERVER_SUBJECT = "camera.ui-server";
|
|
4
|
+
export interface DeserializedError {
|
|
5
|
+
name: string;
|
|
6
|
+
message: string;
|
|
7
|
+
stack: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class RemoteError extends Error {
|
|
10
|
+
constructor(error: DeserializedError, cause: Omit<ProxyMessageStructure, 'error'>);
|
|
11
|
+
}
|
|
12
|
+
export interface QueueItem {
|
|
13
|
+
message: ProxyMessageStructure;
|
|
14
|
+
resolve: (response: any) => void;
|
|
15
|
+
reject: (error: RemoteError) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ProxyMessageStructure {
|
|
18
|
+
requestId: string;
|
|
19
|
+
cameraId?: string;
|
|
20
|
+
targetId: string;
|
|
21
|
+
targetName?: string;
|
|
22
|
+
pluginId: string;
|
|
23
|
+
type: 'request' | 'reply';
|
|
24
|
+
proxy: 'device' | 'camera' | 'plugin' | 'core';
|
|
25
|
+
client: 'cameraFn' | 'pluginFn' | 'deviceFn' | 'storageFn' | 'coreFn' | keyof CameraDelegates;
|
|
26
|
+
fn: string;
|
|
27
|
+
args: any[];
|
|
28
|
+
timeout: number;
|
|
29
|
+
timestamp: number;
|
|
30
|
+
response?: any;
|
|
31
|
+
error?: DeserializedError;
|
|
32
|
+
}
|
|
33
|
+
export declare class MessageQueue {
|
|
34
|
+
private logger;
|
|
35
|
+
private type;
|
|
36
|
+
private publisher;
|
|
37
|
+
private subscriber;
|
|
38
|
+
private requestHandler;
|
|
39
|
+
private aborted;
|
|
40
|
+
private isProcessing;
|
|
41
|
+
private queue;
|
|
42
|
+
private pendingResponses;
|
|
43
|
+
constructor(type: 'server' | 'client', publisher: ProxyConnection, subscriber: ProxySubscription, logger: PluginLogger, requestHandler: (message: ProxyMessageStructure) => void);
|
|
44
|
+
abortQueue(): void;
|
|
45
|
+
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
46
|
+
private processQueue;
|
|
47
|
+
private onMessage;
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import type { Msg, NatsConnection, Subscription as NatsSubscription, RequestOptions } from 'nats';
|
|
3
|
+
export interface AuthConfig {
|
|
4
|
+
user: string;
|
|
5
|
+
password: string;
|
|
6
|
+
}
|
|
7
|
+
export declare interface ProxySubscription {
|
|
8
|
+
on(event: 'message', listener: (message: Msg) => void): this;
|
|
9
|
+
emit(event: 'message', message: Msg): boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProxySubscription extends EventEmitter implements ProxySubscription {
|
|
12
|
+
readonly subscriber: NatsSubscription;
|
|
13
|
+
constructor(subscriber: NatsSubscription);
|
|
14
|
+
listen(): Promise<void>;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class ProxyConnection {
|
|
18
|
+
private name;
|
|
19
|
+
private servers;
|
|
20
|
+
private auth;
|
|
21
|
+
private publisher?;
|
|
22
|
+
private subscribers;
|
|
23
|
+
private closed;
|
|
24
|
+
constructor(name: string, servers: string[], auth: AuthConfig);
|
|
25
|
+
connect(): Promise<NatsConnection>;
|
|
26
|
+
subscribe(subject: string, skipListening?: boolean): ProxySubscription;
|
|
27
|
+
publish(subject: string, message: any): void;
|
|
28
|
+
request(subject: string, message: any, opts?: RequestOptions): Promise<any>;
|
|
29
|
+
close(): Promise<void>;
|
|
30
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { Subscribed } from '@camera.ui/common/utils';
|
|
1
2
|
import { LRUCache } from 'lru-cache';
|
|
2
3
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import {
|
|
4
|
+
import type { AudioSetEvent, AudioState, BatterySetEvent, BatteryState, Camera, CameraActivitySettings, CameraDelegate, CameraFrameWorkerSettings, CameraInformation, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, CameraType, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, PluginLogger as Logger, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, SirenSetEvent, SirenState, StateValues } from '@camera.ui/types';
|
|
4
5
|
import type { Observable } from 'rxjs';
|
|
5
|
-
import type { Camera, CameraActivitySettings, CameraFrameWorkerSettings, CameraInformation, CameraType } from '../api/database/types.js';
|
|
6
|
-
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraDelegate, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, SirenSetEvent, SirenState, StateValues } from './types.js';
|
|
7
6
|
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
8
|
-
protected logger:
|
|
7
|
+
protected logger: Logger;
|
|
9
8
|
protected snapshotCache: LRUCache<string, ArrayBuffer, unknown>;
|
|
10
9
|
protected cameraSubject: BehaviorSubject<Camera>;
|
|
11
10
|
protected cameraState: BehaviorSubject<boolean>;
|
|
@@ -56,7 +55,7 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
56
55
|
get lowResolutionSource(): CameraSource | undefined;
|
|
57
56
|
get ptz(): CameraPTZDelegate;
|
|
58
57
|
abstract get sources(): CameraSource[];
|
|
59
|
-
constructor(camera: Camera, logger:
|
|
58
|
+
constructor(camera: Camera, logger: Logger);
|
|
60
59
|
protected abstract cleanup(): void;
|
|
61
60
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
62
61
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CameraDelegate } from '@camera.ui/types';
|
|
2
|
+
export declare class CameraInterface implements CameraDelegate {
|
|
3
|
+
delegate?: CameraDelegate;
|
|
4
|
+
private onRequest;
|
|
5
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>);
|
|
6
|
+
snapshot(): Promise<ArrayBuffer | undefined>;
|
|
7
|
+
private _onRequest;
|
|
8
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { CameraPrebufferDelegate } from '
|
|
2
|
-
|
|
3
|
-
export declare class CameraPrebufferInterface extends CameraPrebufferDelegate {
|
|
1
|
+
import type { CameraPrebufferDelegate, Container, PrebufferState, StreamInfo } from '@camera.ui/types';
|
|
2
|
+
export declare class CameraPrebufferInterface implements CameraPrebufferDelegate {
|
|
4
3
|
delegate?: CameraPrebufferDelegate;
|
|
5
4
|
private onRequest;
|
|
6
|
-
|
|
7
|
-
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
5
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>);
|
|
8
6
|
getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
9
7
|
getPrebufferingState(sourceName: string, container: Container): Promise<PrebufferState | undefined>;
|
|
10
8
|
private _onRequest;
|
package/dist/types/{server/src → packages/plugineer/src/polyglot/node}/camera/interfaces/ptz.d.ts
RENAMED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { CameraPTZDelegate } from '
|
|
2
|
-
|
|
3
|
-
export declare class CameraPTZInterface extends CameraPTZDelegate {
|
|
1
|
+
import type { CameraPTZDelegate } from '@camera.ui/types';
|
|
2
|
+
export declare class CameraPTZInterface implements CameraPTZDelegate {
|
|
4
3
|
delegate?: CameraPTZDelegate;
|
|
5
4
|
private onRequest;
|
|
6
|
-
|
|
7
|
-
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
5
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>);
|
|
8
6
|
moveAbsolute(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
9
7
|
moveRelative(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
10
8
|
moveContinuous(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Detection } from '
|
|
1
|
+
import type { Detection } from '@camera.ui/types';
|
|
2
2
|
export declare const mergeDetections: (detections: Detection[], iouThreshold?: number) => Detection[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { CameraActivitySettings } from '
|
|
2
|
-
import type { Detection, DetectionZone } from './types.js';
|
|
1
|
+
import type { CameraActivitySettings, Detection, DetectionZone } from '@camera.ui/types';
|
|
3
2
|
export declare const convertZonePointsToPixels: (zone: DetectionZone, detection: Detection) => DetectionZone;
|
|
4
3
|
export declare const convertBoundingBoxToPixels: (detection: Detection) => Detection;
|
|
5
4
|
export declare const areObjectDetectionsValid: (detections: Detection[], zones: DetectionZone[], activitySettings: CameraActivitySettings) => Detection[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { JsonSchema, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaForm, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectButton, JsonSchemaObjectWithButtons, JsonSchemaString, RootSchema } from '@camera.ui/types';
|
|
2
3
|
import type { ZodTypeAny } from 'zod';
|
|
3
|
-
import type { JsonSchema, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaForm, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectButton, JsonSchemaObjectWithButtons, JsonSchemaString, RootSchema } from '../../../plugins/types.js';
|
|
4
4
|
type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
}, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CAMERAS_ID = "cameras";
|
|
2
|
+
export declare const DATABASE_ID = "database";
|
|
3
|
+
export declare const PLUGINS_ID = "plugins";
|
|
4
|
+
export declare const USER_PLUGINS_ID = "user-plugins";
|
|
5
|
+
export declare const SETTINGS_ID = "settings";
|
|
6
|
+
export declare const USERS_ID = "users";
|
|
7
|
+
export declare const SYSTEM_ID = "system";
|
|
8
|
+
export declare const TOKENS_ID = "tokens";
|
|
@@ -3,14 +3,6 @@ import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
|
3
3
|
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
|
|
4
4
|
export declare class Database {
|
|
5
5
|
static readonly VERSION = "1.0.0";
|
|
6
|
-
static readonly CAMERAS_ID = "cameras";
|
|
7
|
-
static readonly DATABASE_ID = "database";
|
|
8
|
-
static readonly PLUGINS_ID = "plugins";
|
|
9
|
-
static readonly USER_PLUGINS_ID = "user-plugins";
|
|
10
|
-
static readonly SETTINGS_ID = "settings";
|
|
11
|
-
static readonly USERS_ID = "users";
|
|
12
|
-
static readonly SYSTEM_ID = "system";
|
|
13
|
-
static readonly TOKENS_ID = "tokens";
|
|
14
6
|
authDB: RootDB<DBAuth, 'auth'>;
|
|
15
7
|
camerasDB: DB<DBCamera[], 'cameras'>;
|
|
16
8
|
pluginsDB: DB<DBPlugin[], 'plugins'>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { UsableNetworkAddress } from '@camera.ui/common/network';
|
|
1
2
|
import type { Database as DB } from 'lmdb';
|
|
2
3
|
import type { DetectionZone, ObjectClass } from '../../camera/types.js';
|
|
3
|
-
import type { UsableNetworkAddress } from '../../utils/network.js';
|
|
4
4
|
import type { CamviewSettingsLayoutMode, ClientData, JwtTokenEncoded } from '../types/index.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { CAMERAS_ID, PLUGINS_ID, SETTINGS_ID, USERS_ID } from './constants.js';
|
|
6
6
|
export interface CameraUiDatabase {
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
7
|
+
[CAMERAS_ID]: DB<DBCamera[], 'cameras'>;
|
|
8
|
+
[PLUGINS_ID]: DB<DBPlugin[], 'plugins'>;
|
|
9
|
+
[SETTINGS_ID]: DB<DBSettings, 'settings'>;
|
|
10
|
+
[USERS_ID]: DB<DBUser[], 'users'>;
|
|
11
11
|
}
|
|
12
12
|
export interface DBAuth {
|
|
13
13
|
tokens: JwtTokenEncoded[];
|