@camera.ui/browser 0.0.104 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -2
- package/dist/types/packages/client/browser/src/types.d.ts +1 -1
- package/dist/types/packages/plugineer/src/polyglot/node/camera/index.d.ts +3 -3
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +2 -2
- package/dist/types/packages/types/src/index.d.ts +73 -23
- package/dist/types/server/src/api/controllers/api.controller.d.ts +7 -0
- package/dist/types/server/src/api/controllers/auth.controller.d.ts +16 -0
- package/dist/types/server/src/api/controllers/backup.controller.d.ts +10 -0
- package/dist/types/server/src/api/controllers/cameras.controller.d.ts +38 -0
- package/dist/types/server/src/api/controllers/config.controller.d.ts +14 -0
- package/dist/types/server/src/api/controllers/files.controller.d.ts +8 -0
- package/dist/types/server/src/api/controllers/frameWorkers.controller.d.ts +11 -0
- package/dist/types/server/src/api/controllers/plugins.controller.d.ts +48 -0
- package/dist/types/server/src/api/controllers/system.controller.d.ts +23 -0
- package/dist/types/server/src/api/controllers/users.controller.d.ts +28 -0
- package/dist/types/server/src/api/database/index.d.ts +1 -1
- package/dist/types/server/src/api/database/types.d.ts +0 -4
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +2 -1
- package/dist/types/server/src/api/go2rtc/types.d.ts +6 -6
- package/dist/types/server/src/api/index.d.ts +22 -0
- package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +5 -0
- package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +4 -0
- package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +3 -0
- package/dist/types/server/src/api/plugins/header.plugin.d.ts +2 -0
- package/dist/types/server/src/api/plugins/socket.plugin.d.ts +11 -0
- package/dist/types/server/src/api/plugins/system.plugin.d.ts +20 -0
- package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +8 -0
- package/dist/types/server/src/api/routes/api.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/auth.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/backup.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/cameras.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/config.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/files.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/frameWorkers.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/index.d.ts +6 -0
- package/dist/types/server/src/api/routes/plugins.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/system.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/users.routes.d.ts +2 -0
- package/dist/types/server/src/api/schemas/backup.schema.d.ts +94 -1
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +16 -16
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +4 -4
- package/dist/types/server/src/api/schemas/plugins.schema.d.ts +3 -3
- package/dist/types/server/src/api/schemas/system.schema.d.ts +8 -0
- package/dist/types/server/src/api/schemas/users.schema.d.ts +35 -35
- package/dist/types/server/src/api/services/backup.service.d.ts +11 -0
- package/dist/types/server/src/api/services/cameras.service.d.ts +2 -4
- package/dist/types/server/src/api/services/plugins.service.d.ts +16 -4
- package/dist/types/server/src/api/services/system.service.d.ts +6 -0
- package/dist/types/server/src/api/types/index.d.ts +18 -0
- package/dist/types/server/src/api/utils/cameraSource.d.ts +6 -2
- package/dist/types/server/src/api/utils/cert.d.ts +11 -0
- package/dist/types/server/src/api/utils/fetch.d.ts +1 -2
- package/dist/types/server/src/api/utils/moveFiles.d.ts +4 -0
- package/dist/types/server/src/api/utils/parse.d.ts +1 -1
- package/dist/types/server/src/api/websocket/nsp/logs.d.ts +3 -1
- package/dist/types/server/src/api/websocket/nsp/main.d.ts +2 -0
- package/dist/types/server/src/camera/controller.d.ts +8 -11
- package/dist/types/server/src/camera/frameWorker.d.ts +1 -1
- package/dist/types/server/src/main.d.ts +25 -0
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +2 -2
- package/dist/types/server/src/plugins/index.d.ts +3 -2
- package/dist/types/server/src/services/config/constants.d.ts +0 -1
- package/dist/types/server/src/services/config/index.d.ts +3 -1
- package/dist/types/server/src/services/config/types.d.ts +1 -2
- package/dist/types/server/src/types.d.ts +24 -0
- package/package.json +9 -9
- package/eslint.config.js +0 -89
|
@@ -18,14 +18,13 @@ export declare class CameraDeviceProxy extends BaseCameraDevice implements Camer
|
|
|
18
18
|
protected prebufferDelegate: CameraPrebufferInterface;
|
|
19
19
|
get sources(): CameraSource[];
|
|
20
20
|
get internalSources(): CameraInternalSource[];
|
|
21
|
-
private get _sources();
|
|
22
21
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
23
22
|
start(): Promise<void>;
|
|
24
23
|
stop(): void;
|
|
25
24
|
close(): void;
|
|
26
25
|
connect(): Promise<void>;
|
|
27
26
|
disconnect(): Promise<void>;
|
|
28
|
-
|
|
27
|
+
createWebRTCSession(options: Go2RTCSessionOptions): Go2RTCSession;
|
|
29
28
|
refreshStates(): Promise<void>;
|
|
30
29
|
cleanup(): Promise<void>;
|
|
31
30
|
private listenToMessages;
|
|
@@ -23,7 +23,7 @@ export interface CameraDevice extends BaseCameraDevice {
|
|
|
23
23
|
start(): Promise<void>;
|
|
24
24
|
stop(): void;
|
|
25
25
|
close(): void;
|
|
26
|
-
|
|
26
|
+
createWebRTCSession(options: Go2RTCSessionOptions): Go2RTCSession;
|
|
27
27
|
}
|
|
28
28
|
export interface Go2RTCSessionOptions {
|
|
29
29
|
sourceName: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subscribed } from '@camera.ui/common/utils';
|
|
2
2
|
import TTLCache from '@isaacs/ttlcache';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import type { AudioSetEvent, AudioState, BatterySetEvent, BatteryState, Camera, CameraActivitySettings, CameraDelegate, CameraFrameWorkerSettings, CameraInformation, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, CameraType, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, LoggerService, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, SirenSetEvent, SirenState, StateValues } from '@camera.ui/types';
|
|
4
|
+
import type { AudioSetEvent, AudioState, BatterySetEvent, BatteryState, Camera, CameraActivitySettings, CameraDelegate, CameraFrameWorkerSettings, CameraInformation, CameraInput, CameraInternalSource, CameraPTZDelegate, CameraPrebufferDelegate, CameraSource, CameraType, DetectionZone, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, LoggerService, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, SirenSetEvent, SirenState, StateValues } from '@camera.ui/types';
|
|
5
5
|
import type { Observable } from 'rxjs';
|
|
6
6
|
export declare abstract class BaseCameraDevice extends Subscribed {
|
|
7
7
|
readonly logger: LoggerService;
|
|
@@ -51,13 +51,13 @@ export declare abstract class BaseCameraDevice extends Subscribed {
|
|
|
51
51
|
get activitySettings(): CameraActivitySettings;
|
|
52
52
|
get frameWorkerSettings(): CameraFrameWorkerSettings;
|
|
53
53
|
get streamSource(): CameraSource;
|
|
54
|
-
get snapshotSource():
|
|
54
|
+
get snapshotSource(): CameraInput | undefined;
|
|
55
55
|
get highResolutionSource(): CameraSource | undefined;
|
|
56
56
|
get midResolutionSource(): CameraSource | undefined;
|
|
57
57
|
get lowResolutionSource(): CameraSource | undefined;
|
|
58
58
|
get ptz(): CameraPTZDelegate;
|
|
59
59
|
abstract get sources(): CameraSource[];
|
|
60
|
-
abstract get internalSources():
|
|
60
|
+
abstract get internalSources(): CameraInternalSource[];
|
|
61
61
|
constructor(camera: Camera, logger: LoggerService);
|
|
62
62
|
protected abstract cleanup(): void;
|
|
63
63
|
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Camera, CameraConfigInputSettings, CameraDevice, CameraExtension, ProbeStream, SetValues, StateValues } from '@camera.ui/types';
|
|
1
|
+
import type { Camera, CameraConfigInputSettings, CameraDevice, CameraExtension, ProbeConfig, ProbeStream, SetValues, StateValues } from '@camera.ui/types';
|
|
2
2
|
export interface ProcessLoadMessage {
|
|
3
3
|
cameras: Camera[];
|
|
4
4
|
plugin: PluginInfo;
|
|
@@ -126,7 +126,7 @@ export interface CameraDeviceProxyMethods {
|
|
|
126
126
|
addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
127
127
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
128
128
|
removeCameraSource(sourceId: string): Promise<void>;
|
|
129
|
-
probeStream(sourceId: string, refresh: boolean): Promise<ProbeStream | undefined>;
|
|
129
|
+
probeStream(sourceId: string, probeConfig: ProbeConfig | undefined, refresh: boolean): Promise<ProbeStream | undefined>;
|
|
130
130
|
}
|
|
131
131
|
export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
132
132
|
stateName: K;
|
|
@@ -95,31 +95,48 @@ export interface PrebufferState {
|
|
|
95
95
|
url?: string;
|
|
96
96
|
duration?: number;
|
|
97
97
|
}
|
|
98
|
+
export interface RTPInfo {
|
|
99
|
+
payload?: number;
|
|
100
|
+
codec: string;
|
|
101
|
+
rate?: number | undefined;
|
|
102
|
+
encoding?: number | undefined;
|
|
103
|
+
}
|
|
104
|
+
export interface FMTPInfo {
|
|
105
|
+
payload: number;
|
|
106
|
+
config: string;
|
|
107
|
+
}
|
|
98
108
|
export interface AudioCodecProperties {
|
|
99
109
|
sampleRate: number;
|
|
100
110
|
channels: number;
|
|
101
111
|
payloadType: number;
|
|
112
|
+
fmtpInfo?: FMTPInfo;
|
|
102
113
|
}
|
|
103
114
|
export interface VideoCodecProperties {
|
|
104
115
|
clockRate: number;
|
|
105
116
|
payloadType: number;
|
|
117
|
+
fmtpInfo?: FMTPInfo;
|
|
106
118
|
}
|
|
107
119
|
export interface AudioStreamInfo {
|
|
108
120
|
codec: AudioCodec;
|
|
109
121
|
ffmpegCodec: AudioFFmpegCodec;
|
|
110
122
|
properties: AudioCodecProperties;
|
|
111
|
-
direction: 'sendonly' | 'recvonly';
|
|
123
|
+
direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
|
|
112
124
|
}
|
|
113
125
|
export interface VideoStreamInfo {
|
|
114
126
|
codec: VideoCodec;
|
|
115
127
|
ffmpegCodec: VideoFFmpegCodec;
|
|
116
128
|
properties: VideoCodecProperties;
|
|
117
|
-
direction: 'sendonly';
|
|
129
|
+
direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
|
|
130
|
+
}
|
|
131
|
+
export interface ProbeConfig {
|
|
132
|
+
video?: VideoCodec;
|
|
133
|
+
audio?: AudioCodec;
|
|
134
|
+
microphone?: AudioCodec;
|
|
118
135
|
}
|
|
119
136
|
export interface ProbeStream {
|
|
120
137
|
sdp: string;
|
|
121
138
|
audio: AudioStreamInfo[];
|
|
122
|
-
video: VideoStreamInfo;
|
|
139
|
+
video: VideoStreamInfo[];
|
|
123
140
|
}
|
|
124
141
|
export interface StreamUrls {
|
|
125
142
|
ws: Go2RtcWSSource;
|
|
@@ -127,8 +144,13 @@ export interface StreamUrls {
|
|
|
127
144
|
www: Go2RtcEndpoint;
|
|
128
145
|
}
|
|
129
146
|
export interface Go2RtcRTSPSource {
|
|
130
|
-
single: string;
|
|
131
147
|
default: string;
|
|
148
|
+
defaultMicrophone: string;
|
|
149
|
+
h264: string;
|
|
150
|
+
h265: string;
|
|
151
|
+
aac: string;
|
|
152
|
+
opus: string;
|
|
153
|
+
pcma: string;
|
|
132
154
|
mp4: string;
|
|
133
155
|
}
|
|
134
156
|
export interface Go2RtcEndpoint {
|
|
@@ -158,7 +180,7 @@ export interface BaseState<T extends LightState | AudioState | MotionState | Obj
|
|
|
158
180
|
lastEvent?: Omit<T, 'lastEvent'>;
|
|
159
181
|
}
|
|
160
182
|
export interface MotionSetEvent {
|
|
161
|
-
state
|
|
183
|
+
state: boolean;
|
|
162
184
|
detections: Detection[];
|
|
163
185
|
}
|
|
164
186
|
export interface AudioSetEvent {
|
|
@@ -305,22 +327,34 @@ export interface CameraDelegates {
|
|
|
305
327
|
prebufferDelegate: CameraPrebufferDelegate;
|
|
306
328
|
ptzDelegate: CameraPTZDelegate;
|
|
307
329
|
}
|
|
308
|
-
export
|
|
330
|
+
export type InternalSourceType = 'aac' | 'opus' | 'pcma';
|
|
331
|
+
export interface CameraBaseSource extends CameraInput {
|
|
332
|
+
probeStream(probeConfig?: ProbeConfig, refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
333
|
+
}
|
|
334
|
+
export interface CameraSource extends CameraBaseSource {
|
|
335
|
+
getInternalSource(type: InternalSourceType): CameraInternalSource;
|
|
309
336
|
getPrebufferingState(container: Container): Promise<PrebufferState | undefined>;
|
|
310
|
-
probeStream(refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
311
337
|
}
|
|
312
|
-
export interface CameraInternalSource extends
|
|
313
|
-
type:
|
|
338
|
+
export interface CameraInternalSource extends CameraBaseSource {
|
|
339
|
+
type: InternalSourceType;
|
|
314
340
|
}
|
|
315
341
|
export interface CameraDeviceSource extends CameraSource {
|
|
316
|
-
|
|
342
|
+
getInternalSource(type: InternalSourceType): CameraDeviceInternalSource;
|
|
343
|
+
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
344
|
+
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
317
345
|
}
|
|
318
|
-
export interface CameraDeviceInternalSource extends
|
|
346
|
+
export interface CameraDeviceInternalSource extends CameraBaseSource {
|
|
347
|
+
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
348
|
+
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
349
|
+
type: InternalSourceType;
|
|
319
350
|
}
|
|
320
|
-
export interface
|
|
351
|
+
export interface WebRTCConnectionOptions {
|
|
321
352
|
createPeerConnection?: () => BasicPeerConnection;
|
|
322
353
|
iceServers?: IceServer[];
|
|
323
354
|
}
|
|
355
|
+
export interface RTSPConnectionOptions {
|
|
356
|
+
target?: keyof Go2RtcRTSPSource;
|
|
357
|
+
}
|
|
324
358
|
export interface Subscribed {
|
|
325
359
|
addSubscriptions(...subscriptions: Subscription[]): void;
|
|
326
360
|
addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
|
|
@@ -328,19 +362,31 @@ export interface Subscribed {
|
|
|
328
362
|
unsubscribeAdditional(): void;
|
|
329
363
|
}
|
|
330
364
|
export interface WeriftSession extends Subscribed {
|
|
365
|
+
readonly onStarted: ReplaySubject<void>;
|
|
366
|
+
readonly onError: ReplaySubject<Error>;
|
|
331
367
|
readonly onCallEnded: ReplaySubject<void>;
|
|
332
368
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
333
369
|
readonly onAudioRtp: Subject<RtpPacket>;
|
|
334
370
|
reservePort(bufferPorts?: number): Promise<number>;
|
|
335
|
-
startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
|
|
336
|
-
transcodeReturnAudio(ffmpegOptions:
|
|
337
|
-
ffmpegPath: string;
|
|
338
|
-
input: SpawnInput[];
|
|
339
|
-
}): Promise<void>;
|
|
371
|
+
startTranscoding(ffmpegOptions: FfmpegOptions, streamProbe?: ProbeStream): Promise<void>;
|
|
372
|
+
transcodeReturnAudio(ffmpegOptions: ReturnAudioFFmpegOptions, streamProbe?: ProbeStream): Promise<void>;
|
|
340
373
|
stop(): void;
|
|
341
|
-
sendAudioPacket(rtp: RtpPacket): void;
|
|
374
|
+
sendAudioPacket(rtp: RtpPacket | Buffer): void;
|
|
342
375
|
requestKeyFrame(): void;
|
|
343
376
|
}
|
|
377
|
+
export interface RTSPSession extends Subscribed {
|
|
378
|
+
readonly onStarted: ReplaySubject<void>;
|
|
379
|
+
readonly onError: ReplaySubject<Error>;
|
|
380
|
+
readonly onCallEnded: ReplaySubject<void>;
|
|
381
|
+
readonly onVideoRtp: Subject<RtpPacket>;
|
|
382
|
+
readonly onAudioRtp: Subject<RtpPacket>;
|
|
383
|
+
reservePort(bufferPorts?: number): Promise<number>;
|
|
384
|
+
startStream(): Promise<void>;
|
|
385
|
+
startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
|
|
386
|
+
transcodeReturnAudio(ffmpegOptions: ReturnAudioFFmpegOptions): Promise<void>;
|
|
387
|
+
stop(): void;
|
|
388
|
+
sendAudioPacket(rtp: RtpPacket | Buffer): void;
|
|
389
|
+
}
|
|
344
390
|
export type SpawnInput = string | number;
|
|
345
391
|
export interface FfmpegOptions {
|
|
346
392
|
ffmpegPath: string;
|
|
@@ -348,10 +394,12 @@ export interface FfmpegOptions {
|
|
|
348
394
|
video?: SpawnInput[];
|
|
349
395
|
audio?: SpawnInput[];
|
|
350
396
|
output: SpawnInput[];
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
397
|
+
logPrefix?: string;
|
|
398
|
+
}
|
|
399
|
+
export interface ReturnAudioFFmpegOptions {
|
|
400
|
+
ffmpegPath: string;
|
|
401
|
+
input: SpawnInput[];
|
|
402
|
+
logPrefix?: string;
|
|
355
403
|
}
|
|
356
404
|
export interface BasicPeerConnection {
|
|
357
405
|
createOffer(): Promise<RTCSessionDescription>;
|
|
@@ -422,7 +470,7 @@ export interface CameraDevice {
|
|
|
422
470
|
readonly highResolutionSource: CameraDeviceSource | undefined;
|
|
423
471
|
readonly midResolutionSource: CameraDeviceSource | undefined;
|
|
424
472
|
readonly lowResolutionSource: CameraDeviceSource | undefined;
|
|
425
|
-
readonly snapshotSource:
|
|
473
|
+
readonly snapshotSource: CameraInput | undefined;
|
|
426
474
|
readonly sources: CameraDeviceSource[];
|
|
427
475
|
readonly internalSources: CameraDeviceInternalSource[];
|
|
428
476
|
readonly onConnected: Observable<boolean>;
|
|
@@ -540,10 +588,12 @@ export interface JsonSchemaArray extends JsonBaseSchema {
|
|
|
540
588
|
}
|
|
541
589
|
export interface JsonSchemaButton extends JsonBaseSchema {
|
|
542
590
|
type: 'button';
|
|
591
|
+
color?: string;
|
|
543
592
|
}
|
|
544
593
|
export interface JsonSchemaObjectButton {
|
|
545
594
|
label: string;
|
|
546
595
|
onSubmit: string;
|
|
596
|
+
color?: string;
|
|
547
597
|
}
|
|
548
598
|
export interface JsonSchemaObjectWithButtons extends JsonSchemaObject {
|
|
549
599
|
buttons: JsonSchemaObjectButton[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
export declare class ApiController {
|
|
3
|
+
private app;
|
|
4
|
+
constructor(app: FastifyInstance);
|
|
5
|
+
welcome(req: FastifyRequest, reply: FastifyReply): FastifyReply;
|
|
6
|
+
health(req: FastifyRequest, reply: FastifyReply): Promise<FastifyReply>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, AuthNewLoginRequest, AuthParamsRequest, AuthRefreshRequest, AuthTokensRequest, JwtTokenClientData, JwtTokenEncoded, PaginationRequest } from '../types/index.js';
|
|
3
|
+
export declare class AuthController {
|
|
4
|
+
private app;
|
|
5
|
+
private configService;
|
|
6
|
+
private service;
|
|
7
|
+
private userService;
|
|
8
|
+
constructor(app: FastifyInstance);
|
|
9
|
+
check(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply;
|
|
10
|
+
list(req: FastifyRequest<AuthLoginRequest & AuthTokensRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | JwtTokenClientData[] | JwtTokenEncoded[];
|
|
11
|
+
login(req: FastifyRequest<AuthNewLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
12
|
+
logout(req: FastifyRequest, reply: FastifyReply): Promise<FastifyReply>;
|
|
13
|
+
logoutByToken(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
14
|
+
logoutAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
refresh(req: FastifyRequest<AuthRefreshRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, BackupCreateRequest, BackupRestoreRequest } from '../types/index.js';
|
|
3
|
+
export declare class BackupController {
|
|
4
|
+
private app;
|
|
5
|
+
private logger;
|
|
6
|
+
private service;
|
|
7
|
+
constructor(app: FastifyInstance);
|
|
8
|
+
download(req: FastifyRequest<AuthLoginRequest & BackupCreateRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
9
|
+
restore(req: FastifyRequest<AuthLoginRequest & BackupRestoreRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { DBCamera } from '../database/types.js';
|
|
3
|
+
import type { AuthLoginRequest, CameraSnapshotQueryRequest, CameraSourceParamsRequest, CameraZoneInsertPatchRequest, CameraZonesParamsRequest, CamerasExtensionsParamsRequest, CamerasExtensionsRequest, CamerasInsertRequest, CamerasParamsIdRequest, CamerasParamsRequest, CamerasPatchRequest, CamerasPreviewRequest, ExtensionsPatchRequest, ExtensionsSubmitRequest, PaginationRequest } from '../types/index.js';
|
|
4
|
+
export declare class CamerasController {
|
|
5
|
+
private app;
|
|
6
|
+
private api;
|
|
7
|
+
private go2rtcApi;
|
|
8
|
+
private configService;
|
|
9
|
+
private service;
|
|
10
|
+
private pluginsService;
|
|
11
|
+
private proxyServer;
|
|
12
|
+
constructor(app: FastifyInstance);
|
|
13
|
+
getByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
14
|
+
getZoneByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
15
|
+
insertZone(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZoneInsertPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
patchZoneByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesParamsRequest & CameraZoneInsertPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
17
|
+
removeZoneByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
18
|
+
getExtensionsByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
19
|
+
getExtensionConfigByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
20
|
+
patchExtensionConfigByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & ExtensionsPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
21
|
+
submitExtensionConfigByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & ExtensionsSubmitRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
22
|
+
probeSourceByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraSourceParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
23
|
+
getSnapshotByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraSnapshotQueryRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
24
|
+
getSnapshotById(req: FastifyRequest<AuthLoginRequest & CamerasParamsIdRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
25
|
+
insert(req: FastifyRequest<AuthLoginRequest & CamerasInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
26
|
+
preview(req: FastifyRequest<AuthLoginRequest & CamerasPreviewRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
27
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | DBCamera[];
|
|
28
|
+
patchByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CamerasPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
29
|
+
clearLog(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): FastifyReply | void;
|
|
30
|
+
downloadLog(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): FastifyReply | void;
|
|
31
|
+
enableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
32
|
+
disableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
33
|
+
addExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
34
|
+
removeExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
35
|
+
removeByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
36
|
+
removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
37
|
+
private resolvePluginName;
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, ConfigPatchRequest, ConfigRequest, Go2RtcConfigPatchRequest } from '../types/index.js';
|
|
3
|
+
export declare class ConfigController {
|
|
4
|
+
private app;
|
|
5
|
+
private configService;
|
|
6
|
+
private go2rtcApi;
|
|
7
|
+
constructor(app: FastifyInstance);
|
|
8
|
+
showConfig(req: FastifyRequest<AuthLoginRequest & ConfigRequest>, reply: FastifyReply): FastifyReply;
|
|
9
|
+
showGo2RtcConfig(req: FastifyRequest<AuthLoginRequest & ConfigRequest>, reply: FastifyReply): FastifyReply;
|
|
10
|
+
downloadConfig(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
11
|
+
downloadGo2RtcConfig(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
12
|
+
patchConfig(req: FastifyRequest<AuthLoginRequest & ConfigPatchRequest>, reply: FastifyReply): FastifyReply | void;
|
|
13
|
+
patchGo2RtcConfig(req: FastifyRequest<AuthLoginRequest & Go2RtcConfigPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, FilesParamsRequest } from '../types/index.js';
|
|
3
|
+
export declare class FilesController {
|
|
4
|
+
private app;
|
|
5
|
+
private configService;
|
|
6
|
+
constructor(app: FastifyInstance);
|
|
7
|
+
serve(req: FastifyRequest<AuthLoginRequest & FilesParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, FrameWorker, FrameWorkerParamsNameRequest, PaginationRequest } from '../types/index.js';
|
|
3
|
+
export declare class FrameWorkersController {
|
|
4
|
+
private app;
|
|
5
|
+
private api;
|
|
6
|
+
constructor(app: FastifyInstance);
|
|
7
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | FrameWorker[];
|
|
8
|
+
restartByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
9
|
+
startByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
10
|
+
stopByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, CameraUiPlugin, PaginationRequest, PluginExtension, PluginsActionRequest, PluginsConfigPatchRequest, PluginsDetectAudioRequest, PluginsDetectMotionRequest, PluginsDetectObjectRequest, PluginsInsertRequest, PluginsInterfaceQuery, PluginsParamsNameRequest, PluginsParamsRemoveRequest, PluginsQueryRequest } from '../types/index.js';
|
|
3
|
+
export declare class PluginsController {
|
|
4
|
+
private app;
|
|
5
|
+
private logger;
|
|
6
|
+
private configService;
|
|
7
|
+
private io;
|
|
8
|
+
private pluginManager;
|
|
9
|
+
private proxyServer;
|
|
10
|
+
private service;
|
|
11
|
+
private camerasService;
|
|
12
|
+
private socketService;
|
|
13
|
+
constructor(app: FastifyInstance);
|
|
14
|
+
enableByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
disableByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
getByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply;
|
|
17
|
+
getPluginUpdateByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
18
|
+
getVersionsByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
19
|
+
getChangelogByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
20
|
+
getConfigJsonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
21
|
+
getPluginLogoByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
22
|
+
getPluginSchemaByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
23
|
+
getPluginInterface(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsInterfaceQuery>, reply: FastifyReply): Promise<FastifyReply>;
|
|
24
|
+
detectObjects(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectObjectRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
25
|
+
detectAudio(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectAudioRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
26
|
+
detectMotion(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectMotionRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
27
|
+
submitActionButtonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsActionRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
28
|
+
getContractByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply;
|
|
29
|
+
getReadmeByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsQueryRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
30
|
+
getReleaseByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
31
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | CameraUiPlugin[];
|
|
32
|
+
listExtensions(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | PluginExtension[];
|
|
33
|
+
patchConfigJsonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsConfigPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
34
|
+
restartByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
35
|
+
clearLog(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply | void;
|
|
36
|
+
downloadLog(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply | void;
|
|
37
|
+
search(req: FastifyRequest<AuthLoginRequest & PluginsQueryRequest & PaginationRequest>, reply: FastifyReply): Promise<FastifyReply | CameraUiPlugin[]>;
|
|
38
|
+
startByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
39
|
+
stopByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
40
|
+
installOrUpdate(req: FastifyRequest<AuthLoginRequest & PluginsInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
41
|
+
uninstallByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
42
|
+
uninstallAll(req: FastifyRequest<AuthLoginRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
43
|
+
private getAvailablePluginVersions;
|
|
44
|
+
private getPluginFromNpm;
|
|
45
|
+
private searchNpmRegistrySingle;
|
|
46
|
+
private resolvePluginName;
|
|
47
|
+
private isScopedPlugin;
|
|
48
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, FilesParamsRequest, ServerUpdateRequest, SystemPatchRequest } from '../types/index.js';
|
|
3
|
+
export declare class SystemController {
|
|
4
|
+
private app;
|
|
5
|
+
private configService;
|
|
6
|
+
private go2rtcApi;
|
|
7
|
+
private proxy;
|
|
8
|
+
private logger;
|
|
9
|
+
private socketService;
|
|
10
|
+
private service;
|
|
11
|
+
constructor(app: FastifyInstance);
|
|
12
|
+
updateServer(req: FastifyRequest<AuthLoginRequest & ServerUpdateRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
13
|
+
systemInfo(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
14
|
+
patchSystemInfo(req: FastifyRequest<AuthLoginRequest & SystemPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
checkVersion(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
natsInfo(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
17
|
+
go2rtcInfo(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
18
|
+
clearLog(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply | void;
|
|
19
|
+
downloadLog(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply | void;
|
|
20
|
+
downloadCert(req: FastifyRequest<AuthLoginRequest & FilesParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
21
|
+
restart(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
22
|
+
restartGo2rtc(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { DBCamviewLayout, DBUser } from '../database/types.js';
|
|
3
|
+
import type { AuthLoginRequest, AuthParamsRequest, CamerasParamsRequest, PaginationRequest, ShortcutInsertRequest, ShortcutParamsRequest, ShortcutPatchRequest, UsersInsertRequest, UsersParamsRequest, UsersPatchRequest, ViewsInsertRequest, ViewsParamsRequest, ViewsPatchRequest } from '../types/index.js';
|
|
4
|
+
export declare class UsersController {
|
|
5
|
+
private app;
|
|
6
|
+
private configService;
|
|
7
|
+
private service;
|
|
8
|
+
private camerasService;
|
|
9
|
+
constructor(app: FastifyInstance);
|
|
10
|
+
insert(req: FastifyRequest<AuthLoginRequest & UsersInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
11
|
+
getByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
12
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | Partial<DBUser>[];
|
|
13
|
+
patchByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & UsersPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
14
|
+
removeByName(req: FastifyRequest<AuthLoginRequest & UsersParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
insertShortcut(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
17
|
+
getShortcutByCameraName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
18
|
+
getShortcutsByCameraName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
19
|
+
patchShortcutByCameraName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutParamsRequest & ShortcutPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
20
|
+
removeShortcutByCameraName(req: FastifyRequest<AuthLoginRequest & PaginationRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
21
|
+
removeAllShortcutsByCameraName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & CamerasParamsRequest & ShortcutParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
22
|
+
insertView(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
23
|
+
getViewById(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
24
|
+
listViews(req: FastifyRequest<AuthLoginRequest & PaginationRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): FastifyReply | Partial<DBUser>[];
|
|
25
|
+
patchViewById(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest & ViewsPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
26
|
+
removeViewById(req: FastifyRequest<AuthLoginRequest & PaginationRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | DBCamviewLayout[]>;
|
|
27
|
+
removeAllViews(req: FastifyRequest<AuthLoginRequest & PaginationRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): Promise<FastifyReply | DBCamviewLayout[]>;
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
2
2
|
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
|
|
3
3
|
export declare class Database {
|
|
4
|
-
static readonly VERSION = "1.0.
|
|
4
|
+
static readonly VERSION = "1.0.7";
|
|
5
5
|
authDB: RootDB<DBAuth, 'auth'>;
|
|
6
6
|
camerasDB: DB<DBCamera[], 'cameras'>;
|
|
7
7
|
pluginsDB: DB<DBPlugin[], 'plugins'>;
|
|
@@ -22,7 +22,6 @@ export interface DBCamera extends BaseCamera {
|
|
|
22
22
|
export interface DBPlugin {
|
|
23
23
|
readonly _id: string;
|
|
24
24
|
pluginName: string;
|
|
25
|
-
storage: DBPluginStorage;
|
|
26
25
|
}
|
|
27
26
|
export interface DBSettings {
|
|
28
27
|
version: string;
|
|
@@ -69,9 +68,6 @@ export interface DBCamviewLayoutCamera {
|
|
|
69
68
|
index: number;
|
|
70
69
|
cameraId: string;
|
|
71
70
|
}
|
|
72
|
-
export type DBPluginStorage = Record<string, {
|
|
73
|
-
config: DBPluginStorageValue;
|
|
74
|
-
}>;
|
|
75
71
|
export type DBPluginStorageValue = Record<string, any>;
|
|
76
72
|
export interface CameraExtensions {
|
|
77
73
|
hub?: string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProbeConfig } from '@camera.ui/types';
|
|
1
2
|
import type { RequestQueue } from '../queue.js';
|
|
2
3
|
import type { CreateStreamData, Go2RTCProbe, SourceData, UpdateStreamData } from '../types.js';
|
|
3
4
|
export declare class StreamsApi {
|
|
@@ -7,5 +8,5 @@ export declare class StreamsApi {
|
|
|
7
8
|
deleteStream(data: SourceData): Promise<void>;
|
|
8
9
|
getStreamInfo(data: SourceData): Promise<Go2RTCProbe>;
|
|
9
10
|
updateStreamSource(data: UpdateStreamData): Promise<void>;
|
|
10
|
-
probeStreamSource(data: SourceData): Promise<Go2RTCProbe>;
|
|
11
|
+
probeStreamSource(data: SourceData, probeData?: ProbeConfig): Promise<Go2RTCProbe>;
|
|
11
12
|
}
|
|
@@ -36,7 +36,7 @@ export interface SourceData {
|
|
|
36
36
|
}
|
|
37
37
|
export interface CreateStreamData {
|
|
38
38
|
name?: string;
|
|
39
|
-
src: string;
|
|
39
|
+
src: string[];
|
|
40
40
|
}
|
|
41
41
|
export interface UpdateStreamData {
|
|
42
42
|
name: string;
|
|
@@ -65,14 +65,14 @@ export interface Go2RTCSender {
|
|
|
65
65
|
parent: number;
|
|
66
66
|
}
|
|
67
67
|
export interface Go2RTCProducer {
|
|
68
|
-
id
|
|
69
|
-
format_name
|
|
70
|
-
protocol
|
|
71
|
-
remote_addr
|
|
68
|
+
id?: string;
|
|
69
|
+
format_name?: string;
|
|
70
|
+
protocol?: string;
|
|
71
|
+
remote_addr?: string;
|
|
72
72
|
url?: string;
|
|
73
73
|
sdp?: string;
|
|
74
74
|
user_agent?: string;
|
|
75
|
-
medias
|
|
75
|
+
medias?: string[];
|
|
76
76
|
receivers?: Go2RTCReceiver[];
|
|
77
77
|
senders?: Go2RTCSender[];
|
|
78
78
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FastifyInstance } from 'fastify';
|
|
2
|
+
import type { Http2SecureServer } from 'http2';
|
|
3
|
+
export declare class Server {
|
|
4
|
+
isRunning: boolean;
|
|
5
|
+
app?: FastifyInstance<Http2SecureServer>;
|
|
6
|
+
private api;
|
|
7
|
+
private logger;
|
|
8
|
+
private configService;
|
|
9
|
+
constructor();
|
|
10
|
+
register(): Promise<void>;
|
|
11
|
+
listen(): Promise<void>;
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
private setupListeners;
|
|
14
|
+
private registerPlugins;
|
|
15
|
+
private registerRouters;
|
|
16
|
+
private get corsOptions();
|
|
17
|
+
private get helmetOptions();
|
|
18
|
+
private get serverOptions();
|
|
19
|
+
private qsParser;
|
|
20
|
+
private get socketOptions();
|
|
21
|
+
private get staticOptions();
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, AuthParamsRequest } from '../types/index.js';
|
|
3
|
+
export declare const onlyAdminCanDoThisAction: (req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply) => Promise<FastifyReply>;
|
|
4
|
+
export declare const onlySameUserOrAdminCanDoThisAction: (req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply) => Promise<FastifyReply>;
|
|
5
|
+
export declare const sameUserCantDoThisAction: (req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply) => Promise<FastifyReply>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, AuthNewLoginRequest } from '../types/index.js';
|
|
3
|
+
export declare const isPasswordAndUserMatch: (req: FastifyRequest<AuthNewLoginRequest>, reply: FastifyReply) => Promise<FastifyReply>;
|
|
4
|
+
export declare const validJWTNeeded: (req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply) => Promise<FastifyReply>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, PaginationRequest, PaginationResponse } from '../types/index.js';
|
|
3
|
+
export declare const pages: (req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply, payload: any) => Promise<PaginationResponse | void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FastifyPluginAsync } from 'fastify';
|
|
2
|
+
import type { Server, ServerOptions } from 'socket.io';
|
|
3
|
+
declare module 'fastify' {
|
|
4
|
+
interface FastifyInstance {
|
|
5
|
+
io: Server;
|
|
6
|
+
}
|
|
7
|
+
interface FastifyRequest {
|
|
8
|
+
io: Server;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const SocketIoPlugin: FastifyPluginAsync<Partial<ServerOptions>>;
|