@camera.ui/browser 0.0.82 → 0.0.83

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 (89) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +3 -7
  3. package/dist/types/server/src/api/database/types.d.ts +1 -1
  4. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +4 -4
  5. package/dist/types/server/src/api/go2rtc/types.d.ts +6 -2
  6. package/dist/types/server/src/api/schemas/backup.schema.d.ts +3 -3
  7. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +54 -34
  8. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +29 -32
  9. package/dist/types/server/src/api/schemas/users.schema.d.ts +6 -6
  10. package/dist/types/server/src/api/services/cameras.service.d.ts +1 -0
  11. package/dist/types/server/src/api/types/index.d.ts +1 -1
  12. package/dist/types/server/src/api.d.ts +2 -2
  13. package/dist/types/server/src/camera/controller.d.ts +9 -4
  14. package/dist/types/server/src/camera/device.d.ts +15 -3
  15. package/dist/types/server/src/camera/index.d.ts +18 -39
  16. package/dist/types/server/src/camera/interfaces/camera.d.ts +0 -1
  17. package/dist/types/server/src/camera/types.d.ts +1 -3
  18. package/dist/types/server/src/camera/videoFrame.d.ts +3 -3
  19. package/dist/types/server/src/decoder/types.d.ts +5 -12
  20. package/dist/types/server/src/decoder/worker.d.ts +3 -5
  21. package/dist/types/server/src/nats/connection.d.ts +17 -0
  22. package/dist/types/server/src/nats/error.d.ts +9 -0
  23. package/dist/types/server/src/nats/index.d.ts +6 -4
  24. package/dist/types/server/src/nats/messageQueue.d.ts +7 -4
  25. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +2 -2
  26. package/dist/types/server/src/nats/server.d.ts +0 -1
  27. package/dist/types/server/src/nats/subscription.d.ts +12 -0
  28. package/dist/types/server/src/nats/types.d.ts +25 -40
  29. package/dist/types/server/src/nats/utils.d.ts +2 -4
  30. package/dist/types/server/src/plugins/index.d.ts +3 -5
  31. package/dist/types/server/src/plugins/plugin.d.ts +4 -13
  32. package/dist/types/server/src/plugins/types.d.ts +4 -0
  33. package/dist/types/server/src/plugins/worker.d.ts +1 -1
  34. package/dist/types/server/src/polyglot/node/plugins/cameraStorage.d.ts +2 -2
  35. package/dist/types/server/src/polyglot/node/plugins/{api.d.ts → pluginApi.d.ts} +9 -12
  36. package/dist/types/server/src/polyglot/node/plugins/{logger.d.ts → pluginLogger.d.ts} +2 -0
  37. package/dist/types/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +8 -11
  38. package/dist/types/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +6 -8
  39. package/dist/types/server/src/polyglot/node/plugins/storageController.d.ts +2 -2
  40. package/dist/types/server/src/services/config/index.d.ts +3 -2
  41. package/dist/types/server/src/services/config/types.d.ts +4 -4
  42. package/dist/types/server/src/services/logger/index.d.ts +2 -0
  43. package/dist/types/server/src/utils/ffmpeg.d.ts +2 -0
  44. package/dist/types/server/src/utils/pythonInstaller.d.ts +1 -1
  45. package/dist/types/server/src/utils/subscribed.d.ts +4 -4
  46. package/package.json +5 -5
  47. package/dist/types/server/src/api/controllers/api.controller.d.ts +0 -6
  48. package/dist/types/server/src/api/controllers/auth.controller.d.ts +0 -20
  49. package/dist/types/server/src/api/controllers/backup.controller.d.ts +0 -10
  50. package/dist/types/server/src/api/controllers/cameras.controller.d.ts +0 -34
  51. package/dist/types/server/src/api/controllers/config.controller.d.ts +0 -14
  52. package/dist/types/server/src/api/controllers/files.controller.d.ts +0 -8
  53. package/dist/types/server/src/api/controllers/frameWorkers.controller.d.ts +0 -16
  54. package/dist/types/server/src/api/controllers/plugins.controller.d.ts +0 -59
  55. package/dist/types/server/src/api/controllers/system.controller.d.ts +0 -14
  56. package/dist/types/server/src/api/controllers/users.controller.d.ts +0 -28
  57. package/dist/types/server/src/api/index.d.ts +0 -21
  58. package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +0 -5
  59. package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +0 -4
  60. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +0 -3
  61. package/dist/types/server/src/api/plugins/cameraui.plugin.d.ts +0 -11
  62. package/dist/types/server/src/api/plugins/database.plugin.d.ts +0 -11
  63. package/dist/types/server/src/api/plugins/go2rtc.plugin.d.ts +0 -11
  64. package/dist/types/server/src/api/plugins/logger.plugin.d.ts +0 -7
  65. package/dist/types/server/src/api/plugins/socket.plugin.d.ts +0 -11
  66. package/dist/types/server/src/api/plugins/system.plugin.d.ts +0 -21
  67. package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +0 -8
  68. package/dist/types/server/src/api/routes/api.routes.d.ts +0 -2
  69. package/dist/types/server/src/api/routes/auth.routes.d.ts +0 -2
  70. package/dist/types/server/src/api/routes/backup.routes.d.ts +0 -2
  71. package/dist/types/server/src/api/routes/cameras.routes.d.ts +0 -2
  72. package/dist/types/server/src/api/routes/config.routes.d.ts +0 -2
  73. package/dist/types/server/src/api/routes/files.routes.d.ts +0 -2
  74. package/dist/types/server/src/api/routes/frameWorkers.routes.d.ts +0 -2
  75. package/dist/types/server/src/api/routes/index.d.ts +0 -6
  76. package/dist/types/server/src/api/routes/plugins.routes.d.ts +0 -2
  77. package/dist/types/server/src/api/routes/system.routes.d.ts +0 -2
  78. package/dist/types/server/src/api/routes/users.routes.d.ts +0 -2
  79. package/dist/types/server/src/api/services/backup.service.d.ts +0 -11
  80. package/dist/types/server/src/api/utils/cert.d.ts +0 -11
  81. package/dist/types/server/src/api/utils/fetch.d.ts +0 -2
  82. package/dist/types/server/src/api/utils/moveFiles.d.ts +0 -1
  83. package/dist/types/server/src/api/utils/parse.d.ts +0 -2
  84. package/dist/types/server/src/decoder/ffmpeg.d.ts +0 -2
  85. package/dist/types/server/src/main.d.ts +0 -21
  86. package/dist/types/server/src/nats/proxy/index.d.ts +0 -2
  87. package/dist/types/server/src/polyglot/node/plugins/proxy/index.d.ts +0 -2
  88. package/dist/types/server/src/polyglot/node/plugins/proxy/messageQueue.d.ts +0 -20
  89. /package/dist/types/server/src/polyglot/node/plugins/{config.d.ts → configService.d.ts} +0 -0
@@ -5,13 +5,13 @@ import { CameraPTZInterface } from '../../../../camera/interfaces/ptz.js';
5
5
  import { MotionFrame, VideoFrame } from '../../../../camera/videoFrame.js';
6
6
  import type { Camera } from '../../../../api/database/types.js';
7
7
  import type { CameraConfigInputSettings, CameraDelegates, CameraSource, SetValues } from '../../../../camera/types.js';
8
- import type { VideoFrame as VideoFrameImp } from '../../../../decoder/types.js';
8
+ import type { AuthConfig, VideoFrame as VideoFrameImp } from '../../../../decoder/types.js';
9
9
  import type { CameraDeviceProxyMethods } from '../../../../nats/types.js';
10
10
  import type { PluginInfo } from '../../../../plugins/types.js';
11
11
  import type { IceServer } from '../../../../services/config/types.js';
12
12
  import type { MethodKeys, MethodType } from '../../../../types.js';
13
- import type { PluginAPI } from '../api.js';
14
- import type { PluginLogger } from '../logger.js';
13
+ import type { API } from '../pluginApi.js';
14
+ import type { PluginLogger } from '../pluginLogger.js';
15
15
  export declare class CameraDeviceProxy extends CameraDevice {
16
16
  private api;
17
17
  private initialized;
@@ -39,14 +39,11 @@ export declare class CameraDeviceProxy extends CameraDevice {
39
39
  private auth;
40
40
  private proxyEndpoints;
41
41
  private plugin;
42
- cameraDelegate: CameraInterface;
42
+ protected cameraDelegate: CameraInterface;
43
+ protected ptzDelegate: CameraPTZInterface;
43
44
  protected prebufferDelegate: CameraPrebufferInterface;
44
- ptzDelegate: CameraPTZInterface;
45
45
  get sources(): CameraSource[];
46
- constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, plugin: PluginInfo, proxyEndpoints: string[], auth: {
47
- user: string;
48
- pass: string;
49
- });
46
+ constructor(api: API, logger: PluginLogger, camera: Camera, plugin: PluginInfo, proxyEndpoints: string[], auth: AuthConfig);
50
47
  init(): Promise<void>;
51
48
  setDelegate<T extends keyof CameraDelegates>(name: T, delegate: CameraDelegates[T]): void;
52
49
  connect(): Promise<void>;
@@ -68,8 +65,8 @@ export declare class CameraDeviceProxy extends CameraDevice {
68
65
  private closeFrameSubscriber;
69
66
  private closeMotionFrameSubsciber;
70
67
  private requestHandler;
71
- private listenToMessages;
72
- private listenToSignalingMessages;
68
+ private onProxyMessage;
69
+ private onSignalingMessage;
73
70
  onRequest<T extends MethodKeys<CameraDeviceProxyMethods>>(client: 'cameraFn', fn: T, args?: Parameters<MethodType<CameraDeviceProxyMethods, T>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<CameraDeviceProxyMethods, T>>>>;
74
71
  onRequest<T extends keyof CameraDelegates, K extends MethodKeys<CameraDelegates[T]>>(client: T, fn: K, args: Parameters<MethodType<CameraDelegates[T], K>>, timeout?: number): Promise<Awaited<ReturnType<MethodType<CameraDelegates[T], K>>>>;
75
72
  }
@@ -2,10 +2,11 @@ import { EventEmitter } from 'node:events';
2
2
  import { CameraDeviceProxy } from './cameraDevice.js';
3
3
  import type { CameraDevice } from '../../../../camera/device.js';
4
4
  import type { CameraConfig } from '../../../../camera/types.js';
5
+ import type { AuthConfig } from '../../../../decoder/types.js';
5
6
  import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../../nats/types.js';
6
7
  import type { PluginInfo } from '../../../../plugins/types.js';
7
- import type { PluginAPI } from '../api.js';
8
- import type { PluginLogger } from '../logger.js';
8
+ import type { API } from '../pluginApi.js';
9
+ import type { PluginLogger } from '../pluginLogger.js';
9
10
  export declare interface DeviceManager extends DeviceManagerProxyMethods {
10
11
  on<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
11
12
  once<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
@@ -13,7 +14,7 @@ export declare interface DeviceManager extends DeviceManagerProxyMethods {
13
14
  removeListener<E extends keyof DeviceManagerProxyEventCallbacks>(event: E, listener: DeviceManagerProxyEventCallbacks[E]): this;
14
15
  removeAllListeners<E extends keyof DeviceManagerProxyEventCallbacks>(event?: E): this;
15
16
  }
16
- export declare class DeviceManager extends EventEmitter implements DeviceManager {
17
+ export declare class DeviceManagerProxy extends EventEmitter implements DeviceManager {
17
18
  private api;
18
19
  private logger;
19
20
  private initialized;
@@ -28,10 +29,7 @@ export declare class DeviceManager extends EventEmitter implements DeviceManager
28
29
  private proxyEndpoints;
29
30
  private plugin;
30
31
  private devices;
31
- constructor(api: PluginAPI, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: {
32
- user: string;
33
- pass: string;
34
- });
32
+ constructor(api: API, logger: PluginLogger, plugin: PluginInfo, proxyEndpoints: string[], auth: AuthConfig);
35
33
  init(): Promise<void>;
36
34
  getCameraById(id: string): Promise<CameraDevice | undefined>;
37
35
  getCameraByName(name: string): Promise<CameraDevice | undefined>;
@@ -42,7 +40,7 @@ export declare class DeviceManager extends EventEmitter implements DeviceManager
42
40
  configureCameras(cameraDevices: CameraDeviceProxy[]): void;
43
41
  private requestHandler;
44
42
  private emitEvent;
45
- private listenToMessages;
43
+ private onProxyMessage;
46
44
  private onRequest;
47
45
  private addOrGetCamera;
48
46
  private close;
@@ -1,10 +1,10 @@
1
1
  import { CameraStorage } from './cameraStorage.js';
2
2
  import type { PluginJsonSchemaForm } from '../../../plugins/types.js';
3
- import type { PluginAPI } from './api.js';
3
+ import type { API } from './pluginApi.js';
4
4
  export declare class StorageController {
5
5
  private api;
6
6
  private cameraStorages;
7
- constructor(api: PluginAPI);
7
+ constructor(api: API);
8
8
  /**
9
9
  * Create a camera storage instance
10
10
  *
@@ -31,12 +31,11 @@ export declare class ConfigService {
31
31
  readonly GO2RTC_CONFIG_FILE: string;
32
32
  readonly NATS_BINARY: string;
33
33
  readonly UI_PORT: number;
34
- readonly UI_ELECTRON_PORT: number;
35
34
  get config(): IConfig;
36
35
  set config(newConfig: IConfig);
37
36
  get go2rtcConfig(): Go2RtcConfig;
38
37
  set go2rtcConfig(newConfig: Go2RtcConfig);
39
- constructor();
38
+ constructor(storagePath?: string);
40
39
  static extractVersion(str: string): string | null;
41
40
  read(): void;
42
41
  writeConfig(newConfig?: IConfig): void;
@@ -50,4 +49,6 @@ export declare class ConfigService {
50
49
  private updateConfig;
51
50
  private updateGo2RtcConfig;
52
51
  private updateSecrets;
52
+ private createDirs;
53
+ private generatePluginsPackageJson;
53
54
  }
@@ -90,8 +90,8 @@ export interface Log {
90
90
  export interface API {
91
91
  origin: string;
92
92
  listen: string;
93
- username: string;
94
- password: string;
93
+ username?: string;
94
+ password?: string;
95
95
  }
96
96
  export interface Streams {
97
97
  [key: string]: string | string[] | null;
@@ -104,8 +104,8 @@ export interface RTMP {
104
104
  }
105
105
  export interface RTSP {
106
106
  listen: string;
107
- username: string;
108
- password: string;
107
+ username?: string;
108
+ password?: string;
109
109
  default_query: string;
110
110
  }
111
111
  export interface Webrtc {
@@ -23,6 +23,8 @@ export declare class Logger {
23
23
  debug(...args: any[]): void;
24
24
  trace(...args: any[]): void;
25
25
  notify(title: string, text: string, type: LoggingLevel, link: string, socket?: Socket): Promise<void>;
26
+ formatMessage(level: 'log' | 'warn' | 'error' | 'debug' | 'trace' | 'attention', ...args: any[]): string[];
26
27
  private setNotification;
28
+ private formattedArgs;
27
29
  private formatDateTime;
28
30
  }
@@ -0,0 +1,2 @@
1
+ import type { FfmpegArgs } from '../decoder/types.js';
2
+ export declare const getHwaccelInfo: (go2rtApiPort: number) => Promise<FfmpegArgs>;
@@ -1,5 +1,5 @@
1
1
  import { PortablePython } from '@bjia56/portable-python';
2
- import { PluginLogger } from '../polyglot/node/plugins/logger.js';
2
+ import { PluginLogger } from '../polyglot/node/plugins/pluginLogger.js';
3
3
  export declare const SERVER_PY_VERSION = "3.11";
4
4
  export declare class PythonInstaller {
5
5
  static readonly versions: string[];
@@ -2,8 +2,8 @@ import type { Subscription } from 'rxjs';
2
2
  export declare class Subscribed {
3
3
  private readonly subscriptions;
4
4
  private readonly additionalSubscriptions;
5
- addSubscriptions(...subscriptions: Subscription[]): void;
6
- addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
7
- unsubscribe(): void;
8
- unsubscribeAdditional(): void;
5
+ protected addSubscriptions(...subscriptions: Subscription[]): void;
6
+ protected addAdditionalSubscriptions(...subscriptions: Subscription[]): void;
7
+ protected unsubscribe(): void;
8
+ protected unsubscribeAdditional(): void;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/seydx/camera.ui)",
6
6
  "module": "./dist/bundle.js",
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "axios": "^1.7.2",
26
+ "axios": "^1.7.3",
27
27
  "lru-cache": "^11.0.0",
28
28
  "rxjs": "^7.8.1",
29
29
  "socket.io-client": "^4.7.5"
@@ -32,8 +32,8 @@
32
32
  "@rushstack/eslint-patch": "^1.10.4",
33
33
  "@swc/register": "^0.1.10",
34
34
  "@types/webrtc": "^0.0.43",
35
- "@typescript-eslint/eslint-plugin": "^7.17.0",
36
- "@typescript-eslint/parser": "^7.17.0",
35
+ "@typescript-eslint/eslint-plugin": "^8.0.1",
36
+ "@typescript-eslint/parser": "^8.0.1",
37
37
  "bufferutil": "^4.0.8",
38
38
  "eslint": "^8.57.0",
39
39
  "eslint-config-prettier": "^9.1.0",
@@ -42,7 +42,7 @@
42
42
  "rimraf": "^6.0.1",
43
43
  "ts-loader": "^9.5.1",
44
44
  "typescript": "^5.5.4",
45
- "updates": "^16.3.3",
45
+ "updates": "^16.3.7",
46
46
  "utf-8-validate": "^6.0.4",
47
47
  "webpack": "^5.93.0",
48
48
  "webpack-cli": "^5.1.4"
@@ -1,6 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1,34 +0,0 @@
1
- import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
2
- import type { DBCamera } from '../database/types.js';
3
- import type { AuthLoginRequest, CameraZoneInsertPatchRequest, CameraZonesParamsRequest, CamerasExtensionsParamsRequest, CamerasExtensionsRequest, CamerasInsertRequest, CamerasParamsIdRequest, 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>, 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
- getSnapshotByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
22
- getSnapshotById(req: FastifyRequest<AuthLoginRequest & CamerasParamsIdRequest>, reply: FastifyReply): Promise<FastifyReply>;
23
- insert(req: FastifyRequest<AuthLoginRequest & CamerasInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
24
- preview(req: FastifyRequest<AuthLoginRequest & CamerasPreviewRequest>, reply: FastifyReply): Promise<FastifyReply>;
25
- list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | DBCamera[];
26
- patchByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest & CamerasPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
27
- enableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
28
- disableExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest & CamerasExtensionsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
29
- addExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
30
- removeExtensionByName(req: FastifyRequest<AuthLoginRequest & CamerasExtensionsParamsRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
31
- removeByName(req: FastifyRequest<AuthLoginRequest & CamerasParamsRequest>, reply: FastifyReply): Promise<FastifyReply>;
32
- removeAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply>;
33
- private resolvePluginName;
34
- }
@@ -1,14 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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
- }
@@ -1,16 +0,0 @@
1
- import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
2
- import type { AuthLoginRequest, FrameWorker, FrameWorkerParamsNameRequest, PaginationRequest } from '../types/index.js';
3
- export interface PluginInfo {
4
- pluginName: string;
5
- id?: string;
6
- version?: string;
7
- }
8
- export declare class FrameWorkersController {
9
- private app;
10
- private frameManager;
11
- constructor(app: FastifyInstance);
12
- list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | FrameWorker[];
13
- restartByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
14
- startByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
15
- stopByName(req: FastifyRequest<AuthLoginRequest & FrameWorkerParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
16
- }
@@ -1,59 +0,0 @@
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 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
- getPluginLogoByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
26
- getPluginSchemaByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
27
- getPluginInterface(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsInterfaceQuery>, reply: FastifyReply): Promise<FastifyReply>;
28
- detectObjects(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectObjectRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
29
- detectAudio(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectAudioRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
30
- detectMotion(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsDetectMotionRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
31
- submitActionButtonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsActionRequest>, reply: FastifyReply): Promise<FastifyReply>;
32
- getContractByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): FastifyReply;
33
- getReadmeByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsQueryRequest>, reply: FastifyReply): Promise<FastifyReply>;
34
- getReleaseByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
35
- installOrUpdate(req: FastifyRequest<AuthLoginRequest & PluginsInsertRequest>, reply: FastifyReply): Promise<FastifyReply>;
36
- managePlugin(action: 'install' | 'uninstall' | 'unlink', pluginInfo: PluginInfo): Promise<string>;
37
- list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | CameraUiPlugin[];
38
- listExtensions(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | PluginExtension[];
39
- patchConfigJsonByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsConfigPatchRequest>, reply: FastifyReply): Promise<FastifyReply | void>;
40
- restartByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
41
- search(req: FastifyRequest<AuthLoginRequest & PluginsQueryRequest & PaginationRequest>, reply: FastifyReply): Promise<FastifyReply | CameraUiPlugin[]>;
42
- startByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
43
- stopByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest>, reply: FastifyReply): Promise<FastifyReply>;
44
- uninstallByName(req: FastifyRequest<AuthLoginRequest & PluginsParamsNameRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
45
- uninstallAll(req: FastifyRequest<AuthLoginRequest & PluginsParamsRemoveRequest>, reply: FastifyReply): Promise<FastifyReply>;
46
- private cleanNpmCache;
47
- private ensurePluginDirExists;
48
- private getAvailablePluginVersions;
49
- private getLastNodeModulesPath;
50
- private getNpmModuleLatestVersion;
51
- private getNpmPath;
52
- private getPluginFromNpm;
53
- private pluginsPackageJson;
54
- private removeSynologyMetadata;
55
- private runNpmCommand;
56
- private searchNpmRegistrySingle;
57
- private resolvePluginName;
58
- private isScopedPlugin;
59
- }
@@ -1,14 +0,0 @@
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
- }
@@ -1,28 +0,0 @@
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,21 +0,0 @@
1
- export declare class Server {
2
- private app?;
3
- private api;
4
- private logger;
5
- private configService;
6
- constructor();
7
- register(): Promise<void>;
8
- listen(): Promise<void>;
9
- close(): Promise<void>;
10
- private setupListeners;
11
- private registerPlugins;
12
- private registerRouters;
13
- private get corsOptions();
14
- private get helmetOptions();
15
- private get multipartOptions();
16
- private get serverOptions();
17
- private get localServerOptions();
18
- private qsParser;
19
- private get socketOptions();
20
- private get staticOptions();
21
- }
@@ -1,5 +0,0 @@
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>;
@@ -1,4 +0,0 @@
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>;
@@ -1,3 +0,0 @@
1
- import type { FastifyReply, FastifyRequest } from 'fastify';
2
- import type { AuthLoginRequest, PaginationRequest, PaginationResponse } from '../types/index.js';
3
- export declare const pages: (req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply, payload: any) => Promise<PaginationResponse | void>;
@@ -1,11 +0,0 @@
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>;
@@ -1,11 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,7 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- declare module 'fastify' {
3
- interface FastifyReply {
4
- startTime: number;
5
- }
6
- }
7
- export declare const LoggerPlugin: FastifyPluginAsync;
@@ -1,11 +0,0 @@
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>>;
@@ -1,21 +0,0 @@
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 {};
@@ -1,8 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const ApiRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const AuthRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const BackupRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const CamerasRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const ConfigRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const FilesRoute: FastifyPluginAsync;
@@ -1,2 +0,0 @@
1
- import type { FastifyPluginAsync } from 'fastify';
2
- export declare const FrameWorkersRoute: FastifyPluginAsync;
@@ -1,6 +0,0 @@
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
- }