camstreamerlib 4.0.34-be26059 → 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 +4 -1
- 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 +18 -13
- package/cjs/types/PlaneTrackerAPI.js +14 -9
- package/cjs/types/PlaneTrackerAPI.test.js +27 -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 +13 -8
- package/esm/types/PlaneTrackerAPI.test.js +27 -0
- package/esm/types/common.js +5 -0
- package/package.json +9 -12
- package/types/CamOverlayAPI.d.ts +6 -0
- package/types/CamSwitcherAPI.d.ts +1 -1
- package/types/PlaneTrackerAPI.d.ts +4 -1
- package/types/types/CamSwitcherAPI.d.ts +4 -4
- package/types/types/PlaneTrackerAPI.d.ts +18 -13
- 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>;
|
|
@@ -87,6 +87,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
87
87
|
widget: {
|
|
88
88
|
enabled: boolean;
|
|
89
89
|
scale: number;
|
|
90
|
+
units: "rotate" | "metric" | "imperial";
|
|
90
91
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
91
92
|
posX: number;
|
|
92
93
|
posY: number;
|
|
@@ -100,6 +101,8 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
100
101
|
posY: number;
|
|
101
102
|
showWeather: boolean;
|
|
102
103
|
weatherLocationKey: string;
|
|
104
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
105
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
103
106
|
};
|
|
104
107
|
fr24FlightInfoSource: {
|
|
105
108
|
enabled: boolean;
|
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<{
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export type TImportDataType = 'MAP_DATA' | 'SERVER_DATA' | 'ALL';
|
|
3
3
|
export type TExportDataType = 'NIGHT_SKY_CALIBRATION_DATA' | 'ALL';
|
|
4
|
-
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
5
|
-
alias: z.ZodString;
|
|
6
|
-
ws: z.ZodString;
|
|
7
|
-
ws_initial_message: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
ws: string;
|
|
10
|
-
ws_initial_message: string;
|
|
11
|
-
alias: string;
|
|
12
|
-
}, {
|
|
13
|
-
ws: string;
|
|
14
|
-
ws_initial_message: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
}>;
|
|
17
4
|
export declare const connectionSchema: z.ZodObject<{
|
|
18
5
|
protocol: z.ZodUnion<[z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodLiteral<"https_insecure">]>;
|
|
19
6
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
@@ -67,6 +54,8 @@ export declare const widgetSchema: z.ZodObject<{
|
|
|
67
54
|
posY: number;
|
|
68
55
|
enabled?: boolean | undefined;
|
|
69
56
|
}>;
|
|
57
|
+
declare const widgetUnitsSchema: z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>;
|
|
58
|
+
export type TWidgetUnits = z.infer<typeof widgetUnitsSchema>;
|
|
70
59
|
declare const labelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"registration">, z.ZodLiteral<"call_sign">, z.ZodLiteral<"flight_number">, z.ZodLiteral<"icao">]>;
|
|
71
60
|
export type TLabelOption = z.infer<typeof labelOptionsSchema>;
|
|
72
61
|
declare const droneLabelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"remote_id">]>;
|
|
@@ -326,9 +315,12 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
326
315
|
posX: z.ZodNumber;
|
|
327
316
|
posY: z.ZodNumber;
|
|
328
317
|
scale: z.ZodNumber;
|
|
318
|
+
} & {
|
|
319
|
+
units: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
329
320
|
}, "strip", z.ZodTypeAny, {
|
|
330
321
|
enabled: boolean;
|
|
331
322
|
scale: number;
|
|
323
|
+
units: "rotate" | "metric" | "imperial";
|
|
332
324
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
333
325
|
posX: number;
|
|
334
326
|
posY: number;
|
|
@@ -338,6 +330,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
338
330
|
posX: number;
|
|
339
331
|
posY: number;
|
|
340
332
|
enabled?: boolean | undefined;
|
|
333
|
+
units?: "rotate" | "metric" | "imperial" | undefined;
|
|
341
334
|
}>>;
|
|
342
335
|
airportWidget: z.ZodDefault<z.ZodObject<{
|
|
343
336
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -349,6 +342,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
349
342
|
showWeather: z.ZodDefault<z.ZodBoolean>;
|
|
350
343
|
weatherLocationKey: z.ZodDefault<z.ZodString>;
|
|
351
344
|
weatherLocationName: z.ZodDefault<z.ZodString>;
|
|
345
|
+
windSpeedUnits: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
346
|
+
temperatureUnits: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
352
347
|
}, "strip", z.ZodTypeAny, {
|
|
353
348
|
enabled: boolean;
|
|
354
349
|
scale: number;
|
|
@@ -358,6 +353,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
358
353
|
posY: number;
|
|
359
354
|
showWeather: boolean;
|
|
360
355
|
weatherLocationKey: string;
|
|
356
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
357
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
361
358
|
}, {
|
|
362
359
|
scale: number;
|
|
363
360
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
@@ -367,6 +364,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
367
364
|
weatherLocationName?: string | undefined;
|
|
368
365
|
showWeather?: boolean | undefined;
|
|
369
366
|
weatherLocationKey?: string | undefined;
|
|
367
|
+
windSpeedUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
368
|
+
temperatureUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
370
369
|
}>>;
|
|
371
370
|
fr24FlightInfoSource: z.ZodDefault<z.ZodObject<{
|
|
372
371
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -627,6 +626,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
627
626
|
widget: {
|
|
628
627
|
enabled: boolean;
|
|
629
628
|
scale: number;
|
|
629
|
+
units: "rotate" | "metric" | "imperial";
|
|
630
630
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
631
631
|
posX: number;
|
|
632
632
|
posY: number;
|
|
@@ -640,6 +640,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
640
640
|
posY: number;
|
|
641
641
|
showWeather: boolean;
|
|
642
642
|
weatherLocationKey: string;
|
|
643
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
644
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
643
645
|
};
|
|
644
646
|
fr24FlightInfoSource: {
|
|
645
647
|
enabled: boolean;
|
|
@@ -815,6 +817,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
815
817
|
posX: number;
|
|
816
818
|
posY: number;
|
|
817
819
|
enabled?: boolean | undefined;
|
|
820
|
+
units?: "rotate" | "metric" | "imperial" | undefined;
|
|
818
821
|
} | undefined;
|
|
819
822
|
airportWidget?: {
|
|
820
823
|
scale: number;
|
|
@@ -825,6 +828,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
825
828
|
weatherLocationName?: string | undefined;
|
|
826
829
|
showWeather?: boolean | undefined;
|
|
827
830
|
weatherLocationKey?: string | undefined;
|
|
831
|
+
windSpeedUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
832
|
+
temperatureUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
828
833
|
} | undefined;
|
|
829
834
|
fr24FlightInfoSource?: {
|
|
830
835
|
enabled?: boolean | undefined;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainListSchema = exports.zonesSchema = exports.zonePerimeterSchema = exports.domainIdSchema = exports.mapInfoSchema = exports.mapTypeSchema = exports.friendlyListSchema = exports.priorityListSchema = exports.blackListSchema = exports.whiteListSchema = exports.priorityListEntrySchema = exports.listEntrySchema = exports.listEntryIdTypeSchema = exports.listEntryDomainSchema = exports.flightInfoSchema = exports.trackingModeSchema = exports.getIcaoSchema = exports.serverSettingsSchema = exports.cameraSettingsSchema = exports.widgetSchema = exports.milestoneCameraListSchema = exports.connectionSchema =
|
|
3
|
+
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainListSchema = exports.zonesSchema = exports.zonePerimeterSchema = exports.domainIdSchema = exports.mapInfoSchema = exports.mapTypeSchema = exports.friendlyListSchema = exports.priorityListSchema = exports.blackListSchema = exports.whiteListSchema = exports.priorityListEntrySchema = exports.listEntrySchema = exports.listEntryIdTypeSchema = exports.listEntryDomainSchema = exports.flightInfoSchema = exports.trackingModeSchema = exports.getIcaoSchema = exports.serverSettingsSchema = exports.cameraSettingsSchema = exports.widgetSchema = exports.milestoneCameraListSchema = exports.connectionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.wsAliasResponseSchema = zod_1.z.object({
|
|
6
|
-
alias: zod_1.z.string(),
|
|
7
|
-
ws: zod_1.z.string(),
|
|
8
|
-
ws_initial_message: zod_1.z.string(),
|
|
9
|
-
});
|
|
10
5
|
exports.connectionSchema = zod_1.z.object({
|
|
11
6
|
protocol: zod_1.z.union([zod_1.z.literal('http'), zod_1.z.literal('https'), zod_1.z.literal('https_insecure')]),
|
|
12
7
|
ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
|
|
@@ -33,6 +28,7 @@ exports.widgetSchema = zod_1.z.object({
|
|
|
33
28
|
posY: zod_1.z.number().nonnegative(),
|
|
34
29
|
scale: zod_1.z.number().positive(),
|
|
35
30
|
});
|
|
31
|
+
const widgetUnitsSchema = zod_1.z.union([zod_1.z.literal('metric'), zod_1.z.literal('imperial'), zod_1.z.literal('rotate')]);
|
|
36
32
|
const labelOptionsSchema = zod_1.z.union([
|
|
37
33
|
zod_1.z.literal('blank'),
|
|
38
34
|
zod_1.z.literal('registration'),
|
|
@@ -45,12 +41,12 @@ const aircraftIdentificationLabelSchema = zod_1.z.object({
|
|
|
45
41
|
secondRow: labelOptionsSchema,
|
|
46
42
|
thirdRow: labelOptionsSchema,
|
|
47
43
|
fourthRow: labelOptionsSchema,
|
|
48
|
-
opacity: zod_1.z.number().
|
|
44
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
49
45
|
});
|
|
50
46
|
const droneLabelOptionsSchema = zod_1.z.union([zod_1.z.literal('blank'), zod_1.z.literal('remote_id')]);
|
|
51
47
|
const droneIdentificationLabelSchema = zod_1.z.object({
|
|
52
48
|
firstRow: droneLabelOptionsSchema,
|
|
53
|
-
opacity: zod_1.z.number().
|
|
49
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
54
50
|
});
|
|
55
51
|
const DEFAULT_DRONE_IDENTIFICATION_LABEL = {
|
|
56
52
|
firstRow: 'remote_id',
|
|
@@ -194,18 +190,25 @@ exports.cameraSettingsSchema = zod_1.z.object({
|
|
|
194
190
|
displaySystemInfo: zod_1.z.boolean().optional(),
|
|
195
191
|
})
|
|
196
192
|
.optional(),
|
|
197
|
-
widget: exports.widgetSchema
|
|
193
|
+
widget: exports.widgetSchema
|
|
194
|
+
.extend({
|
|
195
|
+
units: widgetUnitsSchema.default('rotate'),
|
|
196
|
+
})
|
|
197
|
+
.default({
|
|
198
198
|
enabled: true,
|
|
199
199
|
coord: 'top_right',
|
|
200
200
|
posX: 10,
|
|
201
201
|
posY: 10,
|
|
202
202
|
scale: 100,
|
|
203
|
+
units: 'rotate',
|
|
203
204
|
}),
|
|
204
205
|
airportWidget: exports.widgetSchema
|
|
205
206
|
.extend({
|
|
206
207
|
showWeather: zod_1.z.boolean().default(false),
|
|
207
208
|
weatherLocationKey: zod_1.z.string().default(''),
|
|
208
209
|
weatherLocationName: zod_1.z.string().default(''),
|
|
210
|
+
windSpeedUnits: widgetUnitsSchema.default('rotate'),
|
|
211
|
+
temperatureUnits: widgetUnitsSchema.default('rotate'),
|
|
209
212
|
})
|
|
210
213
|
.default({
|
|
211
214
|
enabled: true,
|
|
@@ -216,6 +219,8 @@ exports.cameraSettingsSchema = zod_1.z.object({
|
|
|
216
219
|
showWeather: false,
|
|
217
220
|
weatherLocationKey: '',
|
|
218
221
|
weatherLocationName: '',
|
|
222
|
+
windSpeedUnits: 'rotate',
|
|
223
|
+
temperatureUnits: 'rotate',
|
|
219
224
|
}),
|
|
220
225
|
fr24FlightInfoSource: zod_1.z
|
|
221
226
|
.object({
|
|
@@ -88,3 +88,30 @@ const DEFAULT_CAPTURE_CONFIG = { defaultCaptureSizeMeters: 120, captureSizeExten
|
|
|
88
88
|
(0, globals_1.expect)(PlaneTrackerAPI_1.cameraSettingsSchema.safeParse({ cameraConfig }).success).toBe(false);
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
|
+
(0, globals_1.describe)('cameraSettingsSchema widget units', () => {
|
|
92
|
+
const WIDGET = { coord: 'top_left', posX: 10, posY: 10, scale: 100 };
|
|
93
|
+
(0, globals_1.test)('defaults all widget units to rotate', () => {
|
|
94
|
+
const settings = PlaneTrackerAPI_1.cameraSettingsSchema.parse({});
|
|
95
|
+
(0, globals_1.expect)(settings.widget.units).toBe('rotate');
|
|
96
|
+
(0, globals_1.expect)(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
97
|
+
(0, globals_1.expect)(settings.airportWidget.temperatureUnits).toBe('rotate');
|
|
98
|
+
});
|
|
99
|
+
(0, globals_1.test)('defaults missing units of saved widgets to rotate', () => {
|
|
100
|
+
const settings = PlaneTrackerAPI_1.cameraSettingsSchema.parse({ widget: WIDGET, airportWidget: WIDGET });
|
|
101
|
+
(0, globals_1.expect)(settings.widget.units).toBe('rotate');
|
|
102
|
+
(0, globals_1.expect)(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
103
|
+
(0, globals_1.expect)(settings.airportWidget.temperatureUnits).toBe('rotate');
|
|
104
|
+
});
|
|
105
|
+
(0, globals_1.test)('parses independent widget units', () => {
|
|
106
|
+
const settings = PlaneTrackerAPI_1.cameraSettingsSchema.parse({
|
|
107
|
+
widget: { ...WIDGET, units: 'imperial' },
|
|
108
|
+
airportWidget: { ...WIDGET, windSpeedUnits: 'rotate', temperatureUnits: 'metric' },
|
|
109
|
+
});
|
|
110
|
+
(0, globals_1.expect)(settings.widget.units).toBe('imperial');
|
|
111
|
+
(0, globals_1.expect)(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
112
|
+
(0, globals_1.expect)(settings.airportWidget.temperatureUnits).toBe('metric');
|
|
113
|
+
});
|
|
114
|
+
(0, globals_1.test)('rejects an unknown widget unit', () => {
|
|
115
|
+
(0, globals_1.expect)(PlaneTrackerAPI_1.cameraSettingsSchema.safeParse({ widget: { ...WIDGET, units: 'kelvin' } }).success).toBe(false);
|
|
116
|
+
});
|
|
117
|
+
});
|
package/cjs/types/common.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export declare const keyboardShortcutSchema: z.ZodNullable<z.ZodString>;
|
|
|
26
26
|
export declare const keyboardShortcutsSchema: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
27
27
|
export type TKeyboardShortcut = z.infer<typeof keyboardShortcutSchema>;
|
|
28
28
|
export type TKeyboardShortcuts = z.infer<typeof keyboardShortcutsSchema>;
|
|
29
|
+
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
30
|
+
alias: z.ZodString;
|
|
31
|
+
ws: z.ZodString;
|
|
32
|
+
ws_initial_message: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
alias: string;
|
|
35
|
+
ws: string;
|
|
36
|
+
ws_initial_message: string;
|
|
37
|
+
}, {
|
|
38
|
+
alias: string;
|
|
39
|
+
ws: string;
|
|
40
|
+
ws_initial_message: string;
|
|
41
|
+
}>;
|
|
29
42
|
export type TProxyTarget = {
|
|
30
43
|
ip: string;
|
|
31
44
|
mdnsName: string;
|
package/cjs/types/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fileSchema = exports.bitrateVapixParamsSchema = exports.bitrateModeSchema = exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.sdCardStorageTypeSchema = exports.flashStorageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = exports.booleanSchema = void 0;
|
|
3
|
+
exports.fileSchema = exports.bitrateVapixParamsSchema = exports.bitrateModeSchema = exports.wsAliasResponseSchema = exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.sdCardStorageTypeSchema = exports.flashStorageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = exports.booleanSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.booleanSchema = zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]);
|
|
6
6
|
exports.audioChannelSchema = zod_1.z.union([zod_1.z.literal('mono'), zod_1.z.literal('stereo')]);
|
|
@@ -15,6 +15,11 @@ exports.networkCameraListSchema = zod_1.z.array(zod_1.z.object({
|
|
|
15
15
|
}));
|
|
16
16
|
exports.keyboardShortcutSchema = zod_1.z.string().nullable();
|
|
17
17
|
exports.keyboardShortcutsSchema = zod_1.z.record(exports.keyboardShortcutSchema);
|
|
18
|
+
exports.wsAliasResponseSchema = zod_1.z.object({
|
|
19
|
+
alias: zod_1.z.string(),
|
|
20
|
+
ws: zod_1.z.string(),
|
|
21
|
+
ws_initial_message: zod_1.z.string(),
|
|
22
|
+
});
|
|
18
23
|
exports.bitrateModeSchema = zod_1.z.union([zod_1.z.literal('VBR'), zod_1.z.literal('MBR'), zod_1.z.literal('ABR')]);
|
|
19
24
|
exports.bitrateVapixParamsSchema = zod_1.z.object({
|
|
20
25
|
bitrateMode: exports.bitrateModeSchema,
|
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorWithResponse, ServiceNotFoundError, StorageDataFetchError } from './errors/errors';
|
|
2
|
-
import { networkCameraListSchema } from './types/common';
|
|
2
|
+
import { networkCameraListSchema, wsAliasResponseSchema } from './types/common';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { ImageType, serviceListSchema, servicesSchema, wsResponseSchema, getStorageDataListSchema, getFileListSchema, } from './types/CamOverlayAPI';
|
|
5
5
|
import { BasicAPI } from './internal/BasicAPI';
|
|
@@ -26,6 +26,22 @@ export class CamOverlayAPI extends BasicAPI {
|
|
|
26
26
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
27
27
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
28
28
|
}
|
|
29
|
+
async isViewerPassValid(pass, options) {
|
|
30
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
31
|
+
if (res.status !== 200) {
|
|
32
|
+
throw new Error(res.message);
|
|
33
|
+
}
|
|
34
|
+
return res.data === '1';
|
|
35
|
+
}
|
|
36
|
+
async getLiveViewAlias(rtspUrl, options) {
|
|
37
|
+
const agent = this.getClient(options?.proxyParams);
|
|
38
|
+
const res = await agent.get({
|
|
39
|
+
path: `${BASE_PATH}/getLiveViewAlias.cgi`,
|
|
40
|
+
parameters: { rtsp_url: rtspUrl },
|
|
41
|
+
timeout: options?.timeout,
|
|
42
|
+
});
|
|
43
|
+
return wsAliasResponseSchema.parse(await res.json());
|
|
44
|
+
}
|
|
29
45
|
async listFiles(fileType, options) {
|
|
30
46
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
31
47
|
return getFileListSchema(fileType).parse(res.list);
|
package/esm/PlaneTrackerAPI.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { blackListSchema, cameraSettingsSchema, domainListSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, milestoneCameraListSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, whiteListSchema,
|
|
2
|
+
import { blackListSchema, cameraSettingsSchema, domainListSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, milestoneCameraListSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, whiteListSchema, zonesSchema, } from './types/PlaneTrackerAPI';
|
|
3
3
|
import { CannotSetCoordsInAutoModeError, ImportSettingsError, InvalidAltitudeError, InvalidLatLngError, ResetCalibrationError, ServerError, BadRequestError, } from './errors/errors';
|
|
4
|
+
import { wsAliasResponseSchema } from './types/common';
|
|
4
5
|
import { BasicAPI } from './internal/BasicAPI';
|
|
5
6
|
import { apiUserInputSchema } from './types/ws/PlaneTrackerEvents';
|
|
6
7
|
const BASE_PATH = '/local/planetracker';
|
package/esm/VapixAPI.js
CHANGED
|
@@ -90,7 +90,9 @@ export class VapixAPI extends BasicAPI {
|
|
|
90
90
|
};
|
|
91
91
|
await this._postJsonEncoded('/axis-cgi/opticscontrol.cgi', data, undefined, options);
|
|
92
92
|
}
|
|
93
|
-
catch {
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.warn('Failed to perform autofocus: ', error instanceof Error ? error.message : String(error));
|
|
95
|
+
console.warn('Falling back to deprecated optics setup API');
|
|
94
96
|
await this._postUrlEncoded('/axis-cgi/opticssetup.cgi', {
|
|
95
97
|
autofocus: 'perform',
|
|
96
98
|
source: '1',
|
|
@@ -141,7 +143,7 @@ export class VapixAPI extends BasicAPI {
|
|
|
141
143
|
return data.data.activeTimeZone;
|
|
142
144
|
}
|
|
143
145
|
catch (error) {
|
|
144
|
-
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message :
|
|
146
|
+
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message : String(error));
|
|
145
147
|
console.warn('Falling back to deprecated time API v1');
|
|
146
148
|
}
|
|
147
149
|
try {
|
package/esm/errors/errors.js
CHANGED
|
@@ -20,7 +20,7 @@ export class ServiceNotFoundError extends Error {
|
|
|
20
20
|
}
|
|
21
21
|
export class ParsingBlobError extends Error {
|
|
22
22
|
constructor(err) {
|
|
23
|
-
super('Error parsing response as Blob: ' + err);
|
|
23
|
+
super('Error parsing response as Blob: ' + String(err));
|
|
24
24
|
this.name = 'ParsingBlobError';
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -84,7 +84,7 @@ export class NoDeviceInfoError extends Error {
|
|
|
84
84
|
}
|
|
85
85
|
export class FetchDeviceInfoError extends Error {
|
|
86
86
|
constructor(err) {
|
|
87
|
-
super('Error fetching remote camera data: ' + err);
|
|
87
|
+
super('Error fetching remote camera data: ' + String(err));
|
|
88
88
|
this.name = 'NoDeviceInfoFromCameraError';
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -108,7 +108,7 @@ export class PtzNotSupportedError extends Error {
|
|
|
108
108
|
}
|
|
109
109
|
export class StorageDataFetchError extends Error {
|
|
110
110
|
constructor(err) {
|
|
111
|
-
super('Error fetching storage data: ' + err);
|
|
111
|
+
super('Error fetching storage data: ' + String(err));
|
|
112
112
|
this.name = 'StorageDataFetchError';
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -132,7 +132,7 @@ export class TimezoneNotSetupError extends Error {
|
|
|
132
132
|
}
|
|
133
133
|
export class TimezoneFetchError extends Error {
|
|
134
134
|
constructor(err) {
|
|
135
|
-
super('Error fetching time zone information: ' + err);
|
|
135
|
+
super('Error fetching time zone information: ' + String(err));
|
|
136
136
|
this.name = 'TimezoneFetchError';
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const wsAliasResponseSchema = z.object({
|
|
3
|
-
alias: z.string(),
|
|
4
|
-
ws: z.string(),
|
|
5
|
-
ws_initial_message: z.string(),
|
|
6
|
-
});
|
|
7
2
|
export const connectionSchema = z.object({
|
|
8
3
|
protocol: z.union([z.literal('http'), z.literal('https'), z.literal('https_insecure')]),
|
|
9
4
|
ip: z.union([z.string().ip(), z.literal('')]),
|
|
@@ -30,6 +25,7 @@ export const widgetSchema = z.object({
|
|
|
30
25
|
posY: z.number().nonnegative(),
|
|
31
26
|
scale: z.number().positive(),
|
|
32
27
|
});
|
|
28
|
+
const widgetUnitsSchema = z.union([z.literal('metric'), z.literal('imperial'), z.literal('rotate')]);
|
|
33
29
|
const labelOptionsSchema = z.union([
|
|
34
30
|
z.literal('blank'),
|
|
35
31
|
z.literal('registration'),
|
|
@@ -42,12 +38,12 @@ const aircraftIdentificationLabelSchema = z.object({
|
|
|
42
38
|
secondRow: labelOptionsSchema,
|
|
43
39
|
thirdRow: labelOptionsSchema,
|
|
44
40
|
fourthRow: labelOptionsSchema,
|
|
45
|
-
opacity: z.number().
|
|
41
|
+
opacity: z.number().nonnegative(),
|
|
46
42
|
});
|
|
47
43
|
const droneLabelOptionsSchema = z.union([z.literal('blank'), z.literal('remote_id')]);
|
|
48
44
|
const droneIdentificationLabelSchema = z.object({
|
|
49
45
|
firstRow: droneLabelOptionsSchema,
|
|
50
|
-
opacity: z.number().
|
|
46
|
+
opacity: z.number().nonnegative(),
|
|
51
47
|
});
|
|
52
48
|
const DEFAULT_DRONE_IDENTIFICATION_LABEL = {
|
|
53
49
|
firstRow: 'remote_id',
|
|
@@ -191,18 +187,25 @@ export const cameraSettingsSchema = z.object({
|
|
|
191
187
|
displaySystemInfo: z.boolean().optional(),
|
|
192
188
|
})
|
|
193
189
|
.optional(),
|
|
194
|
-
widget: widgetSchema
|
|
190
|
+
widget: widgetSchema
|
|
191
|
+
.extend({
|
|
192
|
+
units: widgetUnitsSchema.default('rotate'),
|
|
193
|
+
})
|
|
194
|
+
.default({
|
|
195
195
|
enabled: true,
|
|
196
196
|
coord: 'top_right',
|
|
197
197
|
posX: 10,
|
|
198
198
|
posY: 10,
|
|
199
199
|
scale: 100,
|
|
200
|
+
units: 'rotate',
|
|
200
201
|
}),
|
|
201
202
|
airportWidget: widgetSchema
|
|
202
203
|
.extend({
|
|
203
204
|
showWeather: z.boolean().default(false),
|
|
204
205
|
weatherLocationKey: z.string().default(''),
|
|
205
206
|
weatherLocationName: z.string().default(''),
|
|
207
|
+
windSpeedUnits: widgetUnitsSchema.default('rotate'),
|
|
208
|
+
temperatureUnits: widgetUnitsSchema.default('rotate'),
|
|
206
209
|
})
|
|
207
210
|
.default({
|
|
208
211
|
enabled: true,
|
|
@@ -213,6 +216,8 @@ export const cameraSettingsSchema = z.object({
|
|
|
213
216
|
showWeather: false,
|
|
214
217
|
weatherLocationKey: '',
|
|
215
218
|
weatherLocationName: '',
|
|
219
|
+
windSpeedUnits: 'rotate',
|
|
220
|
+
temperatureUnits: 'rotate',
|
|
216
221
|
}),
|
|
217
222
|
fr24FlightInfoSource: z
|
|
218
223
|
.object({
|
|
@@ -86,3 +86,30 @@ describe('cameraSettingsSchema cameraConfig', () => {
|
|
|
86
86
|
expect(cameraSettingsSchema.safeParse({ cameraConfig }).success).toBe(false);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
+
describe('cameraSettingsSchema widget units', () => {
|
|
90
|
+
const WIDGET = { coord: 'top_left', posX: 10, posY: 10, scale: 100 };
|
|
91
|
+
test('defaults all widget units to rotate', () => {
|
|
92
|
+
const settings = cameraSettingsSchema.parse({});
|
|
93
|
+
expect(settings.widget.units).toBe('rotate');
|
|
94
|
+
expect(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
95
|
+
expect(settings.airportWidget.temperatureUnits).toBe('rotate');
|
|
96
|
+
});
|
|
97
|
+
test('defaults missing units of saved widgets to rotate', () => {
|
|
98
|
+
const settings = cameraSettingsSchema.parse({ widget: WIDGET, airportWidget: WIDGET });
|
|
99
|
+
expect(settings.widget.units).toBe('rotate');
|
|
100
|
+
expect(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
101
|
+
expect(settings.airportWidget.temperatureUnits).toBe('rotate');
|
|
102
|
+
});
|
|
103
|
+
test('parses independent widget units', () => {
|
|
104
|
+
const settings = cameraSettingsSchema.parse({
|
|
105
|
+
widget: { ...WIDGET, units: 'imperial' },
|
|
106
|
+
airportWidget: { ...WIDGET, windSpeedUnits: 'rotate', temperatureUnits: 'metric' },
|
|
107
|
+
});
|
|
108
|
+
expect(settings.widget.units).toBe('imperial');
|
|
109
|
+
expect(settings.airportWidget.windSpeedUnits).toBe('rotate');
|
|
110
|
+
expect(settings.airportWidget.temperatureUnits).toBe('metric');
|
|
111
|
+
});
|
|
112
|
+
test('rejects an unknown widget unit', () => {
|
|
113
|
+
expect(cameraSettingsSchema.safeParse({ widget: { ...WIDGET, units: 'kelvin' } }).success).toBe(false);
|
|
114
|
+
});
|
|
115
|
+
});
|
package/esm/types/common.js
CHANGED
|
@@ -12,6 +12,11 @@ export const networkCameraListSchema = z.array(z.object({
|
|
|
12
12
|
}));
|
|
13
13
|
export const keyboardShortcutSchema = z.string().nullable();
|
|
14
14
|
export const keyboardShortcutsSchema = z.record(keyboardShortcutSchema);
|
|
15
|
+
export const wsAliasResponseSchema = z.object({
|
|
16
|
+
alias: z.string(),
|
|
17
|
+
ws: z.string(),
|
|
18
|
+
ws_initial_message: z.string(),
|
|
19
|
+
});
|
|
15
20
|
export const bitrateModeSchema = z.union([z.literal('VBR'), z.literal('MBR'), z.literal('ABR')]);
|
|
16
21
|
export const bitrateVapixParamsSchema = z.object({
|
|
17
22
|
bitrateMode: bitrateModeSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camstreamerlib",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.35-9984935",
|
|
4
4
|
"description": "Helper library for CamStreamer ACAP applications.",
|
|
5
5
|
"prettier": "@camstreamer/prettier-config",
|
|
6
6
|
"engine": {
|
|
@@ -16,34 +16,31 @@
|
|
|
16
16
|
"zod": "^3.25.76"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@camstreamer/eslint-config": "^1.0.
|
|
19
|
+
"@camstreamer/eslint-config": "^1.0.10",
|
|
20
20
|
"@camstreamer/prettier-config": "^2.0.4",
|
|
21
|
+
"@eslint/js": "^10.0.1",
|
|
21
22
|
"@types/adm-zip": "^0.5.5",
|
|
22
23
|
"@types/jest": "^30.0.0",
|
|
23
24
|
"@types/node": "^18.19.127",
|
|
24
25
|
"@types/ws": "^8.5.10",
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
|
26
|
-
"@typescript-eslint/parser": "^8.71.1",
|
|
27
26
|
"esbuild": "^0.28.2",
|
|
28
|
-
"eslint": "^
|
|
29
|
-
"eslint-plugin-deprecation": "^2.0.0",
|
|
27
|
+
"eslint": "^10.12.0",
|
|
30
28
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
29
|
+
"globals": "^17.13.0",
|
|
31
30
|
"jest": "^30.5.2",
|
|
32
31
|
"npm-run-all": "^4.1.5",
|
|
33
32
|
"prettier": "^2.7.1",
|
|
34
33
|
"ts-jest": "^29.4.14",
|
|
35
34
|
"ts-node": "^10.7.0",
|
|
36
|
-
"typescript": "5.3.3"
|
|
35
|
+
"typescript": "5.3.3",
|
|
36
|
+
"typescript-eslint": "^8.71.2"
|
|
37
37
|
},
|
|
38
38
|
"overrides": {
|
|
39
39
|
"js-yaml": "^4.3.2",
|
|
40
|
-
"browserslist": "^4.28.7"
|
|
41
|
-
"eslint-plugin-deprecation": {
|
|
42
|
-
"@typescript-eslint/utils": "^8.71.1"
|
|
43
|
-
}
|
|
40
|
+
"browserslist": "^4.28.7"
|
|
44
41
|
},
|
|
45
42
|
"scripts": {
|
|
46
|
-
"clean": "
|
|
43
|
+
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
47
44
|
"build": "npm-run-all clean build:cjs build:esm copyPackage",
|
|
48
45
|
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
49
46
|
"build:esm": "tsc --project tsconfig.esm.json",
|
package/types/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>;
|
|
@@ -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;
|
|
@@ -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>;
|
|
@@ -87,6 +87,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
87
87
|
widget: {
|
|
88
88
|
enabled: boolean;
|
|
89
89
|
scale: number;
|
|
90
|
+
units: "rotate" | "metric" | "imperial";
|
|
90
91
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
91
92
|
posX: number;
|
|
92
93
|
posY: number;
|
|
@@ -100,6 +101,8 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
100
101
|
posY: number;
|
|
101
102
|
showWeather: boolean;
|
|
102
103
|
weatherLocationKey: string;
|
|
104
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
105
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
103
106
|
};
|
|
104
107
|
fr24FlightInfoSource: {
|
|
105
108
|
enabled: boolean;
|
|
@@ -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<{
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export type TImportDataType = 'MAP_DATA' | 'SERVER_DATA' | 'ALL';
|
|
3
3
|
export type TExportDataType = 'NIGHT_SKY_CALIBRATION_DATA' | 'ALL';
|
|
4
|
-
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
5
|
-
alias: z.ZodString;
|
|
6
|
-
ws: z.ZodString;
|
|
7
|
-
ws_initial_message: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
ws: string;
|
|
10
|
-
ws_initial_message: string;
|
|
11
|
-
alias: string;
|
|
12
|
-
}, {
|
|
13
|
-
ws: string;
|
|
14
|
-
ws_initial_message: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
}>;
|
|
17
4
|
export declare const connectionSchema: z.ZodObject<{
|
|
18
5
|
protocol: z.ZodUnion<[z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodLiteral<"https_insecure">]>;
|
|
19
6
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
@@ -67,6 +54,8 @@ export declare const widgetSchema: z.ZodObject<{
|
|
|
67
54
|
posY: number;
|
|
68
55
|
enabled?: boolean | undefined;
|
|
69
56
|
}>;
|
|
57
|
+
declare const widgetUnitsSchema: z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>;
|
|
58
|
+
export type TWidgetUnits = z.infer<typeof widgetUnitsSchema>;
|
|
70
59
|
declare const labelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"registration">, z.ZodLiteral<"call_sign">, z.ZodLiteral<"flight_number">, z.ZodLiteral<"icao">]>;
|
|
71
60
|
export type TLabelOption = z.infer<typeof labelOptionsSchema>;
|
|
72
61
|
declare const droneLabelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"remote_id">]>;
|
|
@@ -326,9 +315,12 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
326
315
|
posX: z.ZodNumber;
|
|
327
316
|
posY: z.ZodNumber;
|
|
328
317
|
scale: z.ZodNumber;
|
|
318
|
+
} & {
|
|
319
|
+
units: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
329
320
|
}, "strip", z.ZodTypeAny, {
|
|
330
321
|
enabled: boolean;
|
|
331
322
|
scale: number;
|
|
323
|
+
units: "rotate" | "metric" | "imperial";
|
|
332
324
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
333
325
|
posX: number;
|
|
334
326
|
posY: number;
|
|
@@ -338,6 +330,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
338
330
|
posX: number;
|
|
339
331
|
posY: number;
|
|
340
332
|
enabled?: boolean | undefined;
|
|
333
|
+
units?: "rotate" | "metric" | "imperial" | undefined;
|
|
341
334
|
}>>;
|
|
342
335
|
airportWidget: z.ZodDefault<z.ZodObject<{
|
|
343
336
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -349,6 +342,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
349
342
|
showWeather: z.ZodDefault<z.ZodBoolean>;
|
|
350
343
|
weatherLocationKey: z.ZodDefault<z.ZodString>;
|
|
351
344
|
weatherLocationName: z.ZodDefault<z.ZodString>;
|
|
345
|
+
windSpeedUnits: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
346
|
+
temperatureUnits: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">, z.ZodLiteral<"rotate">]>>;
|
|
352
347
|
}, "strip", z.ZodTypeAny, {
|
|
353
348
|
enabled: boolean;
|
|
354
349
|
scale: number;
|
|
@@ -358,6 +353,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
358
353
|
posY: number;
|
|
359
354
|
showWeather: boolean;
|
|
360
355
|
weatherLocationKey: string;
|
|
356
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
357
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
361
358
|
}, {
|
|
362
359
|
scale: number;
|
|
363
360
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
@@ -367,6 +364,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
367
364
|
weatherLocationName?: string | undefined;
|
|
368
365
|
showWeather?: boolean | undefined;
|
|
369
366
|
weatherLocationKey?: string | undefined;
|
|
367
|
+
windSpeedUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
368
|
+
temperatureUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
370
369
|
}>>;
|
|
371
370
|
fr24FlightInfoSource: z.ZodDefault<z.ZodObject<{
|
|
372
371
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -627,6 +626,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
627
626
|
widget: {
|
|
628
627
|
enabled: boolean;
|
|
629
628
|
scale: number;
|
|
629
|
+
units: "rotate" | "metric" | "imperial";
|
|
630
630
|
coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
|
|
631
631
|
posX: number;
|
|
632
632
|
posY: number;
|
|
@@ -640,6 +640,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
640
640
|
posY: number;
|
|
641
641
|
showWeather: boolean;
|
|
642
642
|
weatherLocationKey: string;
|
|
643
|
+
windSpeedUnits: "rotate" | "metric" | "imperial";
|
|
644
|
+
temperatureUnits: "rotate" | "metric" | "imperial";
|
|
643
645
|
};
|
|
644
646
|
fr24FlightInfoSource: {
|
|
645
647
|
enabled: boolean;
|
|
@@ -815,6 +817,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
815
817
|
posX: number;
|
|
816
818
|
posY: number;
|
|
817
819
|
enabled?: boolean | undefined;
|
|
820
|
+
units?: "rotate" | "metric" | "imperial" | undefined;
|
|
818
821
|
} | undefined;
|
|
819
822
|
airportWidget?: {
|
|
820
823
|
scale: number;
|
|
@@ -825,6 +828,8 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
825
828
|
weatherLocationName?: string | undefined;
|
|
826
829
|
showWeather?: boolean | undefined;
|
|
827
830
|
weatherLocationKey?: string | undefined;
|
|
831
|
+
windSpeedUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
832
|
+
temperatureUnits?: "rotate" | "metric" | "imperial" | undefined;
|
|
828
833
|
} | undefined;
|
|
829
834
|
fr24FlightInfoSource?: {
|
|
830
835
|
enabled?: boolean | undefined;
|
package/types/types/common.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export declare const keyboardShortcutSchema: z.ZodNullable<z.ZodString>;
|
|
|
26
26
|
export declare const keyboardShortcutsSchema: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
27
27
|
export type TKeyboardShortcut = z.infer<typeof keyboardShortcutSchema>;
|
|
28
28
|
export type TKeyboardShortcuts = z.infer<typeof keyboardShortcutsSchema>;
|
|
29
|
+
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
30
|
+
alias: z.ZodString;
|
|
31
|
+
ws: z.ZodString;
|
|
32
|
+
ws_initial_message: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
alias: string;
|
|
35
|
+
ws: string;
|
|
36
|
+
ws_initial_message: string;
|
|
37
|
+
}, {
|
|
38
|
+
alias: string;
|
|
39
|
+
ws: string;
|
|
40
|
+
ws_initial_message: string;
|
|
41
|
+
}>;
|
|
29
42
|
export type TProxyTarget = {
|
|
30
43
|
ip: string;
|
|
31
44
|
mdnsName: string;
|