@camera.ui/browser 0.0.72 → 0.0.74

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 (91) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -1
  3. package/dist/types/packages/client/browser/src/streaming/streaming-session.d.ts +2 -1
  4. package/dist/types/packages/client/browser/src/types.d.ts +2 -2
  5. package/dist/types/server/src/api/controllers/api.controller.d.ts +6 -0
  6. package/dist/types/server/src/api/controllers/auth.controller.d.ts +20 -0
  7. package/dist/types/server/src/api/controllers/backup.controller.d.ts +10 -0
  8. package/dist/types/server/src/api/controllers/cameras.controller.d.ts +33 -0
  9. package/dist/types/server/src/api/controllers/config.controller.d.ts +14 -0
  10. package/dist/types/server/src/api/controllers/files.controller.d.ts +8 -0
  11. package/dist/types/server/src/api/controllers/plugins.controller.d.ts +54 -0
  12. package/dist/types/server/src/api/controllers/streams.controller.d.ts +12 -0
  13. package/dist/types/server/src/api/controllers/system.controller.d.ts +14 -0
  14. package/dist/types/server/src/api/controllers/users.controller.d.ts +15 -0
  15. package/dist/types/server/src/api/database/index.d.ts +1 -1
  16. package/dist/types/server/src/api/go2rtc/api/application.d.ts +1 -1
  17. package/dist/types/server/src/api/go2rtc/api/config.d.ts +1 -1
  18. package/dist/types/server/src/api/go2rtc/api/snapshot.d.ts +1 -1
  19. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +1 -1
  20. package/dist/types/server/src/api/index.d.ts +24 -0
  21. package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +5 -0
  22. package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +4 -0
  23. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +3 -0
  24. package/dist/types/server/src/api/plugins/cameraui.plugin.d.ts +11 -0
  25. package/dist/types/server/src/api/plugins/database.plugin.d.ts +11 -0
  26. package/dist/types/server/src/api/plugins/go2rtc.plugin.d.ts +11 -0
  27. package/dist/types/server/src/api/plugins/socket.plugin.d.ts +11 -0
  28. package/dist/types/server/src/api/plugins/system.plugin.d.ts +21 -0
  29. package/dist/types/server/src/api/plugins/useragent.plugin.d.ts +8 -0
  30. package/dist/types/server/src/api/routes/api.routes.d.ts +2 -0
  31. package/dist/types/server/src/api/routes/auth.routes.d.ts +2 -0
  32. package/dist/types/server/src/api/routes/backup.routes.d.ts +2 -0
  33. package/dist/types/server/src/api/routes/cameras.routes.d.ts +2 -0
  34. package/dist/types/server/src/api/routes/config.routes.d.ts +2 -0
  35. package/dist/types/server/src/api/routes/files.routes.d.ts +2 -0
  36. package/dist/types/server/src/api/routes/index.d.ts +7 -0
  37. package/dist/types/server/src/api/routes/plugins.routes.d.ts +2 -0
  38. package/dist/types/server/src/api/routes/streams.routes.d.ts +2 -0
  39. package/dist/types/server/src/api/routes/system.routes.d.ts +2 -0
  40. package/dist/types/server/src/api/routes/users.routes.d.ts +2 -0
  41. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +25 -0
  42. package/dist/types/server/src/api/services/backup.service.d.ts +10 -0
  43. package/dist/types/server/src/api/utils/axios.d.ts +2 -0
  44. package/dist/types/server/src/api/utils/cert.d.ts +11 -0
  45. package/dist/types/server/src/api/utils/moveFiles.d.ts +1 -0
  46. package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
  47. package/dist/types/server/src/api/websocket/types.d.ts +1 -1
  48. package/dist/types/server/src/api.d.ts +4 -4
  49. package/dist/types/server/src/{devices/camera → camera}/cameraDevice.d.ts +1 -1
  50. package/dist/types/server/src/{devices/camera → camera}/controller/index.d.ts +7 -4
  51. package/dist/types/server/src/{devices/camera → camera}/controller/types.d.ts +29 -18
  52. package/dist/types/server/src/{devices/camera → camera}/index.d.ts +24 -14
  53. package/dist/types/server/src/{devices/camera → camera}/streaming/peer-connection.d.ts +8 -7
  54. package/dist/types/server/src/{devices/camera → camera}/streaming/streaming-session.d.ts +1 -1
  55. package/dist/types/server/src/{devices/camera → camera}/streaming/webrtc-connection.d.ts +2 -2
  56. package/dist/types/server/src/decoder/ffmpeg.d.ts +2 -0
  57. package/dist/types/server/src/decoder/index.d.ts +15 -3
  58. package/dist/types/server/src/decoder/types.d.ts +43 -24
  59. package/dist/types/server/src/decoder/worker.d.ts +42 -0
  60. package/dist/types/server/src/main.d.ts +21 -0
  61. package/dist/types/server/src/nats/constants.d.ts +1 -0
  62. package/dist/types/server/src/nats/index.d.ts +1 -1
  63. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +9 -20
  64. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +1 -1
  65. package/dist/types/server/src/nats/proxy/pluginsManager.d.ts +1 -1
  66. package/dist/types/server/src/nats/server.d.ts +3 -2
  67. package/dist/types/server/src/nats/types.d.ts +13 -22
  68. package/dist/types/server/src/nats/websocket.d.ts +1 -1
  69. package/dist/types/server/src/plugins/base.d.ts +1 -1
  70. package/dist/types/server/src/plugins/plugin.d.ts +1 -1
  71. package/dist/types/server/src/plugins/worker.d.ts +5 -1
  72. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/api.d.ts +2 -2
  73. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/cameraStorage.d.ts +1 -1
  74. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/config.d.ts +1 -1
  75. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/logger.d.ts +2 -0
  76. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/cameraDevice.d.ts +11 -7
  77. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/deviceManager.d.ts +3 -3
  78. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/pluginsManager.d.ts +1 -1
  79. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/queue.d.ts +3 -3
  80. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/systemManager.d.ts +1 -1
  81. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/schema.d.ts +2 -2
  82. package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/storageController.d.ts +1 -1
  83. package/dist/types/server/src/services/logger/index.d.ts +3 -3
  84. package/dist/types/server/src/utils/pythonInstaller.d.ts +2 -1
  85. package/dist/types/server/src/utils/subscribed.d.ts +1 -1
  86. package/dist/types/shared/types/index.d.ts +1 -1
  87. package/package.json +4 -4
  88. package/dist/types/server/src/api/websocket/nsp/frame.d.ts +0 -10
  89. package/dist/types/server/src/decoder/worker/index.d.ts +0 -27
  90. package/dist/types/server/src/plugins/worker-ipc.d.ts +0 -22
  91. /package/dist/types/server/src/{plugins/node → polyglot/node/plugins}/proxy/index.d.ts +0 -0
@@ -2,8 +2,8 @@
2
2
  import { EventEmitter } from 'node:events';
3
3
  import { DeviceManager, PluginsManager, SystemManager } from './proxy/index.js';
4
4
  import { StorageController } from './storageController.js';
5
- import type { BasePlugin } from '../base.js';
6
- import type { Plugin } from '../plugin.js';
5
+ import type { BasePlugin } from '../../../plugins/base.js';
6
+ import type { Plugin } from '../../../plugins/plugin.js';
7
7
  import type { PluginConfigService } from './config.js';
8
8
  import type { PluginLogger } from './logger.js';
9
9
  export declare interface API {
@@ -1,4 +1,4 @@
1
- import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '../types.js';
1
+ import type { PluginJsonSchema, PluginJsonSchemaForm, SchemaConfig } from '../../../plugins/types.js';
2
2
  import type { PluginAPI } from './api.js';
3
3
  export declare class CameraStorage {
4
4
  private cameraId;
@@ -1,5 +1,5 @@
1
1
  import { type Path } from 'object-path';
2
- import type { JSONValue, PluginConfig } from '../types.js';
2
+ import type { JSONValue, PluginConfig } from '../../../plugins/types.js';
3
3
  export declare class PluginConfigService {
4
4
  private config;
5
5
  private configFile;
@@ -2,6 +2,8 @@ export declare class PluginLogger {
2
2
  private _prefix;
3
3
  private _loggerPrefix;
4
4
  private _disableTimestamps;
5
+ debugEnabled: boolean;
6
+ traceEnabled: boolean;
5
7
  private get prefix();
6
8
  constructor(prefix: string, disableTimestamps: boolean);
7
9
  log(...args: any[]): void;
@@ -1,8 +1,8 @@
1
- import { CameraDevice } from '../../../devices/camera/cameraDevice.js';
2
- import type { Camera } from '../../../api/database/types.js';
3
- import type { VideoFrame } from '../../../decoder/types.js';
4
- import type { CameraSource, SetValues } from '../../../devices/camera/controller/types.js';
5
- import type { IceServer } from '../../../services/config/types.js';
1
+ import { CameraDevice } from '../../../../camera/cameraDevice.js';
2
+ import type { Camera } from '../../../../api/database/types.js';
3
+ import type { CameraSource, SetValues } from '../../../../camera/controller/types.js';
4
+ import type { VideoFrame } from '../../../../decoder/types.js';
5
+ import type { IceServer } from '../../../../services/config/types.js';
6
6
  import type { PluginAPI } from '../api.js';
7
7
  import type { PluginLogger } from '../logger.js';
8
8
  export declare class CameraDeviceProxy extends CameraDevice {
@@ -12,8 +12,9 @@ export declare class CameraDeviceProxy extends CameraDevice {
12
12
  private client;
13
13
  private cameraSubscriber;
14
14
  private cameraPluginSubscriber;
15
+ private signalingSubscriber;
15
16
  private frameSubscriber?;
16
- private activeSockets;
17
+ private activeRequests;
17
18
  private messageQueue;
18
19
  private auth;
19
20
  private pluginID;
@@ -22,6 +23,8 @@ export declare class CameraDeviceProxy extends CameraDevice {
22
23
  private cameraSubscriberSubject;
23
24
  private cameraPluginSubscriberSubject;
24
25
  private frameSubject;
26
+ private signalingSubject;
27
+ private signalingTargetSubject;
25
28
  get sources(): CameraSource[];
26
29
  constructor(api: PluginAPI, logger: PluginLogger, camera: Camera, pluginId: string, pluginName: string, auth: {
27
30
  user: string;
@@ -37,9 +40,10 @@ export declare class CameraDeviceProxy extends CameraDevice {
37
40
  updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
38
41
  refreshStates(): Promise<void>;
39
42
  cleanup(): Promise<void>;
40
- private connectToServer;
43
+ private signalDecoder;
41
44
  private closeFrameSubscriber;
42
45
  private requestHandler;
43
46
  private listenToMessages;
47
+ private listenToSignalingMessages;
44
48
  private onRequest;
45
49
  }
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  import { EventEmitter } from 'node:events';
3
3
  import { CameraDeviceProxy } from './cameraDevice.js';
4
- import type { CameraDevice } from '../../../devices/camera/cameraDevice.js';
5
- import type { CameraConfig } from '../../../devices/camera/controller/types.js';
6
- import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../nats/types.js';
4
+ import type { CameraDevice } from '../../../../camera/cameraDevice.js';
5
+ import type { CameraConfig } from '../../../../camera/controller/types.js';
6
+ import type { DeviceManagerProxyEventCallbacks, DeviceManagerProxyMethods } from '../../../../nats/types.js';
7
7
  import type { PluginAPI } from '../api.js';
8
8
  import type { PluginLogger } from '../logger.js';
9
9
  export declare interface DeviceManager extends DeviceManagerProxyMethods {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  import { EventEmitter } from 'node:events';
3
- import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../nats/types.js';
3
+ import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../../nats/types.js';
4
4
  import type { PluginAPI } from '../api.js';
5
5
  import type { PluginLogger } from '../logger.js';
6
6
  export declare interface PluginsManager extends PluginsManagerProxyMethods {
@@ -1,6 +1,6 @@
1
- import { type NatsConnection, type Subscription } from 'nats';
2
- import type { BaseLogger } from '../../../devices/camera/controller/types.js';
3
- import type { ProxyMessageStructure } from '../../../nats/types.js';
1
+ import type { NatsConnection, Subscription } from 'nats';
2
+ import type { BaseLogger } from '../../../../camera/controller/types.js';
3
+ import type { ProxyMessageStructure } from '../../../../nats/types.js';
4
4
  export declare class ClientMessageQueue {
5
5
  private logger;
6
6
  private publisher;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  import { EventEmitter } from 'node:events';
3
- import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../nats/types.js';
3
+ import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../../nats/types.js';
4
4
  import type { PluginAPI } from '../api.js';
5
5
  import type { PluginLogger } from '../logger.js';
6
6
  export declare interface SystemManager extends SystemManagerProxyMethods {
@@ -1,5 +1,5 @@
1
1
  import { z, type ZodTypeAny } from 'zod';
2
- import type { JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectWithButtons, JsonSchemaString, PluginJsonSchema, PluginJsonSchemaForm, PluginRootSchema, RootSchema } from '../types.js';
2
+ import type { JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaButton, JsonSchemaEnum, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectWithButtons, JsonSchemaString, PluginJsonSchema, PluginJsonSchemaForm, PluginRootSchema, RootSchema } from '../../../plugins/types.js';
3
3
  type RootZodSchema = z.ZodObject<Record<string, ZodTypeAny>, 'strict', ZodTypeAny, {
4
4
  [x: string]: any;
5
5
  }, {
@@ -92,7 +92,7 @@ export declare const schemaPathToConfigPath: (schemaPath: string) => string;
92
92
  * @param path - The key path to search for.
93
93
  * @returns - The value of the searched key path, if found, otherwise undefined.
94
94
  */
95
- export declare const getValueByPath: (obj: any, path: string) => any;
95
+ export declare const getValueByPath: (obj: Record<any, any> | undefined, path: string) => any;
96
96
  /**
97
97
  * Generates a Zod schema from a given JSON schema.
98
98
  *
@@ -1,5 +1,5 @@
1
1
  import { CameraStorage } from './cameraStorage.js';
2
- import type { PluginJsonSchemaForm } from '../types.js';
2
+ import type { PluginJsonSchemaForm } from '../../../plugins/types.js';
3
3
  import type { PluginAPI } from './api.js';
4
4
  export declare class StorageController {
5
5
  private api;
@@ -5,13 +5,13 @@ import type { LoggingLevel } from '../config/types.js';
5
5
  export declare class Logger {
6
6
  private _loggerPrefix;
7
7
  private _debugEnabled;
8
- private _traceLogging;
8
+ private _traceEnabled;
9
9
  private _disableTimestamps;
10
10
  notifications: UiNotification[];
11
11
  get debugEnabled(): boolean;
12
12
  set debugEnabled(state: boolean);
13
- get traceLogging(): boolean;
14
- set traceLogging(state: boolean);
13
+ get traceEnabled(): boolean;
14
+ set traceEnabled(state: boolean);
15
15
  get disableTimestamps(): boolean;
16
16
  set disableTimestamps(state: boolean);
17
17
  get prefix(): string;
@@ -1,12 +1,13 @@
1
1
  import { PortablePython } from '@bjia56/portable-python';
2
+ import { PluginLogger } from '../polyglot/node/plugins/logger.js';
2
3
  export declare const SERVER_PY_VERSION = "3.11";
3
4
  export declare class PythonInstaller {
4
5
  static readonly versions: string[];
6
+ logger: PluginLogger;
5
7
  readonly python: PortablePython;
6
8
  readonly venvPath?: string;
7
9
  readonly installPath: string;
8
10
  private identifier;
9
- private logger;
10
11
  private configService;
11
12
  private needsUpdate;
12
13
  get isInstalled(): boolean;
@@ -1,4 +1,4 @@
1
- import { Subscription } from 'rxjs';
1
+ import type { Subscription } from 'rxjs';
2
2
  export declare class Subscribed {
3
3
  private readonly subscriptions;
4
4
  private readonly additionalSubscriptions;
@@ -1,8 +1,8 @@
1
1
  export type * from '../../server/src/api/database/types.js';
2
2
  export type * from '../../server/src/api/types/index.js';
3
3
  export type * from '../../server/src/api/websocket/types.js';
4
+ export type * from '../../server/src/camera/controller/types.js';
4
5
  export type * from '../../server/src/decoder/types.js';
5
- export type * from '../../server/src/devices/camera/controller/types.js';
6
6
  export * from '../../server/src/go2rtc/types.js';
7
7
  export type * from '../../server/src/nats/types.js';
8
8
  export * from '../../server/src/plugins/types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
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.6.8",
26
+ "axios": "^1.7.2",
27
27
  "lodash.clonedeep": "^4.5.0",
28
28
  "lodash.isequal": "^4.5.0",
29
29
  "lru-cache": "^10.2.2",
@@ -34,8 +34,8 @@
34
34
  "@rushstack/eslint-patch": "^1.10.3",
35
35
  "@swc/register": "^0.1.10",
36
36
  "@types/webrtc": "^0.0.43",
37
- "@typescript-eslint/eslint-plugin": "^7.9.0",
38
- "@typescript-eslint/parser": "^7.9.0",
37
+ "@typescript-eslint/eslint-plugin": "^7.10.0",
38
+ "@typescript-eslint/parser": "^7.10.0",
39
39
  "bufferutil": "^4.0.8",
40
40
  "eslint": "^8.57.0",
41
41
  "eslint-config-prettier": "^9.1.0",
@@ -1,10 +0,0 @@
1
- import type { Namespace, Server, Socket } from 'socket.io';
2
- import type { SocketNsp } from '../types.js';
3
- export declare class FrameNamespace {
4
- nsp: Namespace;
5
- nspName: SocketNsp;
6
- readonly connectedClients: Map<string, Set<Socket>>;
7
- private decoder;
8
- constructor(io: Server);
9
- private handleConnection;
10
- }
@@ -1,27 +0,0 @@
1
- import { Subscribed } from '../../utils/subscribed.js';
2
- import type { CameraController } from '../../devices/camera/controller/index.js';
3
- import type { FrameMetadata } from '../types.js';
4
- export declare class FrameWorker extends Subscribed {
5
- token: string;
6
- private readonly logger;
7
- private readonly configService;
8
- private readonly camera;
9
- private frameWorker?;
10
- private stopped;
11
- private auth;
12
- constructor(camera: CameraController, auth: {
13
- user: string;
14
- pass: string;
15
- });
16
- listen(): Promise<void>;
17
- close(): Promise<void>;
18
- workerPID(): number;
19
- getMetadata(): Promise<FrameMetadata>;
20
- startVideoSession(): Promise<void>;
21
- stopVideoSession(): Promise<void>;
22
- private onMessage;
23
- private sendMessage;
24
- private sendReponse;
25
- private send;
26
- private getLogPrefix;
27
- }
@@ -1,22 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { EventEmitter } from 'node:events';
3
- import type { ProcessMessage, ProcessResponse } from './types.js';
4
- export declare interface WorkerIPC {
5
- on(event: 'message', listener: (message: ProcessResponse) => void): this;
6
- }
7
- export declare class WorkerIPC extends EventEmitter {
8
- private publisher?;
9
- private subscriber?;
10
- private id;
11
- private subject;
12
- private targetSubject;
13
- private auth;
14
- constructor(id: string, auth: {
15
- user: string;
16
- pass: string;
17
- });
18
- listen(): Promise<void>;
19
- close(): Promise<void>;
20
- sendMessage(message: ProcessMessage): void;
21
- private listenToMessages;
22
- }