camstreamerlib 4.0.0-beta.4 → 4.0.0-beta.40
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 +200 -0
- package/cjs/VapixAPI.js +323 -233
- package/cjs/{CreatePackage.js → bin/CreatePackage.js} +22 -19
- package/cjs/errors/errors.js +64 -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 +281 -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 +196 -0
- package/esm/VapixAPI.js +315 -225
- package/esm/{CreatePackage.js → bin/CreatePackage.js} +3 -3
- package/esm/errors/errors.js +54 -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 +278 -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 +226 -0
- package/types/VapixAPI.d.ts +118 -0
- package/types/bin/CreatePackage.d.ts +1 -0
- package/{esm → types}/errors/errors.d.ts +28 -1
- 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 +877 -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/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
package/cjs/types/common.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const audioChannelSchema: z.ZodUnion<[z.ZodLiteral<"mono">, z.ZodLiteral<"stereo">]>;
|
|
3
|
-
export type TAudioChannel = z.infer<typeof audioChannelSchema>;
|
|
4
|
-
export declare const audioChannelCountSchema: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
5
|
-
export type TAudioChannelCount = z.infer<typeof audioChannelCountSchema>;
|
|
6
|
-
export declare const h264ProfileSchema: z.ZodUnion<[z.ZodLiteral<"high">, z.ZodLiteral<"main">, z.ZodLiteral<"baseline">]>;
|
|
7
|
-
export type TH264Profile = z.infer<typeof h264ProfileSchema>;
|
|
8
|
-
export declare const storageTypeSchema: z.ZodUnion<[z.ZodLiteral<"SD_DISK">, z.ZodLiteral<"FLASH">]>;
|
|
9
|
-
export type TStorageType = z.infer<typeof storageTypeSchema>;
|
|
10
|
-
export declare const networkCameraListSchema: z.ZodArray<z.ZodObject<{
|
|
11
|
-
name: z.ZodString;
|
|
12
|
-
ip: z.ZodString;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
ip: string;
|
|
15
|
-
name: string;
|
|
16
|
-
}, {
|
|
17
|
-
ip: string;
|
|
18
|
-
name: string;
|
|
19
|
-
}>, "many">;
|
|
20
|
-
export type TNetworkCamera = z.infer<typeof networkCameraListSchema>[number];
|
|
21
|
-
export declare const keyboardShortcutSchema: z.ZodNullable<z.ZodString>;
|
|
22
|
-
export declare const keyboardShortcutsSchema: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
23
|
-
export type TKeyboardShortcut = z.infer<typeof keyboardShortcutSchema>;
|
|
24
|
-
export type TKeyboardShortcuts = z.infer<typeof keyboardShortcutsSchema>;
|
|
25
|
-
export type TProxyParam = {
|
|
26
|
-
ip: string;
|
|
27
|
-
mdnsName: string;
|
|
28
|
-
port: number;
|
|
29
|
-
user: string;
|
|
30
|
-
pass: string;
|
|
31
|
-
} | null;
|
|
32
|
-
export type TCameraImageConfig = {
|
|
33
|
-
camera?: string;
|
|
34
|
-
resolution?: string;
|
|
35
|
-
compression?: number;
|
|
36
|
-
overlays?: 'off';
|
|
37
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IClient, TParameters } from '../internal/common';
|
|
3
|
-
export declare class DefaultClient implements IClient {
|
|
4
|
-
get(url: string, parameters?: TParameters, headers?: Record<string, string>): Promise<Response>;
|
|
5
|
-
post(url: string, data: string | Buffer | FormData, parameters?: TParameters, headers?: Record<string, string>): Promise<Response>;
|
|
6
|
-
}
|
package/cjs/web/index.d.ts
DELETED
package/esm/CamOverlayAPI.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IClient } from './internal/common';
|
|
3
|
-
import { CamOverlayOptions, ImageType, TCoordinates, TField, TFile, TFileList, TFileType, TService, TServiceList, TStorage } from './types/CamOverlayAPI';
|
|
4
|
-
import { TNetworkCamera } from './types/common';
|
|
5
|
-
export declare class CamOverlayAPI {
|
|
6
|
-
private client;
|
|
7
|
-
constructor(options?: CamOverlayOptions | IClient);
|
|
8
|
-
checkCameraTime(): Promise<boolean>;
|
|
9
|
-
getNetworkCameraList(): Promise<TNetworkCamera[]>;
|
|
10
|
-
wsAutoratization(): Promise<string>;
|
|
11
|
-
getMjpegStreamImage(mjpegUrl: string): Promise<Blob>;
|
|
12
|
-
listFiles(fileType: TFileType): Promise<TFileList>;
|
|
13
|
-
uploadFile(fileType: TFileType, file: Blob, fileName: string): Promise<void>;
|
|
14
|
-
removeFile(fileType: TFileType, file: TFile): Promise<void>;
|
|
15
|
-
getFileStorage(fileType: TFileType): Promise<TStorage>;
|
|
16
|
-
updateInfoticker(serviceID: number, text: string): Promise<void>;
|
|
17
|
-
setEnabled(serviceID: number, enabled: boolean): Promise<void>;
|
|
18
|
-
isEnabled(serviceID: number): Promise<boolean>;
|
|
19
|
-
getSingleService(serviceId: number): Promise<TService>;
|
|
20
|
-
getServices(): Promise<TService[]>;
|
|
21
|
-
updateSingleService(serviceId: number, serviceJson: TService): Promise<void>;
|
|
22
|
-
updateServices(servicesJson: TServiceList): Promise<void>;
|
|
23
|
-
updateCGText(serviceID: number, fields: TField[]): Promise<void>;
|
|
24
|
-
updateCGImagePos(serviceID: number, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
25
|
-
updateCGImage(serviceID: number, path: string, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
26
|
-
updateCGImageFromData(serviceID: number, imageType: ImageType, imageData: Buffer, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
27
|
-
private promiseCGUpdate;
|
|
28
|
-
private get;
|
|
29
|
-
private post;
|
|
30
|
-
private parseBlobResponse;
|
|
31
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import * as EventEmitter from 'events';
|
|
4
|
-
import { WsOptions } from './internal/common';
|
|
5
|
-
export type CamOverlayDrawingOptions = WsOptions & {
|
|
6
|
-
camera?: number | number[];
|
|
7
|
-
zIndex?: number;
|
|
8
|
-
};
|
|
9
|
-
export type TCairoResponse = {
|
|
10
|
-
message: string;
|
|
11
|
-
call_id: number;
|
|
12
|
-
};
|
|
13
|
-
export type TCairoCreateResponse = {
|
|
14
|
-
var: string;
|
|
15
|
-
call_id: number;
|
|
16
|
-
};
|
|
17
|
-
export type TUploadImageResponse = {
|
|
18
|
-
var: string;
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
call_id: number;
|
|
22
|
-
};
|
|
23
|
-
export type TErrorResponse = {
|
|
24
|
-
error: string;
|
|
25
|
-
call_id?: number;
|
|
26
|
-
};
|
|
27
|
-
export type TService = {
|
|
28
|
-
id: number;
|
|
29
|
-
enabled: number;
|
|
30
|
-
schedule: string;
|
|
31
|
-
name: string;
|
|
32
|
-
identifier: string;
|
|
33
|
-
cameraList: number[];
|
|
34
|
-
};
|
|
35
|
-
export type TServiceList = {
|
|
36
|
-
services: TService[];
|
|
37
|
-
};
|
|
38
|
-
export type TAlign = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
39
|
-
export type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
40
|
-
export type TWriteTextParams = [string, string, number, number, number, number, TAlign, TextFit?];
|
|
41
|
-
export interface CamOverlayDrawingAPI {
|
|
42
|
-
on(event: 'open', listener: () => void): this;
|
|
43
|
-
on(event: 'close', listener: () => void): this;
|
|
44
|
-
on(event: 'error', listener: (err: Error) => void): this;
|
|
45
|
-
on(event: 'message', listener: (msg: string) => void): this;
|
|
46
|
-
emit(event: 'open'): boolean;
|
|
47
|
-
emit(event: 'close'): boolean;
|
|
48
|
-
emit(event: 'error', err: Error): boolean;
|
|
49
|
-
emit(event: 'message', msg: string): boolean;
|
|
50
|
-
}
|
|
51
|
-
export declare class CamOverlayDrawingAPI extends EventEmitter {
|
|
52
|
-
private tls;
|
|
53
|
-
private tlsInsecure;
|
|
54
|
-
private ip;
|
|
55
|
-
private port;
|
|
56
|
-
private user;
|
|
57
|
-
private pass;
|
|
58
|
-
private cameraList;
|
|
59
|
-
private zIndex;
|
|
60
|
-
private callId;
|
|
61
|
-
private sendMessages;
|
|
62
|
-
private timeoutCheckTimer;
|
|
63
|
-
private wsConnected;
|
|
64
|
-
private ws;
|
|
65
|
-
constructor(options?: CamOverlayDrawingOptions);
|
|
66
|
-
connect(): void;
|
|
67
|
-
disconnect(): void;
|
|
68
|
-
isConnected(): boolean;
|
|
69
|
-
cairo(command: string, ...params: unknown[]): Promise<TCairoResponse | TCairoCreateResponse>;
|
|
70
|
-
writeText(...params: TWriteTextParams): Promise<TCairoResponse>;
|
|
71
|
-
uploadImageData(imgBuffer: Buffer): Promise<TUploadImageResponse>;
|
|
72
|
-
uploadFontData(fontBuffer: Buffer): Promise<TCairoCreateResponse>;
|
|
73
|
-
showCairoImage(cairoImage: string, posX: number, posY: number): Promise<TCairoResponse>;
|
|
74
|
-
showCairoImageAbsolute(cairoImage: string, posX: number, posY: number, width: number, height: number): Promise<TCairoResponse>;
|
|
75
|
-
removeImage(): Promise<TCairoResponse>;
|
|
76
|
-
private createWsClient;
|
|
77
|
-
private incomingWsMessageHandler;
|
|
78
|
-
private sendMessage;
|
|
79
|
-
private sendBinaryMessage;
|
|
80
|
-
private startMsgsTimeoutCheck;
|
|
81
|
-
private stopMsgsTimeoutCheck;
|
|
82
|
-
private reconnectWithError;
|
|
83
|
-
private reportMessage;
|
|
84
|
-
private reportError;
|
|
85
|
-
private reportClose;
|
|
86
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { CamOverlayDrawingAPI, CamOverlayDrawingOptions } from '../CamOverlayDrawingAPI';
|
|
2
|
-
import ResourceManager from './ResourceManager';
|
|
3
|
-
import { Frame, TFrameOptions } from './Frame';
|
|
4
|
-
export declare const COORD: {
|
|
5
|
-
readonly top_left: readonly [-1, -1];
|
|
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
|
-
};
|
|
21
|
-
export declare class Painter extends Frame {
|
|
22
|
-
private screenWidth;
|
|
23
|
-
private screenHeight;
|
|
24
|
-
private coAlignment;
|
|
25
|
-
private cod;
|
|
26
|
-
private rm;
|
|
27
|
-
private refreshLayers;
|
|
28
|
-
private layers;
|
|
29
|
-
constructor(opt: TPainterOptions, coopt: CamOverlayDrawingOptions);
|
|
30
|
-
get camOverlayDrawingAPI(): CamOverlayDrawingAPI;
|
|
31
|
-
get resourceManager(): ResourceManager;
|
|
32
|
-
connect(): void;
|
|
33
|
-
disconnect(): void;
|
|
34
|
-
isConnected(): boolean;
|
|
35
|
-
registerImage(moniker: string, fileName: string): void;
|
|
36
|
-
registerFont(moniker: string, fileName: string): void;
|
|
37
|
-
setScreenSize(sw: number, sh: number): void;
|
|
38
|
-
setCoAlignment(coAlignment: TCoAlignment): void;
|
|
39
|
-
protected layoutChanged(): void;
|
|
40
|
-
display(scale?: number): Promise<void>;
|
|
41
|
-
hide(): Promise<void>;
|
|
42
|
-
invalidateLayer(layer: number): Promise<void>;
|
|
43
|
-
private prepareLayers;
|
|
44
|
-
private prepareSurface;
|
|
45
|
-
private cleanupSurface;
|
|
46
|
-
private positionConvertor;
|
|
47
|
-
}
|
|
48
|
-
export { Frame, TFrameOptions as FrameOptions, ResourceManager, CamOverlayDrawingOptions };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CamOverlayDrawingAPI, TUploadImageResponse, TCairoCreateResponse } from '../CamOverlayDrawingAPI';
|
|
2
|
-
export default class ResourceManager {
|
|
3
|
-
private co;
|
|
4
|
-
private imgFileNames;
|
|
5
|
-
private fontFileNames;
|
|
6
|
-
private images;
|
|
7
|
-
private fonts;
|
|
8
|
-
constructor(co: CamOverlayDrawingAPI);
|
|
9
|
-
registerImage(moniker: string, fileName: string): void;
|
|
10
|
-
registerFont(moniker: string, fileName: string): void;
|
|
11
|
-
image(moniker: string): Promise<TUploadImageResponse>;
|
|
12
|
-
font(moniker: string): Promise<TCairoCreateResponse>;
|
|
13
|
-
clear(): void;
|
|
14
|
-
}
|
package/esm/CamScripterAPI.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IClient } from './internal/common';
|
|
2
|
-
import { CamScripterOptions, TNodeState, TPackageInfoList, TStorage, TStorageType } from './types/CamScripterAPI';
|
|
3
|
-
import { TNetworkCamera } from './types/common';
|
|
4
|
-
export declare class CamOverlayAPI {
|
|
5
|
-
private client;
|
|
6
|
-
constructor(options?: CamScripterOptions | IClient);
|
|
7
|
-
checkCameraTime(): Promise<boolean>;
|
|
8
|
-
getStorageInfo(): Promise<TStorage>;
|
|
9
|
-
getNetworkCameraList(): Promise<TNetworkCamera[]>;
|
|
10
|
-
getPackageList(): Promise<TPackageInfoList>;
|
|
11
|
-
installPackages(formData: FormData, storage: TStorageType): Promise<void>;
|
|
12
|
-
uninstallPackage(packageId: string): Promise<void>;
|
|
13
|
-
importSettings(packageId: string, formData: FormData): Promise<void>;
|
|
14
|
-
exportSettings(packageId: string, formData: FormData): Promise<void>;
|
|
15
|
-
getNodejsStatus(): Promise<TNodeState>;
|
|
16
|
-
installNodejs(storage: TStorageType): Promise<void>;
|
|
17
|
-
private get;
|
|
18
|
-
private post;
|
|
19
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as EventEmitter from 'events';
|
|
3
|
-
import { WsOptions } from './internal/common';
|
|
4
|
-
export type CamScripterOptions = WsOptions;
|
|
5
|
-
export type TDeclaration = {
|
|
6
|
-
type?: '' | 'SOURCE' | 'DATA';
|
|
7
|
-
namespace: string;
|
|
8
|
-
key: string;
|
|
9
|
-
value: string | boolean | number;
|
|
10
|
-
value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
|
|
11
|
-
key_nice_name?: string;
|
|
12
|
-
value_nice_name?: string;
|
|
13
|
-
};
|
|
14
|
-
export type TEventDeclaration = {
|
|
15
|
-
declaration_id: string;
|
|
16
|
-
stateless: boolean;
|
|
17
|
-
declaration: TDeclaration[];
|
|
18
|
-
};
|
|
19
|
-
export type TEventUndeclaration = {
|
|
20
|
-
declaration_id: string;
|
|
21
|
-
};
|
|
22
|
-
export type TEventData = {
|
|
23
|
-
namespace: string;
|
|
24
|
-
key: string;
|
|
25
|
-
value: string | boolean | number;
|
|
26
|
-
value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
|
|
27
|
-
};
|
|
28
|
-
export type TEvent = {
|
|
29
|
-
declaration_id: string;
|
|
30
|
-
event_data: TEventData[];
|
|
31
|
-
};
|
|
32
|
-
export type TResponse = {
|
|
33
|
-
call_id: number;
|
|
34
|
-
message: string;
|
|
35
|
-
};
|
|
36
|
-
export type TErrorResponse = {
|
|
37
|
-
error: string;
|
|
38
|
-
call_id?: number;
|
|
39
|
-
};
|
|
40
|
-
export interface CamScripterAPICameraEventsGenerator {
|
|
41
|
-
on(event: 'open', listener: () => void): this;
|
|
42
|
-
on(event: 'close', listener: () => void): this;
|
|
43
|
-
on(event: 'error', listener: (err: Error) => void): this;
|
|
44
|
-
emit(event: 'open'): boolean;
|
|
45
|
-
emit(event: 'close'): boolean;
|
|
46
|
-
emit(event: 'error', err: Error): boolean;
|
|
47
|
-
}
|
|
48
|
-
export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
|
|
49
|
-
private tls;
|
|
50
|
-
private tlsInsecure;
|
|
51
|
-
private ip;
|
|
52
|
-
private port;
|
|
53
|
-
private user;
|
|
54
|
-
private pass;
|
|
55
|
-
private callId;
|
|
56
|
-
private sendMessages;
|
|
57
|
-
private timeoutCheckTimer;
|
|
58
|
-
private wsConnected;
|
|
59
|
-
private ws;
|
|
60
|
-
constructor(options?: CamScripterOptions);
|
|
61
|
-
connect(): void;
|
|
62
|
-
disconnect(): void;
|
|
63
|
-
declareEvent(eventDeclaration: TEventDeclaration): Promise<TResponse>;
|
|
64
|
-
undeclareEvent(eventUndeclaration: TEventUndeclaration): Promise<TResponse>;
|
|
65
|
-
sendEvent(event: TEvent): Promise<TResponse>;
|
|
66
|
-
private createWsClient;
|
|
67
|
-
private incomingWsMessageHandler;
|
|
68
|
-
private sendMessage;
|
|
69
|
-
private startMsgsTimeoutCheck;
|
|
70
|
-
private stopMsgsTimeoutCheck;
|
|
71
|
-
private reconnectWithError;
|
|
72
|
-
private reportErr;
|
|
73
|
-
private reportClose;
|
|
74
|
-
}
|
package/esm/CamStreamerAPI.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IClient } from './internal/common';
|
|
2
|
-
import { CamStreamerAPIOptions, TStreamAttributes, TStreamList } from './types/CamStreamerAPI';
|
|
3
|
-
export declare class CamStreamerAPI {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(options?: CamStreamerAPIOptions | IClient);
|
|
6
|
-
getStreamList(): Promise<TStreamList>;
|
|
7
|
-
getStream(streamID: string): Promise<TStreamAttributes>;
|
|
8
|
-
getStreamParameter(streamID: string, paramName: string): Promise<string>;
|
|
9
|
-
setStream(streamID: string, params: Partial<TStreamAttributes>): Promise<void>;
|
|
10
|
-
setStreamParameter(streamID: string, paramName: string, value: string): Promise<void>;
|
|
11
|
-
isStreaming(streamID: string): Promise<boolean>;
|
|
12
|
-
deleteStream(streamID: string): Promise<void>;
|
|
13
|
-
wsAutoratization(): Promise<string>;
|
|
14
|
-
getUtcTime(): Promise<number>;
|
|
15
|
-
private get;
|
|
16
|
-
}
|
package/esm/CamSwitcherAPI.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IClient } from './internal/common';
|
|
2
|
-
import { TAudioPushInfo, TOutputInfo, TStorageInfo, TStreamSaveList, TClipList, TStreamSaveLoadList, TClipSaveLoadList, TPlaylistSaveLoadList, TTrackerSaveList, TrackerSaveLoadList, TClipSaveList, TPlaylistSaveList, TCameraOptions, TGlobalAudioSettings, TSecondaryAudioSettings } from './types/CamSwitcherAPI';
|
|
3
|
-
import { TAudioChannel, TNetworkCamera, TStorageType } from './types/common';
|
|
4
|
-
export declare class CamSwitcherAPI<Client extends IClient = IClient> {
|
|
5
|
-
client: Client;
|
|
6
|
-
private vapixAgent;
|
|
7
|
-
constructor(client: Client);
|
|
8
|
-
static getProxyUrlPath: () => string;
|
|
9
|
-
static getWsEventsUrlPath: () => string;
|
|
10
|
-
static getClipPreviewUrlPath: (id: string, storage: TStorageType) => string;
|
|
11
|
-
generateSilence(sampleRate: number, channels: TAudioChannel): Promise<void>;
|
|
12
|
-
checkCameraTime(): Promise<boolean>;
|
|
13
|
-
getIpListFromNetworkCheck(): Promise<TNetworkCamera[]>;
|
|
14
|
-
getMaxFps(source: number): Promise<number>;
|
|
15
|
-
getStorageInfo(): Promise<TStorageInfo[]>;
|
|
16
|
-
wsAuthorization(): Promise<string>;
|
|
17
|
-
getOutputInfo(): Promise<TOutputInfo>;
|
|
18
|
-
getAudioPushInfo(): Promise<TAudioPushInfo>;
|
|
19
|
-
getStreamSaveList(): Promise<TStreamSaveLoadList>;
|
|
20
|
-
getClipSaveList(): Promise<TClipSaveLoadList>;
|
|
21
|
-
getPlaylistSaveList(): Promise<TPlaylistSaveLoadList>;
|
|
22
|
-
getTrackerSaveList(): Promise<TrackerSaveLoadList>;
|
|
23
|
-
setStreamSaveList(data: TStreamSaveList): Promise<boolean>;
|
|
24
|
-
setClipSaveList(data: TClipSaveList): Promise<boolean>;
|
|
25
|
-
setPlaylistSaveList(data: TPlaylistSaveList): Promise<boolean>;
|
|
26
|
-
setTrackerSaveList(data: TTrackerSaveList): Promise<boolean>;
|
|
27
|
-
playlistSwitch(playlistName: string): Promise<void>;
|
|
28
|
-
playlistQueuePush(playlistName: string): Promise<void>;
|
|
29
|
-
playlistQueueClear(): Promise<void>;
|
|
30
|
-
playlistQueueList(): Promise<string[]>;
|
|
31
|
-
playlistQueuePlayNext(): Promise<void>;
|
|
32
|
-
addNewClip(file: any, clipType: 'video' | 'audio', storage: TStorageType, id: string, fileName?: string): Promise<void>;
|
|
33
|
-
removeClip(id: string, storage: TStorageType): Promise<any>;
|
|
34
|
-
getClipList(): Promise<TClipList>;
|
|
35
|
-
setCamSwitchOptions(data: TCameraOptions, cameraFWVersion: string): Promise<boolean>;
|
|
36
|
-
setGlobalAudioSettings(settings: TGlobalAudioSettings): Promise<boolean>;
|
|
37
|
-
setSecondaryAudioSettings(settings: TSecondaryAudioSettings): Promise<boolean>;
|
|
38
|
-
setDefaultPlaylist(id: string): Promise<boolean>;
|
|
39
|
-
setPermanentRtspUrlToken(token: string): Promise<boolean>;
|
|
40
|
-
getCamSwitchOptions(): Promise<Partial<TCameraOptions>>;
|
|
41
|
-
getGlobalAudioSettings(): Promise<TGlobalAudioSettings>;
|
|
42
|
-
getSecondaryAudioSettings(): Promise<TSecondaryAudioSettings>;
|
|
43
|
-
getPermanentRtspUrlToken(): Promise<string>;
|
|
44
|
-
private get;
|
|
45
|
-
private set;
|
|
46
|
-
private setParamFromCameraJSON;
|
|
47
|
-
private getParamFromCameraAndJSONParse;
|
|
48
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IWebsocket } from './internal/common';
|
|
2
|
-
import { TCamSwitcherEventOfType, TCamSwitcherEventType } from './types/CamSwitcherEvents';
|
|
3
|
-
type TListenerFunction<T extends TCamSwitcherEventType> = (data: TCamSwitcherEventOfType<T>, isInit: boolean) => void;
|
|
4
|
-
export declare class CamSwitcherEvents<Event extends {
|
|
5
|
-
data: string;
|
|
6
|
-
}> {
|
|
7
|
-
isDestroyed: boolean;
|
|
8
|
-
private ws;
|
|
9
|
-
private listeners;
|
|
10
|
-
setWebsocket(ws: IWebsocket<Event>): void;
|
|
11
|
-
resendInitData(): void;
|
|
12
|
-
addListener<T extends TCamSwitcherEventType>(type: T, listener: TListenerFunction<T>, id: string): void;
|
|
13
|
-
removeListener<T extends TCamSwitcherEventType>(type: T, id: string): void;
|
|
14
|
-
private onMessage;
|
|
15
|
-
private processMessage;
|
|
16
|
-
destroy(): void;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/esm/VapixAPI.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { IClient, TParameters } from './internal/common';
|
|
2
|
-
import { TApplication, TAudioSampleRates, TSDCardInfo, TPtzOverview, TCameraPTZItem, TCameraPTZItemData, TAudioDevice } from './types/VapixAPI';
|
|
3
|
-
import { ProxyClient } from './internal/ProxyClient';
|
|
4
|
-
import { TCameraImageConfig, TProxyParam } from './types/common';
|
|
5
|
-
export declare class VapixAPI<Client extends IClient = IClient> {
|
|
6
|
-
client: ProxyClient<Client>;
|
|
7
|
-
constructor(client: Client, getProxyUrl: () => string);
|
|
8
|
-
getUrlEncoded(proxy: TProxyParam, path: string, parameters?: TParameters, headers?: Record<string, string>): Promise<import("./internal/common").TResponse>;
|
|
9
|
-
postJson(proxy: TProxyParam, path: string, jsonData: Record<string, any>, headers?: Record<string, string>): Promise<import("./internal/common").TResponse>;
|
|
10
|
-
getCameraImage(params: TCameraImageConfig, proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
11
|
-
getEventDeclarations(proxy?: TProxyParam): Promise<string>;
|
|
12
|
-
getSupportedAudioSampleRate(proxy?: TProxyParam): Promise<TAudioSampleRates[]>;
|
|
13
|
-
performAutofocus(proxy?: TProxyParam): Promise<void>;
|
|
14
|
-
checkSDCard(proxy?: TProxyParam): Promise<TSDCardInfo>;
|
|
15
|
-
mountSDCard(proxy?: TProxyParam): Promise<number>;
|
|
16
|
-
unmountSDCard(proxy?: TProxyParam): Promise<number>;
|
|
17
|
-
private _doSDCardMountAction;
|
|
18
|
-
fetchSDCardJobProgress(jobId: number, proxy?: TProxyParam): Promise<number>;
|
|
19
|
-
downloadCameraReport(proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
20
|
-
getSystemLog(proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
21
|
-
getMaxFps(channel: number, proxy?: TProxyParam): Promise<number>;
|
|
22
|
-
getTimezone(proxy?: TProxyParam): Promise<string>;
|
|
23
|
-
getDateTimeInfo(proxy?: TProxyParam): Promise<{
|
|
24
|
-
data: {
|
|
25
|
-
dateTime: string;
|
|
26
|
-
dstEnabled: boolean;
|
|
27
|
-
localDateTime: string;
|
|
28
|
-
posixTimeZone: string;
|
|
29
|
-
timeZone: string;
|
|
30
|
-
};
|
|
31
|
-
}>;
|
|
32
|
-
getDevicesSettings(proxy?: TProxyParam): Promise<TAudioDevice[]>;
|
|
33
|
-
fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T, proxy?: TProxyParam): Promise<any>;
|
|
34
|
-
getHeaders(proxy?: TProxyParam): Promise<Record<string, string>>;
|
|
35
|
-
setHeaders(headers: Record<string, string>, proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
36
|
-
getParameter(paramNames: string | string[], proxy?: TProxyParam): Promise<Record<string, string>>;
|
|
37
|
-
setParameter(params: Record<string, string | number | boolean>, proxy?: TProxyParam): Promise<boolean>;
|
|
38
|
-
getGuardTourList(proxy?: TProxyParam): Promise<{
|
|
39
|
-
name: string;
|
|
40
|
-
id: string;
|
|
41
|
-
running: string;
|
|
42
|
-
tour: {
|
|
43
|
-
moveSpeed?: unknown;
|
|
44
|
-
position?: unknown;
|
|
45
|
-
presetNbr?: unknown;
|
|
46
|
-
waitTime?: unknown;
|
|
47
|
-
waitTimeViewType?: unknown;
|
|
48
|
-
}[];
|
|
49
|
-
camNbr?: unknown;
|
|
50
|
-
randomEnabled?: unknown;
|
|
51
|
-
timeBetweenSequences?: unknown;
|
|
52
|
-
}[]>;
|
|
53
|
-
setGuardTourEnabled(guardTourID: string, enable: boolean, proxy?: TProxyParam): Promise<boolean>;
|
|
54
|
-
getPTZPresetList(channel: number, proxy?: TProxyParam): Promise<string[]>;
|
|
55
|
-
listPTZ(camera: number, proxy?: TProxyParam): Promise<TCameraPTZItem[]>;
|
|
56
|
-
listPtzVideoSourceOverview(proxy?: TProxyParam): Promise<TPtzOverview>;
|
|
57
|
-
goToPreset(channel: number, presetName: string, proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
58
|
-
getPtzPosition(camera: number, proxy?: TProxyParam): Promise<TCameraPTZItemData>;
|
|
59
|
-
getInputState(port: number, proxy?: TProxyParam): Promise<boolean>;
|
|
60
|
-
setOutputState(port: number, active: boolean, proxy?: TProxyParam): Promise<import("./internal/common").TResponse>;
|
|
61
|
-
getApplicationList(proxy?: TProxyParam): Promise<TApplication[]>;
|
|
62
|
-
startApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
|
|
63
|
-
restartApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
|
|
64
|
-
stopApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
|
|
65
|
-
installApplication(data: Blob, fileName: string): Promise<void>;
|
|
66
|
-
}
|
package/esm/VapixEvents.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { EventEmitter2 as EventEmitter } from 'eventemitter2';
|
|
2
|
-
import { WsOptions } from './internal/common';
|
|
3
|
-
export type VapixEventsOptions = WsOptions;
|
|
4
|
-
type TEventMessage = {
|
|
5
|
-
apiVersion: string;
|
|
6
|
-
method: string;
|
|
7
|
-
params: {
|
|
8
|
-
notification: {
|
|
9
|
-
timestamp: number;
|
|
10
|
-
topic: string;
|
|
11
|
-
message: {
|
|
12
|
-
source: Record<string, string>;
|
|
13
|
-
data: Record<string, string>;
|
|
14
|
-
key: Record<string, string>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export interface VapixEvents {
|
|
20
|
-
on(event: 'open', listener: () => void): this;
|
|
21
|
-
on(event: 'close', listener: () => void): this;
|
|
22
|
-
on(event: 'error', listener: (err: Error) => void): this;
|
|
23
|
-
on(event: string, listener: (data: TEventMessage) => void): this;
|
|
24
|
-
emit(event: 'open'): boolean;
|
|
25
|
-
emit(event: 'close'): boolean;
|
|
26
|
-
emit(event: 'error', err: Error): boolean;
|
|
27
|
-
emit(event: string, msg: TEventMessage): boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare class VapixEvents extends EventEmitter {
|
|
30
|
-
private tls;
|
|
31
|
-
private tlsInsecure;
|
|
32
|
-
private ip;
|
|
33
|
-
private port;
|
|
34
|
-
private user;
|
|
35
|
-
private pass;
|
|
36
|
-
private ws;
|
|
37
|
-
constructor(options?: VapixEventsOptions);
|
|
38
|
-
connect(): void;
|
|
39
|
-
disconnect(): void;
|
|
40
|
-
private createWsClient;
|
|
41
|
-
private isReservedEventName;
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IClient, HttpOptions } from '../internal/common';
|
|
2
|
-
export type AcsEventsOptions = HttpOptions;
|
|
3
|
-
export declare class AxisCameraStationEvents {
|
|
4
|
-
private sourceKey;
|
|
5
|
-
private client;
|
|
6
|
-
constructor(sourceKey: string, opt?: AcsEventsOptions | IClient);
|
|
7
|
-
sendEvent(data: Record<string, string>, eventType: string): Promise<void>;
|
|
8
|
-
private getDate;
|
|
9
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { responseStringify, pad } from '../internal/common';
|
|
3
|
-
const ACTION = 'AddCameraBookmark';
|
|
4
|
-
const GET_CAMERAS_URL = 'report/EntityConfiguration?q=EntityTypes@Camera';
|
|
5
|
-
const GET_CAMERAS_DETAILS_URL = '/entity?q=';
|
|
6
|
-
const cameraGuidsResponseSchema = z.object({
|
|
7
|
-
Rsp: z.object({
|
|
8
|
-
Status: z.string(),
|
|
9
|
-
Result: z.array(z.object({ Guid: z.string() })),
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
12
|
-
const connectionResponseSchema = z.object({
|
|
13
|
-
Rsp: z.object({
|
|
14
|
-
Status: z.string(),
|
|
15
|
-
}),
|
|
16
|
-
});
|
|
17
|
-
export const cameraDetailSchema = z.object({
|
|
18
|
-
Guid: z.string().optional(),
|
|
19
|
-
Name: z.string().optional(),
|
|
20
|
-
EntityType: z.string().optional(),
|
|
21
|
-
});
|
|
22
|
-
export const cameraDetailsResponseSchema = z.object({
|
|
23
|
-
Rsp: z.object({
|
|
24
|
-
Status: z.string(),
|
|
25
|
-
Result: z.union([z.array(cameraDetailSchema), cameraDetailSchema]),
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
28
|
-
export class GenetecAgent {
|
|
29
|
-
settings;
|
|
30
|
-
baseUrl;
|
|
31
|
-
credentials;
|
|
32
|
-
constructor(options = {}) {
|
|
33
|
-
this.settings = {
|
|
34
|
-
protocol: options.protocol ?? 'http',
|
|
35
|
-
ip: options.ip ?? '127.0.0.1',
|
|
36
|
-
port: options.port ?? 80,
|
|
37
|
-
base_uri: options.base_uri ?? 'WebSdk',
|
|
38
|
-
user: options.user ?? 'root',
|
|
39
|
-
pass: options.pass ?? '',
|
|
40
|
-
app_id: options.app_id ?? '',
|
|
41
|
-
};
|
|
42
|
-
this.baseUrl = `${this.settings.protocol}://${this.settings.ip}:${this.settings.port}/${this.settings.base_uri}`;
|
|
43
|
-
this.credentials = btoa(`${this.settings.user};${this.settings.app_id}:${this.settings.pass}`);
|
|
44
|
-
}
|
|
45
|
-
async checkConnection() {
|
|
46
|
-
const requestOptions = this.getRequestOptions('GET');
|
|
47
|
-
const res = await fetch(`${this.baseUrl}/`, requestOptions);
|
|
48
|
-
if (!res.ok) {
|
|
49
|
-
throw new Error(await responseStringify(res));
|
|
50
|
-
}
|
|
51
|
-
return connectionResponseSchema.parse(await res.json());
|
|
52
|
-
}
|
|
53
|
-
async getAllCameraGuids() {
|
|
54
|
-
const requestOptions = this.getRequestOptions('GET');
|
|
55
|
-
const res = await fetch(`${this.baseUrl}/${GET_CAMERAS_URL}`, requestOptions);
|
|
56
|
-
if (!res.ok) {
|
|
57
|
-
throw new Error(await responseStringify(res));
|
|
58
|
-
}
|
|
59
|
-
return cameraGuidsResponseSchema.parse(await res.json());
|
|
60
|
-
}
|
|
61
|
-
async getCameraDetails(guids, parameters) {
|
|
62
|
-
const params = parameters.join(',');
|
|
63
|
-
let camerasGuids = [];
|
|
64
|
-
const requestOptions = this.getRequestOptions('GET');
|
|
65
|
-
const allCameras = [];
|
|
66
|
-
const chunkSize = 10;
|
|
67
|
-
while (guids.length > 0) {
|
|
68
|
-
const chunk = guids.slice(0, chunkSize);
|
|
69
|
-
guids.splice(0, chunkSize);
|
|
70
|
-
camerasGuids = chunk.map((item) => item.Guid);
|
|
71
|
-
const camerasDetailsUrl = [];
|
|
72
|
-
for (const guid of camerasGuids) {
|
|
73
|
-
camerasDetailsUrl.push(`entity=${guid},${params}`);
|
|
74
|
-
}
|
|
75
|
-
const res = await fetch(`${this.baseUrl}/${GET_CAMERAS_DETAILS_URL}${camerasDetailsUrl.join(',')}`, requestOptions);
|
|
76
|
-
if (!res.ok) {
|
|
77
|
-
throw new Error(await responseStringify(res));
|
|
78
|
-
}
|
|
79
|
-
const data = cameraDetailsResponseSchema.parse(await res.json());
|
|
80
|
-
const resultArray = Array.isArray(data.Rsp.Result) ? data.Rsp.Result : [data.Rsp.Result];
|
|
81
|
-
allCameras.push(...resultArray);
|
|
82
|
-
}
|
|
83
|
-
return allCameras;
|
|
84
|
-
}
|
|
85
|
-
async sendBookmark(guids, bookmarkText) {
|
|
86
|
-
const cameraEntitiesUrl = [];
|
|
87
|
-
const timeStamp = this.getTimeStamp();
|
|
88
|
-
const requestOptions = this.getRequestOptions('POST');
|
|
89
|
-
for (const guid of guids) {
|
|
90
|
-
cameraEntitiesUrl.push(`${ACTION}(${guid},${timeStamp},${bookmarkText})`);
|
|
91
|
-
}
|
|
92
|
-
const res = await fetch(`${this.baseUrl}/action?q=${cameraEntitiesUrl.join(',')}`, requestOptions);
|
|
93
|
-
if (!res.ok) {
|
|
94
|
-
throw new Error(await responseStringify(res));
|
|
95
|
-
}
|
|
96
|
-
return res;
|
|
97
|
-
}
|
|
98
|
-
getRequestOptions(method) {
|
|
99
|
-
return {
|
|
100
|
-
method,
|
|
101
|
-
headers: new Headers({
|
|
102
|
-
Authorization: `Basic ${this.credentials}`,
|
|
103
|
-
Accept: 'text/json',
|
|
104
|
-
}),
|
|
105
|
-
redirect: 'follow',
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
getTimeStamp() {
|
|
109
|
-
const date = new Date();
|
|
110
|
-
const year = date.getUTCFullYear();
|
|
111
|
-
const month = pad(date.getUTCMonth() + 1, 2);
|
|
112
|
-
const day = pad(date.getUTCDate(), 2);
|
|
113
|
-
const hours = pad(date.getUTCHours(), 2);
|
|
114
|
-
const minutes = pad(date.getUTCMinutes(), 2);
|
|
115
|
-
const seconds = pad(date.getUTCSeconds(), 2);
|
|
116
|
-
const miliSeconds = pad(date.getUTCMilliseconds(), 2);
|
|
117
|
-
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${miliSeconds}Z`;
|
|
118
|
-
}
|
|
119
|
-
}
|
package/esm/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './internal/common';
|
|
2
|
-
export * from './internal/constants';
|
|
3
|
-
export * from './internal/utils';
|
|
4
|
-
export * from './internal/versionCompare';
|
|
5
|
-
export * from './types/common';
|
|
6
|
-
export { CamSwitcherAPI } from './CamSwitcherAPI';
|
|
7
|
-
export { CamSwitcherEvents } from './CamSwitcherEvents';
|
|
8
|
-
export { VapixAPI } from './VapixAPI';
|
|
9
|
-
export * from './types/CamSwitcherEvents';
|
|
10
|
-
export * from './types/CamSwitcherAPI';
|
|
11
|
-
export * from './types/VapixAPI';
|