camstreamerlib 4.0.34-be26059 → 4.0.35
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 +10 -43
- 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 +26 -218
- package/cjs/types/PlaneTrackerAPI.js +16 -65
- 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 +15 -64
- 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 +10 -43
- package/types/types/CamSwitcherAPI.d.ts +4 -4
- package/types/types/PlaneTrackerAPI.d.ts +26 -218
- package/types/types/common.d.ts +13 -0
- package/cjs/types/PlaneTrackerAPI.test.d.ts +0 -1
- package/cjs/types/PlaneTrackerAPI.test.js +0 -90
- package/esm/types/PlaneTrackerAPI.test.js +0 -88
- package/types/types/PlaneTrackerAPI.test.d.ts +0 -1
|
@@ -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('')]),
|
|
@@ -40,59 +35,13 @@ const labelOptionsSchema = zod_1.z.union([
|
|
|
40
35
|
zod_1.z.literal('flight_number'),
|
|
41
36
|
zod_1.z.literal('icao'),
|
|
42
37
|
]);
|
|
43
|
-
const
|
|
38
|
+
const identificationLabelSchema = zod_1.z.object({
|
|
44
39
|
firstRow: labelOptionsSchema,
|
|
45
40
|
secondRow: labelOptionsSchema,
|
|
46
41
|
thirdRow: labelOptionsSchema,
|
|
47
42
|
fourthRow: labelOptionsSchema,
|
|
48
43
|
opacity: zod_1.z.number().positive(),
|
|
49
44
|
});
|
|
50
|
-
const droneLabelOptionsSchema = zod_1.z.union([zod_1.z.literal('blank'), zod_1.z.literal('remote_id')]);
|
|
51
|
-
const droneIdentificationLabelSchema = zod_1.z.object({
|
|
52
|
-
firstRow: droneLabelOptionsSchema,
|
|
53
|
-
opacity: zod_1.z.number().positive(),
|
|
54
|
-
});
|
|
55
|
-
const DEFAULT_DRONE_IDENTIFICATION_LABEL = {
|
|
56
|
-
firstRow: 'remote_id',
|
|
57
|
-
opacity: 30,
|
|
58
|
-
};
|
|
59
|
-
const identificationLabelSchema = zod_1.z.union([
|
|
60
|
-
zod_1.z.object({
|
|
61
|
-
aircraft: aircraftIdentificationLabelSchema,
|
|
62
|
-
drone: droneIdentificationLabelSchema.default(DEFAULT_DRONE_IDENTIFICATION_LABEL),
|
|
63
|
-
}),
|
|
64
|
-
aircraftIdentificationLabelSchema.transform((aircraft) => ({
|
|
65
|
-
aircraft,
|
|
66
|
-
drone: { ...DEFAULT_DRONE_IDENTIFICATION_LABEL },
|
|
67
|
-
})),
|
|
68
|
-
]);
|
|
69
|
-
const captureConfigSchema = zod_1.z.object({
|
|
70
|
-
defaultCaptureSizeMeters: zod_1.z.number().positive(),
|
|
71
|
-
captureSizeExtensionMeters: zod_1.z.number().positive(),
|
|
72
|
-
});
|
|
73
|
-
const DEFAULT_CAPTURE_CONFIG = {
|
|
74
|
-
defaultCaptureSizeMeters: 120,
|
|
75
|
-
captureSizeExtensionMeters: 80,
|
|
76
|
-
};
|
|
77
|
-
const cameraConfigSchema = zod_1.z.union([
|
|
78
|
-
zod_1.z.object({
|
|
79
|
-
aircraft: captureConfigSchema,
|
|
80
|
-
drone: captureConfigSchema.default(() => ({ ...DEFAULT_CAPTURE_CONFIG })),
|
|
81
|
-
}),
|
|
82
|
-
zod_1.z
|
|
83
|
-
.object({
|
|
84
|
-
defaultCaptureSizeMeters: zod_1.z.number().positive().default(DEFAULT_CAPTURE_CONFIG.defaultCaptureSizeMeters),
|
|
85
|
-
captureSizeExtensionMeters: zod_1.z
|
|
86
|
-
.number()
|
|
87
|
-
.positive()
|
|
88
|
-
.default(DEFAULT_CAPTURE_CONFIG.captureSizeExtensionMeters),
|
|
89
|
-
})
|
|
90
|
-
.strict()
|
|
91
|
-
.transform((captureConfig) => ({
|
|
92
|
-
aircraft: captureConfig,
|
|
93
|
-
drone: { ...captureConfig },
|
|
94
|
-
})),
|
|
95
|
-
]);
|
|
96
45
|
exports.cameraSettingsSchema = zod_1.z.object({
|
|
97
46
|
units: zod_1.z.union([zod_1.z.literal('metric'), zod_1.z.literal('imperial')]).default('imperial'),
|
|
98
47
|
adsbSource: zod_1.z
|
|
@@ -130,10 +79,15 @@ exports.cameraSettingsSchema = zod_1.z.object({
|
|
|
130
79
|
nightSkyCalibrationFocusValue: 9000,
|
|
131
80
|
focusCalibrationPoints: '',
|
|
132
81
|
}),
|
|
133
|
-
cameraConfig:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
82
|
+
cameraConfig: zod_1.z
|
|
83
|
+
.object({
|
|
84
|
+
defaultCaptureSizeMeters: zod_1.z.number().positive().default(120),
|
|
85
|
+
captureSizeExtensionMeters: zod_1.z.number().positive().default(80),
|
|
86
|
+
})
|
|
87
|
+
.default({
|
|
88
|
+
defaultCaptureSizeMeters: 120,
|
|
89
|
+
captureSizeExtensionMeters: 80,
|
|
90
|
+
}),
|
|
137
91
|
stream: zod_1.z
|
|
138
92
|
.object({
|
|
139
93
|
width: zod_1.z.number().positive(),
|
|
@@ -244,14 +198,11 @@ exports.cameraSettingsSchema = zod_1.z.object({
|
|
|
244
198
|
port: 80,
|
|
245
199
|
}),
|
|
246
200
|
identificationLabel: identificationLabelSchema.default({
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
opacity: 30,
|
|
253
|
-
},
|
|
254
|
-
drone: DEFAULT_DRONE_IDENTIFICATION_LABEL,
|
|
201
|
+
firstRow: 'registration',
|
|
202
|
+
secondRow: 'blank',
|
|
203
|
+
thirdRow: 'blank',
|
|
204
|
+
fourthRow: 'blank',
|
|
205
|
+
opacity: 30,
|
|
255
206
|
}),
|
|
256
207
|
acs: exports.connectionSchema
|
|
257
208
|
.extend({
|
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('')]),
|
|
@@ -37,59 +32,13 @@ const labelOptionsSchema = z.union([
|
|
|
37
32
|
z.literal('flight_number'),
|
|
38
33
|
z.literal('icao'),
|
|
39
34
|
]);
|
|
40
|
-
const
|
|
35
|
+
const identificationLabelSchema = z.object({
|
|
41
36
|
firstRow: labelOptionsSchema,
|
|
42
37
|
secondRow: labelOptionsSchema,
|
|
43
38
|
thirdRow: labelOptionsSchema,
|
|
44
39
|
fourthRow: labelOptionsSchema,
|
|
45
40
|
opacity: z.number().positive(),
|
|
46
41
|
});
|
|
47
|
-
const droneLabelOptionsSchema = z.union([z.literal('blank'), z.literal('remote_id')]);
|
|
48
|
-
const droneIdentificationLabelSchema = z.object({
|
|
49
|
-
firstRow: droneLabelOptionsSchema,
|
|
50
|
-
opacity: z.number().positive(),
|
|
51
|
-
});
|
|
52
|
-
const DEFAULT_DRONE_IDENTIFICATION_LABEL = {
|
|
53
|
-
firstRow: 'remote_id',
|
|
54
|
-
opacity: 30,
|
|
55
|
-
};
|
|
56
|
-
const identificationLabelSchema = z.union([
|
|
57
|
-
z.object({
|
|
58
|
-
aircraft: aircraftIdentificationLabelSchema,
|
|
59
|
-
drone: droneIdentificationLabelSchema.default(DEFAULT_DRONE_IDENTIFICATION_LABEL),
|
|
60
|
-
}),
|
|
61
|
-
aircraftIdentificationLabelSchema.transform((aircraft) => ({
|
|
62
|
-
aircraft,
|
|
63
|
-
drone: { ...DEFAULT_DRONE_IDENTIFICATION_LABEL },
|
|
64
|
-
})),
|
|
65
|
-
]);
|
|
66
|
-
const captureConfigSchema = z.object({
|
|
67
|
-
defaultCaptureSizeMeters: z.number().positive(),
|
|
68
|
-
captureSizeExtensionMeters: z.number().positive(),
|
|
69
|
-
});
|
|
70
|
-
const DEFAULT_CAPTURE_CONFIG = {
|
|
71
|
-
defaultCaptureSizeMeters: 120,
|
|
72
|
-
captureSizeExtensionMeters: 80,
|
|
73
|
-
};
|
|
74
|
-
const cameraConfigSchema = z.union([
|
|
75
|
-
z.object({
|
|
76
|
-
aircraft: captureConfigSchema,
|
|
77
|
-
drone: captureConfigSchema.default(() => ({ ...DEFAULT_CAPTURE_CONFIG })),
|
|
78
|
-
}),
|
|
79
|
-
z
|
|
80
|
-
.object({
|
|
81
|
-
defaultCaptureSizeMeters: z.number().positive().default(DEFAULT_CAPTURE_CONFIG.defaultCaptureSizeMeters),
|
|
82
|
-
captureSizeExtensionMeters: z
|
|
83
|
-
.number()
|
|
84
|
-
.positive()
|
|
85
|
-
.default(DEFAULT_CAPTURE_CONFIG.captureSizeExtensionMeters),
|
|
86
|
-
})
|
|
87
|
-
.strict()
|
|
88
|
-
.transform((captureConfig) => ({
|
|
89
|
-
aircraft: captureConfig,
|
|
90
|
-
drone: { ...captureConfig },
|
|
91
|
-
})),
|
|
92
|
-
]);
|
|
93
42
|
export const cameraSettingsSchema = z.object({
|
|
94
43
|
units: z.union([z.literal('metric'), z.literal('imperial')]).default('imperial'),
|
|
95
44
|
adsbSource: z
|
|
@@ -127,10 +76,15 @@ export const cameraSettingsSchema = z.object({
|
|
|
127
76
|
nightSkyCalibrationFocusValue: 9000,
|
|
128
77
|
focusCalibrationPoints: '',
|
|
129
78
|
}),
|
|
130
|
-
cameraConfig:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
79
|
+
cameraConfig: z
|
|
80
|
+
.object({
|
|
81
|
+
defaultCaptureSizeMeters: z.number().positive().default(120),
|
|
82
|
+
captureSizeExtensionMeters: z.number().positive().default(80),
|
|
83
|
+
})
|
|
84
|
+
.default({
|
|
85
|
+
defaultCaptureSizeMeters: 120,
|
|
86
|
+
captureSizeExtensionMeters: 80,
|
|
87
|
+
}),
|
|
134
88
|
stream: z
|
|
135
89
|
.object({
|
|
136
90
|
width: z.number().positive(),
|
|
@@ -241,14 +195,11 @@ export const cameraSettingsSchema = z.object({
|
|
|
241
195
|
port: 80,
|
|
242
196
|
}),
|
|
243
197
|
identificationLabel: identificationLabelSchema.default({
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
opacity: 30,
|
|
250
|
-
},
|
|
251
|
-
drone: DEFAULT_DRONE_IDENTIFICATION_LABEL,
|
|
198
|
+
firstRow: 'registration',
|
|
199
|
+
secondRow: 'blank',
|
|
200
|
+
thirdRow: 'blank',
|
|
201
|
+
fourthRow: 'blank',
|
|
202
|
+
opacity: 30,
|
|
252
203
|
}),
|
|
253
204
|
acs: connectionSchema
|
|
254
205
|
.extend({
|
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
|
-
|
|
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.2",
|
|
20
|
-
"@camstreamer/prettier-config": "^2.0.4",
|
|
21
|
-
"@types/adm-zip": "^0.5.5",
|
|
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"
|
|
37
|
-
},
|
|
38
|
-
"overrides": {
|
|
39
|
-
"js-yaml": "^4.3.2",
|
|
40
|
-
"browserslist": "^4.28.7",
|
|
41
|
-
"eslint-plugin-deprecation": {
|
|
42
|
-
"@typescript-eslint/utils": "^8.71.1"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"clean": "rimraf dist/*",
|
|
47
|
-
"build": "npm-run-all clean build:cjs build:esm copyPackage",
|
|
48
|
-
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
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"
|
|
59
|
-
},
|
|
60
|
-
"files": [
|
|
61
|
-
"/**/*.js",
|
|
62
|
-
"/**/*.ts",
|
|
63
|
-
"/examples/**/*"
|
|
64
|
-
],
|
|
65
|
-
"main": "./cjs/index.js",
|
|
66
|
-
"module": "./esm/index.js",
|
|
67
|
-
"types": "types/index.d.ts",
|
|
68
|
-
"exports": {
|
|
69
|
-
".": {
|
|
70
|
-
"import": "./esm/index.js",
|
|
71
|
-
"require": "./cjs/index.js",
|
|
72
|
-
"types": "./types/index.d.ts"
|
|
2
|
+
"name": "camstreamerlib",
|
|
3
|
+
"version": "4.0.35",
|
|
4
|
+
"description": "Helper library for CamStreamer ACAP applications.",
|
|
5
|
+
"prettier": "@camstreamer/prettier-config",
|
|
6
|
+
"engine": {
|
|
7
|
+
"node": ">=18.0.0"
|
|
73
8
|
},
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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"
|
|
78
17
|
},
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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"
|
|
83
37
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"types": "./types/index.d.ts"
|
|
38
|
+
"overrides": {
|
|
39
|
+
"js-yaml": "^4.3.2",
|
|
40
|
+
"browserslist": "^4.28.7"
|
|
88
41
|
},
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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"
|
|
93
56
|
},
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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"
|
|
70
|
+
},
|
|
71
|
+
"./web": {
|
|
72
|
+
"import": "./esm/web/index.js",
|
|
73
|
+
"require": "./cjs/web/index.js",
|
|
74
|
+
"types": "./types/web/index.d.ts"
|
|
75
|
+
},
|
|
76
|
+
"./node": {
|
|
77
|
+
"import": "./esm/node/index.js",
|
|
78
|
+
"require": "./cjs/node/index.js",
|
|
79
|
+
"types": "./types/node/index.d.ts"
|
|
80
|
+
},
|
|
81
|
+
"./cjs/index": {
|
|
82
|
+
"import": "./esm/index.js",
|
|
83
|
+
"require": "./cjs/index.js",
|
|
84
|
+
"types": "./types/index.d.ts"
|
|
85
|
+
},
|
|
86
|
+
"./cjs/node": {
|
|
87
|
+
"import": "./esm/node/index.js",
|
|
88
|
+
"require": "./cjs/node/index.js",
|
|
89
|
+
"types": "./types/node/index.js"
|
|
90
|
+
},
|
|
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;
|