@camera.ui/browser 0.0.104 → 0.0.106

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 (68) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +1 -2
  3. package/dist/types/packages/client/browser/src/types.d.ts +1 -1
  4. package/dist/types/packages/plugineer/src/polyglot/node/camera/index.d.ts +3 -3
  5. package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +2 -2
  6. package/dist/types/packages/types/src/index.d.ts +73 -23
  7. package/dist/types/server/src/api/controllers/api.controller.d.ts +7 -0
  8. package/dist/types/server/src/api/controllers/auth.controller.d.ts +16 -0
  9. package/dist/types/server/src/api/controllers/backup.controller.d.ts +10 -0
  10. package/dist/types/server/src/api/controllers/cameras.controller.d.ts +38 -0
  11. package/dist/types/server/src/api/controllers/config.controller.d.ts +14 -0
  12. package/dist/types/server/src/api/controllers/files.controller.d.ts +8 -0
  13. package/dist/types/server/src/api/controllers/frameWorkers.controller.d.ts +11 -0
  14. package/dist/types/server/src/api/controllers/plugins.controller.d.ts +48 -0
  15. package/dist/types/server/src/api/controllers/system.controller.d.ts +23 -0
  16. package/dist/types/server/src/api/controllers/users.controller.d.ts +28 -0
  17. package/dist/types/server/src/api/database/index.d.ts +1 -1
  18. package/dist/types/server/src/api/database/types.d.ts +0 -4
  19. package/dist/types/server/src/api/go2rtc/api/streams.d.ts +2 -1
  20. package/dist/types/server/src/api/go2rtc/types.d.ts +6 -6
  21. package/dist/types/server/src/api/index.d.ts +22 -0
  22. package/dist/types/server/src/api/middlewares/authPermission.middleware.d.ts +5 -0
  23. package/dist/types/server/src/api/middlewares/authValidation.middleware.d.ts +4 -0
  24. package/dist/types/server/src/api/middlewares/pagination.middleware.d.ts +3 -0
  25. package/dist/types/server/src/api/plugins/header.plugin.d.ts +2 -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 +20 -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/frameWorkers.routes.d.ts +2 -0
  36. package/dist/types/server/src/api/routes/index.d.ts +6 -0
  37. package/dist/types/server/src/api/routes/plugins.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/backup.schema.d.ts +94 -1
  41. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +16 -16
  42. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +4 -4
  43. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +3 -3
  44. package/dist/types/server/src/api/schemas/system.schema.d.ts +8 -0
  45. package/dist/types/server/src/api/schemas/users.schema.d.ts +35 -35
  46. package/dist/types/server/src/api/services/backup.service.d.ts +11 -0
  47. package/dist/types/server/src/api/services/cameras.service.d.ts +2 -4
  48. package/dist/types/server/src/api/services/plugins.service.d.ts +16 -4
  49. package/dist/types/server/src/api/services/system.service.d.ts +6 -0
  50. package/dist/types/server/src/api/types/index.d.ts +18 -0
  51. package/dist/types/server/src/api/utils/cameraSource.d.ts +6 -2
  52. package/dist/types/server/src/api/utils/cert.d.ts +11 -0
  53. package/dist/types/server/src/api/utils/fetch.d.ts +1 -2
  54. package/dist/types/server/src/api/utils/moveFiles.d.ts +4 -0
  55. package/dist/types/server/src/api/utils/parse.d.ts +1 -1
  56. package/dist/types/server/src/api/websocket/nsp/logs.d.ts +3 -1
  57. package/dist/types/server/src/api/websocket/nsp/main.d.ts +2 -0
  58. package/dist/types/server/src/camera/controller.d.ts +8 -11
  59. package/dist/types/server/src/camera/frameWorker.d.ts +1 -1
  60. package/dist/types/server/src/main.d.ts +25 -0
  61. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +2 -2
  62. package/dist/types/server/src/plugins/index.d.ts +3 -2
  63. package/dist/types/server/src/services/config/constants.d.ts +0 -1
  64. package/dist/types/server/src/services/config/index.d.ts +3 -1
  65. package/dist/types/server/src/services/config/types.d.ts +1 -2
  66. package/dist/types/server/src/types.d.ts +24 -0
  67. package/package.json +9 -9
  68. package/eslint.config.js +0 -89
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import 'reflect-metadata';
3
+ import type { Logger } from '@camera.ui/common';
4
+ declare class CameraUi {
5
+ readonly logger: Logger;
6
+ private api;
7
+ private database;
8
+ private configService;
9
+ private pluginManager;
10
+ private go2rtc;
11
+ private go2rtcApi;
12
+ private server;
13
+ private proxy;
14
+ private signalHandler;
15
+ private homePath;
16
+ status: 'loading' | 'ready';
17
+ constructor();
18
+ start(): Promise<void>;
19
+ close(): Promise<void>;
20
+ restart(): Promise<void>;
21
+ requestUpdate(version?: string): Promise<AsyncGenerator<string, void, unknown>>;
22
+ private initializePlugins;
23
+ private setStatus;
24
+ }
25
+ export type { CameraUi };
@@ -1,6 +1,6 @@
1
1
  import type { MessageQueue, ProxyMessageStructure } from '@camera.ui/common';
2
2
  import type { CameraDeviceProxyMethods, CameraInterfaces, RefreshedStates } from '@camera.ui/plugineer';
3
- import type { CameraConfigInputSettings, ProbeStream, SetValues } from '@camera.ui/types';
3
+ import type { CameraConfigInputSettings, ProbeConfig, ProbeStream, SetValues } from '@camera.ui/types';
4
4
  import type { MethodKeys, MethodType } from '../../types.js';
5
5
  export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
6
6
  private api;
@@ -12,7 +12,7 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
12
12
  connect(cameraId: string, pluginId: string): void;
13
13
  disconnect(cameraId: string, pluginId: string): void;
14
14
  updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T], cameraId: string, pluginId: string): Promise<void>;
15
- probeStream(sourceId: string, refresh: boolean, cameraId: string): Promise<ProbeStream | undefined>;
15
+ probeStream(sourceId: string, probeConfig: ProbeConfig | undefined, refresh: boolean, cameraId: string): Promise<ProbeStream | undefined>;
16
16
  addCameraSource(source: CameraConfigInputSettings, cameraId: string, pluginId: string): Promise<void>;
17
17
  updateCameraSource(sourceId: string, source: Partial<CameraConfigInputSettings>, cameraId: string, pluginId: string): Promise<void>;
18
18
  removeCameraSource(sourceId: string, cameraId: string, pluginId: string): Promise<void>;
@@ -17,13 +17,14 @@ export declare class PluginManager {
17
17
  static loadPackageJSON(installPath: string): IPackageJson;
18
18
  initializeInstalledPlugins(): Promise<void>;
19
19
  initializeInstalledPlugin(plugin: Plugin): Promise<void>;
20
- loadPlugin(absolutePath: string): Promise<Plugin>;
20
+ loadPlugin(absolutePath: string, oldId?: string): Promise<Plugin>;
21
21
  removePlugin(plugin: Plugin, removeStorage?: boolean): Promise<void>;
22
22
  startPluginChild(pluginName: string): Promise<void>;
23
23
  stopPluginChild(pluginName: string): Promise<void>;
24
24
  initializePlugins(): Promise<void>;
25
- installRequiredPythonEnvs(): Promise<void>;
25
+ private installRequiredPythonEnvs;
26
26
  private loadInstalledPlugins;
27
+ private restorePlugins;
27
28
  private removeOrphanedPlugins;
28
29
  private handleDisabledPlugins;
29
30
  }
@@ -1,6 +1,5 @@
1
1
  import type { IceServer } from '@camera.ui/types';
2
2
  import type { Go2RtcConfig, IConfig } from './types.js';
3
- export declare const APP_NAME: string;
4
3
  export declare const PROCESS_IDENTIFIER = "--id=camera.ui";
5
4
  export declare const DEFAULT_ICE_SERVERS: IceServer[];
6
5
  export declare const DEFAULT_CONFIG: IConfig;
@@ -8,7 +8,7 @@ export declare class ConfigService {
8
8
  static get ENVIRONMENT(): EnvironmentInfo;
9
9
  static readonly NODE_VERSION: string;
10
10
  static readonly MIN_NODE_VERSION: string;
11
- static readonly INSTALL_PATH: string | null;
11
+ static readonly SERVER_PATH: string;
12
12
  static readonly INTERFACE_PATH: string;
13
13
  private logger;
14
14
  private _config;
@@ -32,6 +32,7 @@ export declare class ConfigService {
32
32
  readonly GO2RTC_BINARY: string;
33
33
  readonly GO2RTC_CONFIG_FILE: string;
34
34
  readonly NATS_BINARY: string;
35
+ readonly BACKUP_INFO_FILE: string;
35
36
  readonly UI_PORT: number;
36
37
  get config(): IConfig;
37
38
  set config(newConfig: IConfig);
@@ -62,4 +63,5 @@ export declare class ConfigService {
62
63
  private safetyEnsureDir;
63
64
  private safetyEmptyDir;
64
65
  private safetyEnsureFile;
66
+ private logStart;
65
67
  }
@@ -4,7 +4,6 @@ export interface EnvironmentInfo {
4
4
  docker: boolean;
5
5
  electron: boolean;
6
6
  homeassistant: boolean;
7
- serviceMode: boolean;
8
7
  }
9
8
  export interface Secrets {
10
9
  jwtAccessKey: string;
@@ -99,7 +98,7 @@ export interface API {
99
98
  username?: string;
100
99
  password?: string;
101
100
  }
102
- export type Streams = Record<string, string | string[] | null>;
101
+ export type Streams = Record<string, string | string[]>;
103
102
  export interface SRTP {
104
103
  listen: string;
105
104
  }
@@ -5,3 +5,27 @@ export type MethodType<T, K extends keyof T> = T[K] extends (...args: any) => an
5
5
  export type DeepPartial<T> = T extends object ? {
6
6
  [P in keyof T]?: DeepPartial<T[P]>;
7
7
  } : T;
8
+ export interface UpdateStartedMessage {
9
+ type: 'UPDATE_STARTED';
10
+ version: string;
11
+ }
12
+ export interface UpdateOutputMessage {
13
+ type: 'UPDATE_OUTPUT';
14
+ data: string;
15
+ }
16
+ export interface UpdateErrorMessage {
17
+ type: 'UPDATE_ERROR';
18
+ data: string;
19
+ }
20
+ export interface UpdateCompleteMessage {
21
+ type: 'UPDATE_COMPLETE';
22
+ version: string;
23
+ }
24
+ export interface UpdateFailedMessage {
25
+ type: 'UPDATE_FAILED';
26
+ error: string;
27
+ }
28
+ export interface RestartRequiredMessage {
29
+ type: 'RESTART_REQUIRED';
30
+ }
31
+ export type CLIMessage = UpdateStartedMessage | UpdateOutputMessage | UpdateErrorMessage | UpdateCompleteMessage | UpdateFailedMessage | RestartRequiredMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/seydx/camera.ui)",
6
6
  "exports": {
@@ -22,7 +22,7 @@
22
22
  "install-updates": "npm i --save",
23
23
  "prebuild": "rimraf dist",
24
24
  "postbuild": "echo Build completed successfully!",
25
- "prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
25
+ "prepublishOnly": "npm i --package-lock-only && npm run lint:fix && npm run format && npm run build"
26
26
  },
27
27
  "dependencies": {
28
28
  "@isaacs/ttlcache": "^1.4.1",
@@ -30,12 +30,12 @@
30
30
  "socket.io-client": "^4.8.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@stylistic/eslint-plugin": "^2.9.0",
34
- "@typescript-eslint/parser": "^8.11.0",
35
- "eslint": "^9.13.0",
36
- "globals": "^15.11.0",
33
+ "@stylistic/eslint-plugin": "^2.10.1",
34
+ "@typescript-eslint/parser": "^8.13.0",
35
+ "eslint": "^9.14.0",
36
+ "globals": "^15.12.0",
37
37
  "prettier": "^3.3.3",
38
- "typescript-eslint": "^8.11.0",
38
+ "typescript-eslint": "^8.13.0",
39
39
  "@swc/register": "^0.1.10",
40
40
  "@types/webrtc": "^0.0.44",
41
41
  "bufferutil": "^4.0.8",
@@ -43,8 +43,8 @@
43
43
  "ts-loader": "^9.5.1",
44
44
  "typescript": "^5.6.3",
45
45
  "updates": "^16.4.0",
46
- "utf-8-validate": "^6.0.4",
47
- "webpack": "^5.95.0",
46
+ "utf-8-validate": "^6.0.5",
47
+ "webpack": "^5.96.1",
48
48
  "webpack-cli": "^5.1.4"
49
49
  },
50
50
  "bugs": {
package/eslint.config.js DELETED
@@ -1,89 +0,0 @@
1
- import jsLint from '@eslint/js';
2
- import stylistic from '@stylistic/eslint-plugin';
3
- import tsParser from '@typescript-eslint/parser';
4
- import globals from 'globals';
5
- import tsLint from 'typescript-eslint';
6
-
7
- export default [
8
- {
9
- files: ['**/*.{js,mjs,cjs,ts,mts}'],
10
- },
11
- {
12
- ignores: ['**/dist/**', '**/node_modules/**', '**/public/**', '**/build/**', '**/bundle/**', '**/test/**', '**/wasm/**', '**/example/**'],
13
- },
14
- jsLint.configs.recommended,
15
- // ...tsLint.configs.recommended,
16
- ...tsLint.configs.recommendedTypeChecked,
17
- ...tsLint.configs.stylisticTypeChecked,
18
- stylistic.configs['disable-legacy'],
19
- stylistic.configs.customize({
20
- indent: 2,
21
- quotes: 'single',
22
- semi: true,
23
- commaDangle: 'always-multiline',
24
- jsx: false,
25
- arrowParens: true,
26
- braceStyle: '1tbs',
27
- blockSpacing: true,
28
- quoteProps: 'as-needed',
29
- }),
30
- {
31
- languageOptions: {
32
- globals: { ...globals.node },
33
- parser: tsParser,
34
- parserOptions: {
35
- projectService: true,
36
- tsconfigRootDir: import.meta.dirname,
37
- },
38
- },
39
-
40
- rules: {
41
- // TypeScript specific rules
42
- '@typescript-eslint/consistent-type-imports': 'error',
43
- '@typescript-eslint/await-thenable': 'error',
44
- '@typescript-eslint/no-explicit-any': 'off',
45
- '@typescript-eslint/no-unused-vars': ['error'],
46
- '@typescript-eslint/no-unsafe-assignment': 'off',
47
- '@typescript-eslint/no-unsafe-member-access': 'off',
48
- '@typescript-eslint/no-unsafe-argument': 'off',
49
- '@typescript-eslint/no-unsafe-return': 'off',
50
- '@typescript-eslint/require-await': 'off',
51
- '@typescript-eslint/no-floating-promises': 'off',
52
- '@typescript-eslint/prefer-promise-reject-errors': 'off',
53
- '@typescript-eslint/no-misused-promises': 'off',
54
- '@typescript-eslint/ban-ts-comment': 'off',
55
- '@typescript-eslint/no-empty-function': 'off',
56
- '@typescript-eslint/restrict-template-expressions': 'off',
57
- '@typescript-eslint/no-unsafe-call': 'off',
58
- '@typescript-eslint/no-empty-object-type': 'off',
59
- '@typescript-eslint/no-unsafe-function-type': 'off',
60
- '@typescript-eslint/no-unsafe-declaration-merging': 'off',
61
- '@typescript-eslint/prefer-for-of': 'off',
62
- '@typescript-eslint/prefer-find': 'off',
63
- '@typescript-eslint/no-require-imports': 'off',
64
- '@typescript-eslint/no-redundant-type-constituents': 'off',
65
- '@typescript-eslint/no-namespace': 'off',
66
-
67
- // Stylistic specific rules
68
- '@stylistic/max-len': ['error', { code: 170, tabWidth: 2 }],
69
- '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
70
- '@stylistic/operator-linebreak': 'off',
71
-
72
- semi: [1, 'always'],
73
- // quotes: ['error', 'single'],
74
- 'comma-dangle': ['error', 'only-multiline'],
75
- 'no-multiple-empty-lines': ['warn', { max: 1, maxEOF: 0 }],
76
- 'eol-last': ['error', 'always'],
77
- 'space-before-function-paren': ['error', { named: 'never' }],
78
-
79
- 'no-unused-vars': 'off',
80
- 'no-case-declarations': 'off',
81
- 'no-async-promise-executor': 'off',
82
- 'no-control-regex': 'off',
83
- },
84
- },
85
- {
86
- files: ['**/*.js', '**/*.cjs', '**/*.mjs', '*.d.ts', '*.config.ts'],
87
- ...tsLint.configs.disableTypeChecked,
88
- },
89
- ];