@camera.ui/browser 0.0.103 → 0.0.105
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/client/browser/src/utils.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/schema.d.ts +2 -14
- package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +3 -2
- package/dist/types/packages/types/src/index.d.ts +75 -29
- 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 +3 -4
- package/dist/types/server/src/api/database/types.d.ts +4 -14
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +2 -1
- package/dist/types/server/src/api/go2rtc/index.d.ts +1 -0
- 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/middlewares/socketAuth.middleware.d.ts +1 -1
- 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 +121 -121
- 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/api/websocket/types.d.ts +3 -9
- package/dist/types/server/src/camera/controller.d.ts +5 -9
- package/dist/types/server/src/camera/frameWorker.d.ts +1 -2
- 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/plugins/plugin.d.ts +0 -2
- package/dist/types/server/src/plugins/worker.d.ts +2 -2
- package/dist/types/server/src/services/config/constants.d.ts +0 -1
- package/dist/types/server/src/services/config/index.d.ts +2 -1
- package/dist/types/server/src/services/config/types.d.ts +3 -10
- package/dist/types/server/src/types.d.ts +24 -0
- package/package.json +15 -16
|
@@ -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;
|
|
@@ -5,7 +5,7 @@ export declare const isIpad: () => boolean;
|
|
|
5
5
|
export declare const isAppleMobile: () => boolean;
|
|
6
6
|
export declare const iosVersion: () => number[] | undefined;
|
|
7
7
|
export declare const isSafari: () => boolean;
|
|
8
|
-
export declare const safariVersion: () =>
|
|
8
|
+
export declare const safariVersion: () => RegExpExecArray | null;
|
|
9
9
|
export declare const isFirefox: () => boolean;
|
|
10
10
|
export declare const isChrome: () => boolean;
|
|
11
11
|
export declare const isTouch: () => boolean;
|
|
@@ -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,23 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { JsonSchema, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaForm, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectButton, JsonSchemaObjectWithButtons, JsonSchemaString, RootSchema } from '@camera.ui/types';
|
|
3
3
|
import type { ZodTypeAny } from 'zod';
|
|
4
|
-
type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny,
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
}, {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
}>;
|
|
4
|
+
type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, Record<string, any>, Record<string, any>>;
|
|
9
5
|
type OptionalZodString = z.ZodOptional<z.ZodString> | z.ZodString | z.ZodOptional<z.ZodEffects<z.ZodString, string, string>> | z.ZodEffects<z.ZodString, string, string>;
|
|
10
6
|
type OptionalZodNumber = z.ZodOptional<z.ZodNumber> | z.ZodNumber | z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>> | z.ZodEffects<z.ZodNumber, number, number>;
|
|
11
7
|
type OptionalZodBoolean = z.ZodOptional<z.ZodBoolean> | z.ZodBoolean;
|
|
12
|
-
type OptionalZodZobject = z.ZodOptional<z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny,
|
|
13
|
-
[x: string]: any;
|
|
14
|
-
}, {
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
}>> | z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny, {
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
}, {
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
}> | z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>> | z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
8
|
+
type OptionalZodZobject = z.ZodOptional<z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny, Record<string, any>, Record<string, any>>> | z.ZodObject<Record<string, z.ZodTypeAny>, 'strict', z.ZodTypeAny, Record<string, any>, Record<string, any>> | z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>> | z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
21
9
|
type OptionalZodArray = z.ZodOptional<z.ZodType<any, any, any>> | z.ZodType<any, any, any>;
|
|
22
10
|
type OptionalZodEnum = z.ZodOptional<z.ZodUnion<[z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]>> | z.ZodUnion<[z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]> | z.ZodEffects<z.ZodAny, any, any> | z.ZodUnion<any>;
|
|
23
11
|
type OptionalZodEnumMultiple = z.ZodOptional<z.ZodArray<z.ZodUnion<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>, 'many'>> | z.ZodArray<z.ZodUnion<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>, 'many'> | z.ZodEffects<z.ZodAny, any, any> | z.ZodUnion<any>;
|
|
@@ -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;
|
|
@@ -55,6 +55,7 @@ export interface PluginContractBase {
|
|
|
55
55
|
options?: PluginOptions;
|
|
56
56
|
dependencies?: string[];
|
|
57
57
|
pythonVersion?: string;
|
|
58
|
+
bundled?: boolean;
|
|
58
59
|
}
|
|
59
60
|
export type PluginContract = PluginContractBase & ExtensionOrSupport;
|
|
60
61
|
export type CameraExtensionWithoutHub = 'prebuffer' | 'motionDetection' | 'objectDetection' | 'audioDetection' | 'ptz';
|
|
@@ -125,7 +126,7 @@ export interface CameraDeviceProxyMethods {
|
|
|
125
126
|
addCameraSource(source: CameraConfigInputSettings): Promise<void>;
|
|
126
127
|
updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
|
|
127
128
|
removeCameraSource(sourceId: string): Promise<void>;
|
|
128
|
-
probeStream(sourceId: string, refresh: boolean): Promise<ProbeStream | undefined>;
|
|
129
|
+
probeStream(sourceId: string, probeConfig: ProbeConfig | undefined, refresh: boolean): Promise<ProbeStream | undefined>;
|
|
129
130
|
}
|
|
130
131
|
export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
131
132
|
stateName: K;
|
|
@@ -2,12 +2,12 @@ import type { Observable, ReplaySubject, Subject, Subscription } from 'rxjs';
|
|
|
2
2
|
import type sharp from 'sharp';
|
|
3
3
|
import type { ConnectionState, RTCIceCandidate, RTCSessionDescription, RtpPacket } from 'werift';
|
|
4
4
|
export type { ConnectionState, RTCIceCandidate, RTCSessionDescription, RtpPacket, sharp };
|
|
5
|
-
export type
|
|
6
|
-
export interface
|
|
7
|
-
[key: string]: JSONValue;
|
|
5
|
+
export type JSONObject = Record<string, JSONValue>;
|
|
6
|
+
export interface JSONValue {
|
|
7
|
+
[key: string]: string | number | boolean | JSONValue | JSONValue[];
|
|
8
8
|
}
|
|
9
9
|
export type JSONArray = JSONValue[];
|
|
10
|
-
export type Path =
|
|
10
|
+
export type Path = (number | string)[] | number | string;
|
|
11
11
|
export type CameraType = 'camera' | 'doorbell';
|
|
12
12
|
export type ZoneType = 'intersect' | 'contain';
|
|
13
13
|
export type ZoneFilter = 'include' | 'exclude';
|
|
@@ -24,6 +24,7 @@ export type AudioCodec = 'PCMU' | 'PCMA' | 'MPEG4-GENERIC' | 'opus' | 'G722' | '
|
|
|
24
24
|
export type AudioFFmpegCodec = 'pcm_mulaw' | 'pcm_alaw' | 'aac' | 'libopus' | 'g722' | 'mp3' | 'pcm_s16be' | 'pcm_s16le' | 'flac';
|
|
25
25
|
export type VideoCodec = 'H264' | 'H265' | 'VP8' | 'VP9' | 'AV1' | 'JPEG' | 'RAW';
|
|
26
26
|
export type VideoFFmpegCodec = 'h264' | 'hevc' | 'vp8' | 'vp9' | 'av1' | 'mjpeg' | 'rawvideo';
|
|
27
|
+
export type PythonVersion = '3.9' | '3.10' | '3.11' | '3.12';
|
|
27
28
|
export interface CameraInformation {
|
|
28
29
|
model?: string;
|
|
29
30
|
manufacturer?: string;
|
|
@@ -94,31 +95,48 @@ export interface PrebufferState {
|
|
|
94
95
|
url?: string;
|
|
95
96
|
duration?: number;
|
|
96
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
|
+
}
|
|
97
108
|
export interface AudioCodecProperties {
|
|
98
109
|
sampleRate: number;
|
|
99
110
|
channels: number;
|
|
100
111
|
payloadType: number;
|
|
112
|
+
fmtpInfo?: FMTPInfo;
|
|
101
113
|
}
|
|
102
114
|
export interface VideoCodecProperties {
|
|
103
115
|
clockRate: number;
|
|
104
116
|
payloadType: number;
|
|
117
|
+
fmtpInfo?: FMTPInfo;
|
|
105
118
|
}
|
|
106
119
|
export interface AudioStreamInfo {
|
|
107
120
|
codec: AudioCodec;
|
|
108
121
|
ffmpegCodec: AudioFFmpegCodec;
|
|
109
122
|
properties: AudioCodecProperties;
|
|
110
|
-
direction: 'sendonly' | 'recvonly';
|
|
123
|
+
direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
|
|
111
124
|
}
|
|
112
125
|
export interface VideoStreamInfo {
|
|
113
126
|
codec: VideoCodec;
|
|
114
127
|
ffmpegCodec: VideoFFmpegCodec;
|
|
115
128
|
properties: VideoCodecProperties;
|
|
116
|
-
direction: 'sendonly';
|
|
129
|
+
direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
|
|
130
|
+
}
|
|
131
|
+
export interface ProbeConfig {
|
|
132
|
+
video?: VideoCodec;
|
|
133
|
+
audio?: AudioCodec;
|
|
134
|
+
microphone?: AudioCodec;
|
|
117
135
|
}
|
|
118
136
|
export interface ProbeStream {
|
|
119
137
|
sdp: string;
|
|
120
138
|
audio: AudioStreamInfo[];
|
|
121
|
-
video: VideoStreamInfo;
|
|
139
|
+
video: VideoStreamInfo[];
|
|
122
140
|
}
|
|
123
141
|
export interface StreamUrls {
|
|
124
142
|
ws: Go2RtcWSSource;
|
|
@@ -126,8 +144,13 @@ export interface StreamUrls {
|
|
|
126
144
|
www: Go2RtcEndpoint;
|
|
127
145
|
}
|
|
128
146
|
export interface Go2RtcRTSPSource {
|
|
129
|
-
single: string;
|
|
130
147
|
default: string;
|
|
148
|
+
defaultMicrophone: string;
|
|
149
|
+
h264: string;
|
|
150
|
+
h265: string;
|
|
151
|
+
aac: string;
|
|
152
|
+
opus: string;
|
|
153
|
+
pcma: string;
|
|
131
154
|
mp4: string;
|
|
132
155
|
}
|
|
133
156
|
export interface Go2RtcEndpoint {
|
|
@@ -304,22 +327,34 @@ export interface CameraDelegates {
|
|
|
304
327
|
prebufferDelegate: CameraPrebufferDelegate;
|
|
305
328
|
ptzDelegate: CameraPTZDelegate;
|
|
306
329
|
}
|
|
307
|
-
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;
|
|
308
336
|
getPrebufferingState(container: Container): Promise<PrebufferState | undefined>;
|
|
309
|
-
probeStream(refresh?: boolean): Promise<ProbeStream | undefined>;
|
|
310
337
|
}
|
|
311
|
-
export interface CameraInternalSource extends
|
|
312
|
-
type:
|
|
338
|
+
export interface CameraInternalSource extends CameraBaseSource {
|
|
339
|
+
type: InternalSourceType;
|
|
313
340
|
}
|
|
314
341
|
export interface CameraDeviceSource extends CameraSource {
|
|
315
|
-
|
|
342
|
+
getInternalSource(type: InternalSourceType): CameraDeviceInternalSource;
|
|
343
|
+
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
344
|
+
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
316
345
|
}
|
|
317
|
-
export interface CameraDeviceInternalSource extends
|
|
346
|
+
export interface CameraDeviceInternalSource extends CameraBaseSource {
|
|
347
|
+
createWebRTCSession(options?: WebRTCConnectionOptions): WeriftSession;
|
|
348
|
+
createRTSPSession(options?: RTSPConnectionOptions): RTSPSession;
|
|
349
|
+
type: InternalSourceType;
|
|
318
350
|
}
|
|
319
|
-
export interface
|
|
351
|
+
export interface WebRTCConnectionOptions {
|
|
320
352
|
createPeerConnection?: () => BasicPeerConnection;
|
|
321
353
|
iceServers?: IceServer[];
|
|
322
354
|
}
|
|
355
|
+
export interface RTSPConnectionOptions {
|
|
356
|
+
target?: keyof Go2RtcRTSPSource;
|
|
357
|
+
}
|
|
323
358
|
export interface Subscribed {
|
|
324
359
|
addSubscriptions(...subscriptions: Subscription[]): void;
|
|
325
360
|
addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
|
|
@@ -327,19 +362,30 @@ export interface Subscribed {
|
|
|
327
362
|
unsubscribeAdditional(): void;
|
|
328
363
|
}
|
|
329
364
|
export interface WeriftSession extends Subscribed {
|
|
365
|
+
readonly onStarted: ReplaySubject<void>;
|
|
366
|
+
readonly onError: ReplaySubject<Error>;
|
|
330
367
|
readonly onCallEnded: ReplaySubject<void>;
|
|
331
368
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
332
369
|
readonly onAudioRtp: Subject<RtpPacket>;
|
|
333
370
|
reservePort(bufferPorts?: number): Promise<number>;
|
|
334
|
-
startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
|
|
335
|
-
transcodeReturnAudio(ffmpegOptions:
|
|
336
|
-
ffmpegPath: string;
|
|
337
|
-
input: SpawnInput[];
|
|
338
|
-
}): Promise<void>;
|
|
371
|
+
startTranscoding(ffmpegOptions: FfmpegOptions, streamProbe?: ProbeStream): Promise<void>;
|
|
372
|
+
transcodeReturnAudio(ffmpegOptions: ReturnAudioFFmpegOptions, streamProbe?: ProbeStream): Promise<void>;
|
|
339
373
|
stop(): void;
|
|
340
|
-
sendAudioPacket(rtp: RtpPacket): void;
|
|
374
|
+
sendAudioPacket(rtp: RtpPacket | Buffer): void;
|
|
341
375
|
requestKeyFrame(): void;
|
|
342
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
|
+
startTranscoding(ffmpegOptions: FfmpegOptions): Promise<void>;
|
|
385
|
+
transcodeReturnAudio(ffmpegOptions: ReturnAudioFFmpegOptions): Promise<void>;
|
|
386
|
+
stop(): void;
|
|
387
|
+
sendAudioPacket(rtp: RtpPacket | Buffer): void;
|
|
388
|
+
}
|
|
343
389
|
export type SpawnInput = string | number;
|
|
344
390
|
export interface FfmpegOptions {
|
|
345
391
|
ffmpegPath: string;
|
|
@@ -347,10 +393,12 @@ export interface FfmpegOptions {
|
|
|
347
393
|
video?: SpawnInput[];
|
|
348
394
|
audio?: SpawnInput[];
|
|
349
395
|
output: SpawnInput[];
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
396
|
+
logPrefix?: string;
|
|
397
|
+
}
|
|
398
|
+
export interface ReturnAudioFFmpegOptions {
|
|
399
|
+
ffmpegPath: string;
|
|
400
|
+
input: SpawnInput[];
|
|
401
|
+
logPrefix?: string;
|
|
354
402
|
}
|
|
355
403
|
export interface BasicPeerConnection {
|
|
356
404
|
createOffer(): Promise<RTCSessionDescription>;
|
|
@@ -421,7 +469,7 @@ export interface CameraDevice {
|
|
|
421
469
|
readonly highResolutionSource: CameraDeviceSource | undefined;
|
|
422
470
|
readonly midResolutionSource: CameraDeviceSource | undefined;
|
|
423
471
|
readonly lowResolutionSource: CameraDeviceSource | undefined;
|
|
424
|
-
readonly snapshotSource:
|
|
472
|
+
readonly snapshotSource: CameraInput | undefined;
|
|
425
473
|
readonly sources: CameraDeviceSource[];
|
|
426
474
|
readonly internalSources: CameraDeviceInternalSource[];
|
|
427
475
|
readonly onConnected: Observable<boolean>;
|
|
@@ -548,9 +596,7 @@ export interface JsonSchemaObjectWithButtons extends JsonSchemaObject {
|
|
|
548
596
|
buttons: JsonSchemaObjectButton[];
|
|
549
597
|
}
|
|
550
598
|
export type JsonSchema = JsonSchemaString | JsonSchemaNumber | JsonSchemaBoolean | JsonSchemaEnum | JsonSchemaObject | JsonSchemaObjectWithButtons | JsonSchemaArray | JsonSchemaButton;
|
|
551
|
-
export
|
|
552
|
-
[key: string]: JsonSchema;
|
|
553
|
-
}
|
|
599
|
+
export type JsonSchemaForm = Record<string, JsonSchema>;
|
|
554
600
|
export interface RootSchema {
|
|
555
601
|
schema: JsonSchemaForm;
|
|
556
602
|
}
|
|
@@ -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,8 +1,7 @@
|
|
|
1
|
-
import type { FastifyInstance } from 'fastify';
|
|
2
1
|
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
3
2
|
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBSystem, DBUser } from './types.js';
|
|
4
3
|
export declare class Database {
|
|
5
|
-
static readonly VERSION = "1.0.
|
|
4
|
+
static readonly VERSION = "1.0.7";
|
|
6
5
|
authDB: RootDB<DBAuth, 'auth'>;
|
|
7
6
|
camerasDB: DB<DBCamera[], 'cameras'>;
|
|
8
7
|
pluginsDB: DB<DBPlugin[], 'plugins'>;
|
|
@@ -13,11 +12,11 @@ export declare class Database {
|
|
|
13
12
|
private databaseMigration;
|
|
14
13
|
private selfCheck;
|
|
15
14
|
private databases;
|
|
16
|
-
private app;
|
|
17
15
|
private configService;
|
|
18
16
|
private logger;
|
|
17
|
+
private api;
|
|
19
18
|
private authDbPath;
|
|
20
|
-
constructor(
|
|
19
|
+
constructor();
|
|
21
20
|
initialize(): Promise<void>;
|
|
22
21
|
close(): Promise<void>;
|
|
23
22
|
getRootAdminId(): Promise<string | null>;
|
|
@@ -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;
|
|
@@ -48,11 +47,9 @@ export interface DBCameraShortcut {
|
|
|
48
47
|
cameraId: string;
|
|
49
48
|
coords: ZoneCoord;
|
|
50
49
|
}
|
|
51
|
-
export
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} | undefined;
|
|
55
|
-
}
|
|
50
|
+
export type DBUserCameraPreferences = Record<string, {
|
|
51
|
+
shortcuts: DBCameraShortcut[];
|
|
52
|
+
} | undefined>;
|
|
56
53
|
export interface DBUserPreferences {
|
|
57
54
|
camview: {
|
|
58
55
|
views: DBCamviewLayout[];
|
|
@@ -71,14 +68,7 @@ export interface DBCamviewLayoutCamera {
|
|
|
71
68
|
index: number;
|
|
72
69
|
cameraId: string;
|
|
73
70
|
}
|
|
74
|
-
export
|
|
75
|
-
[key: string]: {
|
|
76
|
-
config: DBPluginStorageValue;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
export interface DBPluginStorageValue {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
}
|
|
71
|
+
export type DBPluginStorageValue = Record<string, any>;
|
|
82
72
|
export interface CameraExtensions {
|
|
83
73
|
hub?: string[];
|
|
84
74
|
prebuffer?: 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
|
}
|
|
@@ -3,6 +3,7 @@ import { ConfigApi } from './api/config.js';
|
|
|
3
3
|
import { SnapshotApi } from './api/snapshot.js';
|
|
4
4
|
import { StreamsApi } from './api/streams.js';
|
|
5
5
|
export declare class Go2RtcApi {
|
|
6
|
+
private api;
|
|
6
7
|
private requestQueue;
|
|
7
8
|
applicationApi: ApplicationApi;
|
|
8
9
|
configApi: ConfigApi;
|