camstreamerlib 4.0.34 → 4.0.35-38dd1fb
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 +2 -1
- package/cjs/CamSwitcherAPI.js +2 -0
- package/cjs/PlaneTrackerAPI.d.ts +43 -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 +7 -4
- package/cjs/types/CamSwitcherAPI.js +1 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +205 -39
- package/cjs/types/PlaneTrackerAPI.js +61 -22
- package/cjs/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/cjs/types/PlaneTrackerAPI.test.js +90 -0
- package/cjs/types/common.d.ts +13 -0
- package/cjs/types/common.js +6 -1
- package/esm/CamOverlayAPI.js +17 -1
- package/esm/CamSwitcherAPI.js +2 -0
- package/esm/PlaneTrackerAPI.js +2 -1
- package/esm/VapixAPI.js +4 -2
- package/esm/errors/errors.js +4 -4
- package/esm/types/CamSwitcherAPI.js +1 -0
- package/esm/types/PlaneTrackerAPI.js +60 -21
- package/esm/types/PlaneTrackerAPI.test.js +88 -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 +2 -1
- package/types/PlaneTrackerAPI.d.ts +43 -10
- package/types/types/CamSwitcherAPI.d.ts +7 -4
- package/types/types/PlaneTrackerAPI.d.ts +205 -39
- package/types/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/types/types/common.d.ts +13 -0
package/esm/CamSwitcherAPI.js
CHANGED
|
@@ -153,6 +153,7 @@ export class CamSwitcherAPI extends BasicAPI {
|
|
|
153
153
|
audio: {
|
|
154
154
|
sampleRate: data.audioSampleRate,
|
|
155
155
|
channelCount: data.audioChannelCount,
|
|
156
|
+
bitrate: data.audioBitrate,
|
|
156
157
|
},
|
|
157
158
|
keyboard: data.keyboard,
|
|
158
159
|
};
|
|
@@ -204,6 +205,7 @@ export class CamSwitcherAPI extends BasicAPI {
|
|
|
204
205
|
const settings = {
|
|
205
206
|
audioSampleRate: saveData.audio?.sampleRate,
|
|
206
207
|
audioChannelCount: saveData.audio?.channelCount,
|
|
208
|
+
audioBitrate: saveData.audio?.bitrate,
|
|
207
209
|
keyboard: saveData.keyboard,
|
|
208
210
|
fps: saveData.video.fps,
|
|
209
211
|
resolution: saveData.video.resolution,
|
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
|
}
|
|
@@ -142,6 +142,7 @@ export const cameraOptionsSchema = bitrateVapixParamsSchema
|
|
|
142
142
|
bitrateVapixParams: z.string().nullable(),
|
|
143
143
|
audioSampleRate: z.number(),
|
|
144
144
|
audioChannelCount: audioChannelCountSchema,
|
|
145
|
+
audioBitrate: z.number().int().nonnegative(),
|
|
145
146
|
keyboard: z.object({
|
|
146
147
|
fromSource: keyboardShortcutSchema,
|
|
147
148
|
none: keyboardShortcutSchema,
|
|
@@ -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('')]),
|
|
@@ -37,13 +32,59 @@ const labelOptionsSchema = z.union([
|
|
|
37
32
|
z.literal('flight_number'),
|
|
38
33
|
z.literal('icao'),
|
|
39
34
|
]);
|
|
40
|
-
const
|
|
35
|
+
const aircraftIdentificationLabelSchema = z.object({
|
|
41
36
|
firstRow: labelOptionsSchema,
|
|
42
37
|
secondRow: labelOptionsSchema,
|
|
43
38
|
thirdRow: labelOptionsSchema,
|
|
44
39
|
fourthRow: labelOptionsSchema,
|
|
45
|
-
opacity: z.number().
|
|
40
|
+
opacity: z.number().nonnegative(),
|
|
41
|
+
});
|
|
42
|
+
const droneLabelOptionsSchema = z.union([z.literal('blank'), z.literal('remote_id')]);
|
|
43
|
+
const droneIdentificationLabelSchema = z.object({
|
|
44
|
+
firstRow: droneLabelOptionsSchema,
|
|
45
|
+
opacity: z.number().nonnegative(),
|
|
46
|
+
});
|
|
47
|
+
const DEFAULT_DRONE_IDENTIFICATION_LABEL = {
|
|
48
|
+
firstRow: 'remote_id',
|
|
49
|
+
opacity: 30,
|
|
50
|
+
};
|
|
51
|
+
const identificationLabelSchema = z.union([
|
|
52
|
+
z.object({
|
|
53
|
+
aircraft: aircraftIdentificationLabelSchema,
|
|
54
|
+
drone: droneIdentificationLabelSchema.default(DEFAULT_DRONE_IDENTIFICATION_LABEL),
|
|
55
|
+
}),
|
|
56
|
+
aircraftIdentificationLabelSchema.transform((aircraft) => ({
|
|
57
|
+
aircraft,
|
|
58
|
+
drone: { ...DEFAULT_DRONE_IDENTIFICATION_LABEL },
|
|
59
|
+
})),
|
|
60
|
+
]);
|
|
61
|
+
const captureConfigSchema = z.object({
|
|
62
|
+
defaultCaptureSizeMeters: z.number().positive(),
|
|
63
|
+
captureSizeExtensionMeters: z.number().positive(),
|
|
46
64
|
});
|
|
65
|
+
const DEFAULT_CAPTURE_CONFIG = {
|
|
66
|
+
defaultCaptureSizeMeters: 120,
|
|
67
|
+
captureSizeExtensionMeters: 80,
|
|
68
|
+
};
|
|
69
|
+
const cameraConfigSchema = z.union([
|
|
70
|
+
z.object({
|
|
71
|
+
aircraft: captureConfigSchema,
|
|
72
|
+
drone: captureConfigSchema.default(() => ({ ...DEFAULT_CAPTURE_CONFIG })),
|
|
73
|
+
}),
|
|
74
|
+
z
|
|
75
|
+
.object({
|
|
76
|
+
defaultCaptureSizeMeters: z.number().positive().default(DEFAULT_CAPTURE_CONFIG.defaultCaptureSizeMeters),
|
|
77
|
+
captureSizeExtensionMeters: z
|
|
78
|
+
.number()
|
|
79
|
+
.positive()
|
|
80
|
+
.default(DEFAULT_CAPTURE_CONFIG.captureSizeExtensionMeters),
|
|
81
|
+
})
|
|
82
|
+
.strict()
|
|
83
|
+
.transform((captureConfig) => ({
|
|
84
|
+
aircraft: captureConfig,
|
|
85
|
+
drone: { ...captureConfig },
|
|
86
|
+
})),
|
|
87
|
+
]);
|
|
47
88
|
export const cameraSettingsSchema = z.object({
|
|
48
89
|
units: z.union([z.literal('metric'), z.literal('imperial')]).default('imperial'),
|
|
49
90
|
adsbSource: z
|
|
@@ -81,15 +122,10 @@ export const cameraSettingsSchema = z.object({
|
|
|
81
122
|
nightSkyCalibrationFocusValue: 9000,
|
|
82
123
|
focusCalibrationPoints: '',
|
|
83
124
|
}),
|
|
84
|
-
cameraConfig:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
89
|
-
.default({
|
|
90
|
-
defaultCaptureSizeMeters: 120,
|
|
91
|
-
captureSizeExtensionMeters: 80,
|
|
92
|
-
}),
|
|
125
|
+
cameraConfig: cameraConfigSchema.default(() => ({
|
|
126
|
+
aircraft: { ...DEFAULT_CAPTURE_CONFIG },
|
|
127
|
+
drone: { ...DEFAULT_CAPTURE_CONFIG },
|
|
128
|
+
})),
|
|
93
129
|
stream: z
|
|
94
130
|
.object({
|
|
95
131
|
width: z.number().positive(),
|
|
@@ -200,11 +236,14 @@ export const cameraSettingsSchema = z.object({
|
|
|
200
236
|
port: 80,
|
|
201
237
|
}),
|
|
202
238
|
identificationLabel: identificationLabelSchema.default({
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
239
|
+
aircraft: {
|
|
240
|
+
firstRow: 'icao',
|
|
241
|
+
secondRow: 'call_sign',
|
|
242
|
+
thirdRow: 'blank',
|
|
243
|
+
fourthRow: 'blank',
|
|
244
|
+
opacity: 30,
|
|
245
|
+
},
|
|
246
|
+
drone: DEFAULT_DRONE_IDENTIFICATION_LABEL,
|
|
208
247
|
}),
|
|
209
248
|
acs: connectionSchema
|
|
210
249
|
.extend({
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cameraSettingsSchema } from './PlaneTrackerAPI';
|
|
2
|
+
import { describe, test, expect } from '@jest/globals';
|
|
3
|
+
const AIRCRAFT_LABEL = {
|
|
4
|
+
firstRow: 'icao',
|
|
5
|
+
secondRow: 'call_sign',
|
|
6
|
+
thirdRow: 'blank',
|
|
7
|
+
fourthRow: 'registration',
|
|
8
|
+
opacity: 50,
|
|
9
|
+
};
|
|
10
|
+
const DEFAULT_DRONE_LABEL = { firstRow: 'remote_id', opacity: 30 };
|
|
11
|
+
describe('cameraSettingsSchema identificationLabel', () => {
|
|
12
|
+
test('defaults both aircraft and drone labels', () => {
|
|
13
|
+
expect(cameraSettingsSchema.parse({}).identificationLabel).toEqual({
|
|
14
|
+
aircraft: {
|
|
15
|
+
firstRow: 'icao',
|
|
16
|
+
secondRow: 'call_sign',
|
|
17
|
+
thirdRow: 'blank',
|
|
18
|
+
fourthRow: 'blank',
|
|
19
|
+
opacity: 30,
|
|
20
|
+
},
|
|
21
|
+
drone: DEFAULT_DRONE_LABEL,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
test('parses the aircraft and drone label', () => {
|
|
25
|
+
const identificationLabel = { aircraft: AIRCRAFT_LABEL, drone: { firstRow: 'blank', opacity: 70 } };
|
|
26
|
+
expect(cameraSettingsSchema.parse({ identificationLabel }).identificationLabel).toEqual(identificationLabel);
|
|
27
|
+
});
|
|
28
|
+
test('defaults a missing drone label', () => {
|
|
29
|
+
expect(cameraSettingsSchema.parse({ identificationLabel: { aircraft: AIRCRAFT_LABEL } }).identificationLabel).toEqual({ aircraft: AIRCRAFT_LABEL, drone: DEFAULT_DRONE_LABEL });
|
|
30
|
+
});
|
|
31
|
+
test('converts the legacy flat label to the aircraft label', () => {
|
|
32
|
+
expect(cameraSettingsSchema.parse({ identificationLabel: AIRCRAFT_LABEL }).identificationLabel).toEqual({
|
|
33
|
+
aircraft: AIRCRAFT_LABEL,
|
|
34
|
+
drone: DEFAULT_DRONE_LABEL,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
test('returns an independent drone label for each legacy parse', () => {
|
|
38
|
+
const first = cameraSettingsSchema.parse({ identificationLabel: AIRCRAFT_LABEL });
|
|
39
|
+
first.identificationLabel.drone.opacity = 90;
|
|
40
|
+
const second = cameraSettingsSchema.parse({ identificationLabel: AIRCRAFT_LABEL });
|
|
41
|
+
expect(second.identificationLabel.drone).toEqual(DEFAULT_DRONE_LABEL);
|
|
42
|
+
});
|
|
43
|
+
test('rejects an unknown drone label row', () => {
|
|
44
|
+
const identificationLabel = { aircraft: AIRCRAFT_LABEL, drone: { firstRow: 'icao', opacity: 30 } };
|
|
45
|
+
expect(cameraSettingsSchema.safeParse({ identificationLabel }).success).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
const CAPTURE_CONFIG = { defaultCaptureSizeMeters: 50, captureSizeExtensionMeters: 20 };
|
|
49
|
+
const DEFAULT_CAPTURE_CONFIG = { defaultCaptureSizeMeters: 120, captureSizeExtensionMeters: 80 };
|
|
50
|
+
describe('cameraSettingsSchema cameraConfig', () => {
|
|
51
|
+
test('defaults both aircraft and drone capture config', () => {
|
|
52
|
+
expect(cameraSettingsSchema.parse({}).cameraConfig).toEqual({
|
|
53
|
+
aircraft: DEFAULT_CAPTURE_CONFIG,
|
|
54
|
+
drone: DEFAULT_CAPTURE_CONFIG,
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
test('parses independent aircraft and drone capture config', () => {
|
|
58
|
+
const cameraConfig = {
|
|
59
|
+
aircraft: CAPTURE_CONFIG,
|
|
60
|
+
drone: { defaultCaptureSizeMeters: 5, captureSizeExtensionMeters: 3 },
|
|
61
|
+
};
|
|
62
|
+
expect(cameraSettingsSchema.parse({ cameraConfig }).cameraConfig).toEqual(cameraConfig);
|
|
63
|
+
});
|
|
64
|
+
test('defaults a missing drone capture config', () => {
|
|
65
|
+
expect(cameraSettingsSchema.parse({ cameraConfig: { aircraft: CAPTURE_CONFIG } }).cameraConfig).toEqual({
|
|
66
|
+
aircraft: CAPTURE_CONFIG,
|
|
67
|
+
drone: DEFAULT_CAPTURE_CONFIG,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
test('copies the legacy flat capture config to both aircraft and drone', () => {
|
|
71
|
+
expect(cameraSettingsSchema.parse({ cameraConfig: CAPTURE_CONFIG }).cameraConfig).toEqual({
|
|
72
|
+
aircraft: CAPTURE_CONFIG,
|
|
73
|
+
drone: CAPTURE_CONFIG,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
test('returns independent aircraft and drone objects', () => {
|
|
77
|
+
const legacy = cameraSettingsSchema.parse({ cameraConfig: CAPTURE_CONFIG }).cameraConfig;
|
|
78
|
+
legacy.drone.defaultCaptureSizeMeters = 1;
|
|
79
|
+
expect(legacy.aircraft).toEqual(CAPTURE_CONFIG);
|
|
80
|
+
const first = cameraSettingsSchema.parse({}).cameraConfig;
|
|
81
|
+
first.drone.defaultCaptureSizeMeters = 1;
|
|
82
|
+
expect(cameraSettingsSchema.parse({}).cameraConfig.drone).toEqual(DEFAULT_CAPTURE_CONFIG);
|
|
83
|
+
});
|
|
84
|
+
test('rejects a non-positive drone capture size', () => {
|
|
85
|
+
const cameraConfig = { aircraft: CAPTURE_CONFIG, drone: { ...CAPTURE_CONFIG, defaultCaptureSizeMeters: 0 } };
|
|
86
|
+
expect(cameraSettingsSchema.safeParse({ cameraConfig }).success).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
});
|
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,117 +1,114 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"name": "camstreamerlib",
|
|
3
|
+
"version": "4.0.35-38dd1fb",
|
|
4
|
+
"description": "Helper library for CamStreamer ACAP applications.",
|
|
5
|
+
"prettier": "@camstreamer/prettier-config",
|
|
6
|
+
"engine": {
|
|
7
|
+
"node": ">=18.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"adm-zip": "^0.6.0",
|
|
11
|
+
"eventemitter2": "^5.0.1",
|
|
12
|
+
"fast-xml-parser": "^5.3.6",
|
|
13
|
+
"type-fest": "^4.41.0",
|
|
14
|
+
"undici": "^6.28.1",
|
|
15
|
+
"ws": "^8.18.0",
|
|
16
|
+
"zod": "^3.25.76"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@camstreamer/eslint-config": "^1.0.10",
|
|
20
|
+
"@camstreamer/prettier-config": "^2.0.4",
|
|
21
|
+
"@eslint/js": "^10.0.1",
|
|
22
|
+
"@types/adm-zip": "^0.5.5",
|
|
23
|
+
"@types/jest": "^30.0.0",
|
|
24
|
+
"@types/node": "^18.19.127",
|
|
25
|
+
"@types/ws": "^8.5.10",
|
|
26
|
+
"esbuild": "^0.28.2",
|
|
27
|
+
"eslint": "^10.12.0",
|
|
28
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
29
|
+
"globals": "^17.13.0",
|
|
30
|
+
"jest": "^30.5.2",
|
|
31
|
+
"npm-run-all": "^4.1.5",
|
|
32
|
+
"prettier": "^2.7.1",
|
|
33
|
+
"ts-jest": "^29.4.14",
|
|
34
|
+
"ts-node": "^10.7.0",
|
|
35
|
+
"typescript": "5.3.3",
|
|
36
|
+
"typescript-eslint": "^8.71.2"
|
|
37
|
+
},
|
|
38
|
+
"overrides": {
|
|
39
|
+
"js-yaml": "^4.3.2",
|
|
40
|
+
"browserslist": "^4.28.7"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
44
|
+
"build": "npm-run-all clean build:cjs build:esm copyPackage",
|
|
45
|
+
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
46
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
47
|
+
"build:browser": "esbuild src/browser.index.ts --bundle --format=esm --platform=browser --target=es2022 --outfile=examples/camstreamerlib.js",
|
|
48
|
+
"copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/ && cp -r -f examples dist/",
|
|
49
|
+
"publishPackage": "./publish.sh",
|
|
50
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
51
|
+
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
52
|
+
"pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
|
|
53
|
+
"pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
|
|
54
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
55
|
+
"audit": "npm audit --audit-level=high"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"/**/*.js",
|
|
59
|
+
"/**/*.ts",
|
|
60
|
+
"/examples/**/*"
|
|
61
|
+
],
|
|
62
|
+
"main": "./cjs/index.js",
|
|
63
|
+
"module": "./esm/index.js",
|
|
64
|
+
"types": "types/index.d.ts",
|
|
65
|
+
"exports": {
|
|
66
|
+
".": {
|
|
67
|
+
"import": "./esm/index.js",
|
|
68
|
+
"require": "./cjs/index.js",
|
|
69
|
+
"types": "./types/index.d.ts"
|
|
8
70
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"type-fest": "^4.41.0",
|
|
14
|
-
"undici": "^6.28.1",
|
|
15
|
-
"ws": "^8.18.0",
|
|
16
|
-
"zod": "^3.25.76"
|
|
71
|
+
"./web": {
|
|
72
|
+
"import": "./esm/web/index.js",
|
|
73
|
+
"require": "./cjs/web/index.js",
|
|
74
|
+
"types": "./types/web/index.d.ts"
|
|
17
75
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"@types/jest": "^30.0.0",
|
|
23
|
-
"@types/node": "^18.19.127",
|
|
24
|
-
"@types/ws": "^8.5.10",
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
|
26
|
-
"@typescript-eslint/parser": "^8.71.1",
|
|
27
|
-
"esbuild": "^0.28.2",
|
|
28
|
-
"eslint": "^8.51.0",
|
|
29
|
-
"eslint-plugin-deprecation": "^2.0.0",
|
|
30
|
-
"eslint-plugin-unused-imports": "^4.4.1",
|
|
31
|
-
"jest": "^30.5.2",
|
|
32
|
-
"npm-run-all": "^4.1.5",
|
|
33
|
-
"prettier": "^2.7.1",
|
|
34
|
-
"ts-jest": "^29.4.14",
|
|
35
|
-
"ts-node": "^10.7.0",
|
|
36
|
-
"typescript": "5.3.3"
|
|
76
|
+
"./node": {
|
|
77
|
+
"import": "./esm/node/index.js",
|
|
78
|
+
"require": "./cjs/node/index.js",
|
|
79
|
+
"types": "./types/node/index.d.ts"
|
|
37
80
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@typescript-eslint/utils": "^8.71.1"
|
|
43
|
-
}
|
|
81
|
+
"./cjs/index": {
|
|
82
|
+
"import": "./esm/index.js",
|
|
83
|
+
"require": "./cjs/index.js",
|
|
84
|
+
"types": "./types/index.d.ts"
|
|
44
85
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"build:esm": "tsc --project tsconfig.esm.json",
|
|
50
|
-
"build:browser": "esbuild src/browser.index.ts --bundle --format=esm --platform=browser --target=es2022 --outfile=examples/camstreamerlib.js",
|
|
51
|
-
"copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/ && cp -r -f examples dist/",
|
|
52
|
-
"publishPackage": "./publish.sh",
|
|
53
|
-
"lint": "eslint \"src/**/*.ts\"",
|
|
54
|
-
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
55
|
-
"pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
|
|
56
|
-
"pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
|
|
57
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
58
|
-
"audit": "npm audit --audit-level=high"
|
|
86
|
+
"./cjs/node": {
|
|
87
|
+
"import": "./esm/node/index.js",
|
|
88
|
+
"require": "./cjs/node/index.js",
|
|
89
|
+
"types": "./types/node/index.js"
|
|
59
90
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
"./cjs/index": {
|
|
85
|
-
"import": "./esm/index.js",
|
|
86
|
-
"require": "./cjs/index.js",
|
|
87
|
-
"types": "./types/index.d.ts"
|
|
88
|
-
},
|
|
89
|
-
"./cjs/node": {
|
|
90
|
-
"import": "./esm/node/index.js",
|
|
91
|
-
"require": "./cjs/node/index.js",
|
|
92
|
-
"types": "./types/node/index.js"
|
|
93
|
-
},
|
|
94
|
-
"./cjs/node/index": {
|
|
95
|
-
"import": "./esm/node/index.js",
|
|
96
|
-
"require": "./cjs/node/index.js",
|
|
97
|
-
"types": "./types/node/index.js"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"repository": {
|
|
101
|
-
"type": "git",
|
|
102
|
-
"url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
|
|
103
|
-
},
|
|
104
|
-
"keywords": [
|
|
105
|
-
"CamStreamer",
|
|
106
|
-
"CamOverlay",
|
|
107
|
-
"CamScripter",
|
|
108
|
-
"Camera",
|
|
109
|
-
"Axis"
|
|
110
|
-
],
|
|
111
|
-
"author": "CamStreamer s.r.o",
|
|
112
|
-
"license": "ISC",
|
|
113
|
-
"bugs": {
|
|
114
|
-
"url": "https://github.com/CamStreamer/CamStreamerLib/issues"
|
|
115
|
-
},
|
|
116
|
-
"homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
|
|
91
|
+
"./cjs/node/index": {
|
|
92
|
+
"import": "./esm/node/index.js",
|
|
93
|
+
"require": "./cjs/node/index.js",
|
|
94
|
+
"types": "./types/node/index.js"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"repository": {
|
|
98
|
+
"type": "git",
|
|
99
|
+
"url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
|
|
100
|
+
},
|
|
101
|
+
"keywords": [
|
|
102
|
+
"CamStreamer",
|
|
103
|
+
"CamOverlay",
|
|
104
|
+
"CamScripter",
|
|
105
|
+
"Camera",
|
|
106
|
+
"Axis"
|
|
107
|
+
],
|
|
108
|
+
"author": "CamStreamer s.r.o",
|
|
109
|
+
"license": "ISC",
|
|
110
|
+
"bugs": {
|
|
111
|
+
"url": "https://github.com/CamStreamer/CamStreamerLib/issues"
|
|
112
|
+
},
|
|
113
|
+
"homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
|
|
117
114
|
}
|
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;
|
|
@@ -161,6 +161,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> exte
|
|
|
161
161
|
bitrateVapixParams?: string | null | undefined;
|
|
162
162
|
audioSampleRate?: number | undefined;
|
|
163
163
|
audioChannelCount?: 1 | 2 | undefined;
|
|
164
|
+
audioBitrate?: number | undefined;
|
|
164
165
|
} | undefined>;
|
|
165
166
|
getGlobalAudioSettings(options?: THttpRequestOptions): Promise<{
|
|
166
167
|
type: "source" | "fromSource";
|
|
@@ -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;
|
|
@@ -99,11 +114,29 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
99
114
|
priority: number;
|
|
100
115
|
};
|
|
101
116
|
identificationLabel: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
aircraft: {
|
|
118
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
119
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
120
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
121
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
122
|
+
opacity: number;
|
|
123
|
+
};
|
|
124
|
+
drone: {
|
|
125
|
+
firstRow: "blank" | "remote_id";
|
|
126
|
+
opacity: number;
|
|
127
|
+
};
|
|
128
|
+
} | {
|
|
129
|
+
aircraft: {
|
|
130
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
131
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
132
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
133
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
134
|
+
opacity: number;
|
|
135
|
+
};
|
|
136
|
+
drone: {
|
|
137
|
+
firstRow: "blank" | "remote_id";
|
|
138
|
+
opacity: number;
|
|
139
|
+
};
|
|
107
140
|
};
|
|
108
141
|
acs: {
|
|
109
142
|
ip: string;
|
|
@@ -181,11 +214,11 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
181
214
|
importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
|
|
182
215
|
getDomainList(options?: THttpRequestOptions): Promise<Partial<Record<"adsb" | "remoteId", {
|
|
183
216
|
uiName: string;
|
|
184
|
-
icon: "unknown" | "small" | "
|
|
217
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
185
218
|
categoryList: {
|
|
186
219
|
categoryId: string;
|
|
187
220
|
uiName: string;
|
|
188
|
-
icon: "unknown" | "small" | "
|
|
221
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
189
222
|
}[];
|
|
190
223
|
}>>>;
|
|
191
224
|
fetchFlightInfo(targetId: string, options?: THttpRequestOptions): Promise<{
|