camstreamerlib 4.0.0-beta.3 → 4.0.0-beta.31
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 +8 -2
- package/cjs/CamOverlayAPI.d.ts +48 -26
- package/cjs/CamOverlayAPI.js +171 -88
- package/cjs/CamOverlayDrawingAPI.d.ts +2 -47
- package/cjs/CamOverlayDrawingAPI.js +6 -3
- package/cjs/CamOverlayPainter/Frame.d.ts +8 -37
- package/cjs/CamOverlayPainter/Frame.js +33 -0
- package/cjs/CamOverlayPainter/Painter.d.ts +16 -10
- package/cjs/CamOverlayPainter/Painter.js +6 -5
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +3 -2
- package/cjs/CamOverlayPainter/ResourceManager.js +8 -11
- package/cjs/CamScripterAPI.d.ts +34 -16
- package/cjs/CamScripterAPI.js +50 -41
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +1 -1
- package/cjs/CamScripterAPICameraEventsGenerator.js +6 -3
- package/cjs/CamStreamerAPI.d.ts +17 -14
- package/cjs/CamStreamerAPI.js +32 -32
- package/cjs/CamSwitcherAPI.d.ts +43 -37
- package/cjs/CamSwitcherAPI.js +123 -114
- package/cjs/CamSwitcherEvents.d.ts +1 -1
- package/cjs/PlaneTrackerAPI.d.ts +43 -0
- package/cjs/PlaneTrackerAPI.js +211 -0
- package/cjs/VapixAPI.d.ts +56 -42
- package/cjs/VapixAPI.js +305 -216
- package/cjs/VapixEvents.d.ts +1 -1
- package/cjs/VapixEvents.js +3 -3
- package/cjs/errors/errors.d.ts +3 -0
- package/cjs/errors/errors.js +8 -1
- package/cjs/events/AxisCameraStationEvents.d.ts +7 -4
- package/cjs/events/AxisCameraStationEvents.js +23 -18
- package/cjs/events/GenetecAgent.d.ts +6 -3
- package/cjs/events/GenetecAgent.js +30 -19
- package/cjs/index.d.ts +14 -1
- package/cjs/index.js +23 -2
- package/cjs/internal/Digest.js +6 -6
- package/cjs/internal/ProxyClient.d.ts +8 -9
- package/cjs/internal/ProxyClient.js +25 -29
- package/cjs/internal/types.d.ts +42 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.d.ts +4 -1
- package/cjs/internal/utils.js +22 -3
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/node/DefaultClient.d.ts +5 -6
- package/cjs/node/DefaultClient.js +12 -14
- package/cjs/node/HttpRequestSender.d.ts +1 -0
- package/cjs/node/HttpRequestSender.js +13 -3
- package/cjs/node/HttpServer.js +1 -1
- package/cjs/node/WsClient.d.ts +2 -1
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +18 -1
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +3071 -0
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +127 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +114 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +50 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +783 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +75 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +122 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/index.d.ts +9 -0
- package/cjs/types/CamOverlayAPI/index.js +25 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +130 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +29 -0
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +166 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +42 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +126 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +28 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +146 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +15 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +79 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +11 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +79 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +11 -0
- package/cjs/types/CamOverlayDrawingAPI.d.ts +58 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.d.ts +74 -0
- package/cjs/types/CamOverlayPainter.js +2 -0
- package/cjs/types/CamScripterAPI.d.ts +82 -17
- package/cjs/types/CamScripterAPI.js +22 -7
- package/cjs/types/CamStreamerAPI.d.ts +16 -5
- package/cjs/types/CamStreamerAPI.js +5 -1
- package/cjs/types/CamSwitcherAPI.d.ts +4 -6
- package/cjs/types/CamSwitcherEvents.d.ts +77 -0
- package/cjs/types/CamSwitcherEvents.js +8 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +8 -0
- package/cjs/types/PlaneTrackerAPI.js +2 -0
- package/cjs/types/VapixAPI.d.ts +635 -520
- package/cjs/types/VapixAPI.js +62 -24
- package/cjs/types/common.d.ts +14 -5
- package/cjs/web/DefaultClient.d.ts +5 -5
- package/cjs/web/DefaultClient.js +22 -10
- package/cjs/web/WsClient.js +2 -2
- package/esm/CamOverlayAPI.d.ts +48 -26
- package/esm/CamOverlayAPI.js +167 -84
- package/esm/CamOverlayDrawingAPI.d.ts +2 -47
- package/esm/CamOverlayDrawingAPI.js +6 -3
- package/esm/CamOverlayPainter/Frame.d.ts +8 -37
- package/esm/CamOverlayPainter/Frame.js +33 -0
- package/esm/CamOverlayPainter/Painter.d.ts +16 -10
- package/esm/CamOverlayPainter/Painter.js +5 -3
- package/esm/CamOverlayPainter/ResourceManager.d.ts +3 -2
- package/esm/CamOverlayPainter/ResourceManager.js +7 -11
- package/esm/CamScripterAPI.d.ts +34 -16
- package/esm/CamScripterAPI.js +46 -37
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +1 -1
- package/esm/CamScripterAPICameraEventsGenerator.js +6 -3
- package/esm/CamStreamerAPI.d.ts +17 -14
- package/esm/CamStreamerAPI.js +32 -32
- package/esm/CamSwitcherAPI.d.ts +43 -37
- package/esm/CamSwitcherAPI.js +116 -107
- package/esm/CamSwitcherEvents.d.ts +1 -1
- package/esm/PlaneTrackerAPI.d.ts +43 -0
- package/esm/PlaneTrackerAPI.js +207 -0
- package/esm/VapixAPI.d.ts +56 -42
- package/esm/VapixAPI.js +297 -208
- package/esm/VapixEvents.d.ts +1 -1
- package/esm/VapixEvents.js +3 -3
- package/esm/errors/errors.d.ts +3 -0
- package/esm/errors/errors.js +6 -0
- package/esm/events/AxisCameraStationEvents.d.ts +7 -4
- package/esm/events/AxisCameraStationEvents.js +18 -13
- package/esm/events/GenetecAgent.d.ts +6 -3
- package/esm/events/GenetecAgent.js +20 -9
- package/esm/index.d.ts +14 -1
- package/esm/index.js +14 -1
- package/esm/internal/Digest.js +6 -6
- package/esm/internal/ProxyClient.d.ts +8 -9
- package/esm/internal/ProxyClient.js +25 -29
- package/esm/internal/types.d.ts +42 -0
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.d.ts +4 -1
- package/esm/internal/utils.js +17 -1
- package/esm/internal/versionCompare.d.ts +2 -2
- package/esm/node/DefaultClient.d.ts +5 -6
- package/esm/node/DefaultClient.js +12 -14
- package/esm/node/HttpRequestSender.d.ts +1 -0
- package/esm/node/HttpRequestSender.js +13 -3
- package/esm/node/HttpServer.js +1 -1
- package/esm/node/WsClient.d.ts +2 -1
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +3071 -0
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +124 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +114 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +46 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +783 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +71 -0
- package/esm/types/CamOverlayAPI/imagesSchema.d.ts +122 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +8 -0
- package/esm/types/CamOverlayAPI/index.d.ts +9 -0
- package/esm/types/CamOverlayAPI/index.js +9 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +130 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +25 -0
- package/esm/types/CamOverlayAPI/pipSchema.d.ts +166 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +38 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +126 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +24 -0
- package/esm/types/CamOverlayAPI/ptzSchema.d.ts +146 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +11 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +79 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +7 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +79 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +7 -0
- package/esm/types/CamOverlayDrawingAPI.d.ts +58 -0
- package/esm/types/CamOverlayDrawingAPI.js +1 -0
- package/esm/types/CamOverlayPainter.d.ts +74 -0
- package/esm/types/CamOverlayPainter.js +1 -0
- package/esm/types/CamScripterAPI.d.ts +82 -17
- package/esm/types/CamScripterAPI.js +21 -6
- package/esm/types/CamStreamerAPI.d.ts +16 -5
- package/esm/types/CamStreamerAPI.js +4 -0
- package/esm/types/CamSwitcherAPI.d.ts +4 -6
- package/esm/types/CamSwitcherEvents.d.ts +77 -0
- package/esm/types/CamSwitcherEvents.js +8 -0
- package/esm/types/PlaneTrackerAPI.d.ts +8 -0
- package/esm/types/PlaneTrackerAPI.js +1 -0
- package/esm/types/VapixAPI.d.ts +635 -520
- package/esm/types/VapixAPI.js +61 -23
- package/esm/types/common.d.ts +14 -5
- package/esm/web/DefaultClient.d.ts +5 -5
- package/esm/web/DefaultClient.js +22 -10
- package/esm/web/WsClient.js +2 -2
- package/package.json +9 -8
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- 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/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/node/WsEventClient.d.ts +0 -13
- package/esm/node/WsEventClient.js +0 -18
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlaneTrackerAPI = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("./internal/utils");
|
|
6
|
+
const errors_1 = require("./errors/errors");
|
|
7
|
+
const ProxyClient_1 = require("./internal/ProxyClient");
|
|
8
|
+
const BASE_PATH = '/local/planetracker';
|
|
9
|
+
class PlaneTrackerAPI {
|
|
10
|
+
client;
|
|
11
|
+
apiUser;
|
|
12
|
+
constructor(client, apiUser) {
|
|
13
|
+
this.client = client;
|
|
14
|
+
this.apiUser = apiUser;
|
|
15
|
+
}
|
|
16
|
+
static getProxyUrlPath = () => `${BASE_PATH}/proxy.cgi`;
|
|
17
|
+
getClient(proxyParams) {
|
|
18
|
+
return proxyParams ? new ProxyClient_1.ProxyClient(this.client, proxyParams) : this.client;
|
|
19
|
+
}
|
|
20
|
+
async checkCameraTime(options) {
|
|
21
|
+
const response = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
22
|
+
return zod_1.z.boolean().parse(response.state);
|
|
23
|
+
}
|
|
24
|
+
resetPtzCalibration = async (options) => {
|
|
25
|
+
const agent = this.getClient(options?.proxyParams);
|
|
26
|
+
return await agent.get({
|
|
27
|
+
path: `${BASE_PATH}/package/resetPtzCalibration.cgi`,
|
|
28
|
+
parameters: this.apiUser,
|
|
29
|
+
timeout: options?.timeout,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
resetFocusCalibration = async (options) => {
|
|
33
|
+
const agent = this.getClient(options?.proxyParams);
|
|
34
|
+
return await agent.get({
|
|
35
|
+
path: `${BASE_PATH}/package/resetFocusCalibration.cgi`,
|
|
36
|
+
parameters: this.apiUser,
|
|
37
|
+
timeout: options?.timeout,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
serverRunCheck = async (options) => {
|
|
41
|
+
const agent = this.getClient(options?.proxyParams);
|
|
42
|
+
return await agent.get({ path: `${BASE_PATH}/package/serverRunCheck.cgi`, timeout: options?.timeout });
|
|
43
|
+
};
|
|
44
|
+
getLiveViewAlias = async (rtspUrl, options) => {
|
|
45
|
+
const agent = this.getClient(options?.proxyParams);
|
|
46
|
+
return await agent.get({
|
|
47
|
+
path: `${BASE_PATH}/getLiveViewAlias.cgi`,
|
|
48
|
+
parameters: { rtsp_url: rtspUrl },
|
|
49
|
+
timeout: options?.timeout,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
fetchCameraSettings = async (options) => {
|
|
53
|
+
return await this._getJson(`${BASE_PATH}/package_camera_settings.cgi`, { action: 'get' }, options);
|
|
54
|
+
};
|
|
55
|
+
setCameraSettings = async (settingsJsonString, options) => {
|
|
56
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settingsJsonString, {
|
|
57
|
+
action: 'set',
|
|
58
|
+
}, options);
|
|
59
|
+
};
|
|
60
|
+
fetchServerSettings = async (options) => {
|
|
61
|
+
return await this._getJson(`${BASE_PATH}/package_server_settings.cgi`, { action: 'get' }, options);
|
|
62
|
+
};
|
|
63
|
+
exportAppSettings = async (dataType, options) => {
|
|
64
|
+
return await this._getBlob(`${BASE_PATH}/package_data.cgi`, { action: 'EXPORT', dataType }, options);
|
|
65
|
+
};
|
|
66
|
+
importAppSettings = async (dataType, formData, options) => {
|
|
67
|
+
const agent = this.getClient(options?.proxyParams);
|
|
68
|
+
return await agent.post({
|
|
69
|
+
path: `${BASE_PATH}/package_data.cgi`,
|
|
70
|
+
data: formData,
|
|
71
|
+
parameters: { action: 'IMPORT', dataType },
|
|
72
|
+
timeout: options?.timeout,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
fetchFlightInfo = async (icao, options) => {
|
|
76
|
+
return await this._getJson(`${BASE_PATH}/package/flightInfo.cgi`, { icao: encodeURIComponent(icao) }, options);
|
|
77
|
+
};
|
|
78
|
+
getTrackingMode = async (options) => {
|
|
79
|
+
return await this._getJson(`${BASE_PATH}/package/getTrackingMode.cgi`, undefined, options);
|
|
80
|
+
};
|
|
81
|
+
setTrackingMode = async (modeJsonString, options) => {
|
|
82
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package/setTrackingMode.cgi`, modeJsonString, this.apiUser, options);
|
|
83
|
+
};
|
|
84
|
+
startTrackingPlane = async (icao, options) => {
|
|
85
|
+
const agent = this.getClient(options?.proxyParams);
|
|
86
|
+
return await agent.get({
|
|
87
|
+
path: `${BASE_PATH}/package/trackIcao.cgi`,
|
|
88
|
+
parameters: { icao, ...this.apiUser },
|
|
89
|
+
timeout: options?.timeout,
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
stopTrackingPlane = async (options) => {
|
|
93
|
+
const agent = this.getClient(options?.proxyParams);
|
|
94
|
+
return await agent.get({
|
|
95
|
+
path: `${BASE_PATH}/package/resetIcao.cgi`,
|
|
96
|
+
parameters: this.apiUser,
|
|
97
|
+
timeout: options?.timeout,
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
getPriorityList = async (options) => {
|
|
101
|
+
return await this._getJson(`${BASE_PATH}/package/getPriorityList.cgi`, undefined, options);
|
|
102
|
+
};
|
|
103
|
+
setPriorityList = async (priorityListJsonString, options) => {
|
|
104
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, priorityListJsonString, this.apiUser, options);
|
|
105
|
+
};
|
|
106
|
+
getWhiteList = async (options) => {
|
|
107
|
+
return await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
|
|
108
|
+
};
|
|
109
|
+
setWhiteList = async (whiteListJsonString, options) => {
|
|
110
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, whiteListJsonString, this.apiUser, options);
|
|
111
|
+
};
|
|
112
|
+
getBlackList = async (options) => {
|
|
113
|
+
return await this._getJson(`${BASE_PATH}/package/getBlackList.cgi`, undefined, options);
|
|
114
|
+
};
|
|
115
|
+
setBlackList = async (blackListJsonString, options) => {
|
|
116
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, blackListJsonString, this.apiUser, options);
|
|
117
|
+
};
|
|
118
|
+
fetchMapInfo = async (options) => {
|
|
119
|
+
return await this._getJson(`${BASE_PATH}/package/getMapInfo.cgi`, undefined, options);
|
|
120
|
+
};
|
|
121
|
+
getZones = async (options) => {
|
|
122
|
+
return await this._getJson(`${BASE_PATH}/package/getZones.cgi`, undefined, options);
|
|
123
|
+
};
|
|
124
|
+
setZones = async (zonesJsonString, options) => {
|
|
125
|
+
return await this._postJsonEncoded(`${BASE_PATH}/package/setZones.cgi`, zonesJsonString, this.apiUser, options);
|
|
126
|
+
};
|
|
127
|
+
goToCoordinates = async (lat, lon, alt, options) => {
|
|
128
|
+
const agent = this.getClient(options?.proxyParams);
|
|
129
|
+
return await agent.get({
|
|
130
|
+
path: `${BASE_PATH}/package/goToCoordinates.cgi`,
|
|
131
|
+
parameters: { lat, lon, alt, ...this.apiUser },
|
|
132
|
+
timeout: options?.timeout,
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
checkGenetecConnection = async (params, options) => {
|
|
136
|
+
return await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
|
|
137
|
+
};
|
|
138
|
+
getGenetecCameraList = async (params, options) => {
|
|
139
|
+
const res = await this._postUrlEncoded(`${BASE_PATH}/package/getGenetecCameraList.cgi`, params, options);
|
|
140
|
+
return await res.json();
|
|
141
|
+
};
|
|
142
|
+
async _getJson(path, parameters, options) {
|
|
143
|
+
const agent = this.getClient(options?.proxyParams);
|
|
144
|
+
const res = await agent.get({
|
|
145
|
+
path,
|
|
146
|
+
parameters,
|
|
147
|
+
timeout: options?.timeout,
|
|
148
|
+
});
|
|
149
|
+
if (res.ok) {
|
|
150
|
+
return await res.json();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async _getBlob(path, parameters, options) {
|
|
157
|
+
const agent = this.getClient(options?.proxyParams);
|
|
158
|
+
const res = await agent.get({
|
|
159
|
+
path,
|
|
160
|
+
parameters,
|
|
161
|
+
timeout: options?.timeout,
|
|
162
|
+
});
|
|
163
|
+
if (res.ok) {
|
|
164
|
+
return await this.parseBlobResponse(res);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async parseBlobResponse(response) {
|
|
171
|
+
try {
|
|
172
|
+
return (await response.blob());
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
throw new errors_1.ParsingBlobError(err);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async _postJsonEncoded(path, data, parameters, options) {
|
|
179
|
+
const agent = this.getClient(options?.proxyParams);
|
|
180
|
+
const res = await agent.post({
|
|
181
|
+
path,
|
|
182
|
+
data,
|
|
183
|
+
parameters,
|
|
184
|
+
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
|
|
185
|
+
timeout: options?.timeout,
|
|
186
|
+
});
|
|
187
|
+
if (res.ok) {
|
|
188
|
+
return res;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async _postUrlEncoded(path, params, options) {
|
|
195
|
+
const data = (0, utils_1.paramToUrl)(params);
|
|
196
|
+
const agent = this.getClient(options?.proxyParams);
|
|
197
|
+
const res = await agent.post({
|
|
198
|
+
path,
|
|
199
|
+
data,
|
|
200
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
201
|
+
timeout: options?.timeout,
|
|
202
|
+
});
|
|
203
|
+
if (res.ok) {
|
|
204
|
+
return res;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.PlaneTrackerAPI = PlaneTrackerAPI;
|
package/cjs/VapixAPI.d.ts
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { IClient, TParameters, TResponse } from './internal/
|
|
2
|
-
import {
|
|
1
|
+
import { IClient, TParameters, TResponse } from './internal/types';
|
|
2
|
+
import { TAudioSampleRates, TSDCardInfo, TPtzOverview, TCameraPTZItem, TCameraPTZItemData, TAudioDevice, TPortSetSchema, TPortSequenceStateSchema } from './types/VapixAPI';
|
|
3
3
|
import { ProxyClient } from './internal/ProxyClient';
|
|
4
|
-
import { TCameraImageConfig,
|
|
5
|
-
export declare class VapixAPI<Client extends IClient = IClient
|
|
6
|
-
client
|
|
7
|
-
constructor(client: Client
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
import { TCameraImageConfig, THttpRequestOptions, TProxyParams } from './types/common';
|
|
5
|
+
export declare class VapixAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(client: Client);
|
|
8
|
+
getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
|
|
9
|
+
postUrlEncoded(path: string, parameters?: TParameters, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
10
|
+
postJson(path: string, jsonData: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
11
|
+
getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<TResponse>;
|
|
12
|
+
getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
|
|
13
|
+
getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<TAudioSampleRates[]>;
|
|
14
|
+
performAutofocus(options?: THttpRequestOptions): Promise<void>;
|
|
15
|
+
checkSDCard(options?: THttpRequestOptions): Promise<TSDCardInfo>;
|
|
16
|
+
mountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
17
|
+
unmountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
17
18
|
private _doSDCardMountAction;
|
|
18
|
-
fetchSDCardJobProgress(jobId: number,
|
|
19
|
-
downloadCameraReport(
|
|
20
|
-
getSystemLog(
|
|
21
|
-
getMaxFps(channel: number,
|
|
22
|
-
getTimezone(
|
|
23
|
-
getDateTimeInfo(
|
|
19
|
+
fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
|
|
20
|
+
downloadCameraReport(options?: THttpRequestOptions): Promise<TResponse>;
|
|
21
|
+
getSystemLog(options?: THttpRequestOptions): Promise<TResponse>;
|
|
22
|
+
getMaxFps(channel: number, options?: THttpRequestOptions): Promise<number>;
|
|
23
|
+
getTimezone(options?: THttpRequestOptions): Promise<string>;
|
|
24
|
+
getDateTimeInfo(options?: THttpRequestOptions): Promise<{
|
|
24
25
|
data: {
|
|
25
26
|
dateTime: string;
|
|
26
27
|
dstEnabled: boolean;
|
|
27
28
|
localDateTime: string;
|
|
28
29
|
posixTimeZone: string;
|
|
29
|
-
timeZone
|
|
30
|
+
timeZone?: string | undefined;
|
|
30
31
|
};
|
|
31
32
|
}>;
|
|
32
|
-
getDevicesSettings(
|
|
33
|
-
fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T,
|
|
34
|
-
getHeaders(
|
|
35
|
-
setHeaders(headers: Record<string, string>,
|
|
36
|
-
getParameter(paramNames: string | string[],
|
|
37
|
-
setParameter(params: Record<string, string | number | boolean>,
|
|
38
|
-
getGuardTourList(
|
|
33
|
+
getDevicesSettings(options?: THttpRequestOptions): Promise<TAudioDevice[]>;
|
|
34
|
+
fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T, options?: THttpRequestOptions): Promise<any>;
|
|
35
|
+
getHeaders(options?: THttpRequestOptions): Promise<Record<string, string>>;
|
|
36
|
+
setHeaders(headers: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
37
|
+
getParameter(paramNames: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
|
|
38
|
+
setParameter(params: Record<string, string | number | boolean>, options?: THttpRequestOptions): Promise<boolean>;
|
|
39
|
+
getGuardTourList(options?: THttpRequestOptions): Promise<{
|
|
39
40
|
name: string;
|
|
40
41
|
id: string;
|
|
41
42
|
running: string;
|
|
@@ -50,17 +51,30 @@ export declare class VapixAPI<Client extends IClient = IClient> {
|
|
|
50
51
|
randomEnabled?: unknown;
|
|
51
52
|
timeBetweenSequences?: unknown;
|
|
52
53
|
}[]>;
|
|
53
|
-
setGuardTourEnabled(guardTourID: string, enable: boolean,
|
|
54
|
-
getPTZPresetList(channel: number,
|
|
55
|
-
listPTZ(camera: number,
|
|
56
|
-
listPtzVideoSourceOverview(
|
|
57
|
-
goToPreset(channel: number, presetName: string,
|
|
58
|
-
getPtzPosition(camera: number,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
setGuardTourEnabled(guardTourID: string, enable: boolean, options?: THttpRequestOptions): Promise<boolean>;
|
|
55
|
+
getPTZPresetList(channel: number, options?: THttpRequestOptions): Promise<string[]>;
|
|
56
|
+
listPTZ(camera: number, options?: THttpRequestOptions): Promise<TCameraPTZItem[]>;
|
|
57
|
+
listPtzVideoSourceOverview(options?: THttpRequestOptions): Promise<TPtzOverview>;
|
|
58
|
+
goToPreset(channel: number, presetName: string, options?: THttpRequestOptions): Promise<TResponse>;
|
|
59
|
+
getPtzPosition(camera: number, options?: THttpRequestOptions): Promise<TCameraPTZItemData>;
|
|
60
|
+
getPorts(options?: THttpRequestOptions): Promise<{
|
|
61
|
+
name: string;
|
|
62
|
+
port: string;
|
|
63
|
+
state: "open" | "closed";
|
|
64
|
+
configurable: boolean;
|
|
65
|
+
usage: string;
|
|
66
|
+
direction: "input" | "output";
|
|
67
|
+
normalState: "open" | "closed";
|
|
68
|
+
readonly?: boolean | undefined;
|
|
69
|
+
}[]>;
|
|
70
|
+
setPorts(ports: TPortSetSchema[], options?: THttpRequestOptions): Promise<void>;
|
|
71
|
+
setPortStateSequence(port: number, sequence: TPortSequenceStateSchema[], options?: THttpRequestOptions): Promise<void>;
|
|
72
|
+
getApplicationList(options?: THttpRequestOptions): Promise<any>;
|
|
73
|
+
startApplication(applicationID: string, options?: THttpRequestOptions): Promise<void>;
|
|
74
|
+
restartApplication(applicationID: string, options?: THttpRequestOptions): Promise<void>;
|
|
75
|
+
stopApplication(applicationID: string, options?: THttpRequestOptions): Promise<void>;
|
|
76
|
+
installApplication(data: Blob, fileName: string, options?: THttpRequestOptions): Promise<void>;
|
|
77
|
+
private static parseParameters;
|
|
78
|
+
private static parseCameraPtzResponse;
|
|
79
|
+
private static parsePtz;
|
|
66
80
|
}
|