@camera.ui/browser 0.0.80 → 0.0.82
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/client.d.ts +1 -7
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +2 -6
- package/dist/types/packages/client/browser/src/proxy/index.d.ts +0 -2
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +2 -0
- package/dist/types/server/src/api/controllers/cameras.controller.d.ts +2 -1
- package/dist/types/server/src/api/controllers/plugins.controller.d.ts +6 -1
- package/dist/types/server/src/api/controllers/users.controller.d.ts +8 -1
- package/dist/types/server/src/api/database/index.d.ts +11 -8
- package/dist/types/server/src/api/database/migration.d.ts +12 -0
- package/dist/types/server/src/api/database/types.d.ts +22 -2
- package/dist/types/server/src/api/index.d.ts +0 -1
- package/dist/types/server/src/api/routes/index.d.ts +1 -1
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +15 -15
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +79 -79
- package/dist/types/server/src/api/schemas/config.schema.d.ts +11 -14
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +60 -60
- package/dist/types/server/src/api/schemas/plugins.schema.d.ts +50 -0
- package/dist/types/server/src/api/schemas/users.schema.d.ts +499 -112
- package/dist/types/server/src/api/services/backup.service.d.ts +2 -1
- package/dist/types/server/src/api/services/cameras.service.d.ts +0 -3
- package/dist/types/server/src/api/services/users.service.d.ts +12 -3
- package/dist/types/server/src/api/types/index.d.ts +40 -35
- package/dist/types/server/src/api/utils/parse.d.ts +2 -0
- package/dist/types/server/src/api.d.ts +1 -1
- package/dist/types/server/src/camera/controller.d.ts +3 -7
- package/dist/types/server/src/camera/index.d.ts +6 -7
- package/dist/types/server/src/camera/interfaces/camera.d.ts +5 -13
- package/dist/types/server/src/camera/interfaces/prebuffer.d.ts +3 -3
- package/dist/types/server/src/camera/types.d.ts +3 -25
- package/dist/types/server/src/decoder/types.d.ts +10 -1
- package/dist/types/server/src/nats/index.d.ts +7 -6
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +11 -55
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +6 -21
- package/dist/types/server/src/nats/proxy/index.d.ts +0 -2
- package/dist/types/server/src/nats/types.d.ts +42 -124
- package/dist/types/server/src/plugins/interfaces/audioDetection.d.ts +7 -0
- package/dist/types/server/src/plugins/{base.d.ts → interfaces/base.d.ts} +2 -2
- package/dist/types/server/src/plugins/interfaces/motionDetection.d.ts +6 -0
- package/dist/types/server/src/plugins/interfaces/objectDetection.d.ts +7 -0
- package/dist/types/server/src/plugins/types.d.ts +12 -5
- package/dist/types/server/src/polyglot/node/plugins/api.d.ts +2 -6
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +6 -16
- package/dist/types/server/src/polyglot/node/plugins/proxy/index.d.ts +0 -2
- package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +14 -10
- package/dist/types/server/src/services/config/types.d.ts +0 -1
- package/dist/types/server/src/utils/utils.d.ts +1 -2
- package/package.json +6 -6
- package/dist/types/packages/client/browser/src/proxy/pluginsManager.d.ts +0 -10
- package/dist/types/packages/client/browser/src/proxy/systemManager.d.ts +0 -10
- package/dist/types/server/src/api/controllers/streams.controller.d.ts +0 -12
- package/dist/types/server/src/api/routes/streams.routes.d.ts +0 -2
- package/dist/types/server/src/camera/interfaces/audioDetection.d.ts +0 -10
- package/dist/types/server/src/camera/interfaces/motionDetection.d.ts +0 -10
- package/dist/types/server/src/camera/interfaces/objectDetection.d.ts +0 -10
- package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +0 -12
- package/dist/types/server/src/nats/proxy/systemManager.d.ts +0 -8
- package/dist/types/server/src/polyglot/node/plugins/proxy/pluginsManager.d.ts +0 -39
- package/dist/types/server/src/polyglot/node/plugins/proxy/systemManager.d.ts +0 -37
- /package/dist/types/server/src/nats/{queue.d.ts → messageQueue.d.ts} +0 -0
- /package/dist/types/server/src/polyglot/node/plugins/proxy/{queue.d.ts → messageQueue.d.ts} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MultipartFile } from '@fastify/multipart';
|
|
2
|
+
import type { BackupInfo, UiLocalStorage } from '../types/index.js';
|
|
2
3
|
export declare class BackupService {
|
|
3
4
|
private logger;
|
|
4
5
|
private configService;
|
|
@@ -12,12 +12,10 @@ export declare class CamerasService {
|
|
|
12
12
|
private pluginsService;
|
|
13
13
|
constructor();
|
|
14
14
|
createCamera(cameraData: DBCamera): Promise<DBCamera>;
|
|
15
|
-
createTransformedCamera(cameraData: DBCamera, cameraSources: CameraInputSettings[]): Promise<Camera>;
|
|
16
15
|
createZone(cameraname: string, zoneData: CameraZone): Promise<DBCamera | undefined>;
|
|
17
16
|
patchZoneByName(cameraname: string, zonename: string, zoneData: CameraZone): Promise<DBCamera | undefined>;
|
|
18
17
|
removeZoneByName(cameraname: string, zonename: string): Promise<void>;
|
|
19
18
|
createCameraSource(cameraname: string, sourceName: string, source: string): Promise<void>;
|
|
20
|
-
resetCameraSource(cameraname: string, sourceName: string): Promise<void>;
|
|
21
19
|
list(): DBCamera[];
|
|
22
20
|
listTransformed(): Camera[];
|
|
23
21
|
listByPluginId(pluginId: string): DBCamera[];
|
|
@@ -42,7 +40,6 @@ export declare class CamerasService {
|
|
|
42
40
|
removeByPluginIdAndName(cameraname: string, pluginId: string): Promise<void>;
|
|
43
41
|
removeAll(): Promise<void>;
|
|
44
42
|
transformCamera(camera: DBCamera): Camera;
|
|
45
|
-
createEmptySource(cameraId: string, source: CameraInputSettings): CameraInputSettings;
|
|
46
43
|
addCameraSources(cameraname: string, sources: CameraInputSettings[]): Promise<void>;
|
|
47
44
|
removeCameraSources(cameraname: string, sources: CameraInputSettings[]): Promise<void>;
|
|
48
45
|
private sourceExistAndEqual;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DBCamviewLayout, DBUser } from '../database/types.js';
|
|
1
|
+
import type { DBCameraShortcut, DBCamviewLayout, DBUser } from '../database/types.js';
|
|
2
2
|
export declare class UsersService {
|
|
3
3
|
private dbs;
|
|
4
4
|
constructor();
|
|
@@ -9,8 +9,17 @@ export declare class UsersService {
|
|
|
9
9
|
patchUser(username: string, userData?: Partial<DBUser>): Promise<DBUser | undefined>;
|
|
10
10
|
removeByName(username: string): Promise<void>;
|
|
11
11
|
removeAll(): Promise<void>;
|
|
12
|
+
createShortcut(username: string, cameraId: string, shortcutData: DBCameraShortcut): Promise<DBCameraShortcut[] | undefined>;
|
|
13
|
+
patchShortcutById(username: string, cameraId: string, shortcutId: string, shortcutData?: Partial<DBCameraShortcut>): Promise<DBCameraShortcut[] | undefined>;
|
|
14
|
+
removeShortcutById(username: string, cameraId: string, shortcutId: string): Promise<DBCameraShortcut[] | undefined>;
|
|
15
|
+
removeAllShortcuts(username: string, cameraId: string): Promise<DBCameraShortcut[] | undefined>;
|
|
12
16
|
createView(username: string, viewData: DBCamviewLayout): Promise<DBCamviewLayout>;
|
|
13
|
-
patchViewById(username: string,
|
|
14
|
-
removeViewById(username: string,
|
|
17
|
+
patchViewById(username: string, viewid: string, viewData?: Partial<DBCamviewLayout>): Promise<DBCamviewLayout | undefined>;
|
|
18
|
+
removeViewById(username: string, viewid: string): Promise<DBCamviewLayout[] | undefined>;
|
|
15
19
|
removeAllViews(username: string): Promise<DBCamviewLayout[] | undefined>;
|
|
20
|
+
resetPreferences(username: string): Promise<void>;
|
|
21
|
+
resetAllPreferences(): Promise<void>;
|
|
22
|
+
removeCameraFromPreferences(cameraId: string): Promise<void>;
|
|
23
|
+
removeCameraFromAllShortcuts(cameraId: string): Promise<void>;
|
|
24
|
+
removeCameraFromAllViews(cameraId: string): Promise<void>;
|
|
16
25
|
}
|
|
@@ -7,7 +7,8 @@ import type { RestoreBackupInput } from '../schemas/backup.schema.js';
|
|
|
7
7
|
import type { CreateCameraInput, PatchCameraInput, PreviewCameraInput } from '../schemas/cameras.schema.js';
|
|
8
8
|
import type { PatchConfigInput } from '../schemas/config.schema.js';
|
|
9
9
|
import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { DetectAudioInput, DetectMotionInput, DetectObjectInput } from '../schemas/plugins.schema.js';
|
|
11
|
+
import type { CreateShortcutInput, CreateUserInput, CreateViewInput, LoginUserInput, PatchShortcutInput, PatchUserInput, PatchViewInput } from '../schemas/users.schema.js';
|
|
11
12
|
export interface BusboyFileStream extends Readable {
|
|
12
13
|
truncated: boolean;
|
|
13
14
|
bytesRead: number;
|
|
@@ -173,32 +174,6 @@ export interface PaginationQuery {
|
|
|
173
174
|
page?: number;
|
|
174
175
|
pageSize?: number;
|
|
175
176
|
}
|
|
176
|
-
export type Multipart = MultipartFile | MultipartValue;
|
|
177
|
-
export interface MultipartFile {
|
|
178
|
-
type: 'file';
|
|
179
|
-
toBuffer: () => Promise<Buffer>;
|
|
180
|
-
file: BusboyFileStream;
|
|
181
|
-
fieldname: string;
|
|
182
|
-
filename: string;
|
|
183
|
-
encoding: string;
|
|
184
|
-
mimetype: string;
|
|
185
|
-
fields: MultipartFields;
|
|
186
|
-
_buf?: Buffer;
|
|
187
|
-
value: Buffer;
|
|
188
|
-
}
|
|
189
|
-
export interface MultipartValue<T = unknown> {
|
|
190
|
-
type: 'field';
|
|
191
|
-
value: T;
|
|
192
|
-
fieldname: string;
|
|
193
|
-
mimetype: string;
|
|
194
|
-
encoding: string;
|
|
195
|
-
fieldnameTruncated: boolean;
|
|
196
|
-
valueTruncated: boolean;
|
|
197
|
-
fields: MultipartFields;
|
|
198
|
-
}
|
|
199
|
-
export interface MultipartFields {
|
|
200
|
-
[fieldname: string]: Multipart | Multipart[] | undefined;
|
|
201
|
-
}
|
|
202
177
|
export type PaginationRequest = {
|
|
203
178
|
Querystring: PaginationQuery;
|
|
204
179
|
};
|
|
@@ -238,6 +213,11 @@ export type CamerasParamsRequest = {
|
|
|
238
213
|
cameraname: string;
|
|
239
214
|
};
|
|
240
215
|
};
|
|
216
|
+
export type CamerasParamsIdRequest = {
|
|
217
|
+
Params: {
|
|
218
|
+
cameraid: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
241
221
|
export type CameraZonesParamsRequest = {
|
|
242
222
|
Params: {
|
|
243
223
|
zonename: string;
|
|
@@ -329,6 +309,23 @@ export type PluginsActionRequest = {
|
|
|
329
309
|
payload: any;
|
|
330
310
|
};
|
|
331
311
|
};
|
|
312
|
+
export type PluginsDetectMotionRequest = {
|
|
313
|
+
Body: DetectMotionInput;
|
|
314
|
+
};
|
|
315
|
+
export type PluginsDetectObjectRequest = {
|
|
316
|
+
Body: DetectObjectInput;
|
|
317
|
+
};
|
|
318
|
+
export type PluginsDetectAudioRequest = {
|
|
319
|
+
Body: DetectAudioInput;
|
|
320
|
+
};
|
|
321
|
+
export interface PluginsInterfaceQueryType {
|
|
322
|
+
type: 'objectDetection' | 'motionDetection' | 'audioDetection';
|
|
323
|
+
}
|
|
324
|
+
export type PluginsInterfaceQuery = {
|
|
325
|
+
Querystring: {
|
|
326
|
+
type: PluginsInterfaceQueryType;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
332
329
|
export type UsersParamsRequest = {
|
|
333
330
|
Params: {
|
|
334
331
|
username: string;
|
|
@@ -346,7 +343,7 @@ export type UsersPatchRequest = {
|
|
|
346
343
|
};
|
|
347
344
|
export type ViewsParamsRequest = {
|
|
348
345
|
Params: {
|
|
349
|
-
|
|
346
|
+
viewid: string;
|
|
350
347
|
};
|
|
351
348
|
};
|
|
352
349
|
export type ViewsInsertRequest = {
|
|
@@ -355,17 +352,22 @@ export type ViewsInsertRequest = {
|
|
|
355
352
|
export type ViewsPatchRequest = {
|
|
356
353
|
Body: PatchViewInput;
|
|
357
354
|
};
|
|
355
|
+
export type ShortcutParamsRequest = {
|
|
356
|
+
Params: {
|
|
357
|
+
shortcutid: string;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
export type ShortcutInsertRequest = {
|
|
361
|
+
Body: CreateShortcutInput;
|
|
362
|
+
};
|
|
363
|
+
export type ShortcutPatchRequest = {
|
|
364
|
+
Body: PatchShortcutInput;
|
|
365
|
+
};
|
|
358
366
|
export type BackupCreateRequest = {
|
|
359
367
|
Body: {
|
|
360
368
|
localStorage: Partial<UiLocalStorage>;
|
|
361
369
|
};
|
|
362
370
|
};
|
|
363
|
-
export type StreamsParamsNameRequest = {
|
|
364
|
-
Params: {
|
|
365
|
-
id: string;
|
|
366
|
-
name: string;
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
371
|
export interface BackupInfo {
|
|
370
372
|
backupDirectory: string;
|
|
371
373
|
backupFile: string;
|
|
@@ -382,7 +384,7 @@ export interface ConsoleSettings {
|
|
|
382
384
|
export type CamviewSettingsLayoutMode = 'dnd' | 'view';
|
|
383
385
|
export interface CamviewSettings {
|
|
384
386
|
dragDisabled?: boolean;
|
|
385
|
-
|
|
387
|
+
viewid?: string;
|
|
386
388
|
}
|
|
387
389
|
export interface UiSettingsLocalStorage {
|
|
388
390
|
config: ConfigSettings;
|
|
@@ -568,6 +570,9 @@ export interface CameraUiPlugin {
|
|
|
568
570
|
'camera.ui'?: string;
|
|
569
571
|
node?: string;
|
|
570
572
|
};
|
|
573
|
+
'camera.ui'?: PluginContract;
|
|
574
|
+
isPython: boolean;
|
|
575
|
+
isNode: boolean;
|
|
571
576
|
}
|
|
572
577
|
export interface FrameWorker {
|
|
573
578
|
name: string;
|
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'node:events';
|
|
|
3
3
|
import { CameraController } from './camera/controller.js';
|
|
4
4
|
import type { Camera, CameraExtensions } from './api/database/types.js';
|
|
5
5
|
import type { FrameWorker } from './decoder/worker.js';
|
|
6
|
-
import type { BasePlugin } from './plugins/base.js';
|
|
6
|
+
import type { BasePlugin } from './plugins/interfaces/base.js';
|
|
7
7
|
import type { CameraExtension } from './plugins/types.js';
|
|
8
8
|
import type { API } from './polyglot/node/plugins/api.js';
|
|
9
9
|
import type { PluginLogger } from './polyglot/node/plugins/logger.js';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
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
2
|
import { CameraPrebufferInterface } from './interfaces/prebuffer.js';
|
|
6
3
|
import { CameraPTZInterface } from './interfaces/ptz.js';
|
|
7
4
|
import type { Camera } from '../api/database/types.js';
|
|
8
5
|
import type { ProxyServer } from '../nats/index.js';
|
|
9
6
|
import type { IceServer } from '../services/config/types.js';
|
|
10
|
-
import type { BaseLogger, CameraConfigInputSettings, CameraSource, SetValues } from './types.js';
|
|
7
|
+
import type { BaseLogger, CameraConfigInputSettings, CameraDelegate, CameraSource, SetValues } from './types.js';
|
|
11
8
|
export declare class CameraController extends BaseCameraDevice {
|
|
12
9
|
proxy: ProxyServer;
|
|
13
10
|
private motionTimeout?;
|
|
@@ -16,11 +13,9 @@ export declare class CameraController extends BaseCameraDevice {
|
|
|
16
13
|
private doorbellTimeout?;
|
|
17
14
|
private doorbellTimeoutDuration;
|
|
18
15
|
private prebufferStateSubscriptions;
|
|
16
|
+
cameraDelegate: CameraDelegate;
|
|
19
17
|
protected prebufferDelegate: CameraPrebufferInterface;
|
|
20
18
|
ptzDelegate: CameraPTZInterface;
|
|
21
|
-
audioDetectorDelegate: CameraAudioDetectionInterface;
|
|
22
|
-
motionDetectorDelegate: CameraMotionDetectionInterface;
|
|
23
|
-
objectDetectorDelegate: CameraObjectDetectionInterface;
|
|
24
19
|
get camera(): Camera;
|
|
25
20
|
get sources(): CameraSource[];
|
|
26
21
|
constructor(camera: Camera, logger: BaseLogger, proxy: ProxyServer);
|
|
@@ -41,5 +36,6 @@ export declare class CameraController extends BaseCameraDevice {
|
|
|
41
36
|
private subscribeToObjectState;
|
|
42
37
|
private subscribeToDoorbellState;
|
|
43
38
|
private triggerProxyEvent;
|
|
39
|
+
private proxyRequest;
|
|
44
40
|
private isCameraEvent;
|
|
45
41
|
}
|
|
@@ -4,7 +4,7 @@ import type { Observable, Subscription } from 'rxjs';
|
|
|
4
4
|
import type { Camera, CameraActivitySettings, CameraFrameWorkerSettings, CameraInformation, CameraType } from '../api/database/types.js';
|
|
5
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,
|
|
7
|
+
import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraConfigInputSettings, CameraDelegate, 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,11 +38,9 @@ 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
|
+
abstract cameraDelegate: CameraDelegate;
|
|
41
42
|
protected abstract prebufferDelegate: CameraPrebufferDelegate;
|
|
42
43
|
abstract ptzDelegate: CameraPTZDelegate;
|
|
43
|
-
abstract motionDetectorDelegate: CameraMotionDetectionDelegate;
|
|
44
|
-
abstract audioDetectorDelegate: CameraAudioDetectionDelegate;
|
|
45
|
-
abstract objectDetectorDelegate: CameraObjectDetectionDelegate;
|
|
46
44
|
protected get cameraObject(): Camera;
|
|
47
45
|
get id(): string;
|
|
48
46
|
get nativeId(): string | undefined;
|
|
@@ -67,9 +65,10 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
67
65
|
get frameWorkerSettings(): CameraFrameWorkerSettings;
|
|
68
66
|
get sources(): CameraSource[];
|
|
69
67
|
get streamSource(): CameraSource;
|
|
70
|
-
get snapshotSource(): CameraSource;
|
|
71
|
-
get
|
|
72
|
-
get
|
|
68
|
+
get snapshotSource(): CameraSource | undefined;
|
|
69
|
+
get highResolutionSource(): CameraSource | undefined;
|
|
70
|
+
get midResolutionSource(): CameraSource | undefined;
|
|
71
|
+
get lowResolutionSource(): CameraSource | undefined;
|
|
73
72
|
constructor(camera: Camera, logger: BaseLogger);
|
|
74
73
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
75
74
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { CameraDelegate } from '../types.js';
|
|
2
|
-
import type { CameraDeviceProxy } from '../../polyglot/node/plugins/proxy/cameraDevice.js';
|
|
3
2
|
import type { BaseLogger } from '../types.js';
|
|
4
3
|
export declare class CameraInterface extends CameraDelegate {
|
|
5
4
|
delegate?: CameraDelegate;
|
|
6
|
-
private
|
|
7
|
-
private cameraDevice;
|
|
5
|
+
private onRequest;
|
|
8
6
|
private logger;
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
|
+
snapshot(): Promise<ArrayBuffer>;
|
|
9
|
+
reboot(): Promise<void>;
|
|
10
|
+
private _onRequest;
|
|
19
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CameraPrebufferDelegate } from '../types.js';
|
|
2
|
-
import type { BaseLogger, Container, StreamInfo } from '../types.js';
|
|
2
|
+
import type { BaseLogger, Container, PrebufferState, StreamInfo } from '../types.js';
|
|
3
3
|
export declare class CameraPrebufferInterface extends CameraPrebufferDelegate {
|
|
4
4
|
delegate?: CameraPrebufferDelegate;
|
|
5
5
|
private onRequest;
|
|
6
6
|
private logger;
|
|
7
|
-
constructor(onRequest: (client: any, fn: string, args?:
|
|
7
|
+
constructor(onRequest: (client: any, fn: string, args?: any[], timeout?: number) => Promise<any>, logger: BaseLogger);
|
|
8
8
|
getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
9
|
-
updatePrebufferState(sourceId: string, container: Container, state:
|
|
9
|
+
updatePrebufferState(sourceId: string, container: Container, state: PrebufferState): Promise<void>;
|
|
10
10
|
private _onRequest;
|
|
11
11
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
2
|
import type { CameraInformation, CameraInput, CameraInputSettings, Point, ZoneFilter, ZoneType } from '../api/database/types.js';
|
|
3
3
|
import type { FrameData, FrameMetadata } from '../decoder/types.js';
|
|
4
|
-
import type { CameraAudioDetectionInterface } from './interfaces/audioDetection.js';
|
|
5
4
|
import type { CameraInterface } from './interfaces/camera.js';
|
|
6
|
-
import type { CameraMotionDetectionInterface } from './interfaces/motionDetection.js';
|
|
7
|
-
import type { CameraObjectDetectionInterface } from './interfaces/objectDetection.js';
|
|
8
5
|
import type { CameraPrebufferInterface } from './interfaces/prebuffer.js';
|
|
9
6
|
import type { CameraPTZInterface } from './interfaces/ptz.js';
|
|
10
7
|
export interface BaseLogger {
|
|
@@ -90,8 +87,7 @@ export interface BaseCameraConfig {
|
|
|
90
87
|
disabled?: boolean;
|
|
91
88
|
info?: Partial<CameraInformation>;
|
|
92
89
|
}
|
|
93
|
-
export interface CameraConfigInputSettings extends Omit<CameraInputSettings, '_id'
|
|
94
|
-
urls?: string[];
|
|
90
|
+
export interface CameraConfigInputSettings extends Omit<CameraInputSettings, '_id'> {
|
|
95
91
|
}
|
|
96
92
|
export type CameraConfig = BaseCameraConfig & {
|
|
97
93
|
sources: CameraConfigInputSettings[];
|
|
@@ -183,11 +179,8 @@ export type StateValue<T extends keyof StateValues> = StateValues[T];
|
|
|
183
179
|
export type SetValue<T extends keyof SetValues> = SetValues[T];
|
|
184
180
|
export type OnChangeCallback<T extends keyof StateValues> = (newEvent: StateValues[T], oldEvent: StateValues[T]) => void;
|
|
185
181
|
export declare abstract class CameraDelegate {
|
|
186
|
-
abstract
|
|
187
|
-
abstract
|
|
188
|
-
abstract stopStream(requestId: string, sourceName: string): Promise<void>;
|
|
189
|
-
abstract onTalkbackSdp(requestId: string, sourceName: string, sdp: string, codec: 'PCMU' | 'PCMA' | 'opus'): void;
|
|
190
|
-
abstract onTalkbackRtp(requestId: string, sourceName: string, rtp: Buffer): void;
|
|
182
|
+
abstract snapshot(): Promise<ArrayBuffer>;
|
|
183
|
+
abstract reboot(): Promise<void>;
|
|
191
184
|
}
|
|
192
185
|
export declare abstract class CameraPrebufferDelegate {
|
|
193
186
|
abstract getStreamInfo(sourceName: string): Promise<StreamInfo | undefined>;
|
|
@@ -198,28 +191,13 @@ export declare abstract class CameraPTZDelegate {
|
|
|
198
191
|
abstract moveContinuous(pan: number, tilt: number, zoom: number): Promise<void>;
|
|
199
192
|
abstract stop(): Promise<void>;
|
|
200
193
|
}
|
|
201
|
-
export declare abstract class CameraMotionDetectionDelegate {
|
|
202
|
-
abstract detectImage(image: Buffer): Promise<Detection[]>;
|
|
203
|
-
}
|
|
204
|
-
export declare abstract class CameraObjectDetectionDelegate {
|
|
205
|
-
abstract detectImage(image: Buffer): Promise<Detection[]>;
|
|
206
|
-
}
|
|
207
|
-
export declare abstract class CameraAudioDetectionDelegate {
|
|
208
|
-
abstract detectAudio(audio: Buffer): Promise<boolean>;
|
|
209
|
-
}
|
|
210
194
|
export interface CameraInterfaces {
|
|
211
195
|
readonly cameraDelegate: CameraInterface;
|
|
212
196
|
readonly prebufferDelegate: CameraPrebufferInterface;
|
|
213
197
|
readonly ptzDelegate: CameraPTZInterface;
|
|
214
|
-
readonly motionDetectorDelegate: CameraMotionDetectionInterface;
|
|
215
|
-
readonly objectDetectorDelegate: CameraObjectDetectionInterface;
|
|
216
|
-
readonly audioDetectorDelegate: CameraAudioDetectionInterface;
|
|
217
198
|
}
|
|
218
199
|
export interface CameraDelegates {
|
|
219
200
|
readonly cameraDelegate: CameraDelegate;
|
|
220
201
|
readonly prebufferDelegate: CameraPrebufferDelegate;
|
|
221
202
|
readonly ptzDelegate: CameraPTZDelegate;
|
|
222
|
-
readonly motionDetectorDelegate: CameraMotionDetectionDelegate;
|
|
223
|
-
readonly objectDetectorDelegate: CameraObjectDetectionDelegate;
|
|
224
|
-
readonly audioDetectorDelegate: CameraAudioDetectionDelegate;
|
|
225
203
|
}
|
|
@@ -2,6 +2,15 @@ import type { ChildProcess } from 'node:child_process';
|
|
|
2
2
|
import type { Sharp } from 'sharp';
|
|
3
3
|
import type { MotionState } from '../camera/types.js';
|
|
4
4
|
export type DecoderFormat = 'yuv' | 'rgb';
|
|
5
|
+
export interface ImageMetadata {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AudioMetadata {
|
|
10
|
+
channels: number;
|
|
11
|
+
sampleRate: number;
|
|
12
|
+
format: string;
|
|
13
|
+
}
|
|
5
14
|
export interface FrameMetadata {
|
|
6
15
|
format: DecoderFormat;
|
|
7
16
|
frameSize: number;
|
|
@@ -30,7 +39,7 @@ export interface ImageOptions {
|
|
|
30
39
|
crop?: ImageCrop;
|
|
31
40
|
resize?: ImageResize;
|
|
32
41
|
}
|
|
33
|
-
export interface
|
|
42
|
+
export interface ProcessPrebufferedImageRequest {
|
|
34
43
|
frameData: FrameData;
|
|
35
44
|
metadata: FrameMetadata;
|
|
36
45
|
options: ImageOptions;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { CameraDeviceProxy } from './proxy/cameraDevice.js';
|
|
2
|
-
import { DeviceManagerProxy
|
|
2
|
+
import { DeviceManagerProxy } from './proxy/index.js';
|
|
3
3
|
import { NatsServer } from './server.js';
|
|
4
4
|
import type { NatsConnection, Subscription } from 'nats';
|
|
5
5
|
import type { StateValues } from '../camera/types.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { CameraStorage } from '../polyglot/node/plugins/cameraStorage.js';
|
|
7
|
+
import type { MethodKeys, MethodType } from '../types.js';
|
|
8
|
+
import type { CameraDeviceListenerMessagePayload, DeviceManagerProxyEvents, PluginMap, ProxyAuth } from './types.js';
|
|
7
9
|
import type { WebsocketProxy } from './websocket.js';
|
|
8
10
|
export declare class ProxyServer {
|
|
9
11
|
private api;
|
|
10
12
|
private logger;
|
|
11
13
|
deviceManagerProxy?: DeviceManagerProxy;
|
|
12
|
-
pluginsManagerProxy?: PluginsManagerProxy;
|
|
13
|
-
systemManagerProxy?: SystemManagerProxy;
|
|
14
14
|
cameraDeviceProxy?: CameraDeviceProxy;
|
|
15
15
|
websocketProxy?: WebsocketProxy;
|
|
16
16
|
server: NatsServer;
|
|
17
17
|
publisher?: NatsConnection;
|
|
18
18
|
subscriber?: Subscription;
|
|
19
|
+
private pluginsService?;
|
|
19
20
|
private messageQueue?;
|
|
20
21
|
private initialized;
|
|
21
22
|
auth: ProxyAuth;
|
|
@@ -23,12 +24,12 @@ export declare class ProxyServer {
|
|
|
23
24
|
initialize(): Promise<void>;
|
|
24
25
|
close(): Promise<void>;
|
|
25
26
|
publishDeviceManagerEvent<K extends keyof DeviceManagerProxyEvents>(targetId: string, type: K, data: DeviceManagerProxyEvents[K]): void;
|
|
26
|
-
publishSystemManagerEvent<K extends keyof SystemManagerProxyEvents>(targetId: string, type: K, data: SystemManagerProxyEvents[K]): void;
|
|
27
|
-
publishPluginsManagerEvent<K extends keyof PluginsManagerProxyEvents>(targetId: string, type: K, data: PluginsManagerProxyEvents[K]): void;
|
|
28
27
|
publishCameraEvent<K extends keyof StateValues>(cameraId: string, stateName: K, data: {
|
|
29
28
|
newEvent: StateValues[K];
|
|
30
29
|
oldEvent: StateValues[K];
|
|
31
30
|
}, targetId?: string): void;
|
|
32
31
|
publishCameraEvent(cameraId: string, type: CameraDeviceListenerMessagePayload['type'], data?: any, targetId?: string): void;
|
|
32
|
+
requestPluginFn<T extends keyof PluginMap, K extends MethodKeys<PluginMap[T]>>(pluginType: T, pluginId: string, fn: K, args: Parameters<MethodType<PluginMap[T], K>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<PluginMap[T], K>>>>;
|
|
33
|
+
requestStorageFn<T extends MethodKeys<CameraStorage>>(pluginId: string, cameraId: string, fn: T, args: Parameters<MethodType<CameraStorage, T>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<CameraStorage, T>>>>;
|
|
33
34
|
private isCameraState;
|
|
34
35
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import type { Camera } from '../../api/database/types.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { CameraInterface } from '../../camera/interfaces/camera.js';
|
|
4
|
-
import type { CameraMotionDetectionInterface } from '../../camera/interfaces/motionDetection.js';
|
|
5
|
-
import type { CameraObjectDetectionInterface } from '../../camera/interfaces/objectDetection.js';
|
|
6
|
-
import type { CameraPrebufferInterface } from '../../camera/interfaces/prebuffer.js';
|
|
7
|
-
import type { CameraPTZInterface } from '../../camera/interfaces/ptz.js';
|
|
8
|
-
import type { CameraConfigInputSettings, Container, PrebufferState, SetValues, StateValues } from '../../camera/types.js';
|
|
2
|
+
import type { CameraConfigInputSettings, CameraInterfaces, Container, PrebufferState, SetValues, StateValues } from '../../camera/types.js';
|
|
9
3
|
import type { IceServer } from '../../services/config/types.js';
|
|
10
4
|
import type { MethodKeys, MethodType } from '../../types.js';
|
|
11
|
-
import type { MessageQueue } from '../
|
|
5
|
+
import type { MessageQueue } from '../messageQueue.js';
|
|
12
6
|
import type { CameraDeviceProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
13
7
|
export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
14
8
|
private api;
|
|
@@ -17,58 +11,20 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
|
|
|
17
11
|
private pluginsService;
|
|
18
12
|
private messageQueue;
|
|
19
13
|
constructor(messageQueue: MessageQueue);
|
|
20
|
-
connect(
|
|
21
|
-
|
|
22
|
-
pluginId: string;
|
|
23
|
-
}): void;
|
|
24
|
-
disconnect(data: {
|
|
25
|
-
cameraId: string;
|
|
26
|
-
pluginId: string;
|
|
27
|
-
}): void;
|
|
14
|
+
connect(cameraId: string, pluginId: string): void;
|
|
15
|
+
disconnect(cameraId: string, pluginId: string): void;
|
|
28
16
|
getFfmpegPath(): string;
|
|
29
17
|
getIceServers(): IceServer[];
|
|
30
|
-
updateState<T extends keyof SetValues>(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
updatePrebufferState(data: {
|
|
37
|
-
sourceId: string;
|
|
38
|
-
container: Container;
|
|
39
|
-
state: PrebufferState;
|
|
40
|
-
cameraId: string;
|
|
41
|
-
pluginId: string;
|
|
42
|
-
}): Promise<void>;
|
|
43
|
-
addCameraSource(data: {
|
|
44
|
-
source: CameraConfigInputSettings;
|
|
45
|
-
cameraId: string;
|
|
46
|
-
pluginId: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
updateCameraSource(data: {
|
|
49
|
-
id: string;
|
|
50
|
-
source: Partial<CameraConfigInputSettings>;
|
|
51
|
-
cameraId: string;
|
|
52
|
-
pluginId: string;
|
|
53
|
-
}): Promise<void>;
|
|
54
|
-
removeCameraSource(data: {
|
|
55
|
-
id: string;
|
|
56
|
-
cameraId: string;
|
|
57
|
-
pluginId: string;
|
|
58
|
-
}): Promise<void>;
|
|
59
|
-
refreshStates(data: {
|
|
60
|
-
cameraId: string;
|
|
61
|
-
pluginId: string;
|
|
62
|
-
}): {
|
|
18
|
+
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], cameraId: string, pluginId: string): Promise<void>;
|
|
19
|
+
updatePrebufferState(sourceId: string, container: Container, state: PrebufferState, cameraId: string, pluginId: string): Promise<void>;
|
|
20
|
+
addCameraSource(source: CameraConfigInputSettings, cameraId: string, pluginId: string): Promise<void>;
|
|
21
|
+
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>, cameraId: string, pluginId: string): Promise<void>;
|
|
22
|
+
removeCameraSource(sourceId: string, cameraId: string, pluginId: string): Promise<void>;
|
|
23
|
+
refreshStates(cameraId: string): {
|
|
63
24
|
camera: Camera;
|
|
64
25
|
states: StateValues;
|
|
65
26
|
cameraState: boolean;
|
|
66
27
|
};
|
|
67
|
-
onRequest<T extends MethodKeys<
|
|
68
|
-
onRequest<T extends MethodKeys<CameraPrebufferInterface>>(delegateType: 'prebufferDelegate', cameraId: string, fn: T, ...args: Parameters<MethodType<CameraPrebufferInterface, T>>): Promise<ReturnType<MethodType<CameraPrebufferInterface, T>>>;
|
|
69
|
-
onRequest<T extends MethodKeys<CameraPTZInterface>>(delegateType: 'ptzDelegate', cameraId: string, fn: T, ...args: Parameters<MethodType<CameraPTZInterface, T>>): Promise<ReturnType<MethodType<CameraPTZInterface, T>>>;
|
|
70
|
-
onRequest<T extends MethodKeys<CameraMotionDetectionInterface>>(delegateType: 'motionDetectorDelegate', cameraId: string, fn: T, ...args: Parameters<MethodType<CameraMotionDetectionInterface, T>>): Promise<ReturnType<MethodType<CameraMotionDetectionInterface, T>>>;
|
|
71
|
-
onRequest<T extends MethodKeys<CameraObjectDetectionInterface>>(delegateType: 'objectDetectorDelegate', cameraId: string, fn: T, ...args: Parameters<MethodType<CameraObjectDetectionInterface, T>>): Promise<ReturnType<MethodType<CameraObjectDetectionInterface, T>>>;
|
|
72
|
-
onRequest<T extends MethodKeys<CameraAudioDetectionInterface>>(delegateType: 'audioDetectorDelegate', cameraId: string, fn: T, ...args: Parameters<MethodType<CameraAudioDetectionInterface, T>>): Promise<ReturnType<MethodType<CameraAudioDetectionInterface, T>>>;
|
|
28
|
+
onRequest<T extends keyof CameraInterfaces, K extends MethodKeys<CameraInterfaces[T]>>(cameraId: string, client: T, fn: K, ...args: Parameters<MethodType<CameraInterfaces[T], K>>): Promise<Awaited<ReturnType<MethodType<CameraInterfaces[T], K>>>>;
|
|
73
29
|
handleMessage(message: ProxyMessageStructure): Promise<void | ProxyMessageStructure>;
|
|
74
30
|
}
|
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
import type { Camera } from '../../api/database/types.js';
|
|
2
2
|
import type { CameraConfig } from '../../camera/types.js';
|
|
3
|
-
import type { MessageQueue } from '../
|
|
3
|
+
import type { MessageQueue } from '../messageQueue.js';
|
|
4
4
|
import type { DeviceManagerServerProxyMethods, ProxyMessageStructure } from '../types.js';
|
|
5
5
|
export declare class DeviceManagerProxy implements DeviceManagerServerProxyMethods {
|
|
6
6
|
private camerasService;
|
|
7
7
|
private pluginsService;
|
|
8
8
|
private messageQueue;
|
|
9
9
|
constructor(messageQueue: MessageQueue);
|
|
10
|
-
getCameraByName(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
id: string;
|
|
16
|
-
pluginId: string;
|
|
17
|
-
}): Camera | void;
|
|
18
|
-
createCamera(data: {
|
|
19
|
-
camera: CameraConfig;
|
|
20
|
-
pluginId: string;
|
|
21
|
-
}): Promise<Camera>;
|
|
22
|
-
removeCameraByName(data: {
|
|
23
|
-
name: string;
|
|
24
|
-
pluginId: string;
|
|
25
|
-
}): Promise<void>;
|
|
26
|
-
removeCameraById(data: {
|
|
27
|
-
id: string;
|
|
28
|
-
pluginId: string;
|
|
29
|
-
}): Promise<void>;
|
|
10
|
+
getCameraByName(cameraName: string, pluginId: string): Camera | undefined;
|
|
11
|
+
getCameraById(cameraId: string, pluginId: string): Camera | void;
|
|
12
|
+
createCamera(cameraConfig: CameraConfig, pluginId: string): Promise<Camera>;
|
|
13
|
+
removeCameraByName(cameraName: string, pluginId: string): Promise<void>;
|
|
14
|
+
removeCameraById(cameraId: string, pluginId: string): Promise<void>;
|
|
30
15
|
handleMessage(message: ProxyMessageStructure): Promise<void | ProxyMessageStructure>;
|
|
31
16
|
}
|