camstreamerlib 4.0.0-beta.4 → 4.0.0-beta.41

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.
Files changed (240) hide show
  1. package/README.md +112 -0
  2. package/cjs/CamOverlayAPI.js +135 -92
  3. package/cjs/CamScripterAPI.js +52 -42
  4. package/cjs/CamStreamerAPI.js +83 -39
  5. package/cjs/CamSwitcherAPI.js +141 -123
  6. package/cjs/CamSwitcherEvents.js +4 -60
  7. package/cjs/PlaneTrackerAPI.js +210 -0
  8. package/cjs/VapixAPI.js +323 -233
  9. package/cjs/{CreatePackage.js → bin/CreatePackage.js} +22 -19
  10. package/cjs/errors/errors.js +78 -1
  11. package/cjs/index.js +17 -4
  12. package/cjs/internal/ProxyClient.js +28 -32
  13. package/cjs/internal/WsEvents.js +72 -0
  14. package/cjs/internal/types.js +2 -0
  15. package/cjs/internal/utils.js +22 -3
  16. package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +7 -4
  17. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  18. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
  19. package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
  20. package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +7 -4
  21. package/cjs/node/DefaultClient.js +10 -12
  22. package/cjs/{internal → node}/Digest.js +8 -5
  23. package/cjs/node/HttpRequestSender.js +14 -4
  24. package/cjs/node/HttpServer.js +15 -12
  25. package/cjs/{VapixEvents.js → node/VapixEvents.js} +1 -1
  26. package/cjs/node/WsClient.js +12 -9
  27. package/cjs/node/events/AxisCameraStationEvents.js +53 -0
  28. package/cjs/node/events/GenetecAgent.js +123 -0
  29. package/cjs/node/index.js +38 -5
  30. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
  31. package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
  32. package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
  33. package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
  34. package/cjs/types/CamOverlayAPI/index.js +27 -0
  35. package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
  36. package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
  37. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +25 -0
  38. package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
  39. package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
  40. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
  41. package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
  42. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
  43. package/cjs/types/CamOverlayDrawingAPI.js +2 -0
  44. package/cjs/types/CamOverlayPainter.js +14 -0
  45. package/cjs/types/CamScripterAPI.js +22 -7
  46. package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
  47. package/cjs/types/CamStreamerAPI.js +34 -3
  48. package/cjs/types/CamSwitcherAPI.js +38 -1
  49. package/cjs/types/CamSwitcherEvents.js +8 -0
  50. package/cjs/types/GenetecAgent.js +31 -0
  51. package/cjs/types/PlaneTrackerAPI.js +286 -0
  52. package/cjs/types/VapixAPI.js +71 -13
  53. package/cjs/types/VapixEvents.js +2 -0
  54. package/cjs/web/DefaultClient.js +22 -10
  55. package/cjs/web/WsClient.js +3 -3
  56. package/esm/CamOverlayAPI.js +131 -88
  57. package/esm/CamScripterAPI.js +48 -38
  58. package/esm/CamStreamerAPI.js +81 -38
  59. package/esm/CamSwitcherAPI.js +137 -119
  60. package/esm/CamSwitcherEvents.js +5 -61
  61. package/esm/PlaneTrackerAPI.js +206 -0
  62. package/esm/VapixAPI.js +315 -225
  63. package/esm/{CreatePackage.js → bin/CreatePackage.js} +3 -3
  64. package/esm/errors/errors.js +66 -0
  65. package/esm/index.js +12 -3
  66. package/esm/internal/ProxyClient.js +28 -32
  67. package/esm/internal/WsEvents.js +68 -0
  68. package/esm/internal/utils.js +17 -1
  69. package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +2 -2
  70. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  71. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
  72. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
  73. package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +2 -2
  74. package/esm/node/DefaultClient.js +10 -12
  75. package/esm/{internal → node}/Digest.js +1 -1
  76. package/esm/node/HttpRequestSender.js +14 -4
  77. package/esm/node/HttpServer.js +5 -5
  78. package/esm/{VapixEvents.js → node/VapixEvents.js} +1 -1
  79. package/esm/node/WsClient.js +3 -3
  80. package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
  81. package/esm/node/events/GenetecAgent.js +119 -0
  82. package/esm/node/index.js +17 -2
  83. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
  84. package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
  85. package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
  86. package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
  87. package/esm/types/CamOverlayAPI/index.js +11 -0
  88. package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
  89. package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
  90. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +22 -0
  91. package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
  92. package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
  93. package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
  94. package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
  95. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
  96. package/esm/types/CamOverlayPainter.js +11 -0
  97. package/esm/types/CamScripterAPI.js +21 -6
  98. package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
  99. package/esm/types/CamStreamerAPI.js +33 -2
  100. package/esm/types/CamSwitcherAPI.js +38 -1
  101. package/esm/types/CamSwitcherEvents.js +8 -0
  102. package/esm/types/GenetecAgent.js +28 -0
  103. package/esm/types/PlaneTrackerAPI.js +283 -0
  104. package/esm/types/VapixAPI.js +70 -12
  105. package/esm/types/VapixEvents.js +1 -0
  106. package/esm/web/DefaultClient.js +22 -10
  107. package/esm/web/WsClient.js +3 -3
  108. package/package.json +30 -12
  109. package/types/CamOverlayAPI.d.ts +865 -0
  110. package/types/CamScripterAPI.d.ts +47 -0
  111. package/types/CamStreamerAPI.d.ts +64 -0
  112. package/types/CamSwitcherAPI.d.ts +167 -0
  113. package/types/CamSwitcherEvents.d.ts +8 -0
  114. package/types/PlaneTrackerAPI.d.ts +230 -0
  115. package/types/VapixAPI.d.ts +118 -0
  116. package/types/bin/CreatePackage.d.ts +1 -0
  117. package/types/errors/errors.d.ts +68 -0
  118. package/types/index.d.ts +20 -0
  119. package/types/internal/ProxyClient.d.ts +10 -0
  120. package/types/internal/WsEvents.d.ts +41 -0
  121. package/types/internal/types.d.ts +45 -0
  122. package/{cjs → types}/internal/utils.d.ts +4 -1
  123. package/{cjs → types}/internal/versionCompare.d.ts +2 -2
  124. package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
  125. package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
  126. package/{cjs → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
  127. package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
  128. package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
  129. package/types/node/DefaultClient.d.ts +16 -0
  130. package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
  131. package/{cjs → types}/node/HttpServer.d.ts +2 -2
  132. package/types/node/VapixEvents.d.ts +16 -0
  133. package/{cjs → types}/node/WsClient.d.ts +3 -2
  134. package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
  135. package/types/node/events/GenetecAgent.d.ts +16 -0
  136. package/types/node/index.d.ts +17 -0
  137. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4321 -0
  138. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
  139. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
  140. package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
  141. package/types/types/CamOverlayAPI/index.d.ts +11 -0
  142. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
  143. package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
  144. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
  145. package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
  146. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
  147. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
  148. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
  149. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
  150. package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
  151. package/types/types/CamOverlayPainter.d.ts +76 -0
  152. package/types/types/CamScripterAPI.d.ts +130 -0
  153. package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
  154. package/types/types/CamStreamerAPI.d.ts +272 -0
  155. package/{esm → types}/types/CamSwitcherAPI.d.ts +115 -36
  156. package/{cjs → types}/types/CamSwitcherEvents.d.ts +77 -0
  157. package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
  158. package/types/types/PlaneTrackerAPI.d.ts +890 -0
  159. package/{cjs → types}/types/VapixAPI.d.ts +647 -465
  160. package/types/types/VapixEvents.d.ts +15 -0
  161. package/{esm → types}/types/common.d.ts +15 -5
  162. package/types/web/DefaultClient.d.ts +6 -0
  163. package/cjs/CamOverlayAPI.d.ts +0 -31
  164. package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
  165. package/cjs/CamOverlayPainter/Frame.d.ts +0 -96
  166. package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
  167. package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
  168. package/cjs/CamScripterAPI.d.ts +0 -19
  169. package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  170. package/cjs/CamStreamerAPI.d.ts +0 -16
  171. package/cjs/CamSwitcherAPI.d.ts +0 -48
  172. package/cjs/CamSwitcherEvents.d.ts +0 -18
  173. package/cjs/VapixAPI.d.ts +0 -66
  174. package/cjs/VapixEvents.d.ts +0 -43
  175. package/cjs/errors/errors.d.ts +0 -34
  176. package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
  177. package/cjs/events/AxisCameraStationEvents.js +0 -48
  178. package/cjs/events/GenetecAgent.d.ts +0 -174
  179. package/cjs/events/GenetecAgent.js +0 -123
  180. package/cjs/index.d.ts +0 -11
  181. package/cjs/internal/ProxyClient.d.ts +0 -11
  182. package/cjs/internal/common.d.ts +0 -39
  183. package/cjs/internal/common.js +0 -27
  184. package/cjs/node/DefaultClient.d.ts +0 -15
  185. package/cjs/node/HttpRequestSender.d.ts +0 -28
  186. package/cjs/node/WsEventClient.d.ts +0 -13
  187. package/cjs/node/WsEventClient.js +0 -22
  188. package/cjs/types/CamOverlayAPI.d.ts +0 -188
  189. package/cjs/types/CamOverlayAPI.js +0 -47
  190. package/cjs/types/CamScripterAPI.d.ts +0 -67
  191. package/cjs/types/CamStreamerAPI.d.ts +0 -139
  192. package/cjs/types/CamSwitcherAPI.d.ts +0 -814
  193. package/cjs/types/common.d.ts +0 -37
  194. package/cjs/web/DefaultClient.d.ts +0 -6
  195. package/cjs/web/index.d.ts +0 -2
  196. package/esm/CamOverlayAPI.d.ts +0 -31
  197. package/esm/CamOverlayDrawingAPI.d.ts +0 -86
  198. package/esm/CamOverlayPainter/Painter.d.ts +0 -48
  199. package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
  200. package/esm/CamScripterAPI.d.ts +0 -19
  201. package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  202. package/esm/CamStreamerAPI.d.ts +0 -16
  203. package/esm/CamSwitcherAPI.d.ts +0 -48
  204. package/esm/CamSwitcherEvents.d.ts +0 -18
  205. package/esm/VapixAPI.d.ts +0 -66
  206. package/esm/VapixEvents.d.ts +0 -43
  207. package/esm/errors/errors.d.ts +0 -34
  208. package/esm/events/AxisCameraStationEvents.d.ts +0 -9
  209. package/esm/events/GenetecAgent.js +0 -119
  210. package/esm/index.d.ts +0 -11
  211. package/esm/internal/Digest.d.ts +0 -4
  212. package/esm/internal/ProxyClient.d.ts +0 -11
  213. package/esm/internal/common.d.ts +0 -39
  214. package/esm/internal/common.js +0 -20
  215. package/esm/internal/constants.d.ts +0 -1
  216. package/esm/internal/transformers.d.ts +0 -5
  217. package/esm/internal/utils.d.ts +0 -11
  218. package/esm/internal/versionCompare.d.ts +0 -6
  219. package/esm/node/DefaultClient.d.ts +0 -15
  220. package/esm/node/HttpServer.d.ts +0 -21
  221. package/esm/node/WsClient.d.ts +0 -39
  222. package/esm/node/WsEventClient.d.ts +0 -13
  223. package/esm/node/WsEventClient.js +0 -18
  224. package/esm/node/index.d.ts +0 -2
  225. package/esm/types/CamOverlayAPI.d.ts +0 -188
  226. package/esm/types/CamOverlayAPI.js +0 -44
  227. package/esm/types/CamScripterAPI.d.ts +0 -67
  228. package/esm/types/CamStreamerAPI.d.ts +0 -139
  229. package/esm/types/CamSwitcherEvents.d.ts +0 -491
  230. package/esm/types/VapixAPI.d.ts +0 -1683
  231. package/esm/web/DefaultClient.d.ts +0 -6
  232. package/esm/web/WsClient.d.ts +0 -13
  233. package/esm/web/index.d.ts +0 -2
  234. /package/{cjs/CreatePackage.d.ts → esm/internal/types.js} +0 -0
  235. /package/esm/{CreatePackage.d.ts → types/CamOverlayDrawingAPI.js} +0 -0
  236. /package/{cjs → types}/internal/constants.d.ts +0 -0
  237. /package/{cjs → types}/internal/transformers.d.ts +0 -0
  238. /package/{cjs/internal → types/node}/Digest.d.ts +0 -0
  239. /package/{cjs → types}/web/WsClient.d.ts +0 -0
  240. /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,286 @@
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 = exports.wsAliasResponseSchema = void 0;
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
+ exports.connectionSchema = zod_1.z.object({
11
+ protocol: zod_1.z.union([zod_1.z.literal('http'), zod_1.z.literal('https'), zod_1.z.literal('https_insecure')]),
12
+ ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
13
+ port: zod_1.z.number().positive().lt(65535),
14
+ user: zod_1.z.string(),
15
+ pass: zod_1.z.string(),
16
+ });
17
+ exports.widgetSchema = zod_1.z.object({
18
+ enabled: zod_1.z.boolean().default(true),
19
+ coord: zod_1.z.union([
20
+ zod_1.z.literal('top_left'),
21
+ zod_1.z.literal('top_right'),
22
+ zod_1.z.literal('bottom_left'),
23
+ zod_1.z.literal('bottom_right'),
24
+ ]),
25
+ posX: zod_1.z.number().nonnegative(),
26
+ posY: zod_1.z.number().nonnegative(),
27
+ scale: zod_1.z.number().positive(),
28
+ });
29
+ const labelOptionsSchema = zod_1.z.union([
30
+ zod_1.z.literal('blank'),
31
+ zod_1.z.literal('registration'),
32
+ zod_1.z.literal('call_sign'),
33
+ zod_1.z.literal('flight_number'),
34
+ zod_1.z.literal('icao'),
35
+ ]);
36
+ const identificationLabelSchema = zod_1.z.object({
37
+ firstRow: labelOptionsSchema,
38
+ secondRow: labelOptionsSchema,
39
+ thirdRow: labelOptionsSchema,
40
+ fourthRow: labelOptionsSchema,
41
+ opacity: zod_1.z.number().positive(),
42
+ });
43
+ exports.cameraSettingsSchema = zod_1.z.object({
44
+ units: zod_1.z.union([zod_1.z.literal('metric'), zod_1.z.literal('imperial')]).default('imperial'),
45
+ adsbSource: zod_1.z
46
+ .object({
47
+ ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
48
+ port: zod_1.z.number().positive().lt(65535),
49
+ })
50
+ .default({ ip: '', port: 30334 }),
51
+ camera: exports.connectionSchema.default({
52
+ protocol: 'http',
53
+ ip: '127.0.0.1',
54
+ port: 80,
55
+ user: 'root',
56
+ pass: '',
57
+ }),
58
+ cameraCalibrationProcessConfig: zod_1.z
59
+ .object({
60
+ nightSkyCalibrationEnabled: zod_1.z.boolean(),
61
+ scheduleNightSkyCalibrationTimestamp: zod_1.z.number(),
62
+ })
63
+ .default({ nightSkyCalibrationEnabled: false, scheduleNightSkyCalibrationTimestamp: 0 }),
64
+ cameraConfig: zod_1.z
65
+ .object({
66
+ maxZoomLevel: zod_1.z.number().optional(),
67
+ defaultCaptureSizeMeters: zod_1.z.number().positive().default(120),
68
+ captureSizeExtensionMeters: zod_1.z.number().positive().default(80),
69
+ })
70
+ .default({
71
+ maxZoomLevel: 30,
72
+ defaultCaptureSizeMeters: 120,
73
+ captureSizeExtensionMeters: 80,
74
+ }),
75
+ stream: zod_1.z
76
+ .object({
77
+ width: zod_1.z.number().positive(),
78
+ height: zod_1.z.number().positive(),
79
+ })
80
+ .default({ width: 1920, height: 1080 }),
81
+ imageConfig: zod_1.z
82
+ .object({
83
+ dayAperture: zod_1.z.number().nonnegative().min(0).max(100),
84
+ nightAperture: zod_1.z.number().nonnegative().min(0).max(100),
85
+ })
86
+ .default({ dayAperture: 50, nightAperture: 0 }),
87
+ airportConfig: zod_1.z
88
+ .object({
89
+ icao: zod_1.z.string().default(''),
90
+ centerLat: zod_1.z.number(),
91
+ centerLon: zod_1.z.number(),
92
+ radius: zod_1.z.number().nonnegative().default(10000),
93
+ })
94
+ .default({
95
+ icao: '',
96
+ centerLat: 0,
97
+ centerLon: 0,
98
+ radius: 10000,
99
+ }),
100
+ trackingConfig: zod_1.z
101
+ .object({
102
+ prioritizeEmergency: zod_1.z.boolean(),
103
+ guardTourEnabled: zod_1.z.boolean().default(false),
104
+ guardTourId: zod_1.z.number().int().nonnegative().default(0),
105
+ })
106
+ .default({ prioritizeEmergency: true, guardTourEnabled: false, guardTourId: 0 }),
107
+ overlayText: zod_1.z
108
+ .object({
109
+ displayIcao: zod_1.z.boolean().optional(),
110
+ displayRegistration: zod_1.z.boolean().optional(),
111
+ displayFlightNumber: zod_1.z.boolean().optional(),
112
+ displayAltitude: zod_1.z.boolean().optional(),
113
+ displayVelocity: zod_1.z.boolean().optional(),
114
+ displayDistance: zod_1.z.boolean().optional(),
115
+ displayFOV: zod_1.z.boolean().optional(),
116
+ displayPTError: zod_1.z.boolean().optional(),
117
+ displayPTZSpeed: zod_1.z.boolean().optional(),
118
+ displayVelocityData: zod_1.z.boolean().optional(),
119
+ displaySignalQuality: zod_1.z.boolean().optional(),
120
+ displayAutoTrackingInfo: zod_1.z.boolean().optional(),
121
+ displayGPSCoords: zod_1.z.boolean().optional(),
122
+ displayVapixQuery: zod_1.z.boolean().optional(),
123
+ displayFocus: zod_1.z.boolean().optional(),
124
+ displayAperture: zod_1.z.boolean().optional(),
125
+ displaySunDistance: zod_1.z.boolean().optional(),
126
+ displayTickTime: zod_1.z.boolean().optional(),
127
+ displayAircraftInfo: zod_1.z.boolean().optional(),
128
+ })
129
+ .optional(),
130
+ widget: exports.widgetSchema.default({
131
+ enabled: true,
132
+ coord: 'top_right',
133
+ posX: 10,
134
+ posY: 10,
135
+ scale: 100,
136
+ }),
137
+ airportWidget: exports.widgetSchema.default({
138
+ enabled: true,
139
+ coord: 'top_left',
140
+ posX: 10,
141
+ posY: 10,
142
+ scale: 100,
143
+ }),
144
+ fr24FlightInfoSource: zod_1.z
145
+ .object({
146
+ enabled: zod_1.z.boolean().default(false),
147
+ priority: zod_1.z.number().int().positive().default(1),
148
+ apiToken: zod_1.z.string().default(''),
149
+ validateFlights: zod_1.z.boolean().default(true),
150
+ })
151
+ .default({
152
+ enabled: false,
153
+ priority: 1,
154
+ apiToken: '',
155
+ validateFlights: true,
156
+ }),
157
+ radarcapeFlightInfoSource: zod_1.z
158
+ .object({
159
+ enabled: zod_1.z.boolean().default(false),
160
+ priority: zod_1.z.number().int().positive().default(2),
161
+ ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]).default(''),
162
+ port: zod_1.z.number().positive().lt(65535).default(80),
163
+ })
164
+ .default({
165
+ enabled: false,
166
+ priority: 2,
167
+ ip: '',
168
+ port: 80,
169
+ }),
170
+ identificationLabel: identificationLabelSchema.default({
171
+ firstRow: 'registration',
172
+ secondRow: 'blank',
173
+ thirdRow: 'blank',
174
+ fourthRow: 'blank',
175
+ opacity: 30,
176
+ }),
177
+ acs: exports.connectionSchema
178
+ .extend({
179
+ enabled: zod_1.z.boolean(),
180
+ sourceKey: zod_1.z.string(),
181
+ })
182
+ .default({
183
+ enabled: false,
184
+ protocol: 'https_insecure',
185
+ ip: '',
186
+ port: 29204,
187
+ user: '',
188
+ pass: '',
189
+ sourceKey: '',
190
+ }),
191
+ genetec: exports.connectionSchema
192
+ .extend({
193
+ enabled: zod_1.z.boolean(),
194
+ baseUri: zod_1.z.string().default(''),
195
+ appId: zod_1.z.string().default(''),
196
+ cameraList: zod_1.z.string().array().default([]),
197
+ })
198
+ .default({
199
+ enabled: false,
200
+ protocol: 'http',
201
+ ip: '',
202
+ port: 4590,
203
+ user: '',
204
+ pass: '',
205
+ baseUri: 'WebSdk',
206
+ appId: '',
207
+ cameraList: [],
208
+ }),
209
+ });
210
+ exports.serverSettingsSchema = zod_1.z.object({
211
+ cameraCalibration: zod_1.z.object({
212
+ posLat: zod_1.z.number(),
213
+ posLon: zod_1.z.number(),
214
+ geoidHN: zod_1.z.number(),
215
+ altitudeAmsl: zod_1.z.number(),
216
+ rotationEast: zod_1.z.number(),
217
+ rotationNorth: zod_1.z.number(),
218
+ rotationUp: zod_1.z.number(),
219
+ tiltTransformationCoefA: zod_1.z.number(),
220
+ tiltCameraKnownPoint: zod_1.z.number(),
221
+ tiltRealKnownPoint: zod_1.z.number(),
222
+ }),
223
+ });
224
+ exports.trackingModeSchema = zod_1.z.object({
225
+ mode: zod_1.z.union([zod_1.z.literal('MANUAL'), zod_1.z.literal('AUTOMATIC')]),
226
+ });
227
+ exports.flightInfoSchema = zod_1.z.object({
228
+ callsign: zod_1.z.string().optional(),
229
+ flightNumber: zod_1.z.string().optional(),
230
+ registration: zod_1.z.string().optional(),
231
+ aircraftType: zod_1.z.string().optional(),
232
+ airlines: zod_1.z.string().optional(),
233
+ originAirport: zod_1.z
234
+ .object({
235
+ icao: zod_1.z.string().optional(),
236
+ iata: zod_1.z.string().optional(),
237
+ city: zod_1.z.string().optional(),
238
+ })
239
+ .optional(),
240
+ destinationAirport: zod_1.z.object({
241
+ icao: zod_1.z.string().optional(),
242
+ iata: zod_1.z.string().optional(),
243
+ city: zod_1.z.string().optional(),
244
+ }),
245
+ flightImages: zod_1.z
246
+ .array(zod_1.z.object({
247
+ src: zod_1.z.string().optional(),
248
+ photographer: zod_1.z.string().optional(),
249
+ }))
250
+ .optional(),
251
+ });
252
+ exports.priorityListSchema = zod_1.z.object({
253
+ priorityList: zod_1.z.array(zod_1.z.string()).default([]),
254
+ });
255
+ exports.whiteListSchema = zod_1.z.object({
256
+ whiteList: zod_1.z.array(zod_1.z.string()).default([]),
257
+ });
258
+ exports.blackListSchema = zod_1.z.object({
259
+ blackList: zod_1.z.array(zod_1.z.string()).default([]),
260
+ });
261
+ exports.mapTypeSchema = zod_1.z.enum(['roadmap', 'satellite']);
262
+ exports.mapInfoSchema = zod_1.z.object({
263
+ minZoom: zod_1.z.number().nonnegative(),
264
+ maxZoom: zod_1.z.number().nonnegative(),
265
+ mapTypes: zod_1.z.array(exports.mapTypeSchema),
266
+ tileSize: zod_1.z.number().nonnegative(),
267
+ });
268
+ exports.zonesSchema = zod_1.z.object({
269
+ zones: zod_1.z
270
+ .array(zod_1.z.object({
271
+ enabled: zod_1.z.boolean().default(true),
272
+ name: zod_1.z.string().optional(),
273
+ area: zod_1.z
274
+ .array(zod_1.z.object({
275
+ lat: zod_1.z.number(),
276
+ lon: zod_1.z.number(),
277
+ }))
278
+ .nonempty(),
279
+ minAltitudeAmsl: zod_1.z.number().optional(),
280
+ maxAltitudeAmsl: zod_1.z.number().optional(),
281
+ minSpeedKmph: zod_1.z.number().optional(),
282
+ maxSpeedKmph: zod_1.z.number().optional(),
283
+ weight: zod_1.z.number(),
284
+ }))
285
+ .default([]),
286
+ });
@@ -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.PtzOverviewSchema = exports.sdCardWatchedStatuses = exports.guardTourSchema = exports.applicationListSchema = exports.APP_IDS = exports.applicationSchema = void 0;
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.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() })));
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({ devices: zod_1.z.array(audioDeviceFromRequestSchema) });
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
+ });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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(url, parameters, headers) {
7
- return fetch((0, utils_1.addParametersToPath)(url, parameters), {
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(url, data, parameters, headers) {
13
- return fetch((0, utils_1.addParametersToPath)(url, parameters), {
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;
@@ -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 = 5_000;
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
  }