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