@camera.ui/browser 0.0.77 → 0.0.80

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.
Files changed (82) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +21 -7
  3. package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +4 -0
  4. package/dist/types/packages/client/browser/src/socket.d.ts +7 -7
  5. package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +54 -0
  6. package/dist/types/packages/client/browser/src/types.d.ts +11 -8
  7. package/dist/types/packages/client/browser/src/utils.d.ts +12 -0
  8. package/dist/types/server/src/api/controllers/users.controller.d.ts +9 -3
  9. package/dist/types/server/src/api/database/index.d.ts +10 -3
  10. package/dist/types/server/src/api/database/types.d.ts +35 -29
  11. package/dist/types/server/src/api/go2rtc/api/config.d.ts +3 -4
  12. package/dist/types/server/src/api/go2rtc/api/index.d.ts +1 -2
  13. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +5 -6
  14. package/dist/types/server/src/api/go2rtc/types.d.ts +5 -2
  15. package/dist/types/server/src/api/index.d.ts +7 -9
  16. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +1 -1
  17. package/dist/types/server/src/api/plugins/logger.plugin.d.ts +7 -0
  18. package/dist/types/server/src/api/routes/index.d.ts +1 -2
  19. package/dist/types/server/src/api/schemas/backup.schema.d.ts +53 -155
  20. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +201 -142
  21. package/dist/types/server/src/api/schemas/config.schema.d.ts +20 -20
  22. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +60 -60
  23. package/dist/types/server/src/api/schemas/users.schema.d.ts +242 -136
  24. package/dist/types/server/src/api/services/cameras.service.d.ts +9 -7
  25. package/dist/types/server/src/api/services/plugins.service.d.ts +1 -0
  26. package/dist/types/server/src/api/services/users.service.d.ts +6 -2
  27. package/dist/types/server/src/api/types/index.d.ts +34 -8
  28. package/dist/types/server/src/api/utils/fetch.d.ts +2 -0
  29. package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
  30. package/dist/types/server/src/api/websocket/types.d.ts +1 -15
  31. package/dist/types/server/src/api.d.ts +1 -2
  32. package/dist/types/server/src/camera/controller.d.ts +23 -12
  33. package/dist/types/server/src/camera/device.d.ts +7 -16
  34. package/dist/types/server/src/camera/index.d.ts +31 -22
  35. package/dist/types/server/src/camera/interfaces/audioDetection.d.ts +10 -0
  36. package/dist/types/server/src/camera/interfaces/camera.d.ts +19 -0
  37. package/dist/types/server/src/camera/interfaces/motionDetection.d.ts +10 -0
  38. package/dist/types/server/src/camera/interfaces/objectDetection.d.ts +10 -0
  39. package/dist/types/server/src/camera/interfaces/prebuffer.d.ts +11 -0
  40. package/dist/types/server/src/camera/interfaces/ptz.d.ts +13 -0
  41. package/dist/types/server/src/camera/polygon.d.ts +3 -2
  42. package/dist/types/server/src/camera/streaming/peer-connection.d.ts +1 -1
  43. package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +2 -1
  44. package/dist/types/server/src/camera/streaming/{streaming-session.d.ts → werift-session.d.ts} +1 -1
  45. package/dist/types/server/src/camera/types.d.ts +60 -21
  46. package/dist/types/server/src/camera/videoFrame.d.ts +10 -11
  47. package/dist/types/server/src/decoder/types.d.ts +31 -22
  48. package/dist/types/server/src/decoder/worker.d.ts +4 -4
  49. package/dist/types/server/src/nats/index.d.ts +1 -1
  50. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +30 -36
  51. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
  52. package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +1 -1
  53. package/dist/types/server/src/nats/proxy/systemManager.d.ts +1 -1
  54. package/dist/types/server/src/nats/server.d.ts +10 -7
  55. package/dist/types/server/src/nats/types.d.ts +27 -53
  56. package/dist/types/server/src/nats/websocket.d.ts +9 -5
  57. package/dist/types/server/src/plugins/base.d.ts +2 -3
  58. package/dist/types/server/src/plugins/index.d.ts +1 -0
  59. package/dist/types/server/src/plugins/types.d.ts +22 -5
  60. package/dist/types/server/src/plugins/worker.d.ts +1 -0
  61. package/dist/types/server/src/polyglot/node/plugins/api.d.ts +1 -2
  62. package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +2 -2
  63. package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +35 -14
  64. package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +5 -5
  65. package/dist/types/server/src/polyglot/node/plugins/proxy/pluginsManager.d.ts +5 -5
  66. package/dist/types/server/src/polyglot/node/plugins/proxy/systemManager.d.ts +5 -5
  67. package/dist/types/server/src/polyglot/node/plugins/schema.d.ts +10 -2
  68. package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +1 -1
  69. package/dist/types/server/src/services/config/constants.d.ts +0 -2
  70. package/dist/types/server/src/services/config/index.d.ts +29 -36
  71. package/dist/types/server/src/services/config/types.d.ts +1 -1
  72. package/dist/types/server/src/types.d.ts +4 -0
  73. package/dist/types/server/src/utils/packer.d.ts +2 -0
  74. package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
  75. package/dist/types/server/src/utils/utils.d.ts +5 -0
  76. package/dist/types/shared/types/index.d.ts +5 -0
  77. package/package.json +10 -14
  78. package/dist/types/packages/client/browser/src/streaming/peer-connection.d.ts +0 -24
  79. package/dist/types/packages/client/browser/src/streaming/streaming-session.d.ts +0 -25
  80. package/dist/types/packages/client/browser/src/streaming/webrtc-connection.d.ts +0 -26
  81. package/dist/types/server/src/api/utils/axios.d.ts +0 -2
  82. package/dist/types/server/src/api/websocket/nsp/streams.d.ts +0 -15
@@ -1,26 +1,40 @@
1
1
  import { BaseCameraDevice } from '../../../../../server/src/camera/index.js';
2
- import { StreamingSession } from '../streaming/streaming-session.js';
3
- import type { BaseLogger, Camera, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
2
+ import { CameraAudioDetectionInterface } from '../../../../../server/src/camera/interfaces/audioDetection.js';
3
+ import { CameraMotionDetectionInterface } from '../../../../../server/src/camera/interfaces/motionDetection.js';
4
+ import { CameraObjectDetectionInterface } from '../../../../../server/src/camera/interfaces/objectDetection.js';
5
+ import { CameraPrebufferInterface } from '../../../../../server/src/camera/interfaces/prebuffer.js';
6
+ import { CameraPTZInterface } from '../../../../../server/src/camera/interfaces/ptz.js';
7
+ import { Go2RTCSession } from '../streaming/go2rts-session.js';
8
+ import type { BaseLogger, Camera, CameraConfigInputSettings, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
4
9
  import type { SocketService } from '../socket.js';
5
- import type { CameraDevice } from '../types.js';
10
+ import type { CameraDevice, Go2RTCSessionOptions } from '../types.js';
6
11
  export declare class CameraDeviceProxy extends BaseCameraDevice implements CameraDevice {
7
12
  private socketService;
8
13
  private socket;
14
+ private pluginName;
15
+ private subject;
9
16
  private _started;
10
17
  get started(): boolean;
18
+ protected prebufferDelegate: CameraPrebufferInterface;
19
+ ptzDelegate: CameraPTZInterface;
20
+ audioDetectorDelegate: CameraAudioDetectionInterface;
21
+ motionDetectorDelegate: CameraMotionDetectionInterface;
22
+ objectDetectorDelegate: CameraObjectDetectionInterface;
11
23
  get sources(): CameraSource[];
12
24
  constructor(camera: Camera, socketService: SocketService, logger: BaseLogger);
13
- start(): void;
25
+ start(): Promise<void>;
14
26
  stop(): void;
15
27
  close(): void;
16
28
  connect(): Promise<void>;
17
29
  disconnect(): Promise<void>;
18
- reboot(): Promise<void>;
19
30
  getIceServers(): Promise<IceServer[]>;
20
- snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
21
- createSession(sourceName: string, videoElement: HTMLVideoElement): Promise<StreamingSession>;
31
+ createSession(options: Go2RTCSessionOptions): Go2RTCSession;
22
32
  updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
33
+ addCameraSource(source: CameraConfigInputSettings): Promise<void>;
34
+ updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>): Promise<void>;
35
+ removeCameraSource(sourceId: string): Promise<void>;
23
36
  refreshStates(): Promise<void>;
24
37
  cleanup(): Promise<void>;
25
38
  private listenToMessages;
39
+ private onRequest;
26
40
  }
@@ -7,9 +7,13 @@ interface DeviceManagerBrowserProxyMethods {
7
7
  }
8
8
  export declare class DeviceManager implements DeviceManagerBrowserProxyMethods {
9
9
  private socketService;
10
+ private socket;
10
11
  private logger;
12
+ private pluginName;
13
+ private subject;
11
14
  constructor(socketService: SocketService, logger: BaseLogger);
12
15
  getCameraById(id: string): Promise<CameraDevice | undefined>;
13
16
  getCameraByName(name: string): Promise<CameraDevice | undefined>;
17
+ private onRequest;
14
18
  }
15
19
  export {};
@@ -1,15 +1,15 @@
1
- import { Manager, type Socket } from 'socket.io-client';
2
- import type { ManagerNames, WebsocketClientRequest } from '../../../../shared/types/index.js';
1
+ import { Manager } from 'socket.io-client';
2
+ import type { Socket } from 'socket.io-client';
3
3
  export declare class SocketService {
4
- manager: Manager;
4
+ socket: Socket;
5
5
  private token;
6
6
  private endpoint;
7
- get socket(): Socket;
7
+ private socketList;
8
8
  constructor(endpoint: string, token: string);
9
- createManager(): {
9
+ close(): void;
10
+ getSocket(id: string, forceNew?: boolean): {
10
11
  manager: Manager;
11
12
  socket: Socket;
12
13
  };
13
- sendRequest<T extends ManagerNames>(data: WebsocketClientRequest<T>, socket?: Socket): Promise<any>;
14
- close(): void;
14
+ private createManager;
15
15
  }
@@ -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 { StreamingSession } from './streaming/streaming-session.js';
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 { BasicPeerConnection } from './streaming/peer-connection.js';
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,16 @@ 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
- snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
29
- createSession(sourceName: string, videoElement: HTMLVideoElement): Promise<StreamingSession>;
26
+ createSession(options: Go2RTCSessionOptions): Go2RTCSession;
27
+ }
28
+ export interface Go2RTCSessionOptions {
29
+ sourceName: string;
30
+ mode: VideoStreamingMode;
31
+ videoElement: HTMLVideoElement;
32
+ reconnectInterval?: number;
30
33
  }
31
34
  interface BaseConfig {
32
35
  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,15 +1,21 @@
1
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';
2
+ import type { DBCamviewLayout, DBUser } from '../database/types.js';
3
+ import type { AuthLoginRequest, AuthParamsRequest, PaginationRequest, UsersInsertRequest, UsersParamsRequest, UsersPatchRequest, ViewsInsertRequest, ViewsParamsRequest, ViewsPatchRequest } from '../types/index.js';
4
4
  export declare class UsersController {
5
5
  private app;
6
6
  private configService;
7
7
  private service;
8
8
  constructor(app: FastifyInstance);
9
- getByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): FastifyReply;
10
9
  insert(req: FastifyRequest<AuthLoginRequest & UsersInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
10
+ getByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): FastifyReply;
11
11
  list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | Partial<DBUser>[];
12
12
  patchByName(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & UsersPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
13
13
  removeByName(req: FastifyRequest<AuthLoginRequest & UsersParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
14
14
  removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
15
+ insertView(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
16
+ getViewById(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): FastifyReply;
17
+ listViews(req: FastifyRequest<AuthLoginRequest & PaginationRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): FastifyReply | Partial<DBUser>[];
18
+ patchViewById(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest & UsersParamsRequest & ViewsParamsRequest & ViewsPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
19
+ removeViewById(req: FastifyRequest<AuthLoginRequest & PaginationRequest & UsersParamsRequest & ViewsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | DBCamviewLayout[]>;
20
+ removeAllViews(req: FastifyRequest<AuthLoginRequest & PaginationRequest & AuthParamsRequest & UsersParamsRequest>, reply: FastifyReply): Promise<FastifyReply | DBCamviewLayout[]>;
15
21
  }
@@ -1,21 +1,28 @@
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 {
6
- private db;
6
+ readonly CAMERAS_ID = "cameras";
7
+ readonly DATABASE_ID = "database";
8
+ readonly PLUGINS_ID = "plugins";
9
+ readonly USER_PLUGINS_ID = "user-plugins";
10
+ readonly SETTINGS_ID = "settings";
11
+ readonly USERS_ID = "users";
12
+ readonly TOKENS_ID = "tokens";
7
13
  authDB: RootDB<DBAuth, 'auth'>;
8
14
  camerasDB: DB<DBCamera[], 'cameras'>;
9
15
  pluginsDB: DB<DBPlugin[], 'plugins'>;
10
16
  settingsDB: DB<DBSettings, 'settings'>;
11
17
  usersDB: DB<DBUser[], 'users'>;
12
18
  private initialized;
19
+ private db;
13
20
  private app;
14
21
  private configService;
15
22
  private logger;
16
23
  constructor(app: FastifyInstance);
24
+ initialize(): Promise<void>;
17
25
  close(): Promise<void>;
18
- initialize(): Promise<Database>;
19
26
  updateCameras(): Promise<void>;
20
27
  createPluginDatabase(plugin: Plugin): Promise<void>;
21
28
  private ensureDatabases;
@@ -1,5 +1,5 @@
1
- import type { DetectionZone, ObjectClasses } from '../../camera/types.js';
2
- import type { ClientData, JwtTokenEncoded } from '../types/index.js';
1
+ import type { DetectionZone, ObjectClass } from '../../camera/types.js';
2
+ import type { CamviewSettingsLayoutMode, ClientData, JwtTokenEncoded } from '../types/index.js';
3
3
  export interface DBAuth {
4
4
  tokens: JwtTokenEncoded[];
5
5
  clients: ClientData[];
@@ -32,16 +32,19 @@ export interface DBUser {
32
32
  export type DBRoles = 'admin' | 'user';
33
33
  export interface DBUserPreferences {
34
34
  camview: {
35
- grids: DBCamviewLayout[];
35
+ views: DBCamviewLayout[];
36
36
  };
37
37
  }
38
+ export type DBCamviewViewSize = 1 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 20 | 26;
38
39
  export interface DBCamviewLayout {
39
40
  readonly _id: string;
40
41
  name: string;
42
+ viewSize: DBCamviewViewSize;
41
43
  cameras: DBCamviewLayoutCamera[];
44
+ type: CamviewSettingsLayoutMode;
42
45
  }
43
46
  export interface DBCamviewLayoutCamera {
44
- readonly _id: string;
47
+ index: number;
45
48
  name: string;
46
49
  }
47
50
  export interface DBPluginStorage {
@@ -67,6 +70,7 @@ export interface BaseCamera {
67
70
  type: CameraType;
68
71
  activityZones: CameraZone[];
69
72
  activitySettings: CameraActivitySettings;
73
+ frameWorkerSettings: CameraFrameWorkerSettings;
70
74
  }
71
75
  export interface Camera extends Omit<BaseCamera, 'activityZones'> {
72
76
  hasAudioDetector: boolean;
@@ -74,7 +78,6 @@ export interface Camera extends Omit<BaseCamera, 'activityZones'> {
74
78
  hasObjectDetector: boolean;
75
79
  hasPtz: boolean;
76
80
  hasPrebuffer: boolean;
77
- hasIntercom: boolean;
78
81
  sources: CameraInput[];
79
82
  activityZones: DetectionZone[];
80
83
  }
@@ -100,17 +103,21 @@ export interface ZoneRegion {
100
103
  coords: ZoneCoord[];
101
104
  type: ZoneType;
102
105
  filter: ZoneFilter;
103
- classes: ObjectClasses[];
106
+ classes: ObjectClass[];
104
107
  isPrivacyMask: boolean;
105
108
  }
106
109
  export interface ZoneCoord {
107
110
  _id: string;
108
111
  points: Point;
109
112
  }
110
- export type CameraPrivateProperties = '_id' | 'nativeId' | 'pluginId';
111
- export interface CameraPublicProperties extends Omit<Camera, CameraPrivateProperties> {
112
- }
113
113
  export type CameraType = 'camera' | 'doorbell';
114
+ export type CameraFrameWorkerDecoder = 'pillow' | 'wasm';
115
+ export type CameraFrameWorkerResolution = 640 | 480 | 320;
116
+ export interface CameraFrameWorkerSettings {
117
+ decoder: CameraFrameWorkerDecoder;
118
+ fps: number;
119
+ resolution: CameraFrameWorkerResolution;
120
+ }
114
121
  export interface CameraInformation {
115
122
  model: string;
116
123
  manufacturer: string;
@@ -125,7 +132,6 @@ export interface CameraExtensions {
125
132
  motionDetection?: string;
126
133
  audioDetection?: string;
127
134
  objectDetection?: string;
128
- intercom?: string;
129
135
  ptz?: string;
130
136
  plugins: string[];
131
137
  }
@@ -139,30 +145,30 @@ export interface CameraInputSettings {
139
145
  urls: string[];
140
146
  }
141
147
  export interface Go2RtcRTSPSource {
142
- single: string;
143
- default: string;
144
- mp4: string;
148
+ readonly single: string;
149
+ readonly default: string;
150
+ readonly mp4: string;
145
151
  }
146
152
  export interface Go2RtcEndpoint {
147
- webrtc: string;
148
- mse: string;
149
- lmp4: string;
150
- mmp4: string;
151
- mp4: string;
152
- mp4Snapshot: string;
153
- jpegSnapshot: string;
154
- lHlsTs: string;
155
- lHlsFmp4: string;
156
- mHlsFmp4: string;
157
- mjpeg: string;
158
- mjpegHtml: string;
153
+ readonly webrtc: string;
154
+ readonly mse: string;
155
+ readonly lmp4: string;
156
+ readonly mmp4: string;
157
+ readonly mp4: string;
158
+ readonly mp4Snapshot: string;
159
+ readonly jpegSnapshot: string;
160
+ readonly lHlsTs: string;
161
+ readonly lHlsFmp4: string;
162
+ readonly mHlsFmp4: string;
163
+ readonly mjpeg: string;
164
+ readonly mjpegHtml: string;
159
165
  }
160
166
  export interface Go2RtcFFMPEGSource {
161
- aac: string;
162
- opus: string;
167
+ readonly aac: string;
168
+ readonly opus: string;
163
169
  }
164
170
  export interface Go2RtcWSSource {
165
- webrtc: string;
171
+ readonly webrtc: string;
166
172
  }
167
173
  export interface StreamUrls {
168
174
  ws: Go2RtcWSSource;
@@ -178,6 +184,6 @@ export interface CameraInput {
178
184
  }
179
185
  export type CameraRoles = 'detect' | 'record' | 'stream' | 'snapshot' | 'none';
180
186
  export interface CameraUiSettings {
181
- streamingModes: VideoStreamingMode[];
187
+ streamingMode: VideoStreamingMode;
182
188
  }
183
189
  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<AxiosResponse>;
7
- rewriteConfig(data: Record<string, any>): Promise<AxiosResponse>;
8
- mergeConfig(data: Record<string, any>): Promise<AxiosResponse>;
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
- import { type AxiosInstance } from 'axios';
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
- import type { SourceData, StreamData } from '../types.js';
2
+ import type { NameData, 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<AxiosResponse>;
8
- deleteStream(data: SourceData): Promise<AxiosResponse>;
9
- getStreamInfo(data: SourceData): Promise<AxiosResponse>;
10
- updateStreamSource(data: StreamData): Promise<AxiosResponse>;
6
+ createStream(data: StreamData): Promise<void>;
7
+ deleteStream(data: NameData): Promise<void>;
8
+ getStreamInfo(data: SourceData): Promise<any>;
9
+ updateStreamSource(data: StreamData): Promise<void>;
11
10
  }
@@ -44,14 +44,17 @@ export interface OnvifSource {
44
44
  export interface ExitData {
45
45
  code: number;
46
46
  }
47
+ export interface NameData {
48
+ name: string;
49
+ }
47
50
  export interface SourceData {
48
51
  src: string;
49
52
  }
50
53
  export interface StreamData {
51
- src: string;
52
54
  name: string;
55
+ src?: string | string[];
53
56
  }
54
57
  export interface IntercomData {
55
- src: string;
58
+ name: string;
56
59
  dst: string;
57
60
  }
@@ -1,6 +1,6 @@
1
1
  export declare class Server {
2
- private secureApp?;
3
- private insecureApp?;
2
+ private app?;
3
+ private localApp?;
4
4
  private api;
5
5
  private logger;
6
6
  private configService;
@@ -8,17 +8,15 @@ export declare class Server {
8
8
  register(): Promise<void>;
9
9
  listen(): Promise<void>;
10
10
  close(): Promise<void>;
11
- private setupSecureAppListeners;
12
- private setupInsecureAppListeners;
13
- private registerSecureAppPlugins;
14
- private registerInsecureAppPlugins;
11
+ private setupListeners;
12
+ private registerPlugins;
15
13
  private registerRouters;
16
14
  private get corsOptions();
17
15
  private get helmetOptions();
18
16
  private get multipartOptions();
19
- private get rateLimitOptions();
20
- private get insecureServerOptions();
21
- private get secureServerOptions();
17
+ private get serverOptions();
18
+ private get localServerOptions();
19
+ private qsParser;
22
20
  private get socketOptions();
23
21
  private get staticOptions();
24
22
  }
@@ -1,3 +1,3 @@
1
- import { type AuthLoginRequest, type PaginationRequest, type PaginationResponse } from '../types/index.js';
2
1
  import type { FastifyReply, FastifyRequest } from 'fastify';
2
+ import type { AuthLoginRequest, PaginationRequest, PaginationResponse } from '../types/index.js';
3
3
  export declare const pages: (req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply, payload: any) => Promise<PaginationResponse | void>;
@@ -0,0 +1,7 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ declare module 'fastify' {
3
+ interface FastifyReply {
4
+ startTime: number;
5
+ }
6
+ }
7
+ export declare const LoggerPlugin: FastifyPluginAsync;
@@ -2,6 +2,5 @@ import type { FastifyInstance } from 'fastify';
2
2
  export declare class FastifyRoutes {
3
3
  private app;
4
4
  constructor(app: FastifyInstance<any, any, any, any>);
5
- register(): Promise<void>;
6
- registerInsecure(): Promise<void>;
5
+ register(local?: boolean): Promise<void>;
7
6
  }