@camera.ui/browser 0.0.55 → 0.0.57
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.
- package/dist/bundle.js +1 -1
- package/dist/types/packages/client/browser/src/client.d.ts +9 -9
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +25 -9
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +35 -12
- package/dist/types/packages/client/browser/src/proxy/index.d.ts +2 -2
- package/dist/types/packages/client/browser/src/proxy/pluginsManager.d.ts +33 -0
- package/dist/types/packages/client/browser/src/proxy/systemManager.d.ts +33 -0
- package/dist/types/server/src/api/schemas/cameras.schema.d.ts +94 -94
- package/dist/types/server/src/api/schemas/config.schema.d.ts +5 -5
- package/dist/types/server/src/api/schemas/users.schema.d.ts +2 -2
- package/dist/types/server/src/camera/base/base.browser.d.ts +1 -1
- package/dist/types/server/src/camera/base/base.d.ts +0 -1
- package/dist/types/server/src/detector/types.d.ts +4 -0
- package/dist/types/server/src/plugins/node/proxy/queue.d.ts +28 -0
- package/dist/types/server/src/plugins/types.d.ts +0 -7
- package/dist/types/server/src/proxy/constants.d.ts +1 -0
- package/dist/types/server/src/proxy/types.d.ts +10 -0
- package/dist/types/shared/types/index.d.ts +6 -6
- package/package.json +3 -2
- package/dist/types/packages/client/node/src/proxy/pluginsManager.d.ts +0 -10
- package/dist/types/packages/client/node/src/proxy/systemManager.d.ts +0 -10
- package/dist/types/packages/client/node/src/socket.d.ts +0 -13
- /package/dist/types/packages/client/{node → browser}/src/api.d.ts +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BaseLogger } from '../../../camera/types';
|
|
2
|
+
import type { ProxyMessageStructure } from '../../../proxy/types';
|
|
3
|
+
interface NatsConnection {
|
|
4
|
+
publish(subject: string, data: Uint8Array): void;
|
|
5
|
+
}
|
|
6
|
+
interface Subscription extends AsyncIterable<any> {
|
|
7
|
+
}
|
|
8
|
+
interface JSONCodec<T> {
|
|
9
|
+
encode(d: T): Uint8Array;
|
|
10
|
+
decode(a: Uint8Array): T;
|
|
11
|
+
}
|
|
12
|
+
export declare class ClientMessageQueue {
|
|
13
|
+
private logger;
|
|
14
|
+
private publisher;
|
|
15
|
+
private subscriber;
|
|
16
|
+
private requestHandler;
|
|
17
|
+
private jc;
|
|
18
|
+
private aborted;
|
|
19
|
+
private isProcessing;
|
|
20
|
+
private queue;
|
|
21
|
+
private pendingResponses;
|
|
22
|
+
constructor(logger: BaseLogger, publisher: NatsConnection, subscriber: Subscription, codec: JSONCodec<any>, requestHandler: (message: ProxyMessageStructure) => void);
|
|
23
|
+
abortQueue(): void;
|
|
24
|
+
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
25
|
+
private processQueue;
|
|
26
|
+
private listenToMessages;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Camera } from '../api/database/types';
|
|
2
|
-
import type { CameraDevice } from '../camera/base';
|
|
3
2
|
export interface SchemaConfig {
|
|
4
3
|
rootSchema: PluginRootSchema;
|
|
5
4
|
config: Record<string, any>;
|
|
@@ -153,10 +152,4 @@ export interface RootSchema {
|
|
|
153
152
|
export interface PluginRootSchema {
|
|
154
153
|
schema: PluginJsonSchemaForm;
|
|
155
154
|
}
|
|
156
|
-
export interface BasePlugin {
|
|
157
|
-
onFormSubmit(actionId: string, payload: any): Promise<{
|
|
158
|
-
toast?: string;
|
|
159
|
-
} | void>;
|
|
160
|
-
configureCameras(cameras: CameraDevice[]): void;
|
|
161
|
-
}
|
|
162
155
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NATS_SERVER_SUBJECT = "camera.ui-server";
|
|
@@ -55,6 +55,16 @@ export interface ApiProxyMethods {
|
|
|
55
55
|
pluginId: string;
|
|
56
56
|
}): Promise<void>;
|
|
57
57
|
}
|
|
58
|
+
export interface ProxyAuth {
|
|
59
|
+
cluster: {
|
|
60
|
+
user: string;
|
|
61
|
+
password: string;
|
|
62
|
+
};
|
|
63
|
+
server: {
|
|
64
|
+
user: string;
|
|
65
|
+
password: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
58
68
|
export interface DeviceManagerListenerMessagePayload {
|
|
59
69
|
type: keyof DeviceManagerProxyEventCallbacks;
|
|
60
70
|
data: any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from '../../server/src/api/database/types';
|
|
2
|
-
export * from '../../server/src/api/types';
|
|
3
|
-
export * from '../../server/src/api/ws/types';
|
|
1
|
+
export type * from '../../server/src/api/database/types';
|
|
2
|
+
export type * from '../../server/src/api/types';
|
|
3
|
+
export type * from '../../server/src/api/ws/types';
|
|
4
4
|
export * from '../../server/src/camera/base/base.browser';
|
|
5
5
|
export * from '../../server/src/camera/streaming/browser/browser-streaming-session';
|
|
6
6
|
export * from '../../server/src/camera/streaming/browser/webrtc-browser-connection';
|
|
7
|
-
export * from '../../server/src/camera/types';
|
|
8
|
-
export * from '../../server/src/detector/types';
|
|
7
|
+
export type * from '../../server/src/camera/types';
|
|
8
|
+
export type * from '../../server/src/detector/types';
|
|
9
9
|
export * from '../../server/src/go2rtc/types';
|
|
10
10
|
export * from '../../server/src/plugins/types';
|
|
11
|
-
export * from '../../server/src/proxy/types';
|
|
11
|
+
export type * from '../../server/src/proxy/types';
|
|
12
12
|
export * from '../../server/src/services/config/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"module": "./dist/bundle.js",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"axios": "^1.6.8",
|
|
27
27
|
"lodash.clonedeep": "^4.5.0",
|
|
28
28
|
"lodash.isequal": "^4.5.0",
|
|
29
|
+
"nats.ws": "^1.25.0",
|
|
29
30
|
"rxjs": "^7.8.1",
|
|
30
|
-
"
|
|
31
|
+
"util": "^0.12.5"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@rushstack/eslint-patch": "^1.10.2",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PluginsManagerProxyEventCallbacks, PluginsManagerProxyMethods } from '../../../../../shared/types';
|
|
2
|
-
import type { SocketService } from '../socket';
|
|
3
|
-
export declare class PluginsManagerClient implements PluginsManagerProxyMethods {
|
|
4
|
-
private socketService;
|
|
5
|
-
constructor(socketService: SocketService);
|
|
6
|
-
on<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callback: PluginsManagerProxyEventCallbacks[E]): void;
|
|
7
|
-
once<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callback: PluginsManagerProxyEventCallbacks[E]): void;
|
|
8
|
-
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callback: PluginsManagerProxyEventCallbacks[E]): void;
|
|
9
|
-
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(eventType?: E): void;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SystemManagerProxyEventCallbacks, SystemManagerProxyMethods } from '../../../../../shared/types';
|
|
2
|
-
import type { SocketService } from '../socket';
|
|
3
|
-
export declare class SystemManagerClient implements SystemManagerProxyMethods {
|
|
4
|
-
private socketService;
|
|
5
|
-
constructor(socketService: SocketService);
|
|
6
|
-
on<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callback: SystemManagerProxyEventCallbacks[E]): void;
|
|
7
|
-
once<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callback: SystemManagerProxyEventCallbacks[E]): void;
|
|
8
|
-
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callback: SystemManagerProxyEventCallbacks[E]): void;
|
|
9
|
-
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(eventType?: E): void;
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Manager, type Socket } from 'socket.io-client';
|
|
2
|
-
import type { CameraDeviceProxyMethodNames, DeviceManagerProxyMethodNames, PluginsManagerProxyMethodNames, SystemManagerProxyMethodNames } from '../../../../shared/types';
|
|
3
|
-
type ManagerMethodNames = DeviceManagerProxyMethodNames | SystemManagerProxyMethodNames | PluginsManagerProxyMethodNames;
|
|
4
|
-
type MethodNames<T> = T extends 'manager' ? ManagerMethodNames : T extends 'cameraDevice' ? CameraDeviceProxyMethodNames : never;
|
|
5
|
-
export declare class SocketService {
|
|
6
|
-
manager: Manager;
|
|
7
|
-
private token;
|
|
8
|
-
constructor(endpoint: string, token: string);
|
|
9
|
-
sendRequest<T extends 'manager' | 'cameraDevice'>(managerType: T, methodName: MethodNames<T>, args: any[]): Promise<any>;
|
|
10
|
-
getSocket(): Socket;
|
|
11
|
-
close(): void;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
File without changes
|