camstreamerlib 4.0.0-beta.4 → 4.0.0-beta.41
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/README.md +112 -0
- package/cjs/CamOverlayAPI.js +135 -92
- package/cjs/CamScripterAPI.js +52 -42
- package/cjs/CamStreamerAPI.js +83 -39
- package/cjs/CamSwitcherAPI.js +141 -123
- package/cjs/CamSwitcherEvents.js +4 -60
- package/cjs/PlaneTrackerAPI.js +210 -0
- package/cjs/VapixAPI.js +323 -233
- package/cjs/{CreatePackage.js → bin/CreatePackage.js} +22 -19
- package/cjs/errors/errors.js +78 -1
- package/cjs/index.js +17 -4
- package/cjs/internal/ProxyClient.js +28 -32
- package/cjs/internal/WsEvents.js +72 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.js +22 -3
- package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +7 -4
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
- package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
- package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +7 -4
- package/cjs/node/DefaultClient.js +10 -12
- package/cjs/{internal → node}/Digest.js +8 -5
- package/cjs/node/HttpRequestSender.js +14 -4
- package/cjs/node/HttpServer.js +15 -12
- package/cjs/{VapixEvents.js → node/VapixEvents.js} +1 -1
- package/cjs/node/WsClient.js +12 -9
- package/cjs/node/events/AxisCameraStationEvents.js +53 -0
- package/cjs/node/events/GenetecAgent.js +123 -0
- package/cjs/node/index.js +38 -5
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
- package/cjs/types/CamOverlayAPI/index.js +27 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +25 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.js +14 -0
- package/cjs/types/CamScripterAPI.js +22 -7
- package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
- package/cjs/types/CamStreamerAPI.js +34 -3
- package/cjs/types/CamSwitcherAPI.js +38 -1
- package/cjs/types/CamSwitcherEvents.js +8 -0
- package/cjs/types/GenetecAgent.js +31 -0
- package/cjs/types/PlaneTrackerAPI.js +286 -0
- package/cjs/types/VapixAPI.js +71 -13
- package/cjs/types/VapixEvents.js +2 -0
- package/cjs/web/DefaultClient.js +22 -10
- package/cjs/web/WsClient.js +3 -3
- package/esm/CamOverlayAPI.js +131 -88
- package/esm/CamScripterAPI.js +48 -38
- package/esm/CamStreamerAPI.js +81 -38
- package/esm/CamSwitcherAPI.js +137 -119
- package/esm/CamSwitcherEvents.js +5 -61
- package/esm/PlaneTrackerAPI.js +206 -0
- package/esm/VapixAPI.js +315 -225
- package/esm/{CreatePackage.js → bin/CreatePackage.js} +3 -3
- package/esm/errors/errors.js +66 -0
- package/esm/index.js +12 -3
- package/esm/internal/ProxyClient.js +28 -32
- package/esm/internal/WsEvents.js +68 -0
- package/esm/internal/utils.js +17 -1
- package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +2 -2
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
- package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +2 -2
- package/esm/node/DefaultClient.js +10 -12
- package/esm/{internal → node}/Digest.js +1 -1
- package/esm/node/HttpRequestSender.js +14 -4
- package/esm/node/HttpServer.js +5 -5
- package/esm/{VapixEvents.js → node/VapixEvents.js} +1 -1
- package/esm/node/WsClient.js +3 -3
- package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
- package/esm/node/events/GenetecAgent.js +119 -0
- package/esm/node/index.js +17 -2
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
- package/esm/types/CamOverlayAPI/index.js +11 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +22 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
- package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
- package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
- package/esm/types/CamOverlayPainter.js +11 -0
- package/esm/types/CamScripterAPI.js +21 -6
- package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
- package/esm/types/CamStreamerAPI.js +33 -2
- package/esm/types/CamSwitcherAPI.js +38 -1
- package/esm/types/CamSwitcherEvents.js +8 -0
- package/esm/types/GenetecAgent.js +28 -0
- package/esm/types/PlaneTrackerAPI.js +283 -0
- package/esm/types/VapixAPI.js +70 -12
- package/esm/types/VapixEvents.js +1 -0
- package/esm/web/DefaultClient.js +22 -10
- package/esm/web/WsClient.js +3 -3
- package/package.json +30 -12
- package/types/CamOverlayAPI.d.ts +865 -0
- package/types/CamScripterAPI.d.ts +47 -0
- package/types/CamStreamerAPI.d.ts +64 -0
- package/types/CamSwitcherAPI.d.ts +167 -0
- package/types/CamSwitcherEvents.d.ts +8 -0
- package/types/PlaneTrackerAPI.d.ts +230 -0
- package/types/VapixAPI.d.ts +118 -0
- package/types/bin/CreatePackage.d.ts +1 -0
- package/types/errors/errors.d.ts +68 -0
- package/types/index.d.ts +20 -0
- package/types/internal/ProxyClient.d.ts +10 -0
- package/types/internal/WsEvents.d.ts +41 -0
- package/types/internal/types.d.ts +45 -0
- package/{cjs → types}/internal/utils.d.ts +4 -1
- package/{cjs → types}/internal/versionCompare.d.ts +2 -2
- package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
- package/{cjs → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
- package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/types/node/DefaultClient.d.ts +16 -0
- package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
- package/{cjs → types}/node/HttpServer.d.ts +2 -2
- package/types/node/VapixEvents.d.ts +16 -0
- package/{cjs → types}/node/WsClient.d.ts +3 -2
- package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/types/node/events/GenetecAgent.d.ts +16 -0
- package/types/node/index.d.ts +17 -0
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4321 -0
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/types/types/CamOverlayAPI/index.d.ts +11 -0
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/types/types/CamOverlayPainter.d.ts +76 -0
- package/types/types/CamScripterAPI.d.ts +130 -0
- package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/types/types/CamStreamerAPI.d.ts +272 -0
- package/{esm → types}/types/CamSwitcherAPI.d.ts +115 -36
- package/{cjs → types}/types/CamSwitcherEvents.d.ts +77 -0
- package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
- package/types/types/PlaneTrackerAPI.d.ts +890 -0
- package/{cjs → types}/types/VapixAPI.d.ts +647 -465
- package/types/types/VapixEvents.d.ts +15 -0
- package/{esm → types}/types/common.d.ts +15 -5
- package/types/web/DefaultClient.d.ts +6 -0
- package/cjs/CamOverlayAPI.d.ts +0 -31
- package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
- package/cjs/CamOverlayPainter/Frame.d.ts +0 -96
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
- package/cjs/CamScripterAPI.d.ts +0 -19
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/cjs/CamStreamerAPI.d.ts +0 -16
- package/cjs/CamSwitcherAPI.d.ts +0 -48
- package/cjs/CamSwitcherEvents.d.ts +0 -18
- package/cjs/VapixAPI.d.ts +0 -66
- package/cjs/VapixEvents.d.ts +0 -43
- package/cjs/errors/errors.d.ts +0 -34
- package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
- package/cjs/events/AxisCameraStationEvents.js +0 -48
- package/cjs/events/GenetecAgent.d.ts +0 -174
- package/cjs/events/GenetecAgent.js +0 -123
- package/cjs/index.d.ts +0 -11
- package/cjs/internal/ProxyClient.d.ts +0 -11
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- package/cjs/node/DefaultClient.d.ts +0 -15
- package/cjs/node/HttpRequestSender.d.ts +0 -28
- package/cjs/node/WsEventClient.d.ts +0 -13
- package/cjs/node/WsEventClient.js +0 -22
- package/cjs/types/CamOverlayAPI.d.ts +0 -188
- package/cjs/types/CamOverlayAPI.js +0 -47
- package/cjs/types/CamScripterAPI.d.ts +0 -67
- package/cjs/types/CamStreamerAPI.d.ts +0 -139
- package/cjs/types/CamSwitcherAPI.d.ts +0 -814
- package/cjs/types/common.d.ts +0 -37
- package/cjs/web/DefaultClient.d.ts +0 -6
- package/cjs/web/index.d.ts +0 -2
- package/esm/CamOverlayAPI.d.ts +0 -31
- package/esm/CamOverlayDrawingAPI.d.ts +0 -86
- package/esm/CamOverlayPainter/Painter.d.ts +0 -48
- package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/esm/CamScripterAPI.d.ts +0 -19
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/esm/CamStreamerAPI.d.ts +0 -16
- package/esm/CamSwitcherAPI.d.ts +0 -48
- package/esm/CamSwitcherEvents.d.ts +0 -18
- package/esm/VapixAPI.d.ts +0 -66
- package/esm/VapixEvents.d.ts +0 -43
- package/esm/errors/errors.d.ts +0 -34
- package/esm/events/AxisCameraStationEvents.d.ts +0 -9
- package/esm/events/GenetecAgent.js +0 -119
- package/esm/index.d.ts +0 -11
- package/esm/internal/Digest.d.ts +0 -4
- package/esm/internal/ProxyClient.d.ts +0 -11
- package/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/internal/constants.d.ts +0 -1
- package/esm/internal/transformers.d.ts +0 -5
- package/esm/internal/utils.d.ts +0 -11
- package/esm/internal/versionCompare.d.ts +0 -6
- package/esm/node/DefaultClient.d.ts +0 -15
- package/esm/node/HttpServer.d.ts +0 -21
- package/esm/node/WsClient.d.ts +0 -39
- package/esm/node/WsEventClient.d.ts +0 -13
- package/esm/node/WsEventClient.js +0 -18
- package/esm/node/index.d.ts +0 -2
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
- package/esm/types/CamScripterAPI.d.ts +0 -67
- package/esm/types/CamStreamerAPI.d.ts +0 -139
- package/esm/types/CamSwitcherEvents.d.ts +0 -491
- package/esm/types/VapixAPI.d.ts +0 -1683
- package/esm/web/DefaultClient.d.ts +0 -6
- package/esm/web/WsClient.d.ts +0 -13
- package/esm/web/index.d.ts +0 -2
- /package/{cjs/CreatePackage.d.ts → esm/internal/types.js} +0 -0
- /package/esm/{CreatePackage.d.ts → types/CamOverlayDrawingAPI.js} +0 -0
- /package/{cjs → types}/internal/constants.d.ts +0 -0
- /package/{cjs → types}/internal/transformers.d.ts +0 -0
- /package/{cjs/internal → types/node}/Digest.d.ts +0 -0
- /package/{cjs → types}/web/WsClient.d.ts +0 -0
- /package/{cjs/node → types/web}/index.d.ts +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare class ServiceUnavailableError extends Error {
|
|
2
|
+
constructor();
|
|
3
|
+
}
|
|
4
|
+
export declare class ServiceNotFoundError extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class ParsingBlobError extends Error {
|
|
8
|
+
constructor(err: unknown);
|
|
9
|
+
}
|
|
10
|
+
export declare class JsonParseError extends Error {
|
|
11
|
+
constructor(paramName: string, data: unknown);
|
|
12
|
+
}
|
|
13
|
+
export declare class ParameterNotFoundError extends Error {
|
|
14
|
+
constructor(paramName: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class SettingParameterError extends Error {
|
|
17
|
+
constructor(message: string);
|
|
18
|
+
}
|
|
19
|
+
type TApplicationAPIAction = 'START' | 'RESTART' | 'STOP' | 'INSTALL';
|
|
20
|
+
export declare class ApplicationAPIError extends Error {
|
|
21
|
+
constructor(action: TApplicationAPIAction, res: string);
|
|
22
|
+
}
|
|
23
|
+
type TSDCardAction = 'MOUNT' | 'UNMOUNT';
|
|
24
|
+
export declare class SDCardActionError extends Error {
|
|
25
|
+
constructor(action: TSDCardAction, res: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class SDCardJobError extends Error {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
|
30
|
+
type TMaxFPSErrorType = 'MALFORMED_REPLY' | 'CHANNEL_NOT_FOUND' | 'CAPTURE_MODE_NOT_FOUND' | 'FPS_NOT_SPECIFIED';
|
|
31
|
+
export declare class MaxFPSError extends Error {
|
|
32
|
+
constructor(state: TMaxFPSErrorType);
|
|
33
|
+
}
|
|
34
|
+
export declare class NoDeviceInfoError extends Error {
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
export declare class FetchDeviceInfoError extends Error {
|
|
38
|
+
constructor(err: unknown);
|
|
39
|
+
}
|
|
40
|
+
export declare class AddNewClipError extends Error {
|
|
41
|
+
constructor(message: string);
|
|
42
|
+
}
|
|
43
|
+
export declare class PtzNotSupportedError extends Error {
|
|
44
|
+
constructor();
|
|
45
|
+
}
|
|
46
|
+
export declare class StorageDataFetchError extends Error {
|
|
47
|
+
constructor(err: unknown);
|
|
48
|
+
}
|
|
49
|
+
export declare class WsAuthorizationError extends Error {
|
|
50
|
+
constructor(message: string);
|
|
51
|
+
}
|
|
52
|
+
export declare class UtcTimeFetchError extends Error {
|
|
53
|
+
constructor(message: string);
|
|
54
|
+
}
|
|
55
|
+
export declare class TimezoneNotSetupError extends Error {
|
|
56
|
+
constructor();
|
|
57
|
+
}
|
|
58
|
+
export declare class TimezoneFetchError extends Error {
|
|
59
|
+
constructor(err: unknown);
|
|
60
|
+
}
|
|
61
|
+
type TCalibrationType = 'PTZ' | 'FOCUS';
|
|
62
|
+
export declare class ResetCalibrationError extends Error {
|
|
63
|
+
constructor(type: TCalibrationType, err: unknown);
|
|
64
|
+
}
|
|
65
|
+
export declare class ImportSettingsError extends Error {
|
|
66
|
+
constructor(err: unknown);
|
|
67
|
+
}
|
|
68
|
+
export {};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './internal/types';
|
|
2
|
+
export * from './internal/constants';
|
|
3
|
+
export * from './internal/utils';
|
|
4
|
+
export * from './internal/versionCompare';
|
|
5
|
+
export * from './internal/ProxyClient';
|
|
6
|
+
export * from './types/common';
|
|
7
|
+
export { CamOverlayAPI } from './CamOverlayAPI';
|
|
8
|
+
export * from './types/CamOverlayAPI';
|
|
9
|
+
export { CamScripterAPI } from './CamScripterAPI';
|
|
10
|
+
export * from './types/CamScripterAPI';
|
|
11
|
+
export { CamStreamerAPI } from './CamStreamerAPI';
|
|
12
|
+
export * from './types/CamStreamerAPI';
|
|
13
|
+
export { CamSwitcherAPI } from './CamSwitcherAPI';
|
|
14
|
+
export * from './types/CamSwitcherAPI';
|
|
15
|
+
export { CamSwitcherEvents } from './CamSwitcherEvents';
|
|
16
|
+
export * from './types/CamSwitcherEvents';
|
|
17
|
+
export { PlaneTrackerAPI } from './PlaneTrackerAPI';
|
|
18
|
+
export * from './types/PlaneTrackerAPI';
|
|
19
|
+
export { VapixAPI } from './VapixAPI';
|
|
20
|
+
export * from './types/VapixAPI';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IClient, TGetParams, TResponse } from './types';
|
|
2
|
+
import { TProxyParams } from '../types/common';
|
|
3
|
+
export declare class ProxyClient<Client extends IClient<TResponse, any>> {
|
|
4
|
+
private client;
|
|
5
|
+
private proxyParams;
|
|
6
|
+
constructor(client: Client, proxyParams: TProxyParams);
|
|
7
|
+
get(params: TGetParams): ReturnType<Client["get"]>;
|
|
8
|
+
post(params: Parameters<Client['post']>[0]): ReturnType<Client["post"]>;
|
|
9
|
+
private getReal;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IWebsocket } from './types';
|
|
2
|
+
type TEventType<T extends {
|
|
3
|
+
type: string;
|
|
4
|
+
}> = T extends {
|
|
5
|
+
type: infer Type;
|
|
6
|
+
} ? Type : never;
|
|
7
|
+
type TEvent<T extends {
|
|
8
|
+
type: string;
|
|
9
|
+
}, Type extends TEventType<T>> = T extends {
|
|
10
|
+
type: Type;
|
|
11
|
+
} ? T : never;
|
|
12
|
+
type TZodSchema<T extends {
|
|
13
|
+
type: string;
|
|
14
|
+
}> = {
|
|
15
|
+
parse: (data: string) => {
|
|
16
|
+
type: 'init';
|
|
17
|
+
data: TEvent<T, TEventType<T>>;
|
|
18
|
+
} | TEvent<T, TEventType<T>>;
|
|
19
|
+
};
|
|
20
|
+
type TListenerFunction<T extends {
|
|
21
|
+
type: string;
|
|
22
|
+
}, Type extends TEventType<T>> = (data: TEvent<T, Type>, isInit: boolean) => void;
|
|
23
|
+
export declare class WsEvents<T extends {
|
|
24
|
+
type: string;
|
|
25
|
+
}, Event extends {
|
|
26
|
+
data: string;
|
|
27
|
+
}> {
|
|
28
|
+
private zodSchema;
|
|
29
|
+
ws: IWebsocket<Event>;
|
|
30
|
+
private _isDestroyed;
|
|
31
|
+
private listeners;
|
|
32
|
+
constructor(zodSchema: TZodSchema<T>, ws: IWebsocket<Event>);
|
|
33
|
+
get isDestroyed(): boolean;
|
|
34
|
+
resendInitData(): void;
|
|
35
|
+
addListener<Type extends TEventType<T>>(type: Type, listener: TListenerFunction<T, Type>, id: string): void;
|
|
36
|
+
removeListener<Type extends TEventType<T>>(type: Type, id: string): void;
|
|
37
|
+
private onMessage;
|
|
38
|
+
private processMessage;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
ip?: string;
|
|
3
|
+
port?: number;
|
|
4
|
+
user?: string;
|
|
5
|
+
pass?: string;
|
|
6
|
+
tls?: boolean;
|
|
7
|
+
tlsInsecure?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type HttpOptions = Options & {
|
|
10
|
+
keepAlive?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type WsOptions = Options;
|
|
13
|
+
export type TParameters = Record<string, string | number | boolean | null | undefined>;
|
|
14
|
+
export type TResponse = {
|
|
15
|
+
json: () => Promise<any>;
|
|
16
|
+
text: () => Promise<string>;
|
|
17
|
+
blob: () => Promise<unknown>;
|
|
18
|
+
status: number;
|
|
19
|
+
ok: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type TGetParams = {
|
|
22
|
+
path: string;
|
|
23
|
+
parameters?: TParameters;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TPostParams<Data> = {
|
|
28
|
+
path: string;
|
|
29
|
+
data: string | Data;
|
|
30
|
+
parameters?: TParameters;
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
timeout?: number;
|
|
33
|
+
};
|
|
34
|
+
export interface IClient<TRes extends TResponse, Data> {
|
|
35
|
+
get: (params: TGetParams) => Promise<TRes>;
|
|
36
|
+
post: (params: TPostParams<Data>) => Promise<TRes>;
|
|
37
|
+
}
|
|
38
|
+
export type TBlobResponse<Client extends IClient<TResponse, any>> = Awaited<ReturnType<Awaited<ReturnType<Client['get']>>['blob']>>;
|
|
39
|
+
export interface IWebsocket<Event extends {
|
|
40
|
+
readonly data: string;
|
|
41
|
+
}> {
|
|
42
|
+
destroy: () => void;
|
|
43
|
+
onmessage: null | ((event: Event) => void);
|
|
44
|
+
send: (data: string) => void;
|
|
45
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TPlaylistPlayType } from '../types/CamSwitcherAPI';
|
|
2
|
-
import { TParameters } from './
|
|
2
|
+
import { TParameters, TResponse } from './types';
|
|
3
3
|
export declare const addParametersToPath: (path: string, params?: TParameters) => string;
|
|
4
4
|
export declare const paramToUrl: (params?: TParameters) => string;
|
|
5
5
|
export declare const arrayToUrl: (arr: string | string[]) => string;
|
|
@@ -9,3 +9,6 @@ export declare const isClip: (id?: string) => boolean;
|
|
|
9
9
|
export declare const isTracker: (id?: string) => boolean;
|
|
10
10
|
export declare const isPlaylist: (id?: string) => boolean;
|
|
11
11
|
export declare const isLoopPlayType: (playType: TPlaylistPlayType) => boolean;
|
|
12
|
+
export declare function responseStringify(res: TResponse): Promise<string>;
|
|
13
|
+
export declare function pad(num: number, size: number): string;
|
|
14
|
+
export declare function isNullish<T>(value: T | undefined | null): value is undefined | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const assertVersionString: (s: string, msg?: string) => void;
|
|
2
2
|
export declare const isFirmwareVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
3
3
|
export declare const isVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
4
|
-
export declare const firmwareVersionCompare: (a: string, b: string) =>
|
|
5
|
-
export declare const versionCompare: (a: string, b: string) =>
|
|
4
|
+
export declare const firmwareVersionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const versionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
6
6
|
export declare const fixVersionToDots: (version: string) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import EventEmitter from 'events';
|
|
5
|
+
import { CamOverlayDrawingOptions, TCairoCreateResponse, TCairoResponse, TUploadImageResponse, TWriteTextParams } from '../types/CamOverlayDrawingAPI';
|
|
6
|
+
export declare class CamOverlayDrawingAPI extends EventEmitter {
|
|
7
|
+
private tls;
|
|
8
|
+
private tlsInsecure;
|
|
9
|
+
private ip;
|
|
10
|
+
private port;
|
|
11
|
+
private user;
|
|
12
|
+
private pass;
|
|
13
|
+
private cameraList;
|
|
14
|
+
private zIndex;
|
|
15
|
+
private callId;
|
|
16
|
+
private sendMessages;
|
|
17
|
+
private timeoutCheckTimer;
|
|
18
|
+
private wsConnected;
|
|
19
|
+
private ws;
|
|
20
|
+
constructor(options?: CamOverlayDrawingOptions);
|
|
21
|
+
connect(): void;
|
|
22
|
+
disconnect(): void;
|
|
23
|
+
isConnected(): boolean;
|
|
24
|
+
cairo(command: string, ...params: unknown[]): Promise<TCairoResponse | TCairoCreateResponse>;
|
|
25
|
+
writeText(...params: TWriteTextParams): Promise<TCairoResponse>;
|
|
26
|
+
uploadImageData(imgBuffer: Buffer): Promise<TUploadImageResponse>;
|
|
27
|
+
uploadFontData(fontBuffer: Buffer): Promise<TCairoCreateResponse>;
|
|
28
|
+
showCairoImage(cairoImage: string, posX: number, posY: number): Promise<TCairoResponse>;
|
|
29
|
+
showCairoImageAbsolute(cairoImage: string, posX: number, posY: number, width: number, height: number): Promise<TCairoResponse>;
|
|
30
|
+
removeImage(): Promise<TCairoResponse>;
|
|
31
|
+
private createWsClient;
|
|
32
|
+
private incomingWsMessageHandler;
|
|
33
|
+
private sendMessage;
|
|
34
|
+
private sendBinaryMessage;
|
|
35
|
+
private startMsgsTimeoutCheck;
|
|
36
|
+
private stopMsgsTimeoutCheck;
|
|
37
|
+
private reconnectWithError;
|
|
38
|
+
private reportMessage;
|
|
39
|
+
private reportError;
|
|
40
|
+
private reportClose;
|
|
41
|
+
}
|
|
@@ -1,42 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { CamOverlayDrawingAPI
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type TTmf = 'TFM_OVERFLOW' | 'TFM_SCALE' | 'TFM_TRUNCATE';
|
|
8
|
-
export type TObjectFitType = 'fill' | 'fit' | 'none';
|
|
9
|
-
export type TFrameOptions = {
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
text?: string;
|
|
16
|
-
fontColor?: TRgb;
|
|
17
|
-
font?: string;
|
|
18
|
-
bgColor?: TRgba;
|
|
19
|
-
bgImage?: string;
|
|
20
|
-
bgType?: TObjectFitType;
|
|
21
|
-
borderRadius?: number;
|
|
22
|
-
borderWidth?: number;
|
|
23
|
-
borderColor?: TRgba;
|
|
24
|
-
customDraw?: TDrawingCallback;
|
|
25
|
-
layer?: number;
|
|
26
|
-
};
|
|
27
|
-
export type TFrameInfo = {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
31
|
-
export type TDrawingCallback = (cod: CamOverlayDrawingAPI, cairo: string, info: TFrameInfo) => Promise<void>;
|
|
32
|
-
export interface Frame {
|
|
33
|
-
on(event: 'open', listener: () => void): this;
|
|
34
|
-
on(event: 'close', listener: () => void): this;
|
|
35
|
-
on(event: 'layoutChanged', listener: () => void): this;
|
|
36
|
-
emit(event: 'open'): boolean;
|
|
37
|
-
emit(event: 'close'): boolean;
|
|
38
|
-
emit(event: 'layoutChanged'): boolean;
|
|
39
|
-
}
|
|
3
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
4
|
+
import { TAlign, TCairoCreateResponse, TUploadImageResponse } from '../../types/CamOverlayDrawingAPI';
|
|
5
|
+
import { ResourceManager } from './ResourceManager';
|
|
6
|
+
import { TBg, TBorder, TDrawingCallback, TFrame, TFrameOptions, TObjectFitType, TRgb, TRgba, TText, TTmf } from '../../types/CamOverlayPainter';
|
|
40
7
|
export declare class Frame extends EventEmitter {
|
|
41
8
|
protected enabled: boolean;
|
|
42
9
|
protected posX: number;
|
|
@@ -64,17 +31,21 @@ export declare class Frame extends EventEmitter {
|
|
|
64
31
|
disable(): void;
|
|
65
32
|
setFramePosition(x: number, y: number): void;
|
|
66
33
|
setFrameSize(width: number, height: number): void;
|
|
34
|
+
getFrameInfo(): TFrame;
|
|
67
35
|
setText(text: string, align: TAlign, textType?: TTmf, fontColor?: TRgb): void;
|
|
68
36
|
setFontColor(fontColor: TRgb): void;
|
|
69
37
|
setFont(fontName: string): void;
|
|
70
38
|
setFontData(fontData: TCairoCreateResponse): void;
|
|
39
|
+
getTextInfo(): TText;
|
|
71
40
|
setBgColor(color: TRgba): void;
|
|
72
41
|
setBgImage(imageName: string, type?: TObjectFitType): void;
|
|
73
42
|
setBgImageData(imageData: TUploadImageResponse, type?: TObjectFitType): void;
|
|
74
43
|
setBgType(type: TObjectFitType): void;
|
|
44
|
+
getBgInfo(): TBg;
|
|
75
45
|
setBorderRadius(radius: number): void;
|
|
76
46
|
setBorderWidth(width: number): void;
|
|
77
47
|
setBorderColor(color: TRgba): void;
|
|
48
|
+
getBorderInfo(): TBorder;
|
|
78
49
|
setCustomDraw(customDraw: TDrawingCallback): void;
|
|
79
50
|
resetFont(): void;
|
|
80
51
|
resetBgColor(): void;
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import { CamOverlayDrawingAPI
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly center_left: readonly [-1, 0];
|
|
7
|
-
readonly bottom_left: readonly [-1, 1];
|
|
8
|
-
readonly top_center: readonly [0, -1];
|
|
9
|
-
readonly center: readonly [0, 0];
|
|
10
|
-
readonly bottom_center: readonly [0, 1];
|
|
11
|
-
readonly top_right: readonly [1, -1];
|
|
12
|
-
readonly center_right: readonly [1, 0];
|
|
13
|
-
readonly bottom_right: readonly [1, 1];
|
|
14
|
-
};
|
|
15
|
-
type TCoAlignment = keyof typeof COORD;
|
|
16
|
-
export type TPainterOptions = TFrameOptions & {
|
|
17
|
-
screenWidth: number;
|
|
18
|
-
screenHeight: number;
|
|
19
|
-
coAlignment: TCoAlignment;
|
|
20
|
-
};
|
|
1
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
2
|
+
import { CamOverlayDrawingOptions } from '../../types/CamOverlayDrawingAPI';
|
|
3
|
+
import { ResourceManager } from './ResourceManager';
|
|
4
|
+
import { Frame } from './Frame';
|
|
5
|
+
import { TCoAlignment, TPainterOptions } from '../../types/CamOverlayPainter';
|
|
21
6
|
export declare class Painter extends Frame {
|
|
22
7
|
private screenWidth;
|
|
23
8
|
private screenHeight;
|
|
@@ -45,4 +30,3 @@ export declare class Painter extends Frame {
|
|
|
45
30
|
private cleanupSurface;
|
|
46
31
|
private positionConvertor;
|
|
47
32
|
}
|
|
48
|
-
export { Frame, TFrameOptions as FrameOptions, ResourceManager, CamOverlayDrawingOptions };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
2
|
+
import { TUploadImageResponse, TCairoCreateResponse } from '../../types/CamOverlayDrawingAPI';
|
|
3
|
+
export declare class ResourceManager {
|
|
4
|
+
private co;
|
|
5
|
+
private imgFileNames;
|
|
6
|
+
private fontFileNames;
|
|
7
|
+
private images;
|
|
8
|
+
private fonts;
|
|
9
|
+
constructor(co: CamOverlayDrawingAPI);
|
|
10
|
+
registerImage(moniker: string, fileName: string): void;
|
|
11
|
+
registerFont(moniker: string, fileName: string): void;
|
|
12
|
+
image(moniker: string): Promise<TUploadImageResponse | undefined>;
|
|
13
|
+
font(moniker: string): Promise<TCairoCreateResponse | undefined>;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
import { WsOptions } from '../internal/types';
|
|
4
|
+
import { TCamScripterEvent, TEventDeclaration, TEventUndeclaration, TCamScripterResponse } from '../types/CamScripterAPICameraEventsGenerator';
|
|
5
|
+
export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
|
|
6
|
+
private tls;
|
|
7
|
+
private tlsInsecure;
|
|
8
|
+
private ip;
|
|
9
|
+
private port;
|
|
10
|
+
private user;
|
|
11
|
+
private pass;
|
|
12
|
+
private callId;
|
|
13
|
+
private sendMessages;
|
|
14
|
+
private timeoutCheckTimer;
|
|
15
|
+
private wsConnected;
|
|
16
|
+
private ws;
|
|
17
|
+
constructor(options?: WsOptions);
|
|
18
|
+
connect(): void;
|
|
19
|
+
disconnect(): void;
|
|
20
|
+
declareEvent(eventDeclaration: TEventDeclaration): Promise<TCamScripterResponse>;
|
|
21
|
+
undeclareEvent(eventUndeclaration: TEventUndeclaration): Promise<TCamScripterResponse>;
|
|
22
|
+
sendEvent(event: TCamScripterEvent): Promise<TCamScripterResponse>;
|
|
23
|
+
private createWsClient;
|
|
24
|
+
private incomingWsMessageHandler;
|
|
25
|
+
private sendMessage;
|
|
26
|
+
private startMsgsTimeoutCheck;
|
|
27
|
+
private stopMsgsTimeoutCheck;
|
|
28
|
+
private reconnectWithError;
|
|
29
|
+
private reportErr;
|
|
30
|
+
private reportClose;
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { IClient, HttpOptions, TGetParams, TPostParams } from '../internal/types';
|
|
4
|
+
import { FormData as UndiciFormData, Response as UndiciResponse } from 'undici';
|
|
5
|
+
export declare class DefaultClient implements IClient<UndiciResponse, UndiciFormData | Buffer> {
|
|
6
|
+
private tls;
|
|
7
|
+
private ip;
|
|
8
|
+
private port;
|
|
9
|
+
private user;
|
|
10
|
+
private pass;
|
|
11
|
+
private httpRequestSender;
|
|
12
|
+
constructor(opt?: HttpOptions);
|
|
13
|
+
get(params: TGetParams): Promise<UndiciResponse>;
|
|
14
|
+
post(params: TPostParams<UndiciFormData | Buffer>): Promise<UndiciResponse>;
|
|
15
|
+
private getBaseConnectionParams;
|
|
16
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import http from 'http';
|
|
4
|
+
import EventEmitter from 'events';
|
|
5
5
|
export type HttpServerOptions = {
|
|
6
6
|
host?: string;
|
|
7
7
|
port?: number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventEmitter2 as EventEmitter } from 'eventemitter2';
|
|
2
|
+
import { WsOptions } from '../internal/types';
|
|
3
|
+
export declare class VapixEvents extends EventEmitter {
|
|
4
|
+
private tls;
|
|
5
|
+
private tlsInsecure;
|
|
6
|
+
private ip;
|
|
7
|
+
private port;
|
|
8
|
+
private user;
|
|
9
|
+
private pass;
|
|
10
|
+
private ws;
|
|
11
|
+
constructor(options?: WsOptions);
|
|
12
|
+
connect(): void;
|
|
13
|
+
disconnect(): void;
|
|
14
|
+
private createWsClient;
|
|
15
|
+
private isReservedEventName;
|
|
16
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
|
|
4
|
-
import
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import EventEmitter from 'events';
|
|
5
|
+
import { WsOptions } from '../internal/types';
|
|
5
6
|
export type WsClientOptions = WsOptions & {
|
|
6
7
|
address: string;
|
|
7
8
|
headers?: Record<string, string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpOptions } from '../../internal/types';
|
|
2
|
+
import { ProxyClient } from '../../internal/ProxyClient';
|
|
3
|
+
import { THttpRequestOptions, TProxyParams } from '../../types/common';
|
|
4
|
+
import { DefaultClient } from '../DefaultClient';
|
|
5
|
+
export declare class AxisCameraStationEvents {
|
|
6
|
+
private sourceKey;
|
|
7
|
+
private client;
|
|
8
|
+
constructor(clientOptions: HttpOptions, sourceKey: string);
|
|
9
|
+
getClient(proxyParams?: TProxyParams): DefaultClient | ProxyClient<DefaultClient>;
|
|
10
|
+
sendEvent(data: Record<string, string>, eventType: string, options?: THttpRequestOptions): Promise<void>;
|
|
11
|
+
private getDate;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GenetecAgentOptions, TCameraDetail, TCameraGuidsResponse, TParams } from '../../types/GenetecAgent';
|
|
2
|
+
export declare class GenetecAgent {
|
|
3
|
+
private settings;
|
|
4
|
+
private baseUrl;
|
|
5
|
+
private credentials;
|
|
6
|
+
constructor(options?: GenetecAgentOptions);
|
|
7
|
+
checkConnection(): Promise<void>;
|
|
8
|
+
getAllCameraGuids(): Promise<TCameraGuidsResponse>;
|
|
9
|
+
getCameraDetails(guids: {
|
|
10
|
+
Guid: string;
|
|
11
|
+
}[], parameters: TParams): Promise<TCameraDetail[]>;
|
|
12
|
+
sendBookmark(guids: string[], bookmarkText: string): Promise<void>;
|
|
13
|
+
private getRequestOptions;
|
|
14
|
+
private getTimeStamp;
|
|
15
|
+
private fetchWithTimeout;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './DefaultClient';
|
|
2
|
+
export * from './WsClient';
|
|
3
|
+
export * from './HttpServer';
|
|
4
|
+
export * from './HttpRequestSender';
|
|
5
|
+
export * from './events/AxisCameraStationEvents';
|
|
6
|
+
export * from './events/GenetecAgent';
|
|
7
|
+
export * from '../types/GenetecAgent';
|
|
8
|
+
export { ResourceManager } from './CamOverlayPainter/ResourceManager';
|
|
9
|
+
export { Painter } from './CamOverlayPainter/Painter';
|
|
10
|
+
export { Frame } from './CamOverlayPainter/Frame';
|
|
11
|
+
export * from '../types/CamOverlayPainter';
|
|
12
|
+
export { CamOverlayDrawingAPI } from './CamOverlayDrawingAPI';
|
|
13
|
+
export * from '../types/CamOverlayDrawingAPI';
|
|
14
|
+
export { CamScripterAPICameraEventsGenerator } from './CamScripterAPICameraEventsGenerator';
|
|
15
|
+
export * from '../types/CamScripterAPICameraEventsGenerator';
|
|
16
|
+
export { VapixEvents } from './VapixEvents';
|
|
17
|
+
export * from '../types/VapixEvents';
|