@camera.ui/browser 0.0.94 → 0.0.95

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 (47) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +3 -1
  3. package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +2 -2
  4. package/dist/types/packages/common/src/utils/subscribed.d.ts +9 -0
  5. package/dist/types/packages/plugineer/src/polyglot/node/camera/index.d.ts +4 -3
  6. package/dist/types/packages/plugineer/src/polyglot/node/camera/interfaces/prebuffer.d.ts +1 -2
  7. package/dist/types/packages/plugineer/src/polyglot/node/camera/types.d.ts +15 -0
  8. package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +136 -0
  9. package/dist/types/packages/plugineer/src/types.d.ts +4 -0
  10. package/dist/types/packages/{common/src/messaging/index.d.ts → plugineer/src/utils/messageQueue.d.ts} +3 -3
  11. package/dist/types/packages/types/src/index.d.ts +657 -0
  12. package/dist/types/server/src/api/database/types.d.ts +1 -122
  13. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +89 -69
  14. package/dist/types/server/src/api/schemas/config.schema.d.ts +6 -6
  15. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +84 -84
  16. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +5 -5
  17. package/dist/types/server/src/api/schemas/users.schema.d.ts +48 -48
  18. package/dist/types/server/src/api/services/cameras.service.d.ts +6 -5
  19. package/dist/types/server/src/api/types/index.d.ts +3 -3
  20. package/dist/types/server/src/api/utils/cameraSource.d.ts +2 -0
  21. package/dist/types/server/src/api/websocket/nsp/plugins.d.ts +1 -1
  22. package/dist/types/server/src/api/websocket/types.d.ts +1 -1
  23. package/dist/types/server/src/api.d.ts +2 -2
  24. package/dist/types/server/src/camera/controller.d.ts +13 -3
  25. package/dist/types/server/src/camera/types.d.ts +1 -318
  26. package/dist/types/server/src/decoder/types.d.ts +0 -127
  27. package/dist/types/server/src/decoder/worker.d.ts +2 -2
  28. package/dist/types/server/src/nats/index.d.ts +4 -4
  29. package/dist/types/server/src/nats/proxy/cameraDevice.d.ts +3 -3
  30. package/dist/types/server/src/nats/proxy/coreManager.d.ts +3 -5
  31. package/dist/types/server/src/nats/proxy/deviceManager.d.ts +3 -5
  32. package/dist/types/server/src/nats/types.d.ts +3 -101
  33. package/dist/types/server/src/nats/utils.d.ts +1 -1
  34. package/dist/types/server/src/nats/websocket.d.ts +2 -2
  35. package/dist/types/server/src/plugins/plugin.d.ts +2 -2
  36. package/dist/types/server/src/plugins/types.d.ts +1 -181
  37. package/dist/types/server/src/plugins/worker.d.ts +1 -1
  38. package/dist/types/server/src/services/config/constants.d.ts +2 -1
  39. package/dist/types/server/src/services/config/types.d.ts +1 -5
  40. package/dist/types/shared/types/index.d.ts +4 -3
  41. package/package.json +4 -4
  42. package/dist/types/server/src/plugins/interfaces/audioDetection.d.ts +0 -7
  43. package/dist/types/server/src/plugins/interfaces/base.d.ts +0 -6
  44. package/dist/types/server/src/plugins/interfaces/motionDetection.d.ts +0 -6
  45. package/dist/types/server/src/plugins/interfaces/objectDetection.d.ts +0 -7
  46. /package/dist/types/packages/{common/src/nats/index.d.ts → plugineer/src/utils/nats.d.ts} +0 -0
  47. /package/dist/types/packages/{common/src/packer/index.d.ts → plugineer/src/utils/packer.d.ts} +0 -0
@@ -1,187 +1,7 @@
1
- import type { Path } from 'object-path';
2
- import type { Camera } from '../api/database/types.js';
3
- import type { Detection, StorageController } from '../camera/types.js';
4
- import type { CoreManager, DeviceManager } from '../nats/types.js';
1
+ import type { CameraExtension } from '@camera.ui/types';
5
2
  export interface Context {
6
3
  engines?: Record<string, string>;
7
4
  dependencies?: Record<string, string>;
8
5
  }
9
- export interface SchemaConfig {
10
- rootSchema: RootSchema;
11
- config: Record<string, any>;
12
- }
13
6
  export declare const PLUGIN_IDENTIFIER_PATTERN: RegExp;
14
- export type JSONValue = string | number | boolean | JSONObject | JSONArray;
15
- export interface JSONObject {
16
- [key: string]: JSONValue;
17
- }
18
- export type JSONArray = JSONValue[];
19
- export type PluginConfig = Record<string, any>;
20
7
  export declare const CAMERA_EXTENSIONS: CameraExtension[];
21
- export type CameraExtensionWithoutHub = 'prebuffer' | 'motionDetection' | 'objectDetection' | 'audioDetection' | 'ptz';
22
- export type CameraExtension = CameraExtensionWithoutHub | 'hub';
23
- type ExtensionOrSupport = {
24
- extension: CameraExtension;
25
- supportAdditionalCameras?: never;
26
- } | {
27
- extension?: never;
28
- supportAdditionalCameras?: boolean;
29
- };
30
- export interface PluginContractBase {
31
- builtIns?: CameraExtensionWithoutHub[];
32
- dependencies?: string[];
33
- pythonVersion?: string;
34
- }
35
- export type PluginContract = PluginContractBase & ExtensionOrSupport;
36
- export declare enum PLUGIN_STATUS {
37
- READY = "ready",
38
- STARTING = "starting",
39
- STARTED = "started",
40
- STOPPED = "stopped",
41
- ERROR = "error",
42
- UNKNOWN = "unknown",
43
- DISABLED = "disabled"
44
- }
45
- export declare enum PLUGIN_COMMAND {
46
- START = "start",
47
- STOP = "stop"
48
- }
49
- export type ProcessErrorMessage = string;
50
- export interface PluginStorage {
51
- installPath: string;
52
- storagePath: string;
53
- configFile: string;
54
- }
55
- export interface PluginInfo {
56
- id: string;
57
- name: string;
58
- contract: PluginContract;
59
- }
60
- export interface ProcessLoadMessage {
61
- cameras: Camera[];
62
- plugin: PluginInfo;
63
- storage: PluginStorage;
64
- }
65
- export interface ProcessMessage {
66
- type: PLUGIN_COMMAND;
67
- data?: ProcessLoadMessage;
68
- }
69
- export interface ProcessResponse {
70
- type: PLUGIN_STATUS;
71
- data?: ProcessErrorMessage;
72
- }
73
- export type JsonSchemaType = 'string' | 'number' | 'boolean' | 'object' | 'array' | 'button';
74
- export interface JsonBaseSchema<T = any> {
75
- type: JsonSchemaType;
76
- key?: string;
77
- title?: string;
78
- description?: string;
79
- required?: boolean;
80
- readonly?: boolean;
81
- placeholder?: string;
82
- hidden?: boolean;
83
- group?: string;
84
- defaultValue?: T;
85
- store?: boolean;
86
- onSet?: (newValue: any, oldValue: any) => Promise<void>;
87
- onGet?: () => Promise<any>;
88
- }
89
- export interface JsonSchemaString extends JsonBaseSchema<string> {
90
- type: 'string';
91
- format?: 'date-time' | 'date' | 'time' | 'email' | 'uuid' | 'ipv4' | 'ipv6' | 'password' | 'qrCode' | 'image';
92
- minLength?: number;
93
- maxLength?: number;
94
- }
95
- export interface JsonSchemaNumber extends JsonBaseSchema<number> {
96
- type: 'number';
97
- minimum?: number;
98
- maximum?: number;
99
- step?: number;
100
- }
101
- export interface JsonSchemaBoolean extends JsonBaseSchema<boolean> {
102
- type: 'boolean';
103
- }
104
- export interface JsonSchemaEnum extends JsonBaseSchema<string> {
105
- type: 'string';
106
- enum: string[];
107
- multiple?: boolean;
108
- }
109
- export interface JsonSchemaObject extends JsonBaseSchema {
110
- type: 'object';
111
- opened?: boolean;
112
- properties?: JsonSchemaForm;
113
- }
114
- export interface JsonSchemaArray extends JsonBaseSchema {
115
- type: 'array';
116
- opened?: boolean;
117
- items?: JsonSchema;
118
- }
119
- export interface JsonSchemaButton extends JsonBaseSchema {
120
- type: 'button';
121
- }
122
- export interface JsonSchemaObjectButton {
123
- label: string;
124
- onSubmit: string;
125
- }
126
- export interface JsonSchemaObjectWithButtons extends JsonSchemaObject {
127
- buttons: JsonSchemaObjectButton[];
128
- }
129
- export type JsonSchema = JsonSchemaString | JsonSchemaNumber | JsonSchemaBoolean | JsonSchemaEnum | JsonSchemaObject | JsonSchemaObjectWithButtons | JsonSchemaArray | JsonSchemaButton;
130
- export interface JsonSchemaForm {
131
- [key: string]: JsonSchema;
132
- }
133
- export interface RootSchema {
134
- schema: JsonSchemaForm;
135
- }
136
- export interface ToastMessage {
137
- type: 'info' | 'success' | 'warning' | 'error';
138
- message: string;
139
- }
140
- export interface FormSubmitSchema {
141
- config: JsonSchemaObjectWithButtons;
142
- }
143
- export interface FormSubmitResponse {
144
- toast?: ToastMessage;
145
- schema?: FormSubmitSchema;
146
- }
147
- export interface MotionDetectionPluginResponse {
148
- filePath: string;
149
- }
150
- export interface ObjectDetectionPluginResponse {
151
- detections: Detection[];
152
- }
153
- export interface AudioDetectionPluginResponse {
154
- detected: boolean;
155
- }
156
- export interface PluginAPI {
157
- on(event: 'finishLaunching', listener: () => void): this;
158
- on(event: 'shutdown', listener: () => void): this;
159
- once(event: 'finishLaunching', listener: () => void): this;
160
- once(event: 'shutdown', listener: () => void): this;
161
- off(event: 'finishLaunching', listener: () => void): this;
162
- off(event: 'shutdown', listener: () => void): this;
163
- removeListener(event: 'finishLaunching', listener: () => void): this;
164
- removeListener(event: 'shutdown', listener: () => void): this;
165
- removeAllListeners(event?: string): this;
166
- readonly coreManager: CoreManager;
167
- readonly deviceManager: DeviceManager;
168
- readonly storageController: StorageController;
169
- readonly configService: PluginConfigService;
170
- readonly storagePath: string;
171
- readonly configFile: string;
172
- }
173
- export interface PluginConfigService {
174
- get(key: Path, defaultValue: JSONValue, validate: Function, refresh?: boolean, writeIfNotValid?: boolean): any;
175
- get(key: Path, defaultValue?: unknown, validate?: Function, refresh?: boolean, writeIfNotValid?: boolean): any;
176
- has(key: Path, refresh?: boolean): boolean;
177
- ensureExists(key: Path, defaultValue: JSONValue, write?: boolean): void;
178
- set(key: Path, value: any, write?: boolean): void;
179
- insert(key: Path, value: any, at?: number, write?: boolean): void;
180
- push(key: Path, write?: boolean, ...items: any[]): void;
181
- delete(key: Path, write?: boolean): void;
182
- all(refresh?: boolean): PluginConfig;
183
- replace(config: PluginConfig, write?: boolean): void;
184
- updateValue(path: string, searchKey: string, searchValue: any, targetKey: string, newValue: any, write?: boolean): void;
185
- replaceOrAddItem(path: string, searchKey: string, searchValue: any, newItem: any, write?: boolean): void;
186
- }
187
- export {};
@@ -1,4 +1,4 @@
1
- import { PLUGIN_STATUS } from './types.js';
1
+ import { PLUGIN_STATUS } from '@camera.ui/plugineer';
2
2
  import type { Plugin } from './plugin.js';
3
3
  export declare class PluginWorker {
4
4
  plugin: Plugin;
@@ -1,4 +1,5 @@
1
- import type { Go2RtcConfig, IConfig, IceServer } from './types.js';
1
+ import type { IceServer } from '@camera.ui/types';
2
+ import type { Go2RtcConfig, IConfig } from './types.js';
2
3
  export declare const DEFAULT_ICE_SERVERS: IceServer[];
3
4
  export declare const DEFAULT_CONFIG: IConfig;
4
5
  export declare const DEFAULT_GO2RTC_CONFIG: Go2RtcConfig;
@@ -1,3 +1,4 @@
1
+ import type { IceServer } from '@camera.ui/types';
1
2
  export interface Secrets {
2
3
  jwtAccessKey: string;
3
4
  jwtRefreshKey: string;
@@ -120,11 +121,6 @@ export interface WebrtcFilter {
120
121
  ips?: string[];
121
122
  udp_ports?: string[];
122
123
  }
123
- export interface IceServer {
124
- urls: string[];
125
- username?: string;
126
- credential?: string;
127
- }
128
124
  export interface Ffmpeg {
129
125
  bin: string;
130
126
  global: string;
@@ -1,7 +1,9 @@
1
- export type * from '../../packages/common/src/messaging/index.js';
2
- export * from '../../packages/common/src/utils/subscribed.js';
1
+ export { Subscribed as SubscribedImp } from '../../packages/common/src/utils/subscribed.js';
3
2
  export * from '../../packages/plugineer/src/polyglot/node/camera/polygon.js';
4
3
  export * from '../../packages/plugineer/src/polyglot/node/plugins/schema.js';
4
+ export * from '../../packages/plugineer/src/polyglot/node/plugins/types.js';
5
+ export type * from '../../packages/plugineer/src/utils/messageQueue.js';
6
+ export * from '../../packages/types/src/index.js';
5
7
  export type * from '../../server/src/api/database/types.js';
6
8
  export * from '../../server/src/api/schemas/cameras.schema.js';
7
9
  export * from '../../server/src/api/schemas/plugins.schema.js';
@@ -13,7 +15,6 @@ export type * from '../../server/src/camera/types.js';
13
15
  export type * from '../../server/src/decoder/types.js';
14
16
  export * from '../../server/src/go2rtc/types.js';
15
17
  export type * from '../../server/src/nats/types.js';
16
- export * from '../../server/src/plugins/interfaces/base.js';
17
18
  export * from '../../server/src/plugins/types.js';
18
19
  export * from '../../server/src/services/config/types.js';
19
20
  export type * from '../../server/src/types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.94",
3
+ "version": "0.0.95",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/seydx/camera.ui)",
6
6
  "module": "./dist/bundle.js",
@@ -33,8 +33,8 @@
33
33
  "@rushstack/eslint-patch": "^1.10.4",
34
34
  "@swc/register": "^0.1.10",
35
35
  "@types/webrtc": "^0.0.43",
36
- "@typescript-eslint/eslint-plugin": "^8.4.0",
37
- "@typescript-eslint/parser": "^8.4.0",
36
+ "@typescript-eslint/eslint-plugin": "^8.5.0",
37
+ "@typescript-eslint/parser": "^8.5.0",
38
38
  "bufferutil": "^4.0.8",
39
39
  "eslint": "^8.57.0",
40
40
  "eslint-config-prettier": "^9.1.0",
@@ -42,7 +42,7 @@
42
42
  "prettier": "^3.3.3",
43
43
  "rimraf": "^6.0.1",
44
44
  "ts-loader": "^9.5.1",
45
- "typescript": "^5.5.4",
45
+ "typescript": "^5.6.2",
46
46
  "updates": "^16.4.0",
47
47
  "utf-8-validate": "^6.0.4",
48
48
  "webpack": "^5.94.0",
@@ -1,7 +0,0 @@
1
- import { BasePlugin } from './base.js';
2
- import type { AudioMetadata } from '../../decoder/types.js';
3
- import type { AudioDetectionPluginResponse, RootSchema } from '../types.js';
4
- export declare abstract class AudioDetectionPlugin extends BasePlugin {
5
- abstract interfaceSchema(): RootSchema | void;
6
- abstract detectAudio(audioPath: string, metadata: AudioMetadata, config: Record<string, any>): Promise<AudioDetectionPluginResponse>;
7
- }
@@ -1,6 +0,0 @@
1
- import type { CameraDevice } from '@camera.ui/plugineer';
2
- import type { FormSubmitResponse } from '../types.js';
3
- export declare abstract class BasePlugin {
4
- abstract onFormSubmit(actionId: string, payload: any): Promise<FormSubmitResponse | void>;
5
- abstract configureCameras(cameras: CameraDevice[]): void;
6
- }
@@ -1,6 +0,0 @@
1
- import { BasePlugin } from './base.js';
2
- import type { MotionDetectionPluginResponse, RootSchema } from '../types.js';
3
- export declare abstract class MotionDetectionPlugin extends BasePlugin {
4
- abstract interfaceSchema(): RootSchema | void;
5
- abstract detectMotion(videoPath: string, config: Record<string, any>): Promise<MotionDetectionPluginResponse>;
6
- }
@@ -1,7 +0,0 @@
1
- import { BasePlugin } from './base.js';
2
- import type { ImageMetadata } from '../../decoder/types.js';
3
- import type { ObjectDetectionPluginResponse, RootSchema } from '../types.js';
4
- export declare abstract class ObjectDetectionPlugin extends BasePlugin {
5
- abstract interfaceSchema(): RootSchema | void;
6
- abstract detectObjects(imagePath: string, metadata: ImageMetadata, config: Record<string, any>): Promise<ObjectDetectionPluginResponse>;
7
- }