@camera.ui/browser 0.0.71 → 0.0.73
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 +10 -2
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +9 -6
- package/dist/types/packages/client/browser/src/proxy/pluginsManager.d.ts +4 -1
- package/dist/types/packages/client/browser/src/proxy/systemManager.d.ts +4 -1
- package/dist/types/packages/client/browser/src/socket.d.ts +6 -1
- package/dist/types/{server/src/camera/streaming/browser/browser-peer-connection.d.ts → packages/client/browser/src/streaming/peer-connection.d.ts} +4 -5
- package/dist/types/{server/src/camera/streaming/browser/browser-streaming-session.d.ts → packages/client/browser/src/streaming/streaming-session.d.ts} +8 -7
- package/dist/types/{server/src/camera/streaming/browser/webrtc-browser-connection.d.ts → packages/client/browser/src/streaming/webrtc-connection.d.ts} +6 -7
- package/dist/types/packages/client/browser/src/types.d.ts +26 -2
- package/dist/types/server/src/api/controllers/api.controller.d.ts +6 -0
- package/dist/types/server/src/api/controllers/auth.controller.d.ts +20 -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 +33 -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/plugins.controller.d.ts +54 -0
- package/dist/types/server/src/api/controllers/streams.controller.d.ts +12 -0
- package/dist/types/server/src/api/controllers/system.controller.d.ts +14 -0
- package/dist/types/server/src/api/controllers/users.controller.d.ts +15 -0
- package/dist/types/server/src/api/database/index.d.ts +1 -1
- package/dist/types/server/src/api/go2rtc/api/application.d.ts +1 -1
- package/dist/types/server/src/api/go2rtc/api/config.d.ts +1 -1
- package/dist/types/server/src/api/go2rtc/api/snapshot.d.ts +1 -1
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +1 -1
- package/dist/types/server/src/api/index.d.ts +18 -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/cameraui.plugin.d.ts +11 -0
- package/dist/types/server/src/api/plugins/database.plugin.d.ts +11 -0
- package/dist/types/server/src/api/plugins/go2rtc.plugin.d.ts +11 -0
- package/dist/types/server/src/api/plugins/logger.plugin.d.ts +7 -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 +21 -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/index.d.ts +7 -0
- package/dist/types/server/src/api/routes/plugins.routes.d.ts +2 -0
- package/dist/types/server/src/api/routes/streams.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/plugins.schema.d.ts +25 -0
- package/dist/types/server/src/api/services/backup.service.d.ts +10 -0
- package/dist/types/server/src/api/utils/axios.d.ts +2 -0
- package/dist/types/server/src/api/utils/cert.d.ts +11 -0
- package/dist/types/server/src/api/utils/moveFiles.d.ts +1 -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 -1
- package/dist/types/server/src/api.d.ts +5 -5
- package/dist/types/server/src/decoder/ffmpeg.d.ts +1 -0
- package/dist/types/server/src/decoder/index.d.ts +17 -6
- package/dist/types/server/src/decoder/types.d.ts +62 -15
- package/dist/types/server/src/decoder/worker/index.d.ts +42 -3
- package/dist/types/server/src/{camera/base → devices/camera}/cameraDevice.d.ts +5 -5
- package/dist/types/server/src/{camera/controller.d.ts → devices/camera/controller/index.d.ts} +6 -6
- package/dist/types/server/src/{camera → devices/camera/controller}/types.d.ts +11 -21
- package/dist/types/server/src/{camera/base → devices/camera}/index.d.ts +18 -16
- package/dist/types/server/src/{camera → devices/camera}/streaming/peer-connection.d.ts +10 -9
- package/dist/types/server/src/{camera → devices/camera}/streaming/streaming-session.d.ts +3 -3
- package/dist/types/server/src/{camera → devices/camera}/streaming/webrtc-connection.d.ts +4 -4
- package/dist/types/server/src/main.d.ts +21 -0
- package/dist/types/server/src/nats/constants.d.ts +1 -0
- package/dist/types/server/src/nats/index.d.ts +1 -1
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +2 -6
- package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
- package/dist/types/server/src/nats/server.d.ts +3 -2
- package/dist/types/server/src/nats/types.d.ts +14 -28
- package/dist/types/server/src/nats/websocket.d.ts +3 -2
- package/dist/types/server/src/plugins/base.d.ts +2 -2
- package/dist/types/server/src/plugins/node/logger.d.ts +2 -0
- package/dist/types/server/src/plugins/node/proxy/cameraDevice.d.ts +10 -6
- package/dist/types/server/src/plugins/node/proxy/deviceManager.d.ts +2 -2
- package/dist/types/server/src/plugins/node/proxy/queue.d.ts +2 -2
- package/dist/types/server/src/plugins/worker-ipc.d.ts +5 -2
- package/dist/types/server/src/services/logger/index.d.ts +3 -3
- package/dist/types/server/src/utils/pythonInstaller.d.ts +2 -1
- package/dist/types/server/src/{camera/utils → utils}/subscribed.d.ts +1 -1
- package/dist/types/shared/types/index.d.ts +2 -4
- package/package.json +4 -4
- package/dist/types/server/src/api/websocket/nsp/frame.d.ts +0 -10
- package/dist/types/server/src/camera/base/cameraDeviceBrowser.d.ts +0 -6
- package/dist/types/server/src/decoder/worker/runtime/base/index.d.ts +0 -36
- package/dist/types/server/src/decoder/worker/runtime/child-process/index.d.ts +0 -17
- package/dist/types/server/src/decoder/worker/runtime/worker-thread/index.d.ts +0 -22
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseCameraDevice } from '../../../../../server/src/devices/camera/index.js';
|
|
2
|
+
import { StreamingSession } from '../streaming/streaming-session.js';
|
|
2
3
|
import type { BaseLogger, Camera, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
|
|
3
4
|
import type { SocketService } from '../socket.js';
|
|
4
|
-
|
|
5
|
+
import type { CameraDevice } from '../types.js';
|
|
6
|
+
export declare class CameraDeviceProxy extends BaseCameraDevice implements CameraDevice {
|
|
5
7
|
private socketService;
|
|
8
|
+
private socket;
|
|
9
|
+
private started;
|
|
6
10
|
get sources(): CameraSource[];
|
|
7
11
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): void;
|
|
8
14
|
connect(): Promise<void>;
|
|
9
15
|
disconnect(): Promise<void>;
|
|
10
16
|
reboot(): Promise<void>;
|
|
11
17
|
getIceServers(): Promise<IceServer[]>;
|
|
18
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
19
|
+
createSession(sourceName: string, videoElement: HTMLVideoElement): Promise<StreamingSession>;
|
|
12
20
|
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
13
21
|
refreshStates(): Promise<void>;
|
|
14
22
|
cleanup(): Promise<void>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { BaseLogger, DeviceManagerBrowserProxyMethods } from '../../../../../shared/types/index.js';
|
|
1
|
+
import type { BaseLogger } from '../../../../../shared/types/index.js';
|
|
3
2
|
import type { SocketService } from '../socket.js';
|
|
3
|
+
import type { CameraDevice } from '../types.js';
|
|
4
|
+
interface DeviceManagerBrowserProxyMethods {
|
|
5
|
+
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
6
|
+
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
7
|
+
}
|
|
4
8
|
export declare class DeviceManager implements DeviceManagerBrowserProxyMethods {
|
|
5
9
|
private socketService;
|
|
6
|
-
private devices;
|
|
7
10
|
private logger;
|
|
8
11
|
constructor(socketService: SocketService, logger: BaseLogger);
|
|
9
|
-
getCameraById(id: string): Promise<
|
|
10
|
-
getCameraByName(name: string): Promise<
|
|
11
|
-
private addOrGetCamera;
|
|
12
|
+
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
13
|
+
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
12
14
|
}
|
|
15
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { BaseLogger
|
|
1
|
+
import type { BaseLogger } from '../../../../../shared/types/index.js';
|
|
2
2
|
import type { SocketService } from '../socket.js';
|
|
3
|
+
interface PluginsManagerBrowserProxyMethods {
|
|
4
|
+
}
|
|
3
5
|
export declare class PluginsManager implements PluginsManagerBrowserProxyMethods {
|
|
4
6
|
private socketService;
|
|
5
7
|
private logger;
|
|
6
8
|
constructor(socketService: SocketService, logger: BaseLogger);
|
|
7
9
|
}
|
|
10
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { BaseLogger
|
|
1
|
+
import type { BaseLogger } from '../../../../../shared/types/index.js';
|
|
2
2
|
import type { SocketService } from '../socket.js';
|
|
3
|
+
interface SystemManagerBrowserProxyMethods {
|
|
4
|
+
}
|
|
3
5
|
export declare class SystemManager implements SystemManagerBrowserProxyMethods {
|
|
4
6
|
private socketService;
|
|
5
7
|
private logger;
|
|
6
8
|
constructor(socketService: SocketService, logger: BaseLogger);
|
|
7
9
|
}
|
|
10
|
+
export {};
|
|
@@ -3,8 +3,13 @@ import type { ManagerNames, WebsocketClientRequest } from '../../../../shared/ty
|
|
|
3
3
|
export declare class SocketService {
|
|
4
4
|
manager: Manager;
|
|
5
5
|
private token;
|
|
6
|
+
private endpoint;
|
|
6
7
|
get socket(): Socket;
|
|
7
8
|
constructor(endpoint: string, token: string);
|
|
8
|
-
|
|
9
|
+
createManager(): {
|
|
10
|
+
manager: Manager;
|
|
11
|
+
socket: Socket;
|
|
12
|
+
};
|
|
13
|
+
sendRequest<T extends ManagerNames>(data: WebsocketClientRequest<T>, socket?: Socket): Promise<any>;
|
|
9
14
|
close(): void;
|
|
10
15
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
|
-
import { Subscribed } from '
|
|
3
|
-
import type { IceServer } from '
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export declare class BrowserPeerConnection extends Subscribed implements BasicBrowserPeerConnection {
|
|
2
|
+
import { Subscribed } from '../../../../../shared/types/index.js';
|
|
3
|
+
import type { BaseLogger, IceServer } from '../../../../../shared/types/index.js';
|
|
4
|
+
import type { BasicBrowserPeerConnection, CameraDevice } from '../types.js';
|
|
5
|
+
export declare class BasicPeerConnection extends Subscribed implements BasicBrowserPeerConnection {
|
|
7
6
|
onIceCandidate: Subject<RTCIceCandidate>;
|
|
8
7
|
onConnectionState: ReplaySubject<RTCPeerConnectionState>;
|
|
9
8
|
videoTransceiver: RTCRtpTransceiver;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Subscribed } from '
|
|
3
|
-
import type {
|
|
4
|
-
import type { BaseLogger } from '
|
|
5
|
-
import type {
|
|
6
|
-
|
|
1
|
+
import { ReplaySubject } from 'rxjs';
|
|
2
|
+
import { Subscribed } from '../../../../../shared/types/index.js';
|
|
3
|
+
import type { Observable } from 'rxjs';
|
|
4
|
+
import type { BaseLogger } from '../../../../../shared/types/index.js';
|
|
5
|
+
import type { CameraDevice } from '../types.js';
|
|
6
|
+
import type { WebrtcConnection } from './webrtc-connection.js';
|
|
7
|
+
export declare class StreamingSession extends Subscribed {
|
|
7
8
|
readonly onCallAnswered: ReplaySubject<void>;
|
|
8
9
|
readonly onCallEnded: ReplaySubject<void>;
|
|
9
10
|
private onUsingOpus;
|
|
@@ -14,7 +15,7 @@ export declare class BrowserStreamingSession extends Subscribed {
|
|
|
14
15
|
private logger;
|
|
15
16
|
onMicrophoneEnabled: Observable<boolean>;
|
|
16
17
|
get isUsingOpus(): Promise<boolean>;
|
|
17
|
-
constructor(cameraDevice: CameraDevice, logger: BaseLogger, connection:
|
|
18
|
+
constructor(cameraDevice: CameraDevice, logger: BaseLogger, connection: WebrtcConnection);
|
|
18
19
|
enableMicrophone(track: MediaStreamTrack): void;
|
|
19
20
|
disableMicrophone(): void;
|
|
20
21
|
stop(): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ReplaySubject, type Observable } from 'rxjs';
|
|
2
|
-
import { Subscribed } from '
|
|
3
|
-
import {
|
|
4
|
-
import type { IceServer } from '
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export declare class WebrtcBrowserConnection extends Subscribed {
|
|
2
|
+
import { Subscribed } from '../../../../../shared/types/index.js';
|
|
3
|
+
import { BasicPeerConnection } from './peer-connection.js';
|
|
4
|
+
import type { BaseLogger, IceServer } from '../../../../../shared/types/index.js';
|
|
5
|
+
import type { CameraDevice } from '../types.js';
|
|
6
|
+
export declare class WebrtcConnection extends Subscribed {
|
|
8
7
|
readonly onCallAnswered: ReplaySubject<string>;
|
|
9
8
|
readonly onCallEnded: ReplaySubject<void>;
|
|
10
9
|
readonly onError: ReplaySubject<void>;
|
|
@@ -12,7 +11,7 @@ export declare class WebrtcBrowserConnection extends Subscribed {
|
|
|
12
11
|
method: string;
|
|
13
12
|
}>;
|
|
14
13
|
readonly onWsOpen: Observable<unknown>;
|
|
15
|
-
readonly pc:
|
|
14
|
+
readonly pc: BasicPeerConnection;
|
|
16
15
|
private readonly ws;
|
|
17
16
|
private readonly onOfferSent;
|
|
18
17
|
private hasEnded;
|
|
@@ -1,7 +1,31 @@
|
|
|
1
|
+
import type { Observable, Subject } from 'rxjs';
|
|
2
|
+
import type { BaseCameraDevice } from '../../../../server/src/devices/camera/index.js';
|
|
1
3
|
import type { BaseLogger } from '../../../../shared/types/index.js';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
+
import type { StreamingSession } from './streaming/streaming-session.js';
|
|
5
|
+
export type { BasicPeerConnection } from './streaming/peer-connection.js';
|
|
6
|
+
export type { StreamingSession } from './streaming/streaming-session.js';
|
|
7
|
+
export type { WebrtcConnection } from './streaming/webrtc-connection.js';
|
|
8
|
+
export type { AudioState, BaseDetection, BaseLogger, Camera, CameraConfig, CameraInput, DoorbellState, FfmpegOptions, Go2RtcAnswerMessage, Go2RtcIceCandidateMessage, Go2RtcIncomingMessage, Go2RtcOfferMessage, Go2RtcOutgoingMessage, LightState, MotionDetection, MotionState, ObjectDetection, ObjectState, SirenState, } from '../../../../shared/types/index.js';
|
|
4
9
|
export type CameraUiClientConfig = WithCredentials | WithToken;
|
|
10
|
+
export interface BasicBrowserPeerConnection {
|
|
11
|
+
enableMicrophone(track: MediaStreamTrack): void;
|
|
12
|
+
disableMicrophone(): void;
|
|
13
|
+
createOffer(): Promise<RTCSessionDescriptionInit>;
|
|
14
|
+
acceptAnswer(answer: {
|
|
15
|
+
type: 'answer';
|
|
16
|
+
sdp: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
addIceCandidate(candidate: Partial<RTCIceCandidate>): Promise<void>;
|
|
19
|
+
onIceCandidate: Subject<RTCIceCandidate>;
|
|
20
|
+
onConnectionState: Observable<RTCPeerConnectionState>;
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
23
|
+
export interface CameraDevice extends BaseCameraDevice {
|
|
24
|
+
start(): void;
|
|
25
|
+
stop(): void;
|
|
26
|
+
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
27
|
+
createSession(sourceName: string, videoElement: HTMLVideoElement): Promise<StreamingSession>;
|
|
28
|
+
}
|
|
5
29
|
interface BaseConfig {
|
|
6
30
|
endpoint: string;
|
|
7
31
|
skipCheck?: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { JwtTokenClientData, JwtTokenEncoded } from '../types/index.js';
|
|
3
|
+
import type { AuthLoginRequest, AuthNewLoginRequest, AuthParamsRequest, AuthRefreshRequest, AuthTokensRequest, PaginationRequest } from '../types/index.js';
|
|
4
|
+
export declare class AuthController {
|
|
5
|
+
private app;
|
|
6
|
+
private configService;
|
|
7
|
+
private service;
|
|
8
|
+
private userService;
|
|
9
|
+
constructor(app: FastifyInstance);
|
|
10
|
+
check(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply;
|
|
11
|
+
list(req: FastifyRequest<AuthLoginRequest & AuthTokensRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | JwtTokenClientData[] | JwtTokenEncoded[];
|
|
12
|
+
login(req: FastifyRequest<AuthNewLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
13
|
+
logout(req: FastifyRequest, reply: FastifyReply): Promise<FastifyReply>;
|
|
14
|
+
logoutByToken(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
logoutAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
refresh(req: FastifyRequest<AuthRefreshRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
17
|
+
private addSessionTimer;
|
|
18
|
+
private clearSessionTimer;
|
|
19
|
+
private refresSessionTimer;
|
|
20
|
+
}
|
|
@@ -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,33 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { DBCamera } from '../database/types.js';
|
|
3
|
+
import type { AuthLoginRequest, CameraZoneInsertPatchRequest, CameraZonesParamsRequest, CameraZonesTypeRequest, CamerasExtensionsParamsRequest, CamerasExtensionsRequest, CamerasInsertRequest, CamerasParamsRequest, CamerasPatchRequest, CamerasPreviewRequest, ExtensionsPatchRequest, 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 & CameraZonesTypeRequest>, reply: FastifyReply): FastifyReply;
|
|
15
|
+
insertZone(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesTypeRequest & CameraZoneInsertPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
16
|
+
patchZoneByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesParamsRequest & CameraZonesTypeRequest & CameraZoneInsertPatchRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
17
|
+
removeZoneByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CameraZonesParamsRequest & CameraZonesTypeRequest>, 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
|
+
getSnapshotByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
22
|
+
insert(req: FastifyRequest<AuthLoginRequest & CamerasInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
23
|
+
preview(req: FastifyRequest<AuthLoginRequest & CamerasPreviewRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
24
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | DBCamera[];
|
|
25
|
+
patchByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CamerasPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
26
|
+
enableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
27
|
+
disableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
28
|
+
addExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
29
|
+
removeExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
30
|
+
removeByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
31
|
+
removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
32
|
+
private resolvePluginName;
|
|
33
|
+
}
|
|
@@ -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,54 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, CameraUiPlugin, PaginationRequest, PluginExtension, PluginsActionRequest, PluginsConfigPatchRequest, PluginsInsertRequest, PluginsParamsNameRequest, PluginsParamsRemoveRequest, PluginsQueryRequest } from '../types/index.js';
|
|
3
|
+
export interface PluginInfo {
|
|
4
|
+
pluginName: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class PluginsController {
|
|
9
|
+
private app;
|
|
10
|
+
private logger;
|
|
11
|
+
private configService;
|
|
12
|
+
private io;
|
|
13
|
+
private pluginManager;
|
|
14
|
+
private proxyServer;
|
|
15
|
+
private service;
|
|
16
|
+
private camerasService;
|
|
17
|
+
constructor(app: FastifyInstance);
|
|
18
|
+
enableByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
19
|
+
disableByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
20
|
+
getByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply;
|
|
21
|
+
getPluginUpdateByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
22
|
+
getVersionsByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
23
|
+
getChangelogByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
24
|
+
getConfigJsonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
25
|
+
getPluginSchemaByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
26
|
+
submitActionButtonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsActionRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
27
|
+
getContractByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply;
|
|
28
|
+
getReadmeByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsQueryRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
29
|
+
getReleaseByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
30
|
+
installOrUpdate(req: FastifyRequest<AuthLoginRequest & PluginsInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
31
|
+
managePlugin(action: 'install' | 'uninstall' | 'unlink', pluginInfo: PluginInfo): Promise<string>;
|
|
32
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | CameraUiPlugin[];
|
|
33
|
+
listExtensions(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | PluginExtension[];
|
|
34
|
+
patchConfigJsonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsConfigPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
35
|
+
restartByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
36
|
+
search(req: FastifyRequest<AuthLoginRequest & PluginsQueryRequest & PaginationRequest>, reply: FastifyReply): Promise<FastifyReply | CameraUiPlugin[]>;
|
|
37
|
+
startByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
38
|
+
stopByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
39
|
+
uninstallByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
40
|
+
uninstallAll(req: FastifyRequest<AuthLoginRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
41
|
+
private cleanNpmCache;
|
|
42
|
+
private ensurePluginDirExists;
|
|
43
|
+
private getAvailablePluginVersions;
|
|
44
|
+
private getLastNodeModulesPath;
|
|
45
|
+
private getNpmModuleLatestVersion;
|
|
46
|
+
private getNpmPath;
|
|
47
|
+
private getPluginFromNpm;
|
|
48
|
+
private pluginsPackageJson;
|
|
49
|
+
private removeSynologyMetadata;
|
|
50
|
+
private runNpmCommand;
|
|
51
|
+
private searchNpmRegistrySingle;
|
|
52
|
+
private resolvePluginName;
|
|
53
|
+
private isScopedPlugin;
|
|
54
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WebSocket } from '@fastify/websocket';
|
|
2
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
3
|
+
import type { StreamsParamsNameRequest } from '../types/index.js';
|
|
4
|
+
export declare class StreamsController {
|
|
5
|
+
private app;
|
|
6
|
+
private api;
|
|
7
|
+
private logger;
|
|
8
|
+
private proxyServer;
|
|
9
|
+
constructor(app: FastifyInstance);
|
|
10
|
+
wsConnection(socket: WebSocket, req: FastifyRequest<StreamsParamsNameRequest>): Promise<void>;
|
|
11
|
+
httpConnection(req: FastifyRequest<StreamsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { AuthLoginRequest, DownloadLogRequest } from '../types/index.js';
|
|
3
|
+
export declare class SystemController {
|
|
4
|
+
private app;
|
|
5
|
+
private configService;
|
|
6
|
+
private go2rtcApi;
|
|
7
|
+
constructor(app: FastifyInstance);
|
|
8
|
+
go2rtcInfo(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
9
|
+
clearLog(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply | void;
|
|
10
|
+
downloadCert(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply | void;
|
|
11
|
+
downloadLog(req: FastifyRequest<AuthLoginRequest & DownloadLogRequest>, reply: FastifyReply): FastifyReply | void;
|
|
12
|
+
restart(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply | void;
|
|
13
|
+
restartGo2rtc(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { DBUser } from '../database/types.js';
|
|
3
|
+
import type { AuthLoginRequest, AuthParamsRequest, PaginationRequest, UsersInsertRequest, UsersParamsRequest, UsersPatchRequest } from '../types/index.js';
|
|
4
|
+
export declare class UsersController {
|
|
5
|
+
private app;
|
|
6
|
+
private configService;
|
|
7
|
+
private service;
|
|
8
|
+
constructor(app: FastifyInstance);
|
|
9
|
+
getByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): FastifyReply;
|
|
10
|
+
insert(req: FastifyRequest<AuthLoginRequest & UsersInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
11
|
+
list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | Partial<DBUser>[];
|
|
12
|
+
patchByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & UsersPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
|
|
13
|
+
removeByName(req: FastifyRequest<AuthLoginRequest & UsersParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
14
|
+
removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
1
|
+
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
2
2
|
import type { FastifyInstance } from 'fastify';
|
|
3
3
|
import type { Plugin } from '../../plugins/plugin.js';
|
|
4
4
|
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBUser } from './types.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class Server {
|
|
2
|
+
private secureApp?;
|
|
3
|
+
private insecureApp?;
|
|
4
|
+
private api;
|
|
5
|
+
private logger;
|
|
6
|
+
private configService;
|
|
7
|
+
constructor();
|
|
8
|
+
register(): Promise<void>;
|
|
9
|
+
listen(): Promise<void>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
private corsOptions;
|
|
12
|
+
private helmetOptions;
|
|
13
|
+
private multipartOptions;
|
|
14
|
+
private insecureServerOptions;
|
|
15
|
+
private secureServerOptions;
|
|
16
|
+
private socketOptions;
|
|
17
|
+
private staticOptions;
|
|
18
|
+
}
|
|
@@ -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 | any>;
|
|
4
|
+
export declare const onlySameUserOrAdminCanDoThisAction: (req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply) => Promise<FastifyReply | any>;
|
|
5
|
+
export declare const sameUserCantDoThisAction: (req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply) => Promise<FastifyReply | any>;
|
|
@@ -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 | any>;
|
|
4
|
+
export declare const validJWTNeeded: (req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply) => Promise<FastifyReply | any>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type AuthLoginRequest, type PaginationRequest, type PaginationResponse } from '../types/index.js';
|
|
2
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
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 { PluginManager } from '../../plugins/index.js';
|
|
3
|
+
declare module 'fastify' {
|
|
4
|
+
interface FastifyInstance {
|
|
5
|
+
pluginManager: PluginManager;
|
|
6
|
+
}
|
|
7
|
+
interface FastifyRequest {
|
|
8
|
+
pluginManager: PluginManager;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const PluginManagerPlugin: FastifyPluginAsync<PluginManager>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Database } from '../database/index.js';
|
|
2
|
+
import type { FastifyPluginAsync } from 'fastify';
|
|
3
|
+
declare module 'fastify' {
|
|
4
|
+
interface FastifyInstance {
|
|
5
|
+
dbs: Database;
|
|
6
|
+
}
|
|
7
|
+
interface FastifyRequest {
|
|
8
|
+
dbs: Database;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const DatabasePlugin: FastifyPluginAsync;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Go2RtcApi } from '../go2rtc/index.js';
|
|
2
|
+
import type { FastifyPluginAsync } from 'fastify';
|
|
3
|
+
declare module 'fastify' {
|
|
4
|
+
interface FastifyInstance {
|
|
5
|
+
go2rtcApi: Go2RtcApi;
|
|
6
|
+
}
|
|
7
|
+
interface FastifyRequest {
|
|
8
|
+
go2rtcApi: Go2RtcApi;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const Go2RtcPlugin: FastifyPluginAsync;
|
|
@@ -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>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyPluginAsync } from 'fastify';
|
|
2
|
+
declare module 'fastify' {
|
|
3
|
+
interface FastifyInstance {
|
|
4
|
+
system: System;
|
|
5
|
+
}
|
|
6
|
+
interface FastifyRequest {
|
|
7
|
+
system: System;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare class System {
|
|
11
|
+
private app;
|
|
12
|
+
private database;
|
|
13
|
+
private io;
|
|
14
|
+
private go2rtc;
|
|
15
|
+
private proxyServer;
|
|
16
|
+
constructor(app: FastifyInstance);
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
restartGo2rtc(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare const SystemPlugin: FastifyPluginAsync;
|
|
21
|
+
export {};
|