camstreamerlib 4.0.34 → 4.0.35-9984935
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/cjs/CamOverlayAPI.d.ts +6 -0
- package/cjs/CamOverlayAPI.js +16 -0
- package/cjs/CamSwitcherAPI.d.ts +1 -1
- package/cjs/PlaneTrackerAPI.d.ts +46 -10
- package/cjs/PlaneTrackerAPI.js +2 -1
- package/cjs/VapixAPI.js +4 -2
- package/cjs/errors/errors.js +4 -4
- package/cjs/types/CamSwitcherAPI.d.ts +4 -4
- package/cjs/types/PlaneTrackerAPI.d.ts +223 -39
- package/cjs/types/PlaneTrackerAPI.js +72 -23
- package/cjs/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/cjs/types/PlaneTrackerAPI.test.js +117 -0
- package/cjs/types/common.d.ts +13 -0
- package/cjs/types/common.js +6 -1
- package/esm/CamOverlayAPI.js +17 -1
- package/esm/PlaneTrackerAPI.js +2 -1
- package/esm/VapixAPI.js +4 -2
- package/esm/errors/errors.js +4 -4
- package/esm/types/PlaneTrackerAPI.js +71 -22
- package/esm/types/PlaneTrackerAPI.test.js +115 -0
- package/esm/types/common.js +5 -0
- package/package.json +107 -110
- package/types/CamOverlayAPI.d.ts +6 -0
- package/types/CamSwitcherAPI.d.ts +1 -1
- package/types/PlaneTrackerAPI.d.ts +46 -10
- package/types/types/CamSwitcherAPI.d.ts +4 -4
- package/types/types/PlaneTrackerAPI.d.ts +223 -39
- package/types/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/types/types/common.d.ts +13 -0
package/cjs/CamOverlayAPI.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> exten
|
|
|
14
14
|
}[]>;
|
|
15
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
16
16
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
17
|
+
isViewerPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
18
|
+
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
19
|
+
alias: string;
|
|
20
|
+
ws: string;
|
|
21
|
+
ws_initial_message: string;
|
|
22
|
+
}>;
|
|
17
23
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
18
24
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
19
25
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
package/cjs/CamOverlayAPI.js
CHANGED
|
@@ -29,6 +29,22 @@ class CamOverlayAPI extends BasicAPI_1.BasicAPI {
|
|
|
29
29
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
30
30
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
31
31
|
}
|
|
32
|
+
async isViewerPassValid(pass, options) {
|
|
33
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
34
|
+
if (res.status !== 200) {
|
|
35
|
+
throw new Error(res.message);
|
|
36
|
+
}
|
|
37
|
+
return res.data === '1';
|
|
38
|
+
}
|
|
39
|
+
async getLiveViewAlias(rtspUrl, options) {
|
|
40
|
+
const agent = this.getClient(options?.proxyParams);
|
|
41
|
+
const res = await agent.get({
|
|
42
|
+
path: `${BASE_PATH}/getLiveViewAlias.cgi`,
|
|
43
|
+
parameters: { rtsp_url: rtspUrl },
|
|
44
|
+
timeout: options?.timeout,
|
|
45
|
+
});
|
|
46
|
+
return common_1.wsAliasResponseSchema.parse(await res.json());
|
|
47
|
+
}
|
|
32
48
|
async listFiles(fileType, options) {
|
|
33
49
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
34
50
|
return (0, CamOverlayAPI_1.getFileListSchema)(fileType).parse(res.list);
|
package/cjs/CamSwitcherAPI.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> exte
|
|
|
28
28
|
}[]>;
|
|
29
29
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
30
30
|
getOutputInfo(options?: THttpRequestOptions): Promise<{
|
|
31
|
-
rtspUrl: string;
|
|
32
31
|
ws: string;
|
|
33
32
|
wsInitialMessage: string;
|
|
33
|
+
rtspUrl: string;
|
|
34
34
|
}>;
|
|
35
35
|
getAudioPushInfo(options?: THttpRequestOptions): Promise<{
|
|
36
36
|
ws: string;
|
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
12
12
|
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
13
13
|
serverRunCheck(options?: THttpRequestOptions): Promise<boolean>;
|
|
14
14
|
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
15
|
+
alias: string;
|
|
15
16
|
ws: string;
|
|
16
17
|
ws_initial_message: string;
|
|
17
|
-
alias: string;
|
|
18
18
|
}>;
|
|
19
19
|
resetPtzCalibration(options?: THttpRequestOptions): Promise<void>;
|
|
20
20
|
resetFocusCalibration(options?: THttpRequestOptions): Promise<void>;
|
|
@@ -45,8 +45,23 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
45
45
|
focusCalibrationPoints: string;
|
|
46
46
|
};
|
|
47
47
|
cameraConfig: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
aircraft: {
|
|
49
|
+
defaultCaptureSizeMeters: number;
|
|
50
|
+
captureSizeExtensionMeters: number;
|
|
51
|
+
};
|
|
52
|
+
drone: {
|
|
53
|
+
defaultCaptureSizeMeters: number;
|
|
54
|
+
captureSizeExtensionMeters: number;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
aircraft: {
|
|
58
|
+
defaultCaptureSizeMeters: number;
|
|
59
|
+
captureSizeExtensionMeters: number;
|
|
60
|
+
};
|
|
61
|
+
drone: {
|
|
62
|
+
defaultCaptureSizeMeters: number;
|
|
63
|
+
captureSizeExtensionMeters: number;
|
|
64
|
+
};
|
|
50
65
|
};
|
|
51
66
|
stream: {
|
|
52
67
|
width: number;
|
|
@@ -72,6 +87,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
72
87
|
widget: {
|
|
73
88
|
enabled: boolean;
|
|
74
89
|
scale: number;
|
|
90
|
+
units: "rotate" | "metric" | "imperial";
|
|
75
91
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
76
92
|
posX: number;
|
|
77
93
|
posY: number;
|
|
@@ -85,6 +101,8 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
85
101
|
posY: number;
|
|
86
102
|
showWeather: boolean;
|
|
87
103
|
weatherLocationKey: string;
|
|
104
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
105
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
88
106
|
};
|
|
89
107
|
fr24FlightInfoSource: {
|
|
90
108
|
enabled: boolean;
|
|
@@ -99,11 +117,29 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
99
117
|
priority: number;
|
|
100
118
|
};
|
|
101
119
|
identificationLabel: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
aircraft: {
|
|
121
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
122
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
123
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
124
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
125
|
+
opacity: number;
|
|
126
|
+
};
|
|
127
|
+
drone: {
|
|
128
|
+
firstRow: "blank" | "remote_id";
|
|
129
|
+
opacity: number;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
aircraft: {
|
|
133
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
134
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
135
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
136
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
137
|
+
opacity: number;
|
|
138
|
+
};
|
|
139
|
+
drone: {
|
|
140
|
+
firstRow: "blank" | "remote_id";
|
|
141
|
+
opacity: number;
|
|
142
|
+
};
|
|
107
143
|
};
|
|
108
144
|
acs: {
|
|
109
145
|
ip: string;
|
|
@@ -181,11 +217,11 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
181
217
|
importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
|
|
182
218
|
getDomainList(options?: THttpRequestOptions): Promise<Partial<Record<"adsb" | "remoteId", {
|
|
183
219
|
uiName: string;
|
|
184
|
-
icon: "unknown" | "small" | "
|
|
220
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
185
221
|
categoryList: {
|
|
186
222
|
categoryId: string;
|
|
187
223
|
uiName: string;
|
|
188
|
-
icon: "unknown" | "small" | "
|
|
224
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
189
225
|
}[];
|
|
190
226
|
}>>>;
|
|
191
227
|
fetchFlightInfo(targetId: string, options?: THttpRequestOptions): Promise<{
|
package/cjs/PlaneTrackerAPI.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.PlaneTrackerAPI = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const PlaneTrackerAPI_1 = require("./types/PlaneTrackerAPI");
|
|
6
6
|
const errors_1 = require("./errors/errors");
|
|
7
|
+
const common_1 = require("./types/common");
|
|
7
8
|
const BasicAPI_1 = require("./internal/BasicAPI");
|
|
8
9
|
const PlaneTrackerEvents_1 = require("./types/ws/PlaneTrackerEvents");
|
|
9
10
|
const BASE_PATH = '/local/planetracker';
|
|
@@ -37,7 +38,7 @@ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
|
|
|
37
38
|
parameters: { rtsp_url: rtspUrl },
|
|
38
39
|
timeout: options?.timeout,
|
|
39
40
|
});
|
|
40
|
-
return
|
|
41
|
+
return common_1.wsAliasResponseSchema.parse(await res.json());
|
|
41
42
|
}
|
|
42
43
|
async resetPtzCalibration(options) {
|
|
43
44
|
const agent = this.getClient(options?.proxyParams);
|
package/cjs/VapixAPI.js
CHANGED
|
@@ -93,7 +93,9 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
93
93
|
};
|
|
94
94
|
await this._postJsonEncoded('/axis-cgi/opticscontrol.cgi', data, undefined, options);
|
|
95
95
|
}
|
|
96
|
-
catch {
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.warn('Failed to perform autofocus: ', error instanceof Error ? error.message : String(error));
|
|
98
|
+
console.warn('Falling back to deprecated optics setup API');
|
|
97
99
|
await this._postUrlEncoded('/axis-cgi/opticssetup.cgi', {
|
|
98
100
|
autofocus: 'perform',
|
|
99
101
|
source: '1',
|
|
@@ -144,7 +146,7 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
144
146
|
return data.data.activeTimeZone;
|
|
145
147
|
}
|
|
146
148
|
catch (error) {
|
|
147
|
-
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message :
|
|
149
|
+
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message : String(error));
|
|
148
150
|
console.warn('Falling back to deprecated time API v1');
|
|
149
151
|
}
|
|
150
152
|
try {
|
package/cjs/errors/errors.js
CHANGED
|
@@ -26,7 +26,7 @@ class ServiceNotFoundError extends Error {
|
|
|
26
26
|
exports.ServiceNotFoundError = ServiceNotFoundError;
|
|
27
27
|
class ParsingBlobError extends Error {
|
|
28
28
|
constructor(err) {
|
|
29
|
-
super('Error parsing response as Blob: ' + err);
|
|
29
|
+
super('Error parsing response as Blob: ' + String(err));
|
|
30
30
|
this.name = 'ParsingBlobError';
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -99,7 +99,7 @@ class NoDeviceInfoError extends Error {
|
|
|
99
99
|
exports.NoDeviceInfoError = NoDeviceInfoError;
|
|
100
100
|
class FetchDeviceInfoError extends Error {
|
|
101
101
|
constructor(err) {
|
|
102
|
-
super('Error fetching remote camera data: ' + err);
|
|
102
|
+
super('Error fetching remote camera data: ' + String(err));
|
|
103
103
|
this.name = 'NoDeviceInfoFromCameraError';
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -127,7 +127,7 @@ class PtzNotSupportedError extends Error {
|
|
|
127
127
|
exports.PtzNotSupportedError = PtzNotSupportedError;
|
|
128
128
|
class StorageDataFetchError extends Error {
|
|
129
129
|
constructor(err) {
|
|
130
|
-
super('Error fetching storage data: ' + err);
|
|
130
|
+
super('Error fetching storage data: ' + String(err));
|
|
131
131
|
this.name = 'StorageDataFetchError';
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -155,7 +155,7 @@ class TimezoneNotSetupError extends Error {
|
|
|
155
155
|
exports.TimezoneNotSetupError = TimezoneNotSetupError;
|
|
156
156
|
class TimezoneFetchError extends Error {
|
|
157
157
|
constructor(err) {
|
|
158
|
-
super('Error fetching time zone information: ' + err);
|
|
158
|
+
super('Error fetching time zone information: ' + String(err));
|
|
159
159
|
this.name = 'TimezoneFetchError';
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -25,21 +25,21 @@ export declare const outputInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
|
25
25
|
ws: z.ZodString;
|
|
26
26
|
ws_initial_message: z.ZodString;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
rtsp_url: string;
|
|
29
28
|
ws: string;
|
|
30
29
|
ws_initial_message: string;
|
|
31
|
-
}, {
|
|
32
30
|
rtsp_url: string;
|
|
31
|
+
}, {
|
|
33
32
|
ws: string;
|
|
34
33
|
ws_initial_message: string;
|
|
34
|
+
rtsp_url: string;
|
|
35
35
|
}>, {
|
|
36
|
-
rtspUrl: string;
|
|
37
36
|
ws: string;
|
|
38
37
|
wsInitialMessage: string;
|
|
38
|
+
rtspUrl: string;
|
|
39
39
|
}, {
|
|
40
|
-
rtsp_url: string;
|
|
41
40
|
ws: string;
|
|
42
41
|
ws_initial_message: string;
|
|
42
|
+
rtsp_url: string;
|
|
43
43
|
}>;
|
|
44
44
|
export type TOutputInfo = z.infer<typeof outputInfoSchema>;
|
|
45
45
|
export declare const audioPushInfoSchema: z.ZodEffects<z.ZodObject<{
|