@camera.ui/browser 0.0.46 → 0.0.48

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 (96) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/{packages/client/node → types/packages/client/browser}/src/client.d.ts +6 -1
  3. package/dist/types/packages/client/browser/src/index.d.ts +2 -0
  4. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +21 -0
  5. package/dist/{packages/client/node → types/packages/client/browser}/src/proxy/deviceManager.d.ts +3 -2
  6. package/dist/types/packages/client/browser/src/proxy/index.d.ts +4 -0
  7. package/dist/{packages → types/packages}/client/node/src/types.d.ts +1 -10
  8. package/dist/{server → types/server}/src/api/database/types.d.ts +1 -0
  9. package/dist/{server → types/server}/src/api/schemas/backup.schema.d.ts +52 -52
  10. package/dist/{server → types/server}/src/api/schemas/cameras.schema.d.ts +70 -64
  11. package/dist/{server → types/server}/src/api/types/index.d.ts +0 -1
  12. package/dist/{server/src/camera/index.d.ts → types/server/src/camera/base.d.ts} +37 -36
  13. package/dist/{server → types/server}/src/camera/streaming/browser/browser-peer-connection.d.ts +2 -1
  14. package/dist/{server → types/server}/src/camera/streaming/browser/browser-streaming-session.d.ts +2 -1
  15. package/dist/{server → types/server}/src/camera/streaming/browser/webrtc-browser-connection.d.ts +2 -1
  16. package/dist/{server → types/server}/src/camera/streaming/peer-connection.d.ts +3 -2
  17. package/dist/{server → types/server}/src/camera/streaming/streaming-session.d.ts +2 -1
  18. package/dist/{server → types/server}/src/camera/streaming/webrtc-connection.d.ts +2 -1
  19. package/dist/{server → types/server}/src/camera/types.d.ts +8 -63
  20. package/dist/types/server/src/camera/utils/subscribed.d.ts +9 -0
  21. package/dist/types/server/src/detector/types.d.ts +48 -0
  22. package/dist/{server → types/server}/src/plugins/types.d.ts +2 -8
  23. package/dist/{server → types/server}/src/proxy/types.d.ts +12 -13
  24. package/dist/{server → types/server}/src/services/config/types.d.ts +1 -1
  25. package/dist/{shared → types/shared}/types/index.d.ts +2 -0
  26. package/package.json +25 -16
  27. package/dist/packages/client/node/src/index.d.ts +0 -2
  28. package/dist/packages/client/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +0 -83
  29. package/dist/packages/client/node/src/proxy/cameraDevice/cameraDevice.mock.d.ts +0 -1
  30. package/dist/packages/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +0 -19
  31. package/dist/packages/client/node/src/proxy/cameraDevice/index.d.ts +0 -2
  32. package/dist/packages/client/node/src/proxy/index.d.ts +0 -4
  33. package/dist/server/bin/python.d.ts +0 -26
  34. package/dist/server/src/api/database/index.d.ts +0 -25
  35. package/dist/server/src/api/go2rtc/api/application.d.ts +0 -9
  36. package/dist/server/src/api/go2rtc/api/config.d.ts +0 -9
  37. package/dist/server/src/api/go2rtc/api/index.d.ts +0 -3
  38. package/dist/server/src/api/go2rtc/api/snapshot.d.ts +0 -8
  39. package/dist/server/src/api/go2rtc/api/streams.d.ts +0 -11
  40. package/dist/server/src/api/go2rtc/index.d.ts +0 -13
  41. package/dist/server/src/api/go2rtc/queue.d.ts +0 -10
  42. package/dist/server/src/api/middlewares/socketAuth.middleware.d.ts +0 -41
  43. package/dist/server/src/api/services/auth.service.d.ts +0 -20
  44. package/dist/server/src/api/services/cameras.service.d.ts +0 -55
  45. package/dist/server/src/api/services/plugins.service.d.ts +0 -25
  46. package/dist/server/src/api/services/users.service.d.ts +0 -13
  47. package/dist/server/src/api/utils/constants.d.ts +0 -15
  48. package/dist/server/src/api/ws/index.d.ts +0 -15
  49. package/dist/server/src/api/ws/nsp/logs.d.ts +0 -11
  50. package/dist/server/src/api/ws/nsp/main.d.ts +0 -9
  51. package/dist/server/src/api/ws/nsp/metrics.d.ts +0 -33
  52. package/dist/server/src/api/ws/nsp/notifications.d.ts +0 -11
  53. package/dist/server/src/api/ws/nsp/plugins.d.ts +0 -13
  54. package/dist/server/src/api/ws/nsp/status.d.ts +0 -20
  55. package/dist/server/src/api/ws/nsp/streams.d.ts +0 -15
  56. package/dist/server/src/api.d.ts +0 -31
  57. package/dist/server/src/camera/utils/subscribed.d.ts +0 -6
  58. package/dist/server/src/go2rtc/index.d.ts +0 -26
  59. package/dist/server/src/plugins/index.d.ts +0 -29
  60. package/dist/server/src/plugins/node/api.d.ts +0 -37
  61. package/dist/server/src/plugins/node/cameraStorage.d.ts +0 -107
  62. package/dist/server/src/plugins/node/config.d.ts +0 -104
  63. package/dist/server/src/plugins/node/logger.d.ts +0 -11
  64. package/dist/server/src/plugins/node/proxy/cameraDevice.d.ts +0 -33
  65. package/dist/server/src/plugins/node/proxy/deviceManager.d.ts +0 -45
  66. package/dist/server/src/plugins/node/proxy/index.d.ts +0 -4
  67. package/dist/server/src/plugins/node/proxy/pluginsManager.d.ts +0 -36
  68. package/dist/server/src/plugins/node/proxy/queue.d.ts +0 -17
  69. package/dist/server/src/plugins/node/proxy/systemManager.d.ts +0 -34
  70. package/dist/server/src/plugins/node/schema.d.ts +0 -268
  71. package/dist/server/src/plugins/node/storageController.d.ts +0 -28
  72. package/dist/server/src/plugins/plugin.d.ts +0 -51
  73. package/dist/server/src/plugins/worker-ipc.d.ts +0 -16
  74. package/dist/server/src/plugins/worker.d.ts +0 -30
  75. package/dist/server/src/proxy/api.d.ts +0 -29
  76. package/dist/server/src/proxy/camera.d.ts +0 -98
  77. package/dist/server/src/proxy/constants.d.ts +0 -7
  78. package/dist/server/src/proxy/index.d.ts +0 -29
  79. package/dist/server/src/proxy/plugin.d.ts +0 -12
  80. package/dist/server/src/proxy/queue.d.ts +0 -16
  81. package/dist/server/src/proxy/utils/generateKeys.d.ts +0 -5
  82. package/dist/server/src/proxy/ws.d.ts +0 -12
  83. package/dist/server/src/services/config/constants.d.ts +0 -6
  84. package/dist/server/src/services/config/index.d.ts +0 -58
  85. package/dist/server/src/services/logger/index.d.ts +0 -28
  86. package/dist/shared/common/utils.d.ts +0 -6
  87. package/dist/{packages → types/packages}/client/node/src/api.d.ts +0 -0
  88. package/dist/{packages → types/packages}/client/node/src/proxy/pluginsManager.d.ts +0 -0
  89. package/dist/{packages → types/packages}/client/node/src/proxy/systemManager.d.ts +0 -0
  90. package/dist/{packages → types/packages}/client/node/src/socket.d.ts +0 -0
  91. package/dist/{server → types/server}/src/api/go2rtc/types.d.ts +0 -0
  92. package/dist/{server → types/server}/src/api/schemas/config.schema.d.ts +5 -5
  93. package/dist/{server → types/server}/src/api/schemas/go2rtc.schema.d.ts +79 -79
  94. package/dist/{server → types/server}/src/api/schemas/users.schema.d.ts +84 -84
  95. /package/dist/{server → types/server}/src/api/ws/types.d.ts +0 -0
  96. /package/dist/{server → types/server}/src/go2rtc/types.d.ts +0 -0
@@ -1,26 +0,0 @@
1
- import { PortablePython } from '@bjia56/portable-python';
2
- export declare const SERVER_PY_VERSION = "3.11";
3
- export declare const SERVER_PY_DEPS: string[];
4
- export declare class PythonInstaller {
5
- static readonly versions: string[];
6
- private _version;
7
- readonly python: PortablePython;
8
- readonly venvPath: string;
9
- get isInstalled(): boolean;
10
- get execPath(): string;
11
- get pipPath(): string;
12
- get version(): string;
13
- constructor(venvDir: string, version?: string);
14
- install(): Promise<void>;
15
- uninstall(): Promise<void>;
16
- updateDependencies(requirementsPath: string): Promise<void>;
17
- installPackages(pkgs: string[]): Promise<string>;
18
- uninstallPackages(pkgs: string[]): Promise<string>;
19
- ensureServerDepsAndVenv(): Promise<void>;
20
- private installRequirements;
21
- private areServerDepsInstalled;
22
- private ensureVenv;
23
- private createVenv;
24
- private removeVenv;
25
- private recreateVenv;
26
- }
@@ -1,25 +0,0 @@
1
- /// <reference types="pouchdb-find" />
2
- /// <reference types="pouchdb-core" />
3
- /// <reference types="pouchdb-mapreduce" />
4
- /// <reference types="pouchdb-replication" />
5
- import type { FastifyInstance } from 'fastify';
6
- import type { Plugin } from '../../plugins/plugin';
7
- import type { DBCameras, DBPlugins, DBSettings, DBTokens, DBUsers } from './types';
8
- export declare class Database {
9
- private _db;
10
- private _tokensDb;
11
- private _initialized;
12
- private _closed;
13
- private app;
14
- private configService;
15
- constructor(app: FastifyInstance);
16
- get db(): PouchDB.Database<DBCameras | DBUsers | DBSettings | DBPlugins>;
17
- get tokensDb(): PouchDB.Database<DBTokens>;
18
- close(): Promise<void>;
19
- initialize(): Promise<Database>;
20
- updateCameras(): Promise<void>;
21
- createPluginDatabase(plugin: Plugin): Promise<void>;
22
- private ensureDatabases;
23
- private updateConfig;
24
- private generateAdmin;
25
- }
@@ -1,9 +0,0 @@
1
- import { RequestQueue } from '../queue';
2
- import type { ApplicationResponse, ExitData } from '../types';
3
- export declare class ApplicationApi {
4
- private requestQueue;
5
- constructor(requestQueue: RequestQueue);
6
- close(data: ExitData): Promise<void>;
7
- info(): Promise<ApplicationResponse>;
8
- restart(): Promise<void>;
9
- }
@@ -1,9 +0,0 @@
1
- import { RequestQueue } from '../queue';
2
- import type { AxiosResponse } from 'axios';
3
- export declare class ConfigApi {
4
- private requestQueue;
5
- constructor(requestQueue: RequestQueue);
6
- getConfig(): Promise<AxiosResponse>;
7
- rewriteConfig(data: Record<string, any>): Promise<AxiosResponse>;
8
- mergeConfig(data: Record<string, any>): Promise<AxiosResponse>;
9
- }
@@ -1,3 +0,0 @@
1
- import { type AxiosInstance } from 'axios';
2
- declare const api: () => AxiosInstance;
3
- export default api;
@@ -1,8 +0,0 @@
1
- import { RequestQueue } from '../queue';
2
- import type { SourceData } from '../types';
3
- export declare class SnapshotApi {
4
- private requestQueue;
5
- constructor(requestQueue: RequestQueue);
6
- jpeg(data: SourceData): Promise<ArrayBuffer>;
7
- mp4(data: SourceData): Promise<ArrayBuffer>;
8
- }
@@ -1,11 +0,0 @@
1
- import { RequestQueue } from '../queue';
2
- import type { AxiosResponse } from 'axios';
3
- import type { SourceData, StreamData } from '../types';
4
- export declare class StreamsApi {
5
- private requestQueue;
6
- 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>;
11
- }
@@ -1,13 +0,0 @@
1
- import { ApplicationApi } from './api/application';
2
- import { ConfigApi } from './api/config';
3
- import { SnapshotApi } from './api/snapshot';
4
- import { StreamsApi } from './api/streams';
5
- export declare class Go2RtcApi {
6
- private requestQueue;
7
- applicationApi: ApplicationApi;
8
- configApi: ConfigApi;
9
- snapshotApi: SnapshotApi;
10
- streamsApi: StreamsApi;
11
- constructor();
12
- clear(): void;
13
- }
@@ -1,10 +0,0 @@
1
- type RequestFunction = () => Promise<any>;
2
- export declare class RequestQueue {
3
- private queue;
4
- private isProcessing;
5
- constructor();
6
- enqueue(requestFunc: RequestFunction): Promise<any>;
7
- clear(): void;
8
- private processQueue;
9
- }
10
- export {};
@@ -1,41 +0,0 @@
1
- import type { Algorithm } from 'jsonwebtoken';
2
- import type { Socket } from 'socket.io';
3
- export declare class UnauthorizedError extends Error {
4
- inner: {
5
- message: string;
6
- };
7
- data: {
8
- message: string;
9
- code: string;
10
- type: 'UnauthorizedError';
11
- };
12
- constructor(code: string, error: {
13
- message: string;
14
- });
15
- }
16
- export declare const isUnauthorizedError: (error: unknown) => error is UnauthorizedError;
17
- declare module 'socket.io' {
18
- interface Socket extends ExtendedSocket {
19
- }
20
- }
21
- interface ExtendedSocket {
22
- encodedToken?: string;
23
- decodedToken?: any;
24
- user?: any;
25
- }
26
- type SocketIOMiddleware = (socket: Socket, next: (error?: UnauthorizedError) => void) => void;
27
- interface CompleteDecodedToken {
28
- header: {
29
- alg: Algorithm;
30
- [key: string]: any;
31
- };
32
- payload: any;
33
- }
34
- type SecretCallback = (decodedToken: CompleteDecodedToken) => Promise<string> | string;
35
- export interface AuthorizeOptions {
36
- secret: string | SecretCallback;
37
- algorithms?: Algorithm[];
38
- onAuthentication?: (decodedToken: any) => Promise<any> | any;
39
- }
40
- export declare const authorize: (options: AuthorizeOptions) => SocketIOMiddleware;
41
- export {};
@@ -1,20 +0,0 @@
1
- import type { ClientData, JwtTokenClientData, JwtTokenEncoded } from '../types';
2
- export default class AuthService {
3
- private configService;
4
- private dbs;
5
- constructor();
6
- findById(id: string): Promise<JwtTokenEncoded | undefined>;
7
- findByRefreshToken(refresh_token: string): Promise<JwtTokenEncoded | undefined>;
8
- findByToken(access_token: string): Promise<JwtTokenEncoded | undefined>;
9
- clientDataById(id: string): Promise<ClientData | undefined>;
10
- clientDataByToken(acces_token: string): Promise<ClientData | undefined>;
11
- insert(jwtToken: JwtTokenEncoded, clientData?: ClientData): Promise<void>;
12
- invalidateAll(): Promise<void>;
13
- invalidateById(id: string): Promise<void>;
14
- invalidateByRefreshToken(refresh_token: string): Promise<void>;
15
- invalidateByToken(access_token: string): Promise<void>;
16
- listTokens(): Promise<JwtTokenEncoded[]>;
17
- listClientData(): Promise<ClientData[]>;
18
- listTokensAndClientData(): Promise<JwtTokenClientData[]>;
19
- patchTokenByRefreshToken(refresh_token: string, newJwtToken: JwtTokenEncoded): Promise<void>;
20
- }
@@ -1,55 +0,0 @@
1
- import { type CameraExtension } from '../../plugins/types';
2
- import type { Camera, CameraZone, DBCamera } from '../database/types';
3
- type DeepPartial<T> = T extends object ? {
4
- [P in keyof T]?: DeepPartial<T[P]>;
5
- } : T;
6
- export default class CamerasService {
7
- private configService;
8
- private api;
9
- private dbs;
10
- private proxy;
11
- private go2rtcApi;
12
- private usersService;
13
- private pluginsService;
14
- constructor();
15
- createCamera(cameraData: DBCamera): Promise<DBCamera>;
16
- createTransformedCamera(cameraData: DBCamera): Promise<Camera>;
17
- createZone(cameraname: string, zoneData: CameraZone, zoneType: 'motion' | 'object'): Promise<DBCamera | undefined>;
18
- patchZoneByName(cameraname: string, zonename: string, zoneData: CameraZone, zoneType: 'motion' | 'object'): Promise<DBCamera | undefined>;
19
- removeZoneByName(cameraname: string, zonename: string, zoneType: 'motion' | 'object'): Promise<void>;
20
- createCameraSource(cameraname: string, sourceName: string, address: string): Promise<void>;
21
- resetCameraSource(cameraname: string, sourceName: string): Promise<void>;
22
- list(): Promise<DBCamera[]>;
23
- listTransformed(): Promise<Camera[]>;
24
- listByPluginId(pluginId: string): Promise<DBCamera[]>;
25
- listTransformedByPluginId(pluginId: string): Promise<Camera[]>;
26
- listByExtension(pluginName: string): Promise<DBCamera[]>;
27
- listTransformedByExtension(pluginName: string, extensions: CameraExtension[]): Promise<Camera[]>;
28
- findById(id: string): Promise<DBCamera | undefined>;
29
- findTransformedById(id: string): Promise<Camera | undefined>;
30
- findByName(cameraname: string): Promise<DBCamera | undefined>;
31
- findTransformedByName(cameraname: string): Promise<Camera | undefined>;
32
- findByPluginAndName(cameraname: string, pluginId: string): Promise<DBCamera | undefined>;
33
- findTransformedByPluginAndName(cameraname: string, pluginId: string): Promise<Camera | undefined>;
34
- patchCameraByName(cameraname: string, cameraData: DeepPartial<DBCamera>): Promise<DBCamera | undefined>;
35
- enableExtensionByName(cameraname: string, pluginName: string, extensionType: CameraExtension): Promise<DBCamera | undefined>;
36
- disableExtensionByName(cameraname: string, pluginName: string, extensionType: CameraExtension): Promise<DBCamera | undefined>;
37
- addExtensionByName(cameraname: string, pluginName: string): Promise<DBCamera | undefined>;
38
- removeExtensionByName(cameraname: string, pluginName: string): Promise<DBCamera | undefined>;
39
- removeExtension(pluginName: string): Promise<void>;
40
- removeByName(cameraname: string): Promise<void>;
41
- removeById(id: string): Promise<void>;
42
- removeByPluginId(pluginId: string): Promise<void>;
43
- removeByPluginIdAndName(cameraname: string, pluginId: string): Promise<void>;
44
- removeAll(): Promise<void>;
45
- transformCamera(camera: DBCamera): Camera;
46
- cameraSourcesChanged(oldCamera: DBCamera, newCamera: DBCamera): boolean;
47
- private addCameraSources;
48
- private removeCameraSources;
49
- private generateWsUrls;
50
- private generateRTSPUrls;
51
- private generateFFmpegUrls;
52
- private generateWWWUrls;
53
- private extensionIsEnabled;
54
- }
55
- export {};
@@ -1,25 +0,0 @@
1
- import type { Plugin } from '../../plugins/plugin';
2
- import type { PluginWorker } from '../../plugins/worker';
3
- import type { DBPlugin } from '../database/types';
4
- export default class PluginsService {
5
- private configService;
6
- private dbs;
7
- private pluginManager;
8
- constructor();
9
- listPlugins(): Plugin[];
10
- listPluginProcesses(): PluginWorker[];
11
- getPluginByName(pluginName: string): Plugin | undefined;
12
- getPluginById(id: string): Plugin | undefined;
13
- getPluginProcessByName(pluginName: string): PluginWorker | undefined;
14
- getPluginProcessById(id: string): PluginWorker | undefined;
15
- installedPlugins(): Plugin[];
16
- installedPluginProcesses(): PluginWorker[];
17
- listPluginDb(): Promise<DBPlugin[]>;
18
- getPluginDbByName(pluginName: string): Promise<DBPlugin | undefined>;
19
- getPluginDbById(id: string): Promise<DBPlugin | undefined>;
20
- insertPluginDb(pluginName: string): Promise<DBPlugin>;
21
- removePluginDbByName(pluginName: string): Promise<void>;
22
- removePluginDbById(id: string): Promise<void>;
23
- removeAllPluginsDb(): Promise<void>;
24
- removeOrphanPluginsDb(): Promise<void>;
25
- }
@@ -1,13 +0,0 @@
1
- import type { DBUser } from '../database/types';
2
- export default class UsersService {
3
- private configService;
4
- private dbs;
5
- constructor();
6
- createUser(userData: DBUser): Promise<DBUser>;
7
- findById(id: string): Promise<DBUser | undefined>;
8
- findByName(username: string): Promise<DBUser | undefined>;
9
- list(): Promise<DBUser[]>;
10
- patchUser(username: string, userData: Partial<DBUser>): Promise<DBUser | undefined>;
11
- removeByName(username: string): Promise<void>;
12
- removeAll(): Promise<void>;
13
- }
@@ -1,15 +0,0 @@
1
- export declare const HOST_CERT_FILENAME = "camera.ui.cert.pem";
2
- export declare const HOST_KEY_FILENAME = "camera.ui.key.pem";
3
- export declare const ROOT_CERT_FILENAME = "camera.ui.root.cert.pem";
4
- export declare const ROOT_KEY_FILENAME = "camera.ui.root.key.pem";
5
- export declare const P12_FILENAME = "camera.ui.p12";
6
- export declare const P12_PASSWORD = "camera.ui";
7
- export declare const DEFAULTS: {
8
- C: string;
9
- ST: string;
10
- L: string;
11
- O: string;
12
- OU: string;
13
- CN: string;
14
- ROOT_CN: string;
15
- };
@@ -1,15 +0,0 @@
1
- import { Server } from 'socket.io';
2
- import type { FastifyInstance } from 'fastify';
3
- import type { ServerOptions } from 'socket.io';
4
- import type { SocketNsp, SocketNspMap } from './types';
5
- export declare class SocketService {
6
- io: Server;
7
- namespaces: Map<SocketNsp, SocketNspMap>;
8
- adminNsp: SocketNsp[];
9
- private logger;
10
- private authService;
11
- private configService;
12
- constructor(app: FastifyInstance, opts: Partial<ServerOptions>);
13
- private registerNamespaces;
14
- private setupConnection;
15
- }
@@ -1,11 +0,0 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
2
- import type { SocketNsp } from '../types';
3
- export declare class Logs {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- private nativeTail?;
7
- private configService;
8
- constructor(io: Server);
9
- connect(socket: Socket, filter?: string[]): void;
10
- private tailLogFromFileNative;
11
- }
@@ -1,9 +0,0 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
2
- import type { SocketNsp } from '../types';
3
- export declare class Main {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- private logger;
7
- constructor(io: Server);
8
- checkUpdate(socket?: Socket): Promise<void>;
9
- }
@@ -1,33 +0,0 @@
1
- import type { Namespace, Server } from 'socket.io';
2
- import type { CpuInfo, CpuTempInfo, MemoryInfo, NetworkInfo, PluginProcessesInfo, ProcessesInfo, SocketNsp } from '../types';
3
- export declare class Metrics {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- private logger;
7
- private configService;
8
- private pluginManager;
9
- private go2rtc;
10
- private cpuHistory;
11
- private cpuTempHistory;
12
- private memHistory;
13
- private networkHistory;
14
- private processServerHistory;
15
- private processGo2RtcHistory;
16
- private processPluginsHistory;
17
- private memoryInfo?;
18
- constructor(io: Server);
19
- getProcessesInfo(payload: any, callback?: Function): Promise<ProcessesInfo>;
20
- getPluginsProcessesInfo(payload: any, callback?: Function): Promise<PluginProcessesInfo>;
21
- getServerCpuInfo(payload?: any, callback?: Function): Promise<CpuInfo>;
22
- getServerMemoryInfo(payload?: any, callback?: Function): Promise<MemoryInfo>;
23
- getCpuTempInfo(payload?: any, callback?: Function): Promise<CpuTempInfo>;
24
- getNetworkUsageInfo(payload?: any, callback?: Function): Promise<NetworkInfo>;
25
- private getCpuTemp;
26
- private getProcesses;
27
- private getCpuLoad;
28
- private getCpuLoadAlt;
29
- private getCpuTempLegacy;
30
- private getCpuTempAlt;
31
- private getMemoryUsage;
32
- private getCurrentNetworkUsage;
33
- }
@@ -1,11 +0,0 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
2
- import type { SocketNsp } from '../types';
3
- export declare class Notifications {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- private logger;
7
- constructor(io: Server);
8
- clearNotifications(): Promise<void>;
9
- getNotifications(socket: Socket): Promise<void>;
10
- removeNotification(id?: string): Promise<void>;
11
- }
@@ -1,13 +0,0 @@
1
- import type { Namespace, Server } from 'socket.io';
2
- import type { PLUGIN_STATUS } from '../../../plugins/types';
3
- import type { SocketNsp } from '../types';
4
- export declare class Plugins {
5
- nsp: Namespace;
6
- nspName: SocketNsp;
7
- private pluginManager;
8
- constructor(io: Server);
9
- pluginStatus(pluginName: string, callback?: Function): Promise<void | {
10
- pluginName: string;
11
- status: PLUGIN_STATUS;
12
- }>;
13
- }
@@ -1,20 +0,0 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
2
- import { PLUGIN_STATUS } from '../../../plugins/types';
3
- import { RUNTIME_STATUS } from '../../../services/config/types';
4
- import type { SocketNsp } from '../types';
5
- export declare class Status {
6
- nsp: Namespace;
7
- nspName: SocketNsp;
8
- private configService;
9
- private pluginManager;
10
- private go2rtc;
11
- constructor(io: Server);
12
- watchStats(socket: Socket, payload: any, callback?: Function): {
13
- name: string;
14
- status: RUNTIME_STATUS;
15
- }[];
16
- watchPluginStats(socket: Socket, payload: any, callback?: Function): {
17
- name: string;
18
- status: PLUGIN_STATUS;
19
- }[];
20
- }
@@ -1,15 +0,0 @@
1
- import type { Namespace, Server } from 'socket.io';
2
- import type { SocketNsp } from '../types';
3
- export declare class Streams {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- private go2rtcWsMap;
7
- private logger;
8
- private configService;
9
- constructor(io: Server);
10
- private go2rtcWsConnect;
11
- private go2rtcWsSendMessage;
12
- private go2rtcClose;
13
- private onEnd;
14
- private onDestroy;
15
- }
@@ -1,31 +0,0 @@
1
- /// <reference types="node" />
2
- import EventEmitter from 'events';
3
- import { CameraController } from './camera';
4
- import type { Camera } from './api/database/types';
5
- import type { API } from './plugins/node/api';
6
- import type { PluginLogger } from './plugins/node/logger';
7
- import type { BasePlugin } from './plugins/types';
8
- export interface PluginConstructor {
9
- new (logger: PluginLogger, api: API): BasePlugin;
10
- }
11
- export declare const enum API_EVENT {
12
- FINISH_LAUNCHING = "finishLaunching",
13
- SHUTDOWN = "shutdown"
14
- }
15
- export declare interface CameraUiAPI {
16
- on(event: 'finishLaunching', listener: () => void): this;
17
- on(event: 'shutdown', listener: () => void): this;
18
- emit(event: 'finishLaunching'): boolean;
19
- emit(event: 'shutdown'): boolean;
20
- }
21
- export declare class CameraUiAPI extends EventEmitter {
22
- private devices;
23
- constructor();
24
- configureCameras(): Promise<void>;
25
- addCamera(camera: Camera): void;
26
- getCamera(cameraId: string): CameraController | undefined;
27
- getCameras(pluginId?: string): CameraController[];
28
- stopCamera(cameraId: string): void;
29
- updateCamera(cameraData: Camera): void;
30
- removeCamera(cameraId: string): Promise<void>;
31
- }
@@ -1,6 +0,0 @@
1
- import { Subscription } from 'rxjs';
2
- export declare class Subscribed {
3
- private readonly subscriptions;
4
- addSubscriptions(...subscriptions: Subscription[]): void;
5
- protected unsubscribe(): void;
6
- }
@@ -1,26 +0,0 @@
1
- import { RUNTIME_STATUS } from '../services/config/types';
2
- export declare class Go2Rtc {
3
- private go2rtcProcess?;
4
- private prefix;
5
- private api;
6
- private logger;
7
- private configService;
8
- version?: string;
9
- os?: string;
10
- private started;
11
- private restarting;
12
- private manuallyKilled;
13
- private shuttingDown;
14
- private _status;
15
- get status(): RUNTIME_STATUS;
16
- constructor();
17
- start(): Promise<void>;
18
- stop(): Promise<void>;
19
- restart(): Promise<void>;
20
- getPID(): number;
21
- private kill;
22
- private handleClose;
23
- private setStatus;
24
- private processLogger;
25
- private isIgnorableString;
26
- }
@@ -1,29 +0,0 @@
1
- import 'reflect-metadata';
2
- import { Plugin } from './plugin';
3
- import { PluginWorker } from './worker';
4
- import type { IPackageJson } from '../api/types';
5
- export declare class PluginManager {
6
- private logger;
7
- plugins: Map<string, Plugin>;
8
- pluginWorkers: Map<string, PluginWorker>;
9
- searchPaths: Set<string>;
10
- private api;
11
- private configService;
12
- constructor();
13
- static isQualifiedPluginIdentifier(pluginName: string): boolean;
14
- static extractPluginScope(pluginName: string): string;
15
- static extractPluginName(pluginName: string): string;
16
- static transformDisplaName(pluginName: string): string;
17
- static loadPackageJSON(installPath: string): IPackageJson;
18
- initializeInstalledPlugins(): Promise<void>;
19
- initializeInstalledPlugin(plugin: Plugin): Promise<void>;
20
- loadPlugin(absolutePath: string, pluginId?: string, storagePath?: string): Promise<Plugin>;
21
- removePlugin(plugin: Plugin, removeFromDb?: boolean, removeStorage?: boolean): Promise<void>;
22
- startPluginChild(pluginName: string): Promise<void>;
23
- stopPluginChild(pluginName: string): Promise<void>;
24
- private initializePlugins;
25
- private loadInstalledPlugins;
26
- private removeOrphanedPlugins;
27
- private loadDefaultPaths;
28
- private addNpmPrefixToSearchPaths;
29
- }
@@ -1,37 +0,0 @@
1
- /// <reference types="node" />
2
- import EventEmitter from 'events';
3
- import { DeviceManager, PluginsManager, SystemManager } from './proxy';
4
- import { StorageController } from './storageController';
5
- import type { Plugin } from '../plugin';
6
- import type { BasePlugin, ProxyInfo } from '../types';
7
- import type { PluginConfigService } from './config';
8
- import type { PluginLogger } from './logger';
9
- export declare interface API {
10
- on(event: 'finishLaunching', listener: () => void): this;
11
- on(event: 'shutdown', listener: () => void): this;
12
- once(event: 'finishLaunching', listener: () => void): this;
13
- once(event: 'shutdown', listener: () => void): this;
14
- off(event: 'finishLaunching', listener: () => void): this;
15
- off(event: 'shutdown', listener: () => void): this;
16
- removeListener(event: 'finishLaunching', listener: () => void): this;
17
- removeListener(event: 'shutdown', listener: () => void): this;
18
- removeAllListeners(event?: string): this;
19
- readonly deviceManager: DeviceManager;
20
- readonly pluginsManager: PluginsManager;
21
- readonly systemManager: SystemManager;
22
- readonly storageController: StorageController;
23
- readonly configService: PluginConfigService;
24
- readonly storagePath: string;
25
- readonly configFile: string;
26
- }
27
- export declare class PluginAPI extends EventEmitter implements API {
28
- readonly deviceManager: DeviceManager;
29
- readonly pluginsManager: PluginsManager;
30
- readonly systemManager: SystemManager;
31
- readonly storageController: StorageController;
32
- readonly configService: PluginConfigService;
33
- readonly storagePath: string;
34
- readonly configFile: string;
35
- readonly plugin: BasePlugin;
36
- constructor(plugin: Plugin, logger: PluginLogger, proxyData: ProxyInfo);
37
- }