@camera.ui/browser 0.0.77 → 0.0.80
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 +21 -7
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +4 -0
- package/dist/types/packages/client/browser/src/socket.d.ts +7 -7
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +54 -0
- package/dist/types/packages/client/browser/src/types.d.ts +11 -8
- package/dist/types/packages/client/browser/src/utils.d.ts +12 -0
- package/dist/types/server/src/api/controllers/users.controller.d.ts +9 -3
- package/dist/types/server/src/api/database/index.d.ts +10 -3
- package/dist/types/server/src/api/database/types.d.ts +35 -29
- package/dist/types/server/src/api/go2rtc/api/config.d.ts +3 -4
- package/dist/types/server/src/api/go2rtc/api/index.d.ts +1 -2
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +5 -6
- package/dist/types/server/src/api/go2rtc/types.d.ts +5 -2
- package/dist/types/server/src/api/index.d.ts +7 -9
- package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +1 -1
- package/dist/types/server/src/api/plugins/logger.plugin.d.ts +7 -0
- package/dist/types/server/src/api/routes/index.d.ts +1 -2
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +53 -155
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +201 -142
- package/dist/types/server/src/api/schemas/config.schema.d.ts +20 -20
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +60 -60
- package/dist/types/server/src/api/schemas/users.schema.d.ts +242 -136
- package/dist/types/server/src/api/services/cameras.service.d.ts +9 -7
- package/dist/types/server/src/api/services/plugins.service.d.ts +1 -0
- package/dist/types/server/src/api/services/users.service.d.ts +6 -2
- package/dist/types/server/src/api/types/index.d.ts +34 -8
- package/dist/types/server/src/api/utils/fetch.d.ts +2 -0
- package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
- package/dist/types/server/src/api/websocket/types.d.ts +1 -15
- package/dist/types/server/src/api.d.ts +1 -2
- package/dist/types/server/src/camera/controller.d.ts +23 -12
- package/dist/types/server/src/camera/device.d.ts +7 -16
- package/dist/types/server/src/camera/index.d.ts +31 -22
- package/dist/types/server/src/camera/interfaces/audioDetection.d.ts +10 -0
- package/dist/types/server/src/camera/interfaces/camera.d.ts +19 -0
- package/dist/types/server/src/camera/interfaces/motionDetection.d.ts +10 -0
- package/dist/types/server/src/camera/interfaces/objectDetection.d.ts +10 -0
- package/dist/types/server/src/camera/interfaces/prebuffer.d.ts +11 -0
- package/dist/types/server/src/camera/interfaces/ptz.d.ts +13 -0
- package/dist/types/server/src/camera/polygon.d.ts +3 -2
- package/dist/types/server/src/camera/streaming/peer-connection.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +2 -1
- package/dist/types/server/src/camera/streaming/{streaming-session.d.ts → werift-session.d.ts} +1 -1
- package/dist/types/server/src/camera/types.d.ts +60 -21
- package/dist/types/server/src/camera/videoFrame.d.ts +10 -11
- package/dist/types/server/src/decoder/types.d.ts +31 -22
- package/dist/types/server/src/decoder/worker.d.ts +4 -4
- package/dist/types/server/src/nats/index.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +30 -36
- 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/proxy/systemManager.d.ts +1 -1
- package/dist/types/server/src/nats/server.d.ts +10 -7
- package/dist/types/server/src/nats/types.d.ts +27 -53
- package/dist/types/server/src/nats/websocket.d.ts +9 -5
- package/dist/types/server/src/plugins/base.d.ts +2 -3
- package/dist/types/server/src/plugins/index.d.ts +1 -0
- package/dist/types/server/src/plugins/types.d.ts +22 -5
- package/dist/types/server/src/plugins/worker.d.ts +1 -0
- package/dist/types/server/src/polyglot/node/plugins/api.d.ts +1 -2
- package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +2 -2
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +35 -14
- package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +5 -5
- package/dist/types/server/src/polyglot/node/plugins/proxy/pluginsManager.d.ts +5 -5
- package/dist/types/server/src/polyglot/node/plugins/proxy/systemManager.d.ts +5 -5
- package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +10 -2
- package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +1 -1
- package/dist/types/server/src/services/config/constants.d.ts +0 -2
- package/dist/types/server/src/services/config/index.d.ts +29 -36
- package/dist/types/server/src/services/config/types.d.ts +1 -1
- package/dist/types/server/src/types.d.ts +4 -0
- package/dist/types/server/src/utils/packer.d.ts +2 -0
- package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
- package/dist/types/server/src/utils/utils.d.ts +5 -0
- package/dist/types/shared/types/index.d.ts +5 -0
- package/package.json +10 -14
- package/dist/types/packages/client/browser/src/streaming/peer-connection.d.ts +0 -24
- package/dist/types/packages/client/browser/src/streaming/streaming-session.d.ts +0 -25
- package/dist/types/packages/client/browser/src/streaming/webrtc-connection.d.ts +0 -26
- package/dist/types/server/src/api/utils/axios.d.ts +0 -2
- package/dist/types/server/src/api/websocket/nsp/streams.d.ts +0 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Camera, CameraZone, DBCamera } from '../database/types.js';
|
|
1
|
+
import type { CameraExtension } from '../../plugins/types.js';
|
|
2
|
+
import type { Camera, CameraInputSettings, CameraZone, DBCamera } from '../database/types.js';
|
|
3
3
|
type DeepPartial<T> = T extends object ? {
|
|
4
4
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
5
5
|
} : T;
|
|
@@ -12,11 +12,11 @@ export declare class CamerasService {
|
|
|
12
12
|
private pluginsService;
|
|
13
13
|
constructor();
|
|
14
14
|
createCamera(cameraData: DBCamera): Promise<DBCamera>;
|
|
15
|
-
createTransformedCamera(cameraData: DBCamera): Promise<Camera>;
|
|
15
|
+
createTransformedCamera(cameraData: DBCamera, cameraSources: CameraInputSettings[]): Promise<Camera>;
|
|
16
16
|
createZone(cameraname: string, zoneData: CameraZone): Promise<DBCamera | undefined>;
|
|
17
17
|
patchZoneByName(cameraname: string, zonename: string, zoneData: CameraZone): Promise<DBCamera | undefined>;
|
|
18
18
|
removeZoneByName(cameraname: string, zonename: string): Promise<void>;
|
|
19
|
-
createCameraSource(cameraname: string, sourceName: string,
|
|
19
|
+
createCameraSource(cameraname: string, sourceName: string, source: string): Promise<void>;
|
|
20
20
|
resetCameraSource(cameraname: string, sourceName: string): Promise<void>;
|
|
21
21
|
list(): DBCamera[];
|
|
22
22
|
listTransformed(): Camera[];
|
|
@@ -42,9 +42,11 @@ export declare class CamerasService {
|
|
|
42
42
|
removeByPluginIdAndName(cameraname: string, pluginId: string): Promise<void>;
|
|
43
43
|
removeAll(): Promise<void>;
|
|
44
44
|
transformCamera(camera: DBCamera): Camera;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
createEmptySource(cameraId: string, source: CameraInputSettings): CameraInputSettings;
|
|
46
|
+
addCameraSources(cameraname: string, sources: CameraInputSettings[]): Promise<void>;
|
|
47
|
+
removeCameraSources(cameraname: string, sources: CameraInputSettings[]): Promise<void>;
|
|
48
|
+
private sourceExistAndEqual;
|
|
49
|
+
private sourceResetted;
|
|
48
50
|
private generateWsUrls;
|
|
49
51
|
private generateRTSPUrls;
|
|
50
52
|
private generateFFmpegUrls;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DBUser } from '../database/types.js';
|
|
1
|
+
import type { DBCamviewLayout, DBUser } from '../database/types.js';
|
|
2
2
|
export declare class UsersService {
|
|
3
3
|
private dbs;
|
|
4
4
|
constructor();
|
|
@@ -6,7 +6,11 @@ export declare class UsersService {
|
|
|
6
6
|
findById(id: string): DBUser | undefined;
|
|
7
7
|
findByName(username: string): DBUser | undefined;
|
|
8
8
|
list(): DBUser[];
|
|
9
|
-
patchUser(username: string, userData
|
|
9
|
+
patchUser(username: string, userData?: Partial<DBUser>): Promise<DBUser | undefined>;
|
|
10
10
|
removeByName(username: string): Promise<void>;
|
|
11
11
|
removeAll(): Promise<void>;
|
|
12
|
+
createView(username: string, viewData: DBCamviewLayout): Promise<DBCamviewLayout>;
|
|
13
|
+
patchViewById(username: string, viewId: string, viewData?: Partial<DBCamviewLayout>): Promise<DBCamviewLayout | undefined>;
|
|
14
|
+
removeViewById(username: string, viewId: string): Promise<DBCamviewLayout[] | undefined>;
|
|
15
|
+
removeAllViews(username: string): Promise<DBCamviewLayout[] | undefined>;
|
|
12
16
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Readable } from 'node:stream';
|
|
4
2
|
import type { CameraExtension, PLUGIN_STATUS, PluginContract, PluginRootSchema } from '../../plugins/types.js';
|
|
5
3
|
import type { LoggingLevel } from '../../services/config/types.js';
|
|
@@ -9,7 +7,7 @@ import type { RestoreBackupInput } from '../schemas/backup.schema.js';
|
|
|
9
7
|
import type { CreateCameraInput, PatchCameraInput, PreviewCameraInput } from '../schemas/cameras.schema.js';
|
|
10
8
|
import type { PatchConfigInput } from '../schemas/config.schema.js';
|
|
11
9
|
import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema.js';
|
|
12
|
-
import type { CreateUserInput, LoginUserInput, PatchUserInput } from '../schemas/users.schema.js';
|
|
10
|
+
import type { CreateUserInput, CreateViewInput, LoginUserInput, PatchUserInput, PatchViewInput } from '../schemas/users.schema.js';
|
|
13
11
|
export interface BusboyFileStream extends Readable {
|
|
14
12
|
truncated: boolean;
|
|
15
13
|
bytesRead: number;
|
|
@@ -116,6 +114,10 @@ export interface UsersResponse {
|
|
|
116
114
|
pagination: Pagination;
|
|
117
115
|
result: DBUser[];
|
|
118
116
|
}
|
|
117
|
+
export interface ViewsResponse {
|
|
118
|
+
pagination: Pagination;
|
|
119
|
+
result: DBCamviewLayout[];
|
|
120
|
+
}
|
|
119
121
|
export interface CamerasResponse {
|
|
120
122
|
pagination: Pagination;
|
|
121
123
|
result: DBCamera[];
|
|
@@ -342,6 +344,17 @@ export type UsersPatchRequest = {
|
|
|
342
344
|
avatar: string;
|
|
343
345
|
};
|
|
344
346
|
};
|
|
347
|
+
export type ViewsParamsRequest = {
|
|
348
|
+
Params: {
|
|
349
|
+
viewId: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
export type ViewsInsertRequest = {
|
|
353
|
+
Body: CreateViewInput;
|
|
354
|
+
};
|
|
355
|
+
export type ViewsPatchRequest = {
|
|
356
|
+
Body: PatchViewInput;
|
|
357
|
+
};
|
|
345
358
|
export type BackupCreateRequest = {
|
|
346
359
|
Body: {
|
|
347
360
|
localStorage: Partial<UiLocalStorage>;
|
|
@@ -350,6 +363,7 @@ export type BackupCreateRequest = {
|
|
|
350
363
|
export type StreamsParamsNameRequest = {
|
|
351
364
|
Params: {
|
|
352
365
|
id: string;
|
|
366
|
+
name: string;
|
|
353
367
|
};
|
|
354
368
|
};
|
|
355
369
|
export interface BackupInfo {
|
|
@@ -359,16 +373,28 @@ export interface BackupInfo {
|
|
|
359
373
|
}
|
|
360
374
|
export type SupportedLanguageAbbreviatons = 'de' | 'en';
|
|
361
375
|
export type SupportedThemes = 'light' | 'dark';
|
|
376
|
+
export interface ConfigSettings {
|
|
377
|
+
zoom: number;
|
|
378
|
+
}
|
|
379
|
+
export interface ConsoleSettings {
|
|
380
|
+
zoom: number;
|
|
381
|
+
}
|
|
382
|
+
export type CamviewSettingsLayoutMode = 'dnd' | 'view';
|
|
383
|
+
export interface CamviewSettings {
|
|
384
|
+
dragDisabled?: boolean;
|
|
385
|
+
viewId?: string;
|
|
386
|
+
}
|
|
387
|
+
export interface UiSettingsLocalStorage {
|
|
388
|
+
config: ConfigSettings;
|
|
389
|
+
console: ConsoleSettings;
|
|
390
|
+
camview: CamviewSettings;
|
|
391
|
+
}
|
|
362
392
|
export interface ThemeLocalStorage {
|
|
363
393
|
theme: SupportedThemes;
|
|
364
394
|
autoMode: boolean;
|
|
365
395
|
}
|
|
366
|
-
export interface CamviewLocalStorage {
|
|
367
|
-
currentLayout: DBCamviewLayout;
|
|
368
|
-
preferences: DBCamviewLayout[];
|
|
369
|
-
}
|
|
370
396
|
export interface UiLocalStorage {
|
|
371
|
-
|
|
397
|
+
ui: UiSettingsLocalStorage;
|
|
372
398
|
theme: ThemeLocalStorage;
|
|
373
399
|
locale: SupportedLanguageAbbreviatons;
|
|
374
400
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { RUNTIME_STATUS } from '../../../services/config/types.js';
|
|
1
2
|
import type { Namespace, Server, Socket } from 'socket.io';
|
|
2
3
|
import type { PLUGIN_STATUS } from '../../../plugins/types.js';
|
|
3
|
-
import { RUNTIME_STATUS } from '../../../services/config/types.js';
|
|
4
4
|
import type { SocketNsp } from '../types.js';
|
|
5
5
|
export declare class StatusNamespace {
|
|
6
6
|
nsp: Namespace;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Namespace } from 'socket.io';
|
|
2
|
-
import type { WebSocket } from 'ws';
|
|
3
2
|
import type { PLUGIN_STATUS } from '../../plugins/types.js';
|
|
4
|
-
|
|
5
|
-
export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/streams' | '/plugins' | '/proxy' | '/frame' | '/frameWorker';
|
|
3
|
+
export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/plugins' | '/proxy' | '/frame' | '/frameWorker';
|
|
6
4
|
export interface SocketNspMap {
|
|
7
5
|
nsp: Namespace;
|
|
8
6
|
[key: string]: any;
|
|
@@ -86,15 +84,3 @@ export interface PluginRuntime {
|
|
|
86
84
|
name: string;
|
|
87
85
|
status: PLUGIN_STATUS;
|
|
88
86
|
}
|
|
89
|
-
export interface StreamPayload {
|
|
90
|
-
type: Exclude<VideoStreamingMode, 'webrtc' | 'webrtc/tcp'> | 'webrtc/offer' | 'webrtc/candidate';
|
|
91
|
-
value: string;
|
|
92
|
-
}
|
|
93
|
-
export interface Go2RtcWs {
|
|
94
|
-
id: string;
|
|
95
|
-
ws?: WebSocket;
|
|
96
|
-
connect: () => void;
|
|
97
|
-
reconnect: () => void;
|
|
98
|
-
close: (destroy?: boolean) => void;
|
|
99
|
-
send: (data: StreamPayload) => void;
|
|
100
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
1
|
import 'reflect-metadata';
|
|
3
2
|
import { EventEmitter } from 'node:events';
|
|
4
3
|
import { CameraController } from './camera/controller.js';
|
|
@@ -37,7 +36,7 @@ export declare class CameraUiAPI extends EventEmitter {
|
|
|
37
36
|
controller: CameraController;
|
|
38
37
|
worker: FrameWorker;
|
|
39
38
|
}[];
|
|
40
|
-
updateCamera(camera: Camera
|
|
39
|
+
updateCamera(camera: Camera): void;
|
|
41
40
|
removeCamera(camera: Camera, extensions: CameraExtensions): Promise<void>;
|
|
42
41
|
selectCamera(pluginId: string, camera: Camera, extension: CameraExtension): void;
|
|
43
42
|
deselectCamera(pluginId: string, camera: Camera, extension: CameraExtension): void;
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseCameraDevice } from './index.js';
|
|
2
|
+
import { CameraAudioDetectionInterface } from './interfaces/audioDetection.js';
|
|
3
|
+
import { CameraMotionDetectionInterface } from './interfaces/motionDetection.js';
|
|
4
|
+
import { CameraObjectDetectionInterface } from './interfaces/objectDetection.js';
|
|
5
|
+
import { CameraPrebufferInterface } from './interfaces/prebuffer.js';
|
|
6
|
+
import { CameraPTZInterface } from './interfaces/ptz.js';
|
|
2
7
|
import type { Camera } from '../api/database/types.js';
|
|
3
|
-
import type { MotionFrame, VideoFrame } from '../decoder/types.js';
|
|
4
8
|
import type { ProxyServer } from '../nats/index.js';
|
|
5
9
|
import type { IceServer } from '../services/config/types.js';
|
|
6
|
-
import type { BaseLogger, CameraSource, SetValues } from './types.js';
|
|
7
|
-
export declare class CameraController extends
|
|
8
|
-
|
|
10
|
+
import type { BaseLogger, CameraConfigInputSettings, CameraSource, SetValues } from './types.js';
|
|
11
|
+
export declare class CameraController extends BaseCameraDevice {
|
|
12
|
+
proxy: ProxyServer;
|
|
9
13
|
private motionTimeout?;
|
|
14
|
+
private objectTimeout?;
|
|
15
|
+
private objectTimeoutDuration;
|
|
10
16
|
private doorbellTimeout?;
|
|
11
17
|
private doorbellTimeoutDuration;
|
|
12
18
|
private prebufferStateSubscriptions;
|
|
19
|
+
protected prebufferDelegate: CameraPrebufferInterface;
|
|
20
|
+
ptzDelegate: CameraPTZInterface;
|
|
21
|
+
audioDetectorDelegate: CameraAudioDetectionInterface;
|
|
22
|
+
motionDetectorDelegate: CameraMotionDetectionInterface;
|
|
23
|
+
objectDetectorDelegate: CameraObjectDetectionInterface;
|
|
24
|
+
get camera(): Camera;
|
|
13
25
|
get sources(): CameraSource[];
|
|
14
26
|
constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
|
|
15
27
|
connect(): Promise<void>;
|
|
16
28
|
disconnect(): Promise<void>;
|
|
17
|
-
reboot(): Promise<void>;
|
|
18
|
-
getFrames(): AsyncIterableIterator<VideoFrame>;
|
|
19
|
-
getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
20
|
-
getPrebufferedFrames(): AsyncIterableIterator<VideoFrame>;
|
|
21
|
-
getFfmpegPath(): Promise<string>;
|
|
22
29
|
getIceServers(): Promise<IceServer[]>;
|
|
23
30
|
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
31
|
+
addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
32
|
+
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
33
|
+
removeCameraSource(sourceId: string): Promise<void>;
|
|
24
34
|
updateCamera(updatedCamera: Camera): void;
|
|
25
35
|
cleanup(): void;
|
|
26
36
|
private subscribeToCameraState;
|
|
27
37
|
private subscribeToCameraSourcesState;
|
|
28
|
-
private subscribeToMotionState;
|
|
29
|
-
private subscribeToDoorbellState;
|
|
30
38
|
private subscribeToCameraChanges;
|
|
31
39
|
private subscribeToStateChanges;
|
|
40
|
+
private subscribeToMotionState;
|
|
41
|
+
private subscribeToObjectState;
|
|
42
|
+
private subscribeToDoorbellState;
|
|
32
43
|
private triggerProxyEvent;
|
|
33
44
|
private isCameraEvent;
|
|
34
45
|
}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import type { Observable } from 'rxjs';
|
|
2
1
|
import { BehaviorSubject } from 'rxjs';
|
|
3
2
|
import { BaseCameraDevice } from './index.js';
|
|
4
|
-
import {
|
|
3
|
+
import { WeriftSession } from './streaming/werift-session.js';
|
|
4
|
+
import type { Observable } from 'rxjs';
|
|
5
5
|
import type { MotionFrame, VideoFrame } from '../decoder/types.js';
|
|
6
6
|
import type { StreamingConnectionOptions } from './streaming/peer-connection.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { CameraDelegates, FrameState } from './types.js';
|
|
8
8
|
export declare abstract class CameraDevice extends BaseCameraDevice {
|
|
9
9
|
protected readonly frameState: BehaviorSubject<FrameState>;
|
|
10
10
|
protected readonly onFrame: Observable<FrameState>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
get prebufferDelegate(): CameraPrebufferDelegate | undefined;
|
|
16
|
-
set prebufferDelegate(delegate: CameraPrebufferDelegate);
|
|
17
|
-
abstract getFrames(): AsyncIterableIterator<VideoFrame>;
|
|
11
|
+
abstract setDelegate<T extends keyof CameraDelegates>(name: T, delegate: CameraDelegates[T]): void;
|
|
12
|
+
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<WeriftSession>;
|
|
13
|
+
removeAllListeners(): void;
|
|
14
|
+
abstract getFrames(prebufferDuration?: number): AsyncIterableIterator<VideoFrame>;
|
|
18
15
|
abstract getMotionFrames(): AsyncIterableIterator<MotionFrame>;
|
|
19
|
-
abstract getPrebufferedFrames(): AsyncIterableIterator<VideoFrame>;
|
|
20
16
|
abstract getFfmpegPath(): Promise<string>;
|
|
21
|
-
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
22
|
-
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
23
|
-
streamVideo(sourceName: string, options: FfmpegOptions): Promise<StreamingSession>;
|
|
24
|
-
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
25
|
-
removeAllListeners(): void;
|
|
26
17
|
private createMotionFrameObservable;
|
|
27
18
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
1
|
import { LRUCache } from 'lru-cache';
|
|
3
2
|
import { BehaviorSubject } from 'rxjs';
|
|
4
3
|
import type { Observable, Subscription } from 'rxjs';
|
|
5
|
-
import type { Camera, CameraActivitySettings,
|
|
4
|
+
import type { Camera, CameraActivitySettings, CameraFrameWorkerSettings, CameraInformation, CameraType } from '../api/database/types.js';
|
|
5
|
+
import type { VideoFrame } from '../decoder/types.js';
|
|
6
6
|
import type { IceServer } from '../services/config/types.js';
|
|
7
|
-
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraSource, Container, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, PrebufferState, SetValues, Sets, SirenSetEvent, SirenState, StateValues, States } from './types.js';
|
|
7
|
+
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraAudioDetectionDelegate, CameraConfigInputSettings, CameraMotionDetectionDelegate, CameraObjectDetectionDelegate, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, Container, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, PrebufferState, SetValues, Sets, SirenSetEvent, SirenState, StateValues, States } from './types.js';
|
|
8
8
|
declare class Subscribed {
|
|
9
9
|
private readonly subscriptions;
|
|
10
10
|
private readonly additionalSubscriptions;
|
|
@@ -38,6 +38,12 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
38
38
|
readonly onDoorbellPressed: Observable<DoorbellState>;
|
|
39
39
|
readonly onSirenDetected: Observable<SirenState>;
|
|
40
40
|
readonly onBatteryChanged: Observable<BatteryState>;
|
|
41
|
+
protected abstract prebufferDelegate: CameraPrebufferDelegate;
|
|
42
|
+
abstract ptzDelegate: CameraPTZDelegate;
|
|
43
|
+
abstract motionDetectorDelegate: CameraMotionDetectionDelegate;
|
|
44
|
+
abstract audioDetectorDelegate: CameraAudioDetectionDelegate;
|
|
45
|
+
abstract objectDetectorDelegate: CameraObjectDetectionDelegate;
|
|
46
|
+
protected get cameraObject(): Camera;
|
|
41
47
|
get id(): string;
|
|
42
48
|
get nativeId(): string | undefined;
|
|
43
49
|
get pluginId(): string;
|
|
@@ -56,35 +62,38 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
56
62
|
get hasObjectDetector(): boolean;
|
|
57
63
|
get hasPtz(): boolean;
|
|
58
64
|
get hasPrebuffer(): boolean;
|
|
59
|
-
get hasIntercom(): boolean;
|
|
60
65
|
get activityZones(): DetectionZone[];
|
|
61
66
|
get activitySettings(): CameraActivitySettings;
|
|
67
|
+
get frameWorkerSettings(): CameraFrameWorkerSettings;
|
|
62
68
|
get sources(): CameraSource[];
|
|
63
69
|
get streamSource(): CameraSource;
|
|
64
70
|
get snapshotSource(): CameraSource;
|
|
65
71
|
get recordingSource(): CameraSource;
|
|
66
72
|
get detectionSource(): CameraSource;
|
|
67
73
|
constructor(camera: Camera, logger: BaseLogger);
|
|
74
|
+
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
75
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
76
|
+
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
77
|
+
newState: StateValues[T];
|
|
78
|
+
oldState: StateValues[T];
|
|
79
|
+
}>;
|
|
68
80
|
abstract connect(): Promise<void>;
|
|
69
81
|
abstract disconnect(): Promise<void>;
|
|
70
|
-
abstract reboot(): Promise<void>;
|
|
71
|
-
abstract snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
72
82
|
abstract getIceServers(): Promise<IceServer[]>;
|
|
73
|
-
protected abstract cleanup(): void;
|
|
74
|
-
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
75
83
|
abstract updateState(stateName: 'light', eventData: LightSetEvent): Promise<void>;
|
|
76
|
-
abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?:
|
|
84
|
+
abstract updateState(stateName: 'motion', eventData: MotionSetEvent, frame?: VideoFrame): Promise<void>;
|
|
77
85
|
abstract updateState(stateName: 'audio', eventData: AudioSetEvent): Promise<void>;
|
|
78
86
|
abstract updateState(stateName: 'object', eventData: ObjectSetEvent): Promise<void>;
|
|
79
87
|
abstract updateState(stateName: 'doorbell', eventData: DoorbellSetEvent): Promise<void>;
|
|
80
88
|
abstract updateState(stateName: 'siren', eventData: SirenSetEvent): Promise<void>;
|
|
81
89
|
abstract updateState(stateName: 'battery', eventData: BatterySetEvent): Promise<void>;
|
|
90
|
+
abstract addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
91
|
+
abstract updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
92
|
+
abstract removeCameraSource(sourceId: string): Promise<void>;
|
|
93
|
+
protected abstract cleanup(): void;
|
|
82
94
|
protected updateStateInternal<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], skipCheck?: boolean): void;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
oldState: StateValues[T];
|
|
86
|
-
}>;
|
|
87
|
-
onPropertyChange<T extends keyof CameraPublicProperties>(property: T): Observable<{
|
|
95
|
+
onPropertyChange<T extends keyof Camera>(property: T | T[]): Observable<{
|
|
96
|
+
property: T;
|
|
88
97
|
oldData: Camera[T];
|
|
89
98
|
newData: Camera[T];
|
|
90
99
|
}>;
|
|
@@ -93,16 +102,16 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
93
102
|
changed: boolean;
|
|
94
103
|
event: StateValues[T];
|
|
95
104
|
};
|
|
96
|
-
protected getAudioState(event: AudioSetEvent): AudioState;
|
|
97
|
-
protected getMotionState(event: MotionSetEvent): MotionState;
|
|
98
|
-
protected getObjectState(event: ObjectSetEvent): ObjectState;
|
|
99
|
-
protected getDoorbellState(event: DoorbellSetEvent): DoorbellState;
|
|
100
|
-
protected getLightState(event: LightSetEvent
|
|
101
|
-
protected getSirenState(event: SirenSetEvent): SirenState;
|
|
102
|
-
protected getBatteryState(event: BatterySetEvent): BatteryState;
|
|
105
|
+
protected getAudioState(event: AudioSetEvent, ignoreLastEvet?: boolean): AudioState;
|
|
106
|
+
protected getMotionState(event: MotionSetEvent, ignoreLastEvet?: boolean): MotionState;
|
|
107
|
+
protected getObjectState(event: ObjectSetEvent, ignoreLastEvet?: boolean): ObjectState;
|
|
108
|
+
protected getDoorbellState(event: DoorbellSetEvent, ignoreLastEvet?: boolean): DoorbellState;
|
|
109
|
+
protected getLightState(event: LightSetEvent, ignoreLastEvet?: boolean): LightState;
|
|
110
|
+
protected getSirenState(event: SirenSetEvent, ignoreLastEvet?: boolean): SirenState;
|
|
111
|
+
protected getBatteryState(event: BatterySetEvent, ignoreLastEvet?: boolean): BatteryState;
|
|
103
112
|
protected updateCamera(updatedCamera: Camera): void;
|
|
104
113
|
protected updatePrebuffer(sourceId: string, container: Container, state: PrebufferState): Promise<void>;
|
|
105
|
-
|
|
114
|
+
protected updateCameraSourcesState(): void;
|
|
106
115
|
protected updateCameraState(state: boolean): void;
|
|
107
116
|
protected cameraSourcePrebufferState(sourceId: string, container: Container): PrebufferState;
|
|
108
117
|
private createStateObservable;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CameraAudioDetectionDelegate } from '../types.js';
|
|
2
|
+
import type { BaseLogger } from '../types.js';
|
|
3
|
+
export declare class CameraAudioDetectionInterface extends CameraAudioDetectionDelegate {
|
|
4
|
+
delegate?: CameraAudioDetectionDelegate;
|
|
5
|
+
private onRequest;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
detectAudio(audio: Buffer): Promise<boolean>;
|
|
9
|
+
private _onRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CameraDelegate } from '../types.js';
|
|
2
|
+
import type { CameraDeviceProxy } from '../../polyglot/node/plugins/proxy/cameraDevice.js';
|
|
3
|
+
import type { BaseLogger } from '../types.js';
|
|
4
|
+
export declare class CameraInterface extends CameraDelegate {
|
|
5
|
+
delegate?: CameraDelegate;
|
|
6
|
+
private connections;
|
|
7
|
+
private cameraDevice;
|
|
8
|
+
private logger;
|
|
9
|
+
constructor(cameraDevice: CameraDeviceProxy, logger: BaseLogger);
|
|
10
|
+
snapshotRequest(requestId: string, sourceName: string): Promise<Buffer | undefined>;
|
|
11
|
+
startStream(requestId: string, sourceName: string, videoPort: number, audioPort: number): Promise<void>;
|
|
12
|
+
stopStream(requestId: string, sourceName: string): Promise<void>;
|
|
13
|
+
onTalkbackSdp(requestId: string, sourceName: string, sdp: string, codec: 'PCMU' | 'PCMA' | 'opus'): void;
|
|
14
|
+
onTalkbackRtp(requestId: string, sourceName: string, rtp: Buffer): void;
|
|
15
|
+
onOffer(requestId: string, sdp: string): Promise<string>;
|
|
16
|
+
onCandidates(requestId: string, candidate: string): Promise<void>;
|
|
17
|
+
private generateSdp;
|
|
18
|
+
private createPeerCoonection;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CameraMotionDetectionDelegate } from '../types.js';
|
|
2
|
+
import type { BaseLogger, Detection } from '../types.js';
|
|
3
|
+
export declare class CameraMotionDetectionInterface extends CameraMotionDetectionDelegate {
|
|
4
|
+
delegate?: CameraMotionDetectionDelegate;
|
|
5
|
+
private onRequest;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
detectImage(image: Buffer): Promise<Detection[]>;
|
|
9
|
+
private _onRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CameraObjectDetectionDelegate } from '../types.js';
|
|
2
|
+
import type { BaseLogger, Detection } from '../types.js';
|
|
3
|
+
export declare class CameraObjectDetectionInterface extends CameraObjectDetectionDelegate {
|
|
4
|
+
delegate?: CameraObjectDetectionDelegate;
|
|
5
|
+
private onRequest;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
detectImage(image: Buffer): Promise<Detection[]>;
|
|
9
|
+
private _onRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CameraPrebufferDelegate } from '../types.js';
|
|
2
|
+
import type { BaseLogger, Container, StreamInfo } from '../types.js';
|
|
3
|
+
export declare class CameraPrebufferInterface extends CameraPrebufferDelegate {
|
|
4
|
+
delegate?: CameraPrebufferDelegate;
|
|
5
|
+
private onRequest;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: Record<string, any> | any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
9
|
+
updatePrebufferState(sourceId: string, container: Container, state: boolean): Promise<void>;
|
|
10
|
+
private _onRequest;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CameraPTZDelegate } from '../types.js';
|
|
2
|
+
import type { BaseLogger } from '../types.js';
|
|
3
|
+
export declare class CameraPTZInterface extends CameraPTZDelegate {
|
|
4
|
+
delegate?: CameraPTZDelegate;
|
|
5
|
+
private onRequest;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
moveAbsolute(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
9
|
+
moveRelative(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
10
|
+
moveContinuous(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
private _onRequest;
|
|
13
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { CameraActivitySettings } from '../api/database/types.js';
|
|
1
2
|
import type { Detection, DetectionZone } from './types.js';
|
|
2
3
|
export declare const convertZonePointsToPixels: (zone: DetectionZone, detection: Detection) => DetectionZone;
|
|
3
4
|
export declare const convertBoundingBoxToPixels: (detection: Detection) => Detection;
|
|
4
|
-
export declare const areObjectDetectionsValid: (detections: Detection[], zones: DetectionZone[]) => Detection[];
|
|
5
|
-
export declare const areMotionDetectionsValid: (detections: Detection[], zones: DetectionZone[]) => Detection[];
|
|
5
|
+
export declare const areObjectDetectionsValid: (detections: Detection[], zones: DetectionZone[], activitySettings: CameraActivitySettings) => Detection[];
|
|
6
|
+
export declare const areMotionDetectionsValid: (detections: Detection[], zones: DetectionZone[], activitySettings: CameraActivitySettings) => Detection[];
|
|
@@ -27,7 +27,7 @@ export declare class WeriftPeerConnection extends Subscribed implements BasicPee
|
|
|
27
27
|
onVideoRtp: Subject<RtpPacket>;
|
|
28
28
|
onVideoRtcp: Subject<RtcpPacket>;
|
|
29
29
|
onIceCandidate: Subject<RTCIceCandidate>;
|
|
30
|
-
onConnectionState: ReplaySubject<"
|
|
30
|
+
onConnectionState: ReplaySubject<"closed" | "failed" | "disconnected" | "new" | "connecting" | "connected">;
|
|
31
31
|
returnAudioTrack: MediaStreamTrack;
|
|
32
32
|
private onRequestKeyFrame;
|
|
33
33
|
private cameraDevice;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ReplaySubject, Subject
|
|
1
|
+
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
2
|
import { Subscribed } from '../../utils/subscribed.js';
|
|
3
|
+
import type { Observable } from 'rxjs';
|
|
3
4
|
import type { RtpPacket } from 'werift';
|
|
4
5
|
import type { IceServer } from '../../services/config/types.js';
|
|
5
6
|
import type { CameraDevice } from '../device.js';
|
package/dist/types/server/src/camera/streaming/{streaming-session.d.ts → werift-session.d.ts}
RENAMED
|
@@ -4,7 +4,7 @@ import { Subscribed } from '../../utils/subscribed.js';
|
|
|
4
4
|
import type { CameraDevice } from '../device.js';
|
|
5
5
|
import type { BaseLogger, FfmpegOptions, SpawnInput } from '../types.js';
|
|
6
6
|
import type { WebrtcConnection } from './webrtc-connection.js';
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class WeriftSession extends Subscribed {
|
|
8
8
|
readonly onCallEnded: ReplaySubject<void>;
|
|
9
9
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
10
10
|
readonly onAudioRtp: Subject<RtpPacket>;
|