@camera.ui/browser 0.0.77 → 0.0.79
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 +4 -4
- package/dist/types/packages/client/browser/src/socket.d.ts +6 -5
- package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +54 -0
- package/dist/types/packages/client/browser/src/types.d.ts +11 -7
- package/dist/types/packages/client/browser/src/utils.d.ts +12 -0
- package/dist/types/server/src/api/database/index.d.ts +1 -1
- package/dist/types/server/src/api/database/types.d.ts +11 -6
- package/dist/types/server/src/api/go2rtc/api/config.d.ts +3 -4
- package/dist/types/server/src/api/go2rtc/api/index.d.ts +1 -2
- package/dist/types/server/src/api/go2rtc/api/streams.d.ts +4 -5
- package/dist/types/server/src/api/index.d.ts +0 -1
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +180 -121
- package/dist/types/server/src/api/schemas/config.schema.d.ts +2 -2
- package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +18 -18
- package/dist/types/server/src/api/schemas/users.schema.d.ts +8 -8
- package/dist/types/server/src/api/services/plugins.service.d.ts +1 -0
- package/dist/types/server/src/api/types/index.d.ts +0 -2
- package/dist/types/server/src/api/utils/fetch.d.ts +2 -0
- package/dist/types/server/src/api/websocket/types.d.ts +1 -15
- package/dist/types/server/src/api.d.ts +1 -2
- package/dist/types/server/src/camera/controller.d.ts +6 -2
- package/dist/types/server/src/camera/device.d.ts +2 -3
- package/dist/types/server/src/camera/index.d.ts +14 -12
- package/dist/types/server/src/camera/polygon.d.ts +3 -2
- package/dist/types/server/src/camera/streaming/peer-connection.d.ts +1 -1
- package/dist/types/server/src/camera/types.d.ts +7 -6
- package/dist/types/server/src/camera/videoFrame.d.ts +10 -11
- package/dist/types/server/src/decoder/types.d.ts +31 -22
- package/dist/types/server/src/decoder/worker.d.ts +3 -3
- package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +0 -2
- package/dist/types/server/src/nats/server.d.ts +10 -7
- package/dist/types/server/src/nats/types.d.ts +7 -8
- package/dist/types/server/src/nats/websocket.d.ts +8 -0
- package/dist/types/server/src/plugins/index.d.ts +1 -0
- package/dist/types/server/src/polyglot/node/plugins/api.d.ts +1 -2
- package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +2 -2
- package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +8 -9
- package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +3 -3
- package/dist/types/server/src/polyglot/node/plugins/proxy/pluginsManager.d.ts +3 -3
- package/dist/types/server/src/polyglot/node/plugins/proxy/systemManager.d.ts +3 -3
- package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +8 -1
- package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +1 -1
- package/dist/types/server/src/services/config/constants.d.ts +0 -2
- package/dist/types/server/src/services/config/index.d.ts +1 -1
- package/dist/types/server/src/utils/packer.d.ts +2 -0
- package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
- package/dist/types/server/src/utils/utils.d.ts +5 -0
- package/package.json +6 -10
- package/dist/types/packages/client/browser/src/streaming/peer-connection.d.ts +0 -24
- package/dist/types/packages/client/browser/src/streaming/streaming-session.d.ts +0 -25
- package/dist/types/packages/client/browser/src/streaming/webrtc-connection.d.ts +0 -26
- package/dist/types/server/src/api/utils/axios.d.ts +0 -2
- package/dist/types/server/src/api/websocket/nsp/streams.d.ts +0 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseCameraDevice } from '../../../../../server/src/camera/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Go2RTCSession } from '../streaming/go2rts-session.js';
|
|
3
3
|
import type { BaseLogger, Camera, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
|
|
4
4
|
import type { SocketService } from '../socket.js';
|
|
5
|
-
import type { CameraDevice } from '../types.js';
|
|
5
|
+
import type { CameraDevice, Go2RTCSessionOptions } from '../types.js';
|
|
6
6
|
export declare class CameraDeviceProxy extends BaseCameraDevice implements CameraDevice {
|
|
7
7
|
private socketService;
|
|
8
8
|
private socket;
|
|
@@ -10,7 +10,7 @@ export declare class CameraDeviceProxy extends BaseCameraDevice implements Camer
|
|
|
10
10
|
get started(): boolean;
|
|
11
11
|
get sources(): CameraSource[];
|
|
12
12
|
constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
|
|
13
|
-
start(): void
|
|
13
|
+
start(): Promise<void>;
|
|
14
14
|
stop(): void;
|
|
15
15
|
close(): void;
|
|
16
16
|
connect(): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export declare class CameraDeviceProxy extends BaseCameraDevice implements Camer
|
|
|
18
18
|
reboot(): Promise<void>;
|
|
19
19
|
getIceServers(): Promise<IceServer[]>;
|
|
20
20
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
21
|
-
createSession(
|
|
21
|
+
createSession(options: Go2RTCSessionOptions): Go2RTCSession;
|
|
22
22
|
updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
|
|
23
23
|
refreshStates(): Promise<void>;
|
|
24
24
|
cleanup(): Promise<void>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Manager, type Socket } from 'socket.io-client';
|
|
2
2
|
import type { ManagerNames, WebsocketClientRequest } from '../../../../shared/types/index.js';
|
|
3
3
|
export declare class SocketService {
|
|
4
|
-
|
|
4
|
+
socket: Socket;
|
|
5
5
|
private token;
|
|
6
6
|
private endpoint;
|
|
7
|
-
|
|
7
|
+
private socketList;
|
|
8
8
|
constructor(endpoint: string, token: string);
|
|
9
|
-
|
|
9
|
+
sendRequest<T extends ManagerNames>(data: WebsocketClientRequest<T>, socket?: Socket): Promise<any>;
|
|
10
|
+
close(): void;
|
|
11
|
+
getSocket(id: string, forceNew?: boolean): {
|
|
10
12
|
manager: Manager;
|
|
11
13
|
socket: Socket;
|
|
12
14
|
};
|
|
13
|
-
|
|
14
|
-
close(): void;
|
|
15
|
+
private createManager;
|
|
15
16
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { VideoStreamingMode } from '../../../../../shared/types/index.js';
|
|
2
|
+
import type { SocketService } from '../socket.js';
|
|
3
|
+
import type { BaseLogger, CameraDevice, Go2RTCSessionOptions } from '../types.js';
|
|
4
|
+
export declare class Go2RTCSession extends EventTarget {
|
|
5
|
+
private cameraDevice;
|
|
6
|
+
private socketService;
|
|
7
|
+
private logger;
|
|
8
|
+
private options;
|
|
9
|
+
private videoPlayer;
|
|
10
|
+
private socket;
|
|
11
|
+
private streamId;
|
|
12
|
+
closed: boolean;
|
|
13
|
+
micTransceiver: RTCRtpTransceiver | null;
|
|
14
|
+
private pc;
|
|
15
|
+
private buf;
|
|
16
|
+
private mediaSource;
|
|
17
|
+
private sourceBuffer;
|
|
18
|
+
private bufLen;
|
|
19
|
+
private mseCodecs;
|
|
20
|
+
private videoPlayerMp4?;
|
|
21
|
+
private media;
|
|
22
|
+
private codecList;
|
|
23
|
+
private reconnectTimeout?;
|
|
24
|
+
private _finishLoading;
|
|
25
|
+
get mode(): VideoStreamingMode;
|
|
26
|
+
private webrtcReconnectTimeout?;
|
|
27
|
+
constructor(cameraDevice: CameraDevice, socketService: SocketService, logger: BaseLogger, options: Go2RTCSessionOptions);
|
|
28
|
+
connect(customMode?: VideoStreamingMode): void;
|
|
29
|
+
disconnect(): void;
|
|
30
|
+
reconnect(customMode?: VideoStreamingMode): Promise<void>;
|
|
31
|
+
reset(): void;
|
|
32
|
+
close(): void;
|
|
33
|
+
private onWsOpen;
|
|
34
|
+
private onWsClose;
|
|
35
|
+
private onWsMessage;
|
|
36
|
+
private requestWebrtc;
|
|
37
|
+
private onWebrtcData;
|
|
38
|
+
private createOffer;
|
|
39
|
+
private requestMse;
|
|
40
|
+
private onMseData;
|
|
41
|
+
private onMseBuffer;
|
|
42
|
+
private requestMjpeg;
|
|
43
|
+
private onMjpegBuffer;
|
|
44
|
+
private requestMp4;
|
|
45
|
+
private onMp4Buffer;
|
|
46
|
+
private requestHls;
|
|
47
|
+
private onHlsData;
|
|
48
|
+
private play;
|
|
49
|
+
private finishLoading;
|
|
50
|
+
private createCodecsList;
|
|
51
|
+
private parseCodecs;
|
|
52
|
+
private btoaBinary;
|
|
53
|
+
private uuidv4;
|
|
54
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Observable, Subject } from 'rxjs';
|
|
2
2
|
import type { BaseCameraDevice } from '../../../../server/src/camera/index.js';
|
|
3
|
-
import type { BaseLogger } from '../../../../shared/types/index.js';
|
|
4
|
-
import type {
|
|
3
|
+
import type { BaseLogger, VideoStreamingMode } from '../../../../shared/types/index.js';
|
|
4
|
+
import type { Go2RTCSession } from './streaming/go2rts-session.js';
|
|
5
5
|
export type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraActivitySettings, CameraSource, CameraZone, Container, Detection, DetectionZone, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, Point, PrebufferState, SirenSetEvent, SirenState, ZoneFilter, ZoneType, } from '../../../../shared/types/index.js';
|
|
6
|
-
export type {
|
|
7
|
-
export type { StreamingSession } from './streaming/streaming-session.js';
|
|
8
|
-
export type { WebrtcConnection } from './streaming/webrtc-connection.js';
|
|
6
|
+
export type { Go2RTCSession } from './streaming/go2rts-session.js';
|
|
9
7
|
export type CameraUiClientConfig = WithCredentials | WithToken;
|
|
10
8
|
export interface BasicBrowserPeerConnection {
|
|
11
9
|
enableMicrophone(track: MediaStreamTrack): void;
|
|
@@ -22,11 +20,17 @@ export interface BasicBrowserPeerConnection {
|
|
|
22
20
|
}
|
|
23
21
|
export interface CameraDevice extends BaseCameraDevice {
|
|
24
22
|
readonly started: boolean;
|
|
25
|
-
start(): void
|
|
23
|
+
start(): Promise<void>;
|
|
26
24
|
stop(): void;
|
|
27
25
|
close(): void;
|
|
28
26
|
snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
29
|
-
createSession(
|
|
27
|
+
createSession(options: Go2RTCSessionOptions): Go2RTCSession;
|
|
28
|
+
}
|
|
29
|
+
export interface Go2RTCSessionOptions {
|
|
30
|
+
sourceName: string;
|
|
31
|
+
mode: VideoStreamingMode;
|
|
32
|
+
videoElement: HTMLVideoElement;
|
|
33
|
+
reconnectInterval?: number;
|
|
30
34
|
}
|
|
31
35
|
interface BaseConfig {
|
|
32
36
|
endpoint: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const isMobile: () => boolean;
|
|
2
|
+
export declare const isAndroid: () => boolean;
|
|
3
|
+
export declare const isIphone: () => boolean;
|
|
4
|
+
export declare const isIpad: () => boolean;
|
|
5
|
+
export declare const isAppleMobile: () => boolean;
|
|
6
|
+
export declare const iosVersion: () => number[] | undefined;
|
|
7
|
+
export declare const isSafari: () => boolean;
|
|
8
|
+
export declare const safariVersion: () => RegExpMatchArray | null;
|
|
9
|
+
export declare const isFirefox: () => boolean;
|
|
10
|
+
export declare const isChrome: () => boolean;
|
|
11
|
+
export declare const isTouch: () => boolean;
|
|
12
|
+
export declare const uuidv4: () => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
2
1
|
import type { FastifyInstance } from 'fastify';
|
|
2
|
+
import type { Database as DB, RootDatabase as RootDB } from 'lmdb';
|
|
3
3
|
import type { Plugin } from '../../plugins/plugin.js';
|
|
4
4
|
import type { DBAuth, DBCamera, DBPlugin, DBSettings, DBUser } from './types.js';
|
|
5
5
|
export declare class Database {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DetectionZone,
|
|
1
|
+
import type { DetectionZone, ObjectClass } from '../../camera/types.js';
|
|
2
2
|
import type { ClientData, JwtTokenEncoded } from '../types/index.js';
|
|
3
3
|
export interface DBAuth {
|
|
4
4
|
tokens: JwtTokenEncoded[];
|
|
@@ -67,6 +67,7 @@ export interface BaseCamera {
|
|
|
67
67
|
type: CameraType;
|
|
68
68
|
activityZones: CameraZone[];
|
|
69
69
|
activitySettings: CameraActivitySettings;
|
|
70
|
+
frameWorkerSettings: CameraFrameWorkerSettings;
|
|
70
71
|
}
|
|
71
72
|
export interface Camera extends Omit<BaseCamera, 'activityZones'> {
|
|
72
73
|
hasAudioDetector: boolean;
|
|
@@ -100,17 +101,21 @@ export interface ZoneRegion {
|
|
|
100
101
|
coords: ZoneCoord[];
|
|
101
102
|
type: ZoneType;
|
|
102
103
|
filter: ZoneFilter;
|
|
103
|
-
classes:
|
|
104
|
+
classes: ObjectClass[];
|
|
104
105
|
isPrivacyMask: boolean;
|
|
105
106
|
}
|
|
106
107
|
export interface ZoneCoord {
|
|
107
108
|
_id: string;
|
|
108
109
|
points: Point;
|
|
109
110
|
}
|
|
110
|
-
export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId';
|
|
111
|
-
export interface CameraPublicProperties extends Omit<Camera, CameraPrivateProperties> {
|
|
112
|
-
}
|
|
113
111
|
export type CameraType = 'camera' | 'doorbell';
|
|
112
|
+
export type CameraFrameWorkerDecoder = 'pillow' | 'wasm';
|
|
113
|
+
export type CameraFrameWorkerResolution = 640 | 480 | 320;
|
|
114
|
+
export interface CameraFrameWorkerSettings {
|
|
115
|
+
decoder: CameraFrameWorkerDecoder;
|
|
116
|
+
fps: number;
|
|
117
|
+
resolution: CameraFrameWorkerResolution;
|
|
118
|
+
}
|
|
114
119
|
export interface CameraInformation {
|
|
115
120
|
model: string;
|
|
116
121
|
manufacturer: string;
|
|
@@ -178,6 +183,6 @@ export interface CameraInput {
|
|
|
178
183
|
}
|
|
179
184
|
export type CameraRoles = 'detect' | 'record' | 'stream' | 'snapshot' | 'none';
|
|
180
185
|
export interface CameraUiSettings {
|
|
181
|
-
|
|
186
|
+
streamingMode: VideoStreamingMode;
|
|
182
187
|
}
|
|
183
188
|
export type VideoStreamingMode = 'webrtc' | 'mse' | 'webrtc/tcp' | 'mjpeg' | 'hls' | 'mp4';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { AxiosResponse } from 'axios';
|
|
2
1
|
import type { RequestQueue } from '../queue.js';
|
|
3
2
|
export declare class ConfigApi {
|
|
4
3
|
private requestQueue;
|
|
5
4
|
constructor(requestQueue: RequestQueue);
|
|
6
|
-
getConfig(): Promise<
|
|
7
|
-
rewriteConfig(data: Record<string, any>): Promise<
|
|
8
|
-
mergeConfig(data: Record<string, any>): Promise<
|
|
5
|
+
getConfig(): Promise<any>;
|
|
6
|
+
rewriteConfig(data: Record<string, any>): Promise<void>;
|
|
7
|
+
mergeConfig(data: Record<string, any>): Promise<void>;
|
|
9
8
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const axiosInstance: () => AxiosInstance;
|
|
1
|
+
export declare const fetchInstance: () => ((url: RequestInfo, options?: RequestInit) => Promise<Response>);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { AxiosResponse } from 'axios';
|
|
2
1
|
import type { RequestQueue } from '../queue.js';
|
|
3
2
|
import type { SourceData, StreamData } from '../types.js';
|
|
4
3
|
export declare class StreamsApi {
|
|
5
4
|
private requestQueue;
|
|
6
5
|
constructor(requestQueue: RequestQueue);
|
|
7
|
-
createStream(data: StreamData): Promise<
|
|
8
|
-
deleteStream(data: SourceData): Promise<
|
|
9
|
-
getStreamInfo(data: SourceData): Promise<
|
|
10
|
-
updateStreamSource(data: StreamData): Promise<
|
|
6
|
+
createStream(data: StreamData): Promise<void>;
|
|
7
|
+
deleteStream(data: SourceData): Promise<void>;
|
|
8
|
+
getStreamInfo(data: SourceData): Promise<any>;
|
|
9
|
+
updateStreamSource(data: StreamData): Promise<void>;
|
|
11
10
|
}
|
|
@@ -16,7 +16,6 @@ export declare class Server {
|
|
|
16
16
|
private get corsOptions();
|
|
17
17
|
private get helmetOptions();
|
|
18
18
|
private get multipartOptions();
|
|
19
|
-
private get rateLimitOptions();
|
|
20
19
|
private get insecureServerOptions();
|
|
21
20
|
private get secureServerOptions();
|
|
22
21
|
private get socketOptions();
|