camstreamerlib 4.0.0-beta.4 → 4.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/cjs/CamOverlayAPI.js +135 -92
- package/cjs/CamScripterAPI.js +52 -42
- package/cjs/CamStreamerAPI.js +83 -39
- package/cjs/CamSwitcherAPI.js +141 -123
- package/cjs/CamSwitcherEvents.js +4 -60
- package/cjs/PlaneTrackerAPI.js +200 -0
- package/cjs/VapixAPI.js +323 -233
- package/cjs/{CreatePackage.js → bin/CreatePackage.js} +22 -19
- package/cjs/errors/errors.js +64 -1
- package/cjs/index.js +17 -4
- package/cjs/internal/ProxyClient.js +28 -32
- package/cjs/internal/WsEvents.js +72 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.js +22 -3
- package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +7 -4
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
- package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
- package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +7 -4
- package/cjs/node/DefaultClient.js +10 -12
- package/cjs/{internal → node}/Digest.js +8 -5
- package/cjs/node/HttpRequestSender.js +14 -4
- package/cjs/node/HttpServer.js +15 -12
- package/cjs/{VapixEvents.js → node/VapixEvents.js} +1 -1
- package/cjs/node/WsClient.js +12 -9
- package/cjs/node/events/AxisCameraStationEvents.js +53 -0
- package/cjs/node/events/GenetecAgent.js +123 -0
- package/cjs/node/index.js +38 -5
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
- package/cjs/types/CamOverlayAPI/index.js +27 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +25 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.js +14 -0
- package/cjs/types/CamScripterAPI.js +22 -7
- package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
- package/cjs/types/CamStreamerAPI.js +34 -3
- package/cjs/types/CamSwitcherAPI.js +38 -1
- package/cjs/types/CamSwitcherEvents.js +8 -0
- package/cjs/types/GenetecAgent.js +31 -0
- package/cjs/types/PlaneTrackerAPI.js +281 -0
- package/cjs/types/VapixAPI.js +71 -13
- package/cjs/types/VapixEvents.js +2 -0
- package/cjs/web/DefaultClient.js +22 -10
- package/cjs/web/WsClient.js +3 -3
- package/esm/CamOverlayAPI.js +131 -88
- package/esm/CamScripterAPI.js +48 -38
- package/esm/CamStreamerAPI.js +81 -38
- package/esm/CamSwitcherAPI.js +137 -119
- package/esm/CamSwitcherEvents.js +5 -61
- package/esm/PlaneTrackerAPI.js +196 -0
- package/esm/VapixAPI.js +315 -225
- package/esm/{CreatePackage.js → bin/CreatePackage.js} +3 -3
- package/esm/errors/errors.js +54 -0
- package/esm/index.js +12 -3
- package/esm/internal/ProxyClient.js +28 -32
- package/esm/internal/WsEvents.js +68 -0
- package/esm/internal/utils.js +17 -1
- package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +2 -2
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
- package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +2 -2
- package/esm/node/DefaultClient.js +10 -12
- package/esm/{internal → node}/Digest.js +1 -1
- package/esm/node/HttpRequestSender.js +14 -4
- package/esm/node/HttpServer.js +5 -5
- package/esm/{VapixEvents.js → node/VapixEvents.js} +1 -1
- package/esm/node/WsClient.js +3 -3
- package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
- package/esm/node/events/GenetecAgent.js +119 -0
- package/esm/node/index.js +17 -2
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
- package/esm/types/CamOverlayAPI/index.js +11 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +22 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
- package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
- package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
- package/esm/types/CamOverlayPainter.js +11 -0
- package/esm/types/CamScripterAPI.js +21 -6
- package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
- package/esm/types/CamStreamerAPI.js +33 -2
- package/esm/types/CamSwitcherAPI.js +38 -1
- package/esm/types/CamSwitcherEvents.js +8 -0
- package/esm/types/GenetecAgent.js +28 -0
- package/esm/types/PlaneTrackerAPI.js +278 -0
- package/esm/types/VapixAPI.js +70 -12
- package/esm/types/VapixEvents.js +1 -0
- package/esm/web/DefaultClient.js +22 -10
- package/esm/web/WsClient.js +3 -3
- package/package.json +30 -12
- package/types/CamOverlayAPI.d.ts +865 -0
- package/types/CamScripterAPI.d.ts +47 -0
- package/types/CamStreamerAPI.d.ts +64 -0
- package/types/CamSwitcherAPI.d.ts +167 -0
- package/types/CamSwitcherEvents.d.ts +8 -0
- package/types/PlaneTrackerAPI.d.ts +226 -0
- package/types/VapixAPI.d.ts +118 -0
- package/types/bin/CreatePackage.d.ts +1 -0
- package/{esm → types}/errors/errors.d.ts +28 -1
- package/types/index.d.ts +20 -0
- package/types/internal/ProxyClient.d.ts +10 -0
- package/types/internal/WsEvents.d.ts +41 -0
- package/types/internal/types.d.ts +45 -0
- package/{cjs → types}/internal/utils.d.ts +4 -1
- package/{cjs → types}/internal/versionCompare.d.ts +2 -2
- package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
- package/{cjs → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
- package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/types/node/DefaultClient.d.ts +16 -0
- package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
- package/{cjs → types}/node/HttpServer.d.ts +2 -2
- package/types/node/VapixEvents.d.ts +16 -0
- package/{cjs → types}/node/WsClient.d.ts +3 -2
- package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/types/node/events/GenetecAgent.d.ts +16 -0
- package/types/node/index.d.ts +17 -0
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4321 -0
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/types/types/CamOverlayAPI/index.d.ts +11 -0
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/types/types/CamOverlayPainter.d.ts +76 -0
- package/types/types/CamScripterAPI.d.ts +130 -0
- package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/types/types/CamStreamerAPI.d.ts +272 -0
- package/{esm → types}/types/CamSwitcherAPI.d.ts +115 -36
- package/{cjs → types}/types/CamSwitcherEvents.d.ts +77 -0
- package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
- package/types/types/PlaneTrackerAPI.d.ts +877 -0
- package/{cjs → types}/types/VapixAPI.d.ts +647 -465
- package/types/types/VapixEvents.d.ts +15 -0
- package/{esm → types}/types/common.d.ts +15 -5
- package/types/web/DefaultClient.d.ts +6 -0
- package/cjs/CamOverlayAPI.d.ts +0 -31
- package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
- package/cjs/CamOverlayPainter/Frame.d.ts +0 -96
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
- package/cjs/CamScripterAPI.d.ts +0 -19
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/cjs/CamStreamerAPI.d.ts +0 -16
- package/cjs/CamSwitcherAPI.d.ts +0 -48
- package/cjs/CamSwitcherEvents.d.ts +0 -18
- package/cjs/VapixAPI.d.ts +0 -66
- package/cjs/VapixEvents.d.ts +0 -43
- package/cjs/errors/errors.d.ts +0 -34
- package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
- package/cjs/events/AxisCameraStationEvents.js +0 -48
- package/cjs/events/GenetecAgent.d.ts +0 -174
- package/cjs/events/GenetecAgent.js +0 -123
- package/cjs/index.d.ts +0 -11
- package/cjs/internal/ProxyClient.d.ts +0 -11
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- package/cjs/node/DefaultClient.d.ts +0 -15
- package/cjs/node/HttpRequestSender.d.ts +0 -28
- package/cjs/node/WsEventClient.d.ts +0 -13
- package/cjs/node/WsEventClient.js +0 -22
- package/cjs/types/CamOverlayAPI.d.ts +0 -188
- package/cjs/types/CamOverlayAPI.js +0 -47
- package/cjs/types/CamScripterAPI.d.ts +0 -67
- package/cjs/types/CamStreamerAPI.d.ts +0 -139
- package/cjs/types/CamSwitcherAPI.d.ts +0 -814
- package/cjs/types/common.d.ts +0 -37
- package/cjs/web/DefaultClient.d.ts +0 -6
- package/cjs/web/index.d.ts +0 -2
- package/esm/CamOverlayAPI.d.ts +0 -31
- package/esm/CamOverlayDrawingAPI.d.ts +0 -86
- package/esm/CamOverlayPainter/Painter.d.ts +0 -48
- package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/esm/CamScripterAPI.d.ts +0 -19
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/esm/CamStreamerAPI.d.ts +0 -16
- package/esm/CamSwitcherAPI.d.ts +0 -48
- package/esm/CamSwitcherEvents.d.ts +0 -18
- package/esm/VapixAPI.d.ts +0 -66
- package/esm/VapixEvents.d.ts +0 -43
- package/esm/events/AxisCameraStationEvents.d.ts +0 -9
- package/esm/events/GenetecAgent.js +0 -119
- package/esm/index.d.ts +0 -11
- package/esm/internal/Digest.d.ts +0 -4
- package/esm/internal/ProxyClient.d.ts +0 -11
- package/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/internal/constants.d.ts +0 -1
- package/esm/internal/transformers.d.ts +0 -5
- package/esm/internal/utils.d.ts +0 -11
- package/esm/internal/versionCompare.d.ts +0 -6
- package/esm/node/DefaultClient.d.ts +0 -15
- package/esm/node/HttpServer.d.ts +0 -21
- package/esm/node/WsClient.d.ts +0 -39
- package/esm/node/WsEventClient.d.ts +0 -13
- package/esm/node/WsEventClient.js +0 -18
- package/esm/node/index.d.ts +0 -2
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
- package/esm/types/CamScripterAPI.d.ts +0 -67
- package/esm/types/CamStreamerAPI.d.ts +0 -139
- package/esm/types/CamSwitcherEvents.d.ts +0 -491
- package/esm/types/VapixAPI.d.ts +0 -1683
- package/esm/web/DefaultClient.d.ts +0 -6
- package/esm/web/WsClient.d.ts +0 -13
- package/esm/web/index.d.ts +0 -2
- /package/{cjs/CreatePackage.d.ts → esm/internal/types.js} +0 -0
- /package/esm/{CreatePackage.d.ts → types/CamOverlayDrawingAPI.js} +0 -0
- /package/{cjs → types}/internal/constants.d.ts +0 -0
- /package/{cjs → types}/internal/transformers.d.ts +0 -0
- /package/{cjs/internal → types/node}/Digest.d.ts +0 -0
- /package/{cjs → types}/web/WsClient.d.ts +0 -0
- /package/{cjs/node → types/web}/index.d.ts +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cameraListSchema = exports.cameraDetailsResponseSchema = exports.cameraDetailSchema = exports.cameraGuidsResponseSchema = exports.successResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.successResponseSchema = zod_1.z.object({
|
|
6
|
+
Rsp: zod_1.z.object({
|
|
7
|
+
Status: zod_1.z.literal('Ok'),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
exports.cameraGuidsResponseSchema = zod_1.z.object({
|
|
11
|
+
Rsp: zod_1.z.object({
|
|
12
|
+
Status: zod_1.z.literal('Ok'),
|
|
13
|
+
Result: zod_1.z.array(zod_1.z.object({ Guid: zod_1.z.string() })),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
exports.cameraDetailSchema = zod_1.z.object({
|
|
17
|
+
Guid: zod_1.z.string().optional(),
|
|
18
|
+
Name: zod_1.z.string().optional(),
|
|
19
|
+
EntityType: zod_1.z.string().optional(),
|
|
20
|
+
});
|
|
21
|
+
exports.cameraDetailsResponseSchema = zod_1.z.object({
|
|
22
|
+
Rsp: zod_1.z.object({
|
|
23
|
+
Status: zod_1.z.literal('Ok'),
|
|
24
|
+
Result: zod_1.z.union([zod_1.z.array(exports.cameraDetailSchema), exports.cameraDetailSchema]),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
exports.cameraListSchema = zod_1.z.array(zod_1.z.object({
|
|
28
|
+
index: zod_1.z.number(),
|
|
29
|
+
value: zod_1.z.string(),
|
|
30
|
+
label: zod_1.z.string(),
|
|
31
|
+
}));
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zonesSchema = exports.mapInfoSchema = exports.mapTypeSchema = exports.blackListSchema = exports.whiteListSchema = exports.priorityListSchema = exports.flightInfoSchema = exports.trackingModeSchema = exports.serverSettingsSchema = exports.cameraSettingsSchema = exports.widgetSchema = exports.connectionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.connectionSchema = zod_1.z.object({
|
|
6
|
+
protocol: zod_1.z.union([zod_1.z.literal('http'), zod_1.z.literal('https'), zod_1.z.literal('https_insecure')]),
|
|
7
|
+
ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
|
|
8
|
+
port: zod_1.z.number().positive().lt(65535),
|
|
9
|
+
user: zod_1.z.string(),
|
|
10
|
+
pass: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
exports.widgetSchema = zod_1.z.object({
|
|
13
|
+
enabled: zod_1.z.boolean().default(true),
|
|
14
|
+
coord: zod_1.z.union([
|
|
15
|
+
zod_1.z.literal('top_left'),
|
|
16
|
+
zod_1.z.literal('top_right'),
|
|
17
|
+
zod_1.z.literal('bottom_left'),
|
|
18
|
+
zod_1.z.literal('bottom_right'),
|
|
19
|
+
]),
|
|
20
|
+
posX: zod_1.z.number().nonnegative(),
|
|
21
|
+
posY: zod_1.z.number().nonnegative(),
|
|
22
|
+
scale: zod_1.z.number().positive(),
|
|
23
|
+
});
|
|
24
|
+
const labelOptionsSchema = zod_1.z.union([
|
|
25
|
+
zod_1.z.literal('blank'),
|
|
26
|
+
zod_1.z.literal('registration'),
|
|
27
|
+
zod_1.z.literal('call_sign'),
|
|
28
|
+
zod_1.z.literal('flight_number'),
|
|
29
|
+
zod_1.z.literal('icao'),
|
|
30
|
+
]);
|
|
31
|
+
const identificationLabelSchema = zod_1.z.object({
|
|
32
|
+
firstRow: labelOptionsSchema,
|
|
33
|
+
secondRow: labelOptionsSchema,
|
|
34
|
+
thirdRow: labelOptionsSchema,
|
|
35
|
+
fourthRow: labelOptionsSchema,
|
|
36
|
+
opacity: zod_1.z.number().positive(),
|
|
37
|
+
});
|
|
38
|
+
exports.cameraSettingsSchema = zod_1.z.object({
|
|
39
|
+
units: zod_1.z.union([zod_1.z.literal('metric'), zod_1.z.literal('imperial')]).default('imperial'),
|
|
40
|
+
adsbSource: zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
|
|
43
|
+
port: zod_1.z.number().positive().lt(65535),
|
|
44
|
+
})
|
|
45
|
+
.default({ ip: '', port: 30334 }),
|
|
46
|
+
camera: exports.connectionSchema.default({
|
|
47
|
+
protocol: 'http',
|
|
48
|
+
ip: '127.0.0.1',
|
|
49
|
+
port: 80,
|
|
50
|
+
user: 'root',
|
|
51
|
+
pass: '',
|
|
52
|
+
}),
|
|
53
|
+
cameraCalibrationProcessConfig: zod_1.z
|
|
54
|
+
.object({
|
|
55
|
+
nightSkyCalibrationEnabled: zod_1.z.boolean(),
|
|
56
|
+
scheduleNightSkyCalibrationTimestamp: zod_1.z.number(),
|
|
57
|
+
})
|
|
58
|
+
.default({ nightSkyCalibrationEnabled: false, scheduleNightSkyCalibrationTimestamp: 0 }),
|
|
59
|
+
cameraConfig: zod_1.z
|
|
60
|
+
.object({
|
|
61
|
+
maxZoomLevel: zod_1.z.number().optional(),
|
|
62
|
+
defaultCaptureSizeMeters: zod_1.z.number().positive().default(120),
|
|
63
|
+
captureSizeExtensionMeters: zod_1.z.number().positive().default(80),
|
|
64
|
+
})
|
|
65
|
+
.default({
|
|
66
|
+
maxZoomLevel: 30,
|
|
67
|
+
defaultCaptureSizeMeters: 120,
|
|
68
|
+
captureSizeExtensionMeters: 80,
|
|
69
|
+
}),
|
|
70
|
+
stream: zod_1.z
|
|
71
|
+
.object({
|
|
72
|
+
width: zod_1.z.number().positive(),
|
|
73
|
+
height: zod_1.z.number().positive(),
|
|
74
|
+
})
|
|
75
|
+
.default({ width: 1920, height: 1080 }),
|
|
76
|
+
imageConfig: zod_1.z
|
|
77
|
+
.object({
|
|
78
|
+
dayAperture: zod_1.z.number().nonnegative().min(0).max(100),
|
|
79
|
+
nightAperture: zod_1.z.number().nonnegative().min(0).max(100),
|
|
80
|
+
})
|
|
81
|
+
.default({ dayAperture: 50, nightAperture: 0 }),
|
|
82
|
+
airportConfig: zod_1.z
|
|
83
|
+
.object({
|
|
84
|
+
icao: zod_1.z.string().default(''),
|
|
85
|
+
centerLat: zod_1.z.number(),
|
|
86
|
+
centerLon: zod_1.z.number(),
|
|
87
|
+
radius: zod_1.z.number().nonnegative().default(10000),
|
|
88
|
+
})
|
|
89
|
+
.default({
|
|
90
|
+
icao: '',
|
|
91
|
+
centerLat: 0,
|
|
92
|
+
centerLon: 0,
|
|
93
|
+
radius: 10000,
|
|
94
|
+
}),
|
|
95
|
+
trackingConfig: zod_1.z
|
|
96
|
+
.object({
|
|
97
|
+
prioritizeEmergency: zod_1.z.boolean(),
|
|
98
|
+
guardTourEnabled: zod_1.z.boolean().default(false),
|
|
99
|
+
guardTourId: zod_1.z.number().int().nonnegative().default(0),
|
|
100
|
+
})
|
|
101
|
+
.default({ prioritizeEmergency: true, guardTourEnabled: false, guardTourId: 0 }),
|
|
102
|
+
overlayText: zod_1.z
|
|
103
|
+
.object({
|
|
104
|
+
displayIcao: zod_1.z.boolean().optional(),
|
|
105
|
+
displayRegistration: zod_1.z.boolean().optional(),
|
|
106
|
+
displayFlightNumber: zod_1.z.boolean().optional(),
|
|
107
|
+
displayAltitude: zod_1.z.boolean().optional(),
|
|
108
|
+
displayVelocity: zod_1.z.boolean().optional(),
|
|
109
|
+
displayDistance: zod_1.z.boolean().optional(),
|
|
110
|
+
displayFOV: zod_1.z.boolean().optional(),
|
|
111
|
+
displayPTError: zod_1.z.boolean().optional(),
|
|
112
|
+
displayPTZSpeed: zod_1.z.boolean().optional(),
|
|
113
|
+
displayVelocityData: zod_1.z.boolean().optional(),
|
|
114
|
+
displaySignalQuality: zod_1.z.boolean().optional(),
|
|
115
|
+
displayAutoTrackingInfo: zod_1.z.boolean().optional(),
|
|
116
|
+
displayGPSCoords: zod_1.z.boolean().optional(),
|
|
117
|
+
displayVapixQuery: zod_1.z.boolean().optional(),
|
|
118
|
+
displayFocus: zod_1.z.boolean().optional(),
|
|
119
|
+
displayAperture: zod_1.z.boolean().optional(),
|
|
120
|
+
displaySunDistance: zod_1.z.boolean().optional(),
|
|
121
|
+
displayTickTime: zod_1.z.boolean().optional(),
|
|
122
|
+
displayAircraftInfo: zod_1.z.boolean().optional(),
|
|
123
|
+
})
|
|
124
|
+
.optional(),
|
|
125
|
+
widget: exports.widgetSchema.default({
|
|
126
|
+
enabled: true,
|
|
127
|
+
coord: 'top_right',
|
|
128
|
+
posX: 10,
|
|
129
|
+
posY: 10,
|
|
130
|
+
scale: 100,
|
|
131
|
+
}),
|
|
132
|
+
airportWidget: exports.widgetSchema.default({
|
|
133
|
+
enabled: true,
|
|
134
|
+
coord: 'top_left',
|
|
135
|
+
posX: 10,
|
|
136
|
+
posY: 10,
|
|
137
|
+
scale: 100,
|
|
138
|
+
}),
|
|
139
|
+
fr24FlightInfoSource: zod_1.z
|
|
140
|
+
.object({
|
|
141
|
+
enabled: zod_1.z.boolean().default(false),
|
|
142
|
+
priority: zod_1.z.number().int().positive().default(1),
|
|
143
|
+
apiToken: zod_1.z.string().default(''),
|
|
144
|
+
validateFlights: zod_1.z.boolean().default(true),
|
|
145
|
+
})
|
|
146
|
+
.default({
|
|
147
|
+
enabled: false,
|
|
148
|
+
priority: 1,
|
|
149
|
+
apiToken: '',
|
|
150
|
+
validateFlights: true,
|
|
151
|
+
}),
|
|
152
|
+
radarcapeFlightInfoSource: zod_1.z
|
|
153
|
+
.object({
|
|
154
|
+
enabled: zod_1.z.boolean().default(false),
|
|
155
|
+
priority: zod_1.z.number().int().positive().default(2),
|
|
156
|
+
ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]).default(''),
|
|
157
|
+
port: zod_1.z.number().positive().lt(65535).default(80),
|
|
158
|
+
})
|
|
159
|
+
.default({
|
|
160
|
+
enabled: false,
|
|
161
|
+
priority: 2,
|
|
162
|
+
ip: '',
|
|
163
|
+
port: 80,
|
|
164
|
+
}),
|
|
165
|
+
identificationLabel: identificationLabelSchema.default({
|
|
166
|
+
firstRow: 'registration',
|
|
167
|
+
secondRow: 'blank',
|
|
168
|
+
thirdRow: 'blank',
|
|
169
|
+
fourthRow: 'blank',
|
|
170
|
+
opacity: 30,
|
|
171
|
+
}),
|
|
172
|
+
acs: exports.connectionSchema
|
|
173
|
+
.extend({
|
|
174
|
+
enabled: zod_1.z.boolean(),
|
|
175
|
+
sourceKey: zod_1.z.string(),
|
|
176
|
+
})
|
|
177
|
+
.default({
|
|
178
|
+
enabled: false,
|
|
179
|
+
protocol: 'https_insecure',
|
|
180
|
+
ip: '',
|
|
181
|
+
port: 29204,
|
|
182
|
+
user: '',
|
|
183
|
+
pass: '',
|
|
184
|
+
sourceKey: '',
|
|
185
|
+
}),
|
|
186
|
+
genetec: exports.connectionSchema
|
|
187
|
+
.extend({
|
|
188
|
+
enabled: zod_1.z.boolean(),
|
|
189
|
+
baseUri: zod_1.z.string().default(''),
|
|
190
|
+
appId: zod_1.z.string().default(''),
|
|
191
|
+
cameraList: zod_1.z.string().array().default([]),
|
|
192
|
+
})
|
|
193
|
+
.default({
|
|
194
|
+
enabled: false,
|
|
195
|
+
protocol: 'http',
|
|
196
|
+
ip: '',
|
|
197
|
+
port: 4590,
|
|
198
|
+
user: '',
|
|
199
|
+
pass: '',
|
|
200
|
+
baseUri: 'WebSdk',
|
|
201
|
+
appId: '',
|
|
202
|
+
cameraList: [],
|
|
203
|
+
}),
|
|
204
|
+
});
|
|
205
|
+
exports.serverSettingsSchema = zod_1.z.object({
|
|
206
|
+
cameraCalibration: zod_1.z.object({
|
|
207
|
+
posLat: zod_1.z.number(),
|
|
208
|
+
posLon: zod_1.z.number(),
|
|
209
|
+
geoidHN: zod_1.z.number(),
|
|
210
|
+
altitudeAmsl: zod_1.z.number(),
|
|
211
|
+
rotationEast: zod_1.z.number(),
|
|
212
|
+
rotationNorth: zod_1.z.number(),
|
|
213
|
+
rotationUp: zod_1.z.number(),
|
|
214
|
+
tiltTransformationCoefA: zod_1.z.number(),
|
|
215
|
+
tiltCameraKnownPoint: zod_1.z.number(),
|
|
216
|
+
tiltRealKnownPoint: zod_1.z.number(),
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
exports.trackingModeSchema = zod_1.z.object({
|
|
220
|
+
mode: zod_1.z.union([zod_1.z.literal('MANUAL'), zod_1.z.literal('AUTOMATIC')]),
|
|
221
|
+
});
|
|
222
|
+
exports.flightInfoSchema = zod_1.z.object({
|
|
223
|
+
callsign: zod_1.z.string().optional(),
|
|
224
|
+
flightNumber: zod_1.z.string().optional(),
|
|
225
|
+
registration: zod_1.z.string().optional(),
|
|
226
|
+
aircraftType: zod_1.z.string().optional(),
|
|
227
|
+
airlines: zod_1.z.string().optional(),
|
|
228
|
+
originAirport: zod_1.z
|
|
229
|
+
.object({
|
|
230
|
+
icao: zod_1.z.string().optional(),
|
|
231
|
+
iata: zod_1.z.string().optional(),
|
|
232
|
+
city: zod_1.z.string().optional(),
|
|
233
|
+
})
|
|
234
|
+
.optional(),
|
|
235
|
+
destinationAirport: zod_1.z.object({
|
|
236
|
+
icao: zod_1.z.string().optional(),
|
|
237
|
+
iata: zod_1.z.string().optional(),
|
|
238
|
+
city: zod_1.z.string().optional(),
|
|
239
|
+
}),
|
|
240
|
+
flightImages: zod_1.z
|
|
241
|
+
.array(zod_1.z.object({
|
|
242
|
+
src: zod_1.z.string().optional(),
|
|
243
|
+
photographer: zod_1.z.string().optional(),
|
|
244
|
+
}))
|
|
245
|
+
.optional(),
|
|
246
|
+
});
|
|
247
|
+
exports.priorityListSchema = zod_1.z.object({
|
|
248
|
+
priorityList: zod_1.z.array(zod_1.z.string()).default([]),
|
|
249
|
+
});
|
|
250
|
+
exports.whiteListSchema = zod_1.z.object({
|
|
251
|
+
whiteList: zod_1.z.array(zod_1.z.string()).default([]),
|
|
252
|
+
});
|
|
253
|
+
exports.blackListSchema = zod_1.z.object({
|
|
254
|
+
blackList: zod_1.z.array(zod_1.z.string()).default([]),
|
|
255
|
+
});
|
|
256
|
+
exports.mapTypeSchema = zod_1.z.enum(['roadmap', 'satellite']);
|
|
257
|
+
exports.mapInfoSchema = zod_1.z.object({
|
|
258
|
+
minZoom: zod_1.z.number().nonnegative(),
|
|
259
|
+
maxZoom: zod_1.z.number().nonnegative(),
|
|
260
|
+
mapTypes: zod_1.z.array(exports.mapTypeSchema),
|
|
261
|
+
tileSize: zod_1.z.number().nonnegative(),
|
|
262
|
+
});
|
|
263
|
+
exports.zonesSchema = zod_1.z.object({
|
|
264
|
+
zones: zod_1.z
|
|
265
|
+
.array(zod_1.z.object({
|
|
266
|
+
enabled: zod_1.z.boolean().default(true),
|
|
267
|
+
name: zod_1.z.string().optional(),
|
|
268
|
+
area: zod_1.z
|
|
269
|
+
.array(zod_1.z.object({
|
|
270
|
+
lat: zod_1.z.number(),
|
|
271
|
+
lon: zod_1.z.number(),
|
|
272
|
+
}))
|
|
273
|
+
.nonempty(),
|
|
274
|
+
minAltitudeAmsl: zod_1.z.number().optional(),
|
|
275
|
+
maxAltitudeAmsl: zod_1.z.number().optional(),
|
|
276
|
+
minSpeedKmph: zod_1.z.number().optional(),
|
|
277
|
+
maxSpeedKmph: zod_1.z.number().optional(),
|
|
278
|
+
weight: zod_1.z.number(),
|
|
279
|
+
}))
|
|
280
|
+
.default([]),
|
|
281
|
+
});
|
package/cjs/types/VapixAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.audioSampleRatesResponseSchema = exports.dateTimeinfoSchema = exports.maxFpsResponseSchema = exports.audioDeviceRequestSchema = exports.audioDeviceSchema = exports.audioDeviceInputOutputSchema = exports.audioDeviceConnectionTypeSchema = exports.audioDeviceSignalingTypeSchema = exports.audioDeviceSignalingChannelTypeSchema = exports.cameraPTZItemSchema = exports.cameraPTZItemDataSchema = exports.
|
|
3
|
+
exports.portSequenceStateSchema = exports.portSetSchema = exports.getPortsResponseSchema = exports.portStatusSchema = exports.audioSampleRatesResponseSchema = exports.timeZoneSchema = exports.dateTimeinfoSchema = exports.maxFpsResponseSchema = exports.audioDeviceRequestSchema = exports.audioDeviceSchema = exports.audioDeviceInputOutputSchema = exports.audioDeviceConnectionTypeSchema = exports.audioDeviceSignalingTypeSchema = exports.audioDeviceSignalingChannelTypeSchema = exports.cameraPTZItemSchema = exports.cameraPTZItemDataSchema = exports.ptzOverviewSchema = exports.sdCardInfoSchema = exports.sdCardWatchedStatuses = exports.guardTourSchema = exports.APP_IDS = exports.applicationListSchema = exports.applicationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const transformers_1 = require("../internal/transformers");
|
|
6
6
|
exports.applicationSchema = zod_1.z.object({
|
|
@@ -15,6 +15,19 @@ exports.applicationSchema = zod_1.z.object({
|
|
|
15
15
|
VendorHomePage: zod_1.z.string().optional(),
|
|
16
16
|
LicenseName: zod_1.z.string().optional(),
|
|
17
17
|
});
|
|
18
|
+
exports.applicationListSchema = zod_1.z.array(exports.applicationSchema.extend({
|
|
19
|
+
appId: zod_1.z
|
|
20
|
+
.union([
|
|
21
|
+
zod_1.z.literal('CamStreamer'),
|
|
22
|
+
zod_1.z.literal('CamSwitcher'),
|
|
23
|
+
zod_1.z.literal('CamOverlay'),
|
|
24
|
+
zod_1.z.literal('CamScripter'),
|
|
25
|
+
zod_1.z.literal('PlaneTracker'),
|
|
26
|
+
zod_1.z.literal('Ndihxplugin'),
|
|
27
|
+
zod_1.z.literal('SportTracker'),
|
|
28
|
+
])
|
|
29
|
+
.nullable(),
|
|
30
|
+
}));
|
|
18
31
|
exports.APP_IDS = [
|
|
19
32
|
'CamStreamer',
|
|
20
33
|
'CamSwitcher',
|
|
@@ -22,15 +35,8 @@ exports.APP_IDS = [
|
|
|
22
35
|
'CamScripter',
|
|
23
36
|
'PlaneTracker',
|
|
24
37
|
'Ndihxplugin',
|
|
38
|
+
'SportTracker',
|
|
25
39
|
];
|
|
26
|
-
exports.applicationListSchema = zod_1.z.object({
|
|
27
|
-
reply: zod_1.z.object({
|
|
28
|
-
$: zod_1.z.object({ result: zod_1.z.string() }),
|
|
29
|
-
application: zod_1.z.array(zod_1.z.object({
|
|
30
|
-
$: exports.applicationSchema,
|
|
31
|
-
})),
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
40
|
exports.guardTourSchema = zod_1.z.object({
|
|
35
41
|
id: zod_1.z.string(),
|
|
36
42
|
camNbr: zod_1.z.unknown(),
|
|
@@ -52,7 +58,12 @@ const audioSampleRatesSchema = zod_1.z.object({
|
|
|
52
58
|
});
|
|
53
59
|
const audioSampleRatesOutSchema = audioSampleRatesSchema.transform(transformers_1.toCamelCaseDeep);
|
|
54
60
|
exports.sdCardWatchedStatuses = ['OK', 'connected', 'disconnected'];
|
|
55
|
-
exports.
|
|
61
|
+
exports.sdCardInfoSchema = zod_1.z.object({
|
|
62
|
+
status: zod_1.z.enum(exports.sdCardWatchedStatuses),
|
|
63
|
+
totalSize: zod_1.z.number(),
|
|
64
|
+
freeSize: zod_1.z.number(),
|
|
65
|
+
});
|
|
66
|
+
exports.ptzOverviewSchema = zod_1.z.record(zod_1.z.number(), zod_1.z.array(zod_1.z.object({ id: zod_1.z.number(), name: zod_1.z.string() })));
|
|
56
67
|
exports.cameraPTZItemDataSchema = zod_1.z.object({
|
|
57
68
|
pan: zod_1.z.number().optional(),
|
|
58
69
|
tilt: zod_1.z.number().optional(),
|
|
@@ -70,7 +81,7 @@ exports.audioDeviceSignalingChannelTypeSchema = zod_1.z.object({
|
|
|
70
81
|
});
|
|
71
82
|
exports.audioDeviceSignalingTypeSchema = zod_1.z.object({
|
|
72
83
|
id: zod_1.z.string(),
|
|
73
|
-
powerType: zod_1.z.string(),
|
|
84
|
+
powerType: zod_1.z.string().optional(),
|
|
74
85
|
channels: zod_1.z.array(exports.audioDeviceSignalingChannelTypeSchema),
|
|
75
86
|
});
|
|
76
87
|
exports.audioDeviceConnectionTypeSchema = zod_1.z.object({
|
|
@@ -97,7 +108,9 @@ const audioDeviceFromRequestSchema = zod_1.z.object({
|
|
|
97
108
|
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
98
109
|
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
99
110
|
});
|
|
100
|
-
exports.audioDeviceRequestSchema = zod_1.z.object({
|
|
111
|
+
exports.audioDeviceRequestSchema = zod_1.z.object({
|
|
112
|
+
data: zod_1.z.object({ devices: zod_1.z.array(audioDeviceFromRequestSchema) }),
|
|
113
|
+
});
|
|
101
114
|
exports.maxFpsResponseSchema = zod_1.z.object({
|
|
102
115
|
data: zod_1.z
|
|
103
116
|
.array(zod_1.z.object({
|
|
@@ -115,9 +128,23 @@ exports.dateTimeinfoSchema = zod_1.z.object({
|
|
|
115
128
|
dstEnabled: zod_1.z.boolean(),
|
|
116
129
|
localDateTime: zod_1.z.string(),
|
|
117
130
|
posixTimeZone: zod_1.z.string(),
|
|
118
|
-
timeZone: zod_1.z.string(),
|
|
131
|
+
timeZone: zod_1.z.string().optional(),
|
|
119
132
|
}),
|
|
120
133
|
});
|
|
134
|
+
exports.timeZoneSchema = zod_1.z.discriminatedUnion('status', [
|
|
135
|
+
zod_1.z.object({
|
|
136
|
+
status: zod_1.z.literal('success'),
|
|
137
|
+
data: zod_1.z.object({
|
|
138
|
+
activeTimeZone: zod_1.z.string(),
|
|
139
|
+
}),
|
|
140
|
+
}),
|
|
141
|
+
zod_1.z.object({
|
|
142
|
+
status: zod_1.z.literal('error'),
|
|
143
|
+
error: zod_1.z.object({
|
|
144
|
+
message: zod_1.z.string(),
|
|
145
|
+
}),
|
|
146
|
+
}),
|
|
147
|
+
]);
|
|
121
148
|
exports.audioSampleRatesResponseSchema = zod_1.z.object({
|
|
122
149
|
data: zod_1.z.object({
|
|
123
150
|
encoders: zod_1.z
|
|
@@ -128,3 +155,34 @@ exports.audioSampleRatesResponseSchema = zod_1.z.object({
|
|
|
128
155
|
.partial(),
|
|
129
156
|
}),
|
|
130
157
|
});
|
|
158
|
+
exports.portStatusSchema = zod_1.z.object({
|
|
159
|
+
port: zod_1.z.string(),
|
|
160
|
+
state: zod_1.z.enum(['open', 'closed']),
|
|
161
|
+
configurable: zod_1.z.boolean(),
|
|
162
|
+
readonly: zod_1.z.boolean().optional(),
|
|
163
|
+
usage: zod_1.z.string(),
|
|
164
|
+
direction: zod_1.z.enum(['input', 'output']),
|
|
165
|
+
name: zod_1.z.string(),
|
|
166
|
+
normalState: zod_1.z.enum(['open', 'closed']),
|
|
167
|
+
});
|
|
168
|
+
exports.getPortsResponseSchema = zod_1.z.object({
|
|
169
|
+
apiVersion: zod_1.z.string(),
|
|
170
|
+
context: zod_1.z.string(),
|
|
171
|
+
method: zod_1.z.literal('getPorts'),
|
|
172
|
+
data: zod_1.z.object({
|
|
173
|
+
numberOfPorts: zod_1.z.number(),
|
|
174
|
+
items: zod_1.z.array(exports.portStatusSchema),
|
|
175
|
+
}),
|
|
176
|
+
});
|
|
177
|
+
exports.portSetSchema = zod_1.z.object({
|
|
178
|
+
port: zod_1.z.string(),
|
|
179
|
+
state: zod_1.z.enum(['open', 'closed']),
|
|
180
|
+
usage: zod_1.z.string().optional(),
|
|
181
|
+
direction: zod_1.z.enum(['input', 'output']).optional(),
|
|
182
|
+
name: zod_1.z.string().optional(),
|
|
183
|
+
normalState: zod_1.z.enum(['open', 'closed']).optional(),
|
|
184
|
+
});
|
|
185
|
+
exports.portSequenceStateSchema = zod_1.z.object({
|
|
186
|
+
state: zod_1.z.enum(['open', 'closed']),
|
|
187
|
+
time: zod_1.z.number().min(0).max(65535),
|
|
188
|
+
});
|
package/cjs/web/DefaultClient.js
CHANGED
|
@@ -3,18 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DefaultClient = void 0;
|
|
4
4
|
const utils_1 = require("../internal/utils");
|
|
5
5
|
class DefaultClient {
|
|
6
|
-
get
|
|
7
|
-
return
|
|
6
|
+
get = (params) => {
|
|
7
|
+
return this.fetchWithTimeout((0, utils_1.addParametersToPath)(params.path, params.parameters), {
|
|
8
8
|
method: 'GET',
|
|
9
|
-
headers: headers,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
post
|
|
13
|
-
return
|
|
9
|
+
headers: params.headers,
|
|
10
|
+
}, params.timeout);
|
|
11
|
+
};
|
|
12
|
+
post = (params) => {
|
|
13
|
+
return this.fetchWithTimeout((0, utils_1.addParametersToPath)(params.path, params.parameters), {
|
|
14
14
|
method: 'POST',
|
|
15
|
-
body: data,
|
|
16
|
-
headers: headers,
|
|
17
|
-
});
|
|
15
|
+
body: params.data,
|
|
16
|
+
headers: params.headers,
|
|
17
|
+
}, params.timeout);
|
|
18
|
+
};
|
|
19
|
+
async fetchWithTimeout(url, options, timeout) {
|
|
20
|
+
const controller = new AbortController();
|
|
21
|
+
const timeoutId = timeout !== undefined ? setTimeout(() => controller.abort(), timeout) : null;
|
|
22
|
+
try {
|
|
23
|
+
return await fetch(url, { ...options, signal: controller.signal });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
if (timeoutId) {
|
|
27
|
+
clearTimeout(timeoutId);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
32
|
exports.DefaultClient = DefaultClient;
|
package/cjs/web/WsClient.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WsClient = void 0;
|
|
4
|
-
const REFRESH_TIMEOUT =
|
|
4
|
+
const REFRESH_TIMEOUT = 5000;
|
|
5
5
|
class WsClient {
|
|
6
6
|
getUrl;
|
|
7
7
|
getAuthToken;
|
|
@@ -30,7 +30,7 @@ class WsClient {
|
|
|
30
30
|
};
|
|
31
31
|
ws.onmessage = (e) => this.onmessage(e);
|
|
32
32
|
ws.onclose = () => {
|
|
33
|
-
this.restartTimeout = setTimeout(() => this.init(), REFRESH_TIMEOUT);
|
|
33
|
+
this.restartTimeout = window.setTimeout(() => this.init(), REFRESH_TIMEOUT);
|
|
34
34
|
};
|
|
35
35
|
this.ws = ws;
|
|
36
36
|
}
|
|
@@ -43,7 +43,7 @@ class WsClient {
|
|
|
43
43
|
this.destroyWebsocket();
|
|
44
44
|
};
|
|
45
45
|
destroyWebsocket() {
|
|
46
|
-
if (this.restartTimeout) {
|
|
46
|
+
if (this.restartTimeout !== null) {
|
|
47
47
|
clearTimeout(this.restartTimeout);
|
|
48
48
|
this.restartTimeout = null;
|
|
49
49
|
}
|