@camera.ui/browser 0.0.72 → 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.
Files changed (67) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/streaming/streaming-session.d.ts +2 -1
  3. package/dist/types/server/src/api/controllers/api.controller.d.ts +6 -0
  4. package/dist/types/server/src/api/controllers/auth.controller.d.ts +20 -0
  5. package/dist/types/server/src/api/controllers/backup.controller.d.ts +10 -0
  6. package/dist/types/server/src/api/controllers/cameras.controller.d.ts +33 -0
  7. package/dist/types/server/src/api/controllers/config.controller.d.ts +14 -0
  8. package/dist/types/server/src/api/controllers/files.controller.d.ts +8 -0
  9. package/dist/types/server/src/api/controllers/plugins.controller.d.ts +54 -0
  10. package/dist/types/server/src/api/controllers/streams.controller.d.ts +12 -0
  11. package/dist/types/server/src/api/controllers/system.controller.d.ts +14 -0
  12. package/dist/types/server/src/api/controllers/users.controller.d.ts +15 -0
  13. package/dist/types/server/src/api/database/index.d.ts +1 -1
  14. package/dist/types/server/src/api/go2rtc/api/application.d.ts +1 -1
  15. package/dist/types/server/src/api/go2rtc/api/config.d.ts +1 -1
  16. package/dist/types/server/src/api/go2rtc/api/snapshot.d.ts +1 -1
  17. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +1 -1
  18. package/dist/types/server/src/api/index.d.ts +18 -0
  19. package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +5 -0
  20. package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +4 -0
  21. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +3 -0
  22. package/dist/types/server/src/api/plugins/cameraui.plugin.d.ts +11 -0
  23. package/dist/types/server/src/api/plugins/database.plugin.d.ts +11 -0
  24. package/dist/types/server/src/api/plugins/go2rtc.plugin.d.ts +11 -0
  25. package/dist/types/server/src/api/plugins/logger.plugin.d.ts +7 -0
  26. package/dist/types/server/src/api/plugins/socket.plugin.d.ts +11 -0
  27. package/dist/types/server/src/api/plugins/system.plugin.d.ts +21 -0
  28. package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +8 -0
  29. package/dist/types/server/src/api/routes/api.routes.d.ts +2 -0
  30. package/dist/types/server/src/api/routes/auth.routes.d.ts +2 -0
  31. package/dist/types/server/src/api/routes/backup.routes.d.ts +2 -0
  32. package/dist/types/server/src/api/routes/cameras.routes.d.ts +2 -0
  33. package/dist/types/server/src/api/routes/config.routes.d.ts +2 -0
  34. package/dist/types/server/src/api/routes/files.routes.d.ts +2 -0
  35. package/dist/types/server/src/api/routes/index.d.ts +7 -0
  36. package/dist/types/server/src/api/routes/plugins.routes.d.ts +2 -0
  37. package/dist/types/server/src/api/routes/streams.routes.d.ts +2 -0
  38. package/dist/types/server/src/api/routes/system.routes.d.ts +2 -0
  39. package/dist/types/server/src/api/routes/users.routes.d.ts +2 -0
  40. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +25 -0
  41. package/dist/types/server/src/api/services/backup.service.d.ts +10 -0
  42. package/dist/types/server/src/api/utils/axios.d.ts +2 -0
  43. package/dist/types/server/src/api/utils/cert.d.ts +11 -0
  44. package/dist/types/server/src/api/utils/moveFiles.d.ts +1 -0
  45. package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
  46. package/dist/types/server/src/api/websocket/types.d.ts +1 -1
  47. package/dist/types/server/src/decoder/ffmpeg.d.ts +1 -0
  48. package/dist/types/server/src/decoder/index.d.ts +13 -1
  49. package/dist/types/server/src/decoder/types.d.ts +29 -21
  50. package/dist/types/server/src/decoder/worker/index.d.ts +24 -9
  51. package/dist/types/server/src/devices/camera/controller/types.d.ts +1 -2
  52. package/dist/types/server/src/devices/camera/index.d.ts +2 -1
  53. package/dist/types/server/src/devices/camera/streaming/peer-connection.d.ts +6 -5
  54. package/dist/types/server/src/main.d.ts +21 -0
  55. package/dist/types/server/src/nats/constants.d.ts +1 -0
  56. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +1 -5
  57. package/dist/types/server/src/nats/server.d.ts +3 -2
  58. package/dist/types/server/src/nats/types.d.ts +2 -6
  59. package/dist/types/server/src/plugins/node/logger.d.ts +2 -0
  60. package/dist/types/server/src/plugins/node/proxy/cameraDevice.d.ts +6 -2
  61. package/dist/types/server/src/plugins/node/proxy/queue.d.ts +1 -1
  62. package/dist/types/server/src/plugins/worker-ipc.d.ts +5 -2
  63. package/dist/types/server/src/services/logger/index.d.ts +3 -3
  64. package/dist/types/server/src/utils/pythonInstaller.d.ts +2 -1
  65. package/dist/types/server/src/utils/subscribed.d.ts +1 -1
  66. package/package.json +4 -4
  67. package/dist/types/server/src/api/websocket/nsp/frame.d.ts +0 -10
@@ -1,5 +1,6 @@
1
- import { Observable, ReplaySubject } from 'rxjs';
1
+ import { ReplaySubject } from 'rxjs';
2
2
  import { Subscribed } from '../../../../../shared/types/index.js';
3
+ import type { Observable } from 'rxjs';
3
4
  import type { BaseLogger } from '../../../../../shared/types/index.js';
4
5
  import type { CameraDevice } from '../types.js';
5
6
  import type { WebrtcConnection } from './webrtc-connection.js';
@@ -0,0 +1,6 @@
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
+ }
@@ -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';
@@ -1,4 +1,4 @@
1
- import { RequestQueue } from '../queue.js';
1
+ import type { RequestQueue } from '../queue.js';
2
2
  import type { ApplicationResponse, ExitData } from '../types.js';
3
3
  export declare class ApplicationApi {
4
4
  private requestQueue;
@@ -1,5 +1,5 @@
1
- import { RequestQueue } from '../queue.js';
2
1
  import type { AxiosResponse } from 'axios';
2
+ import type { RequestQueue } from '../queue.js';
3
3
  export declare class ConfigApi {
4
4
  private requestQueue;
5
5
  constructor(requestQueue: RequestQueue);
@@ -1,4 +1,4 @@
1
- import { RequestQueue } from '../queue.js';
1
+ import type { RequestQueue } from '../queue.js';
2
2
  import type { SourceData } from '../types.js';
3
3
  export declare class SnapshotApi {
4
4
  private requestQueue;
@@ -1,5 +1,5 @@
1
- import { RequestQueue } from '../queue.js';
2
1
  import type { AxiosResponse } from 'axios';
2
+ import type { RequestQueue } from '../queue.js';
3
3
  import type { SourceData, StreamData } from '../types.js';
4
4
  export declare class StreamsApi {
5
5
  private requestQueue;
@@ -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,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;
@@ -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 {};
@@ -0,0 +1,8 @@
1
+ import { type Details } from 'express-useragent';
2
+ import type { FastifyPluginAsync } from 'fastify';
3
+ declare module 'fastify' {
4
+ interface FastifyRequest {
5
+ useragent?: Details;
6
+ }
7
+ }
8
+ export declare const UserAgentPlugin: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const ApiRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const AuthRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const BackupRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const CamerasRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const ConfigRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const FilesRoute: FastifyPluginAsync;
@@ -0,0 +1,7 @@
1
+ import type { FastifyInstance } from 'fastify';
2
+ export declare class FastifyRoutes {
3
+ private app;
4
+ constructor(app: FastifyInstance<any, any, any, any>);
5
+ register(): Promise<void>;
6
+ registerInsecure(): Promise<void>;
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const PluginsRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const StreamsRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const SystemRoute: FastifyPluginAsync;
@@ -0,0 +1,2 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ export declare const UsersRoute: FastifyPluginAsync;
@@ -0,0 +1,25 @@
1
+ import zod from 'zod';
2
+ export declare const installPluginSchema: zod.ZodObject<{
3
+ pluginname: zod.ZodEffects<zod.ZodString, string, string>;
4
+ pluginversion: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
5
+ }, "strict", zod.ZodTypeAny, {
6
+ pluginname: string;
7
+ pluginversion: string;
8
+ }, {
9
+ pluginname: string;
10
+ pluginversion?: string | undefined;
11
+ }>;
12
+ export declare const actionPluginSchema: zod.ZodObject<{
13
+ actionId: zod.ZodString;
14
+ payload: zod.ZodAny;
15
+ }, "strict", zod.ZodTypeAny, {
16
+ actionId: string;
17
+ payload?: any;
18
+ }, {
19
+ actionId: string;
20
+ payload?: any;
21
+ }>;
22
+ export declare const patchPluginConfigJsonSchema: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
23
+ export type InstallPluginInput = zod.TypeOf<typeof installPluginSchema>;
24
+ export type ActionPluginInput = zod.TypeOf<typeof actionPluginSchema>;
25
+ export type PatchPluginConfigJsonInput = zod.TypeOf<typeof patchPluginConfigJsonSchema>;
@@ -0,0 +1,10 @@
1
+ import type { BackupInfo, MultipartFile, UiLocalStorage } from '../types/index.js';
2
+ export declare class BackupService {
3
+ private logger;
4
+ private configService;
5
+ private socketService;
6
+ constructor();
7
+ createBackup(localStorage?: Partial<UiLocalStorage>): Promise<BackupInfo>;
8
+ restoreBackup(file: MultipartFile): Promise<any>;
9
+ removeBackup(backup: BackupInfo): Promise<void>;
10
+ }
@@ -0,0 +1,2 @@
1
+ declare const axiosInstance: import("axios").AxiosInstance;
2
+ export default axiosInstance;
@@ -0,0 +1,11 @@
1
+ import forge from 'node-forge';
2
+ export interface CertKey {
3
+ cert: string;
4
+ certPath: string;
5
+ key: string;
6
+ keyPath: string;
7
+ }
8
+ export declare const getCert: () => CertKey;
9
+ export declare const createRootCA: (customAddresses?: string[]) => CertKey;
10
+ export declare const createCSR: (addresses: string[], keys: forge.pki.rsa.KeyPair) => Partial<CertKey>;
11
+ export declare const createCert: (customAddresses?: string[]) => CertKey;
@@ -0,0 +1 @@
1
+ export declare const moveFiles: (sourceDir: string, targetDir: string) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Namespace, Server, Socket } from 'socket.io';
2
- import { PLUGIN_STATUS } from '../../../plugins/types.js';
2
+ import type { PLUGIN_STATUS } from '../../../plugins/types.js';
3
3
  import { RUNTIME_STATUS } from '../../../services/config/types.js';
4
4
  import type { SocketNsp } from '../types.js';
5
5
  export declare class StatusNamespace {
@@ -1,6 +1,6 @@
1
- import { PLUGIN_STATUS } from '../../plugins/types.js';
2
1
  import type { Namespace } from 'socket.io';
3
2
  import type { WebSocket } from 'ws';
3
+ import type { PLUGIN_STATUS } from '../../plugins/types.js';
4
4
  import type { VideoStreamingMode } from '../database/types.js';
5
5
  export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/streams' | '/plugins' | '/proxy' | '/frame';
6
6
  export interface SocketNspMap {
@@ -0,0 +1 @@
1
+ export declare function buildFfmpegArguments(ffmpegPath: string, streamUrl: string, port: number): Promise<string[]>;
@@ -1,10 +1,22 @@
1
1
  import { FrameWorker } from './worker/index.js';
2
2
  import type { CameraController } from '../devices/camera/controller/index.js';
3
- export declare class Decoder {
3
+ export declare class FrameManager {
4
4
  frameWorkers: Map<string, FrameWorker>;
5
+ private initialized;
5
6
  private api;
6
7
  private proxyServer;
8
+ private logger;
9
+ private publisher?;
10
+ private subscriber?;
11
+ private subject;
7
12
  constructor();
13
+ init(): Promise<void>;
8
14
  addCamera(camera: CameraController): Promise<FrameWorker>;
9
15
  removeCamera(camera: CameraController): Promise<void>;
16
+ private handleConnectMessage;
17
+ private handleDisconnectMessage;
18
+ private disconnectClient;
19
+ private disconnectAllClients;
20
+ private startPingPongForClient;
21
+ private listenToMessages;
10
22
  }
@@ -10,19 +10,11 @@ export interface FrameMetadata {
10
10
  height: number;
11
11
  origHeight: number;
12
12
  }
13
- export interface FrameSession {
14
- token: string;
15
- wsPort: number;
16
- }
17
- export interface Frame {
18
- metadata: FrameMetadata;
19
- data: Buffer;
20
- }
21
13
  export interface ImageCrop {
22
14
  top: number;
23
15
  left: number;
24
- bottom: number;
25
- right: number;
16
+ width: number;
17
+ height: number;
26
18
  }
27
19
  export interface ImageResize {
28
20
  width?: number;
@@ -34,7 +26,7 @@ export interface ImageRotate {
34
26
  options?: RotateOptions;
35
27
  }
36
28
  export interface ImageFormat {
37
- format: 'rgba' | 'gray' | 'bgr';
29
+ format: 'rgba' | 'gray';
38
30
  }
39
31
  export interface ImageOptions {
40
32
  format?: ImageFormat;
@@ -60,33 +52,49 @@ export interface VideoSession {
60
52
  cp: ChildProcess;
61
53
  }
62
54
  export interface BaseFrameWorkerConfig {
55
+ frameWorkerId: string;
63
56
  cameraId: string;
64
57
  cameraName: string;
65
58
  ffmpegPath: string;
66
- logLevel?: string;
67
- disableTimestamps?: boolean;
59
+ logLevel: string;
60
+ disableTimestamps: boolean;
68
61
  auth: {
69
62
  user: string;
70
63
  pass: string;
71
64
  };
72
65
  }
73
- export type WorkerMessage = 'ready' | 'getCameraSource';
74
- export type MainMessage = 'getMetadata' | 'startWorker' | 'stopWorker' | 'startVideoSession' | 'stopVideoSession' | 'setCameraName';
66
+ export type WorkerMessage = 'started' | 'getFFmpegArgs';
67
+ export type MainMessage = 'getMetadata' | 'startVideoSession' | 'stopVideoSession' | 'setCameraName';
75
68
  export interface MainToWorkerMessage {
76
- id: string;
77
69
  message: MainMessage;
78
70
  data: Record<string, any>;
79
71
  }
80
72
  export interface WorkerToMainResponse {
81
- id: string;
82
- response: any;
73
+ response?: Record<string, any>;
83
74
  }
84
75
  export interface WorkerToMainMessage {
85
- id: string;
86
76
  message: WorkerMessage;
87
77
  data: Record<string, any>;
88
78
  }
89
79
  export interface MainToWorkerResponse {
90
- id: string;
91
- response: any;
80
+ response?: Record<string, any>;
81
+ }
82
+ export interface SignalingRequest {
83
+ type: 'connect' | 'disconnect';
84
+ requestId: string;
85
+ cameraId: string;
86
+ pluginId: string;
87
+ }
88
+ export interface SignalingResponse {
89
+ type: 'connected' | 'disconnected' | 'error';
90
+ requestId: string;
91
+ message?: string;
92
+ }
93
+ export interface PingMessage {
94
+ type: 'ping';
95
+ requestId: string;
96
+ }
97
+ export interface PongMessage {
98
+ type: 'pong';
99
+ requestId: string;
92
100
  }