camstreamerlib 4.0.0-beta.99 → 4.0.1
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 +44 -15
- package/cjs/CamOverlayAPI.d.ts +145 -107
- package/cjs/CamOverlayAPI.js +14 -63
- package/cjs/CamScripterAPI.d.ts +5 -8
- package/cjs/CamScripterAPI.js +11 -29
- package/cjs/CamStreamerAPI.d.ts +2362 -806
- package/cjs/CamStreamerAPI.js +68 -76
- package/cjs/CamSwitcherAPI.d.ts +23 -22
- package/cjs/CamSwitcherAPI.js +30 -88
- package/cjs/PlaneTrackerAPI.d.ts +28 -30
- package/cjs/PlaneTrackerAPI.js +20 -75
- package/cjs/VapixAPI.d.ts +36 -23
- package/cjs/VapixAPI.js +227 -106
- package/cjs/errors/errors.d.ts +11 -5
- package/cjs/errors/errors.js +5 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -0
- package/cjs/internal/BasicAPI.d.ts +15 -0
- package/cjs/internal/BasicAPI.js +93 -0
- package/cjs/internal/WsEvents.d.ts +1 -0
- package/cjs/internal/WsEvents.js +5 -0
- package/cjs/internal/constants.d.ts +1 -0
- package/cjs/internal/constants.js +2 -1
- package/cjs/internal/convertors.d.ts +6 -0
- package/cjs/internal/convertors.js +115 -0
- package/cjs/internal/transformers.js +8 -8
- package/cjs/internal/types.d.ts +3 -0
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +878 -358
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +54 -11
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +28 -28
- package/cjs/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
- package/cjs/types/CamOverlayAPI/htmlOverlaySchema.js +21 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
- package/cjs/types/CamOverlayAPI/index.d.ts +1 -0
- package/cjs/types/CamOverlayAPI/index.js +1 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +8 -8
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
- package/cjs/types/CamScripterAPI.d.ts +0 -11
- package/cjs/types/CamScripterAPI.js +1 -5
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +17745 -4940
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +126 -57
- package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +395 -86
- package/cjs/types/CamStreamerAPI/facebookSchema.js +13 -1
- package/cjs/types/CamStreamerAPI/index.d.ts +1 -3
- package/cjs/types/CamStreamerAPI/index.js +1 -3
- package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
- package/cjs/types/CamStreamerAPI/oldStreamSchema.js +1 -1
- package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +392 -304
- package/cjs/types/CamStreamerAPI/streamCommonTypes.js +116 -76
- package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
- package/cjs/types/CamStreamerAPI/streamsSchema.js +81 -0
- package/cjs/types/CamStreamerAPI/windySchema.d.ts +356 -87
- package/cjs/types/CamStreamerAPI/windySchema.js +9 -1
- package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +351 -119
- package/cjs/types/CamStreamerAPI/youtubeSchema.js +5 -9
- package/cjs/types/CamSwitcherAPI.d.ts +96 -91
- package/cjs/types/CamSwitcherAPI.js +9 -9
- package/cjs/types/GenetecAgent.d.ts +2 -2
- package/cjs/types/PlaneTrackerAPI.d.ts +60 -47
- package/cjs/types/PlaneTrackerAPI.js +5 -2
- package/cjs/types/VapixAPI.d.ts +51 -32
- package/cjs/types/VapixAPI.js +10 -3
- package/cjs/types/common.d.ts +27 -0
- package/cjs/types/common.js +13 -1
- package/cjs/types/ws/CamStreamerEvents.d.ts +110 -77
- package/cjs/types/ws/CamStreamerEvents.js +11 -7
- package/cjs/types/ws/CamSwitcherEvents.d.ts +8 -8
- package/cjs/types/ws/PlaneTrackerEvents.d.ts +3 -3
- package/esm/CamOverlayAPI.js +16 -65
- package/esm/CamScripterAPI.js +9 -30
- package/esm/CamStreamerAPI.js +70 -78
- package/esm/CamSwitcherAPI.js +31 -89
- package/esm/PlaneTrackerAPI.js +21 -76
- package/esm/VapixAPI.js +228 -107
- package/esm/errors/errors.js +5 -1
- package/esm/index.js +1 -0
- package/esm/internal/BasicAPI.js +89 -0
- package/esm/internal/WsEvents.js +5 -0
- package/esm/internal/constants.js +1 -0
- package/esm/internal/convertors.js +108 -0
- package/esm/internal/transformers.js +1 -1
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +47 -10
- package/esm/types/CamOverlayAPI/htmlOverlaySchema.js +18 -0
- package/esm/types/CamOverlayAPI/index.js +1 -0
- package/esm/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
- package/esm/types/CamScripterAPI.js +0 -4
- package/esm/types/CamStreamerAPI/CamStreamerAPI.js +109 -41
- package/esm/types/CamStreamerAPI/facebookSchema.js +13 -1
- package/esm/types/CamStreamerAPI/index.js +1 -3
- package/esm/types/CamStreamerAPI/oldStreamSchema.js +1 -1
- package/esm/types/CamStreamerAPI/streamCommonTypes.js +116 -76
- package/esm/types/CamStreamerAPI/streamsSchema.js +75 -0
- package/esm/types/CamStreamerAPI/windySchema.js +9 -1
- package/esm/types/CamStreamerAPI/youtubeSchema.js +5 -9
- package/esm/types/CamSwitcherAPI.js +8 -8
- package/esm/types/PlaneTrackerAPI.js +5 -2
- package/esm/types/VapixAPI.js +9 -2
- package/esm/types/common.js +12 -0
- package/esm/types/ws/CamStreamerEvents.js +11 -7
- package/package.json +4 -4
- package/types/CamOverlayAPI.d.ts +145 -107
- package/types/CamScripterAPI.d.ts +5 -8
- package/types/CamStreamerAPI.d.ts +2362 -806
- package/types/CamSwitcherAPI.d.ts +23 -22
- package/types/PlaneTrackerAPI.d.ts +28 -30
- package/types/VapixAPI.d.ts +36 -23
- package/types/errors/errors.d.ts +11 -5
- package/types/index.d.ts +1 -0
- package/types/internal/BasicAPI.d.ts +15 -0
- package/types/internal/WsEvents.d.ts +1 -0
- package/types/internal/constants.d.ts +1 -0
- package/types/internal/convertors.d.ts +6 -0
- package/types/internal/types.d.ts +3 -0
- package/types/internal/versionCompare.d.ts +2 -2
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +878 -358
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +28 -28
- package/types/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
- package/types/types/CamOverlayAPI/index.d.ts +1 -0
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
- package/types/types/CamOverlayAPI/pipSchema.d.ts +8 -8
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
- package/types/types/CamScripterAPI.d.ts +0 -11
- package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +17745 -4940
- package/types/types/CamStreamerAPI/facebookSchema.d.ts +395 -86
- package/types/types/CamStreamerAPI/index.d.ts +1 -3
- package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
- package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +392 -304
- package/types/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
- package/types/types/CamStreamerAPI/windySchema.d.ts +356 -87
- package/types/types/CamStreamerAPI/youtubeSchema.d.ts +351 -119
- package/types/types/CamSwitcherAPI.d.ts +96 -91
- package/types/types/GenetecAgent.d.ts +2 -2
- package/types/types/PlaneTrackerAPI.d.ts +60 -47
- package/types/types/VapixAPI.d.ts +51 -32
- package/types/types/common.d.ts +27 -0
- package/types/types/ws/CamStreamerEvents.d.ts +110 -77
- package/types/types/ws/CamSwitcherEvents.d.ts +8 -8
- package/types/types/ws/PlaneTrackerEvents.d.ts +3 -3
- package/cjs/types/CamStreamerAPI/churchSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/churchSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/daCastSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/daCastSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/dailymotionSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/gameChangerSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/hlsPullSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/hlsPushSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/ibmSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/ibmSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/microsoftAzureSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/microsoftStreamSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -323
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +0 -27
- package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +0 -284
- package/cjs/types/CamStreamerAPI/rtmpSchema.js +0 -14
- package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/sdCardSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/srtSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/srtSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/twitchSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/twitchSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/vimeoSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/vimeoSchema.js +0 -11
- package/cjs/types/CamStreamerAPI/wowzaSchema.d.ts +0 -275
- package/cjs/types/CamStreamerAPI/wowzaSchema.js +0 -11
- package/esm/types/CamStreamerAPI/churchSchema.js +0 -5
- package/esm/types/CamStreamerAPI/daCastSchema.js +0 -5
- package/esm/types/CamStreamerAPI/dailymotionSchema.js +0 -5
- package/esm/types/CamStreamerAPI/gameChangerSchema.js +0 -5
- package/esm/types/CamStreamerAPI/hlsPullSchema.js +0 -5
- package/esm/types/CamStreamerAPI/hlsPushSchema.js +0 -5
- package/esm/types/CamStreamerAPI/ibmSchema.js +0 -5
- package/esm/types/CamStreamerAPI/microsoftAzureSchema.js +0 -5
- package/esm/types/CamStreamerAPI/microsoftStreamSchema.js +0 -5
- package/esm/types/CamStreamerAPI/mpegDvbSchema.js +0 -21
- package/esm/types/CamStreamerAPI/rtmpSchema.js +0 -8
- package/esm/types/CamStreamerAPI/sdCardSchema.js +0 -5
- package/esm/types/CamStreamerAPI/srtSchema.js +0 -5
- package/esm/types/CamStreamerAPI/twitchSchema.js +0 -5
- package/esm/types/CamStreamerAPI/vimeoSchema.js +0 -5
- package/esm/types/CamStreamerAPI/wowzaSchema.js +0 -5
- package/types/types/CamStreamerAPI/churchSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/daCastSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/ibmSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -323
- package/types/types/CamStreamerAPI/rtmpSchema.d.ts +0 -284
- package/types/types/CamStreamerAPI/sdCardSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/srtSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/twitchSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/vimeoSchema.d.ts +0 -275
- package/types/types/CamStreamerAPI/wowzaSchema.d.ts +0 -275
package/cjs/PlaneTrackerAPI.js
CHANGED
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlaneTrackerAPI = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const utils_1 = require("./internal/utils");
|
|
6
5
|
const PlaneTrackerAPI_1 = require("./types/PlaneTrackerAPI");
|
|
7
6
|
const errors_1 = require("./errors/errors");
|
|
8
|
-
const ProxyClient_1 = require("./internal/ProxyClient");
|
|
9
7
|
const GenetecAgent_1 = require("./types/GenetecAgent");
|
|
8
|
+
const BasicAPI_1 = require("./internal/BasicAPI");
|
|
10
9
|
const BASE_PATH = '/local/planetracker';
|
|
11
|
-
class PlaneTrackerAPI {
|
|
12
|
-
client;
|
|
10
|
+
class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
|
|
13
11
|
apiUser;
|
|
14
12
|
constructor(client, apiUser) {
|
|
15
|
-
|
|
13
|
+
super(client);
|
|
16
14
|
this.apiUser = apiUser;
|
|
17
15
|
}
|
|
18
16
|
static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
|
|
19
17
|
static getWsEventsPath = () => `${BASE_PATH}/package/ws`;
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
async checkAPIAvailable(options) {
|
|
19
|
+
await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
|
|
22
20
|
}
|
|
23
21
|
async checkCameraTime(options) {
|
|
24
22
|
const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
@@ -26,7 +24,11 @@ class PlaneTrackerAPI {
|
|
|
26
24
|
}
|
|
27
25
|
async serverRunCheck(options) {
|
|
28
26
|
const agent = this.getClient(options?.proxyParams);
|
|
29
|
-
|
|
27
|
+
const res = await agent.get({
|
|
28
|
+
path: `${BASE_PATH}/package/serverRunCheck.cgi`,
|
|
29
|
+
timeout: options?.timeout,
|
|
30
|
+
});
|
|
31
|
+
return res.status === 200;
|
|
30
32
|
}
|
|
31
33
|
async getLiveViewAlias(rtspUrl, options) {
|
|
32
34
|
const agent = this.getClient(options?.proxyParams);
|
|
@@ -64,7 +66,7 @@ class PlaneTrackerAPI {
|
|
|
64
66
|
return PlaneTrackerAPI_1.cameraSettingsSchema.parse(res);
|
|
65
67
|
}
|
|
66
68
|
async setCameraSettings(settings, options) {
|
|
67
|
-
|
|
69
|
+
await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settings, {
|
|
68
70
|
action: 'set',
|
|
69
71
|
}, options);
|
|
70
72
|
}
|
|
@@ -123,28 +125,28 @@ class PlaneTrackerAPI {
|
|
|
123
125
|
return PlaneTrackerAPI_1.priorityListSchema.parse(res).priorityList;
|
|
124
126
|
}
|
|
125
127
|
async setPriorityList(priorityList, options) {
|
|
126
|
-
|
|
128
|
+
await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
|
|
127
129
|
}
|
|
128
130
|
async getTypePriorityList(options) {
|
|
129
131
|
const res = await this._getJson(`${BASE_PATH}/package/getTypePriorityList.cgi`, undefined, options);
|
|
130
132
|
return PlaneTrackerAPI_1.typePriorityListSchema.parse(res).typePriorityList;
|
|
131
133
|
}
|
|
132
134
|
async setTypePriorityList(typePriorityList, options) {
|
|
133
|
-
|
|
135
|
+
await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
|
|
134
136
|
}
|
|
135
137
|
async getWhiteList(options) {
|
|
136
138
|
const res = await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
|
|
137
139
|
return PlaneTrackerAPI_1.whiteListSchema.parse(res).whiteList;
|
|
138
140
|
}
|
|
139
141
|
async setWhiteList(whiteList, options) {
|
|
140
|
-
|
|
142
|
+
await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, { whiteList }, this.apiUser, options);
|
|
141
143
|
}
|
|
142
144
|
async getBlackList(options) {
|
|
143
145
|
const res = await this._getJson(`${BASE_PATH}/package/getBlackList.cgi`, undefined, options);
|
|
144
146
|
return PlaneTrackerAPI_1.blackListSchema.parse(res).blackList;
|
|
145
147
|
}
|
|
146
148
|
async setBlackList(blackList, options) {
|
|
147
|
-
|
|
149
|
+
await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, { blackList }, this.apiUser, options);
|
|
148
150
|
}
|
|
149
151
|
async fetchMapInfo(options) {
|
|
150
152
|
const res = await this._getJson(`${BASE_PATH}/package/getMapInfo.cgi`, undefined, options);
|
|
@@ -182,73 +184,16 @@ class PlaneTrackerAPI {
|
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
}
|
|
187
|
+
downloadReport(options) {
|
|
188
|
+
return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
|
|
189
|
+
}
|
|
185
190
|
async checkGenetecConnection(params, options) {
|
|
186
|
-
|
|
191
|
+
const res = await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
|
|
192
|
+
return res.status === 200;
|
|
187
193
|
}
|
|
188
194
|
async getGenetecCameraList(params, options) {
|
|
189
195
|
const res = await this._postUrlEncoded(`${BASE_PATH}/package/getGenetecCameraList.cgi`, params, options);
|
|
190
196
|
return GenetecAgent_1.cameraListSchema.parse(await res.json());
|
|
191
197
|
}
|
|
192
|
-
async _getJson(path, parameters, options, headers) {
|
|
193
|
-
const agent = this.getClient(options?.proxyParams);
|
|
194
|
-
const res = await agent.get({ path, parameters, timeout: options?.timeout, headers });
|
|
195
|
-
if (res.ok) {
|
|
196
|
-
return await res.json();
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
async _getBlob(path, parameters, options) {
|
|
203
|
-
const agent = this.getClient(options?.proxyParams);
|
|
204
|
-
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
205
|
-
if (res.ok) {
|
|
206
|
-
return await this.parseBlobResponse(res);
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async parseBlobResponse(response) {
|
|
213
|
-
try {
|
|
214
|
-
return (await response.blob());
|
|
215
|
-
}
|
|
216
|
-
catch (err) {
|
|
217
|
-
throw new errors_1.ParsingBlobError(err);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
async _postJsonEncoded(path, data, parameters, options) {
|
|
221
|
-
const agent = this.getClient(options?.proxyParams);
|
|
222
|
-
const jsonData = JSON.stringify(data);
|
|
223
|
-
const res = await agent.post({
|
|
224
|
-
path,
|
|
225
|
-
data: jsonData,
|
|
226
|
-
parameters,
|
|
227
|
-
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
|
|
228
|
-
timeout: options?.timeout,
|
|
229
|
-
});
|
|
230
|
-
if (res.ok) {
|
|
231
|
-
return res;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
async _postUrlEncoded(path, params, options) {
|
|
238
|
-
const data = (0, utils_1.paramToUrl)(params);
|
|
239
|
-
const agent = this.getClient(options?.proxyParams);
|
|
240
|
-
const res = await agent.post({
|
|
241
|
-
path,
|
|
242
|
-
data,
|
|
243
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
244
|
-
timeout: options?.timeout,
|
|
245
|
-
});
|
|
246
|
-
if (res.ok) {
|
|
247
|
-
return res;
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
198
|
}
|
|
254
199
|
exports.PlaneTrackerAPI = PlaneTrackerAPI;
|
package/cjs/VapixAPI.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { IClient, TParameters, TResponse } from './internal/types';
|
|
2
2
|
import { TAudioDevice, TPortSetSchema, TPortSequenceStateSchema } from './types/VapixAPI';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
6
|
-
private client;
|
|
3
|
+
import { TCameraImageConfig, THttpRequestOptions } from './types/common';
|
|
4
|
+
import { BasicAPI } from './internal/BasicAPI';
|
|
5
|
+
export declare class VapixAPI<Client extends IClient<TResponse, any>> extends BasicAPI<Client> {
|
|
7
6
|
private CustomFormData;
|
|
8
7
|
constructor(client: Client, CustomFormData?: {
|
|
9
8
|
new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
|
|
10
9
|
prototype: FormData;
|
|
11
10
|
});
|
|
12
|
-
getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
|
|
13
11
|
postUrlEncoded(path: string, parameters?: TParameters, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
14
|
-
postJson(path: string,
|
|
12
|
+
postJson(path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
15
13
|
getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
|
|
16
14
|
getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
|
|
17
15
|
getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<{
|
|
@@ -19,17 +17,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
19
17
|
bitRates: number[];
|
|
20
18
|
}[]>;
|
|
21
19
|
performAutofocus(options?: THttpRequestOptions): Promise<void>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
totalSize: number;
|
|
25
|
-
freeSize: number;
|
|
26
|
-
}>;
|
|
27
|
-
mountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
28
|
-
unmountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
29
|
-
private _doSDCardMountAction;
|
|
30
|
-
fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
|
|
31
|
-
downloadCameraReport(options?: THttpRequestOptions): Promise<TResponse>;
|
|
32
|
-
getSystemLog(options?: THttpRequestOptions): Promise<TResponse>;
|
|
20
|
+
downloadCameraReport(options?: THttpRequestOptions): Promise<string>;
|
|
21
|
+
getSystemLog(options?: THttpRequestOptions): Promise<string>;
|
|
33
22
|
getMaxFps(channel: number, options?: THttpRequestOptions): Promise<number>;
|
|
34
23
|
getTimezone(options?: THttpRequestOptions): Promise<string>;
|
|
35
24
|
getDateTimeInfo(options?: THttpRequestOptions): Promise<{
|
|
@@ -44,7 +33,16 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
44
33
|
getDevicesSettings(options?: THttpRequestOptions): Promise<TAudioDevice[]>;
|
|
45
34
|
fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T, options?: THttpRequestOptions): Promise<any>;
|
|
46
35
|
getHeaders(options?: THttpRequestOptions): Promise<Record<string, string>>;
|
|
47
|
-
setHeaders(headers: Record<string, string>, options?: THttpRequestOptions): Promise<
|
|
36
|
+
setHeaders(headers: Record<string, string>, options?: THttpRequestOptions): Promise<void>;
|
|
37
|
+
checkSDCard(options?: THttpRequestOptions): Promise<{
|
|
38
|
+
status: "OK" | "connected" | "disconnected";
|
|
39
|
+
totalSize: number;
|
|
40
|
+
freeSize: number;
|
|
41
|
+
}>;
|
|
42
|
+
mountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
43
|
+
unmountSDCard(options?: THttpRequestOptions): Promise<number>;
|
|
44
|
+
private _doSDCardMountAction;
|
|
45
|
+
fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
|
|
48
46
|
getParameter(paramNames: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
|
|
49
47
|
setParameter(params: Record<string, string | number | boolean>, options?: THttpRequestOptions): Promise<void>;
|
|
50
48
|
getGuardTourList(options?: THttpRequestOptions): Promise<{
|
|
@@ -52,8 +50,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
52
50
|
id: string;
|
|
53
51
|
running: string;
|
|
54
52
|
tour: {
|
|
55
|
-
moveSpeed?: unknown;
|
|
56
53
|
position?: unknown;
|
|
54
|
+
moveSpeed?: unknown;
|
|
57
55
|
presetNbr?: unknown;
|
|
58
56
|
waitTime?: unknown;
|
|
59
57
|
waitTimeViewType?: unknown;
|
|
@@ -66,18 +64,18 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
66
64
|
getPTZPresetList(channel: number, options?: THttpRequestOptions): Promise<string[]>;
|
|
67
65
|
listPTZ(camera: number, options?: THttpRequestOptions): Promise<{
|
|
68
66
|
name: string;
|
|
69
|
-
id: number;
|
|
70
67
|
data: {
|
|
71
68
|
pan?: number | undefined;
|
|
72
69
|
tilt?: number | undefined;
|
|
73
70
|
zoom?: number | undefined;
|
|
74
71
|
};
|
|
72
|
+
id: number;
|
|
75
73
|
}[]>;
|
|
76
74
|
listPtzVideoSourceOverview(options?: THttpRequestOptions): Promise<Record<number, {
|
|
77
75
|
name: string;
|
|
78
76
|
id: number;
|
|
79
77
|
}[]>>;
|
|
80
|
-
goToPreset(channel: number, presetName: string, options?: THttpRequestOptions): Promise<
|
|
78
|
+
goToPreset(channel: number, presetName: string, options?: THttpRequestOptions): Promise<void>;
|
|
81
79
|
getPtzPosition(camera: number, options?: THttpRequestOptions): Promise<{
|
|
82
80
|
pan?: number | undefined;
|
|
83
81
|
tilt?: number | undefined;
|
|
@@ -86,15 +84,27 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
86
84
|
getPorts(options?: THttpRequestOptions): Promise<{
|
|
87
85
|
name: string;
|
|
88
86
|
port: string;
|
|
87
|
+
direction: "output" | "input";
|
|
89
88
|
state: "open" | "closed";
|
|
90
89
|
configurable: boolean;
|
|
91
90
|
usage: string;
|
|
92
|
-
direction: "input" | "output";
|
|
93
91
|
normalState: "open" | "closed";
|
|
94
92
|
readonly?: boolean | undefined;
|
|
95
93
|
}[]>;
|
|
96
94
|
setPorts(ports: TPortSetSchema[], options?: THttpRequestOptions): Promise<void>;
|
|
97
95
|
setPortStateSequence(port: number, sequence: TPortSequenceStateSchema[], options?: THttpRequestOptions): Promise<void>;
|
|
96
|
+
addCameraUser(username: string, pass: string, sgrp: string, comment?: string, options?: THttpRequestOptions): Promise<void>;
|
|
97
|
+
getCameraUsers(options?: THttpRequestOptions): Promise<string[]>;
|
|
98
|
+
editCameraUser(username: string, pass: string, options?: THttpRequestOptions): Promise<void>;
|
|
99
|
+
getRecordingRuleList(options?: THttpRequestOptions): Promise<{
|
|
100
|
+
options: Record<string, string>;
|
|
101
|
+
diskid: string;
|
|
102
|
+
eventid: string;
|
|
103
|
+
profile: string;
|
|
104
|
+
}[]>;
|
|
105
|
+
addRecordingRule(params: Record<string, string>, options?: THttpRequestOptions): Promise<string | null>;
|
|
106
|
+
removeRecordingRule(profileId: string, options?: THttpRequestOptions): Promise<void>;
|
|
107
|
+
getDiskInfo(diskId?: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
98
108
|
getApplicationList(options?: THttpRequestOptions): Promise<{
|
|
99
109
|
Name: string;
|
|
100
110
|
NiceName: string;
|
|
@@ -102,7 +112,7 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
102
112
|
Version: string;
|
|
103
113
|
License: string;
|
|
104
114
|
Status: string;
|
|
105
|
-
appId: "CamStreamer" | "CamSwitcher" | "CamOverlay" | "CamScripter" | "PlaneTracker" | "Ndihxplugin" | "SportTracker" | null;
|
|
115
|
+
appId: "CamStreamer" | "CamSwitcher" | "CamOverlay" | "CamScripter" | "PlaneTracker" | "Ndihxplugin" | "SportTracker" | "CamOverlayHtmlplugin" | null;
|
|
106
116
|
ApplicationID?: string | undefined;
|
|
107
117
|
ConfigurationPage?: string | undefined;
|
|
108
118
|
VendorHomePage?: string | undefined;
|
|
@@ -112,7 +122,10 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
|
|
|
112
122
|
restartApplication(applicationId: string, options?: THttpRequestOptions): Promise<void>;
|
|
113
123
|
stopApplication(applicationId: string, options?: THttpRequestOptions): Promise<void>;
|
|
114
124
|
installApplication(data: Parameters<typeof FormData.prototype.append>[1], fileName: string, options?: THttpRequestOptions): Promise<void>;
|
|
125
|
+
private static parseQueryString;
|
|
126
|
+
private static checkTextResponseForError;
|
|
115
127
|
private static parseParameters;
|
|
116
128
|
private static parseCameraPtzResponse;
|
|
117
129
|
private static parsePtz;
|
|
130
|
+
private static parseXmlResponse;
|
|
118
131
|
}
|