camstreamerlib 4.0.0-beta.16 → 4.0.0-beta.161

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 (361) hide show
  1. package/README.md +143 -38
  2. package/cjs/CamOverlayAPI.d.ts +603 -327
  3. package/cjs/CamOverlayAPI.js +99 -184
  4. package/cjs/CamScripterAPI.d.ts +41 -17
  5. package/cjs/CamScripterAPI.js +54 -56
  6. package/cjs/CamStreamerAPI.d.ts +3557 -14
  7. package/cjs/CamStreamerAPI.js +174 -52
  8. package/cjs/CamSwitcherAPI.d.ts +158 -42
  9. package/cjs/CamSwitcherAPI.js +148 -189
  10. package/cjs/PlaneTrackerAPI.d.ts +238 -29
  11. package/cjs/PlaneTrackerAPI.js +187 -101
  12. package/cjs/VapixAPI.d.ts +97 -44
  13. package/cjs/VapixAPI.js +400 -207
  14. package/cjs/{CreatePackage.js → bin/CreatePackage.js} +44 -18
  15. package/cjs/errors/errors.d.ts +75 -4
  16. package/cjs/errors/errors.js +142 -7
  17. package/cjs/index.d.ts +20 -9
  18. package/cjs/index.js +28 -14
  19. package/cjs/internal/BasicAPI.d.ts +15 -0
  20. package/cjs/internal/BasicAPI.js +93 -0
  21. package/cjs/internal/ProxyClient.d.ts +8 -9
  22. package/cjs/internal/ProxyClient.js +28 -34
  23. package/cjs/internal/WsEvents.d.ts +38 -0
  24. package/cjs/{CamSwitcherEvents.js → internal/WsEvents.js} +33 -22
  25. package/cjs/internal/constants.d.ts +1 -0
  26. package/cjs/internal/constants.js +2 -1
  27. package/cjs/internal/convertors.d.ts +6 -0
  28. package/cjs/internal/convertors.js +115 -0
  29. package/cjs/internal/transformers.js +8 -8
  30. package/cjs/internal/types.d.ts +32 -20
  31. package/cjs/internal/utils.d.ts +1 -3
  32. package/cjs/internal/utils.js +1 -12
  33. package/cjs/internal/versionCompare.d.ts +2 -2
  34. package/cjs/node/CamOverlayDrawingAPI.d.ts +41 -0
  35. package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +28 -20
  36. package/{esm → cjs/node}/CamOverlayPainter/Frame.d.ts +8 -37
  37. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  38. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.d.ts +5 -21
  39. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
  40. package/cjs/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
  41. package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
  42. package/cjs/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
  43. package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +13 -13
  44. package/cjs/node/DefaultClient.d.ts +6 -6
  45. package/cjs/node/DefaultClient.js +12 -16
  46. package/cjs/{internal → node}/Digest.js +24 -1
  47. package/cjs/node/Digest.test.js +13 -0
  48. package/cjs/node/HttpRequestSender.d.ts +1 -0
  49. package/cjs/node/HttpRequestSender.js +14 -4
  50. package/cjs/node/HttpServer.d.ts +1 -1
  51. package/cjs/node/HttpServer.js +29 -6
  52. package/cjs/node/TimeZoneDaemon.d.ts +6 -0
  53. package/cjs/node/TimeZoneDaemon.js +29 -0
  54. package/cjs/node/VapixEvents.d.ts +16 -0
  55. package/cjs/{VapixEvents.js → node/VapixEvents.js} +10 -10
  56. package/cjs/node/WsClient.d.ts +9 -18
  57. package/cjs/node/WsClient.js +27 -20
  58. package/cjs/node/events/AxisCameraStationEvents.d.ts +12 -0
  59. package/cjs/{events → node/events}/AxisCameraStationEvents.js +18 -13
  60. package/cjs/node/events/GenetecAgent.d.ts +16 -0
  61. package/cjs/node/events/GenetecAgent.js +124 -0
  62. package/cjs/node/index.d.ts +18 -2
  63. package/cjs/node/index.js +39 -5
  64. package/cjs/{models/CamOverlayAPI/widgetsSchema.d.ts → types/CamOverlayAPI/CamOverlayAPI.d.ts} +2794 -767
  65. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +135 -0
  66. package/cjs/{models → types}/CamOverlayAPI/accuweatherSchema.d.ts +19 -19
  67. package/cjs/{models → types}/CamOverlayAPI/accuweatherSchema.js +7 -8
  68. package/cjs/{models → types}/CamOverlayAPI/customGraphicsSchema.d.ts +108 -107
  69. package/cjs/{models → types}/CamOverlayAPI/customGraphicsSchema.js +5 -6
  70. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  71. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.js +21 -0
  72. package/{esm/models → cjs/types}/CamOverlayAPI/imagesSchema.d.ts +19 -19
  73. package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
  74. package/cjs/{models → types}/CamOverlayAPI/index.d.ts +3 -4
  75. package/cjs/{models → types}/CamOverlayAPI/index.js +3 -4
  76. package/cjs/{models → types}/CamOverlayAPI/infotickerSchema.d.ts +27 -27
  77. package/cjs/{models → types}/CamOverlayAPI/infotickerSchema.js +6 -7
  78. package/{esm/models → cjs/types}/CamOverlayAPI/pipSchema.d.ts +21 -21
  79. package/cjs/{models → types}/CamOverlayAPI/pipSchema.js +5 -6
  80. package/{esm/models → cjs/types}/CamOverlayAPI/ptzCompassSchema.d.ts +18 -15
  81. package/cjs/{models → types}/CamOverlayAPI/ptzCompassSchema.js +5 -5
  82. package/cjs/{models → types}/CamOverlayAPI/ptzSchema.d.ts +28 -28
  83. package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
  84. package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
  85. package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
  86. package/{esm/models → cjs/types}/CamOverlayAPI/screenSharingSchema.d.ts +15 -15
  87. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
  88. package/{esm/models/CamOverlayAPI/widgetCommonSchema.d.ts → cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts} +80 -60
  89. package/cjs/{models/CamOverlayAPI/widgetCommonSchema.js → types/CamOverlayAPI/serviceCommonTypes.js} +39 -21
  90. package/{esm/models → cjs/types}/CamOverlayAPI/webCameraSharingSchema.d.ts +15 -15
  91. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
  92. package/cjs/types/CamOverlayDrawingAPI.d.ts +48 -0
  93. package/cjs/types/CamOverlayDrawingAPI.js +2 -0
  94. package/cjs/types/CamOverlayPainter.d.ts +76 -0
  95. package/cjs/types/CamOverlayPainter.js +14 -0
  96. package/cjs/types/CamScripterAPI.d.ts +75 -23
  97. package/cjs/types/CamScripterAPI.js +20 -8
  98. package/cjs/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
  99. package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
  100. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +26085 -0
  101. package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +222 -0
  102. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +574 -0
  103. package/cjs/types/CamStreamerAPI/facebookSchema.js +23 -0
  104. package/cjs/types/CamStreamerAPI/index.d.ts +6 -0
  105. package/cjs/types/CamStreamerAPI/index.js +22 -0
  106. package/cjs/types/{CamStreamerAPI.d.ts → CamStreamerAPI/oldStreamSchema.d.ts} +104 -35
  107. package/cjs/types/CamStreamerAPI/oldStreamSchema.js +53 -0
  108. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +570 -0
  109. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +123 -0
  110. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +8642 -0
  111. package/cjs/types/CamStreamerAPI/streamsSchema.js +81 -0
  112. package/cjs/types/CamStreamerAPI/windySchema.d.ts +534 -0
  113. package/cjs/types/CamStreamerAPI/windySchema.js +19 -0
  114. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +542 -0
  115. package/cjs/types/CamStreamerAPI/youtubeSchema.js +22 -0
  116. package/cjs/types/CamSwitcherAPI.d.ts +205 -121
  117. package/cjs/types/CamSwitcherAPI.js +38 -1
  118. package/cjs/{events → types}/GenetecAgent.d.ts +47 -47
  119. package/cjs/types/GenetecAgent.js +31 -0
  120. package/cjs/types/PlaneTrackerAPI.d.ts +993 -0
  121. package/cjs/types/PlaneTrackerAPI.js +336 -0
  122. package/cjs/types/VapixAPI.d.ts +281 -22
  123. package/cjs/types/VapixAPI.js +74 -4
  124. package/cjs/types/VapixEvents.d.ts +15 -0
  125. package/cjs/types/VapixEvents.js +2 -0
  126. package/cjs/types/common.d.ts +43 -3
  127. package/cjs/types/common.js +17 -2
  128. package/cjs/types/ws/CamOverlayEvents.d.ts +88 -0
  129. package/cjs/types/ws/CamOverlayEvents.js +19 -0
  130. package/cjs/types/ws/CamStreamerEvents.d.ts +282 -0
  131. package/cjs/types/ws/CamStreamerEvents.js +36 -0
  132. package/cjs/types/ws/PlaneTrackerEvents.d.ts +1703 -0
  133. package/cjs/types/ws/PlaneTrackerEvents.js +207 -0
  134. package/cjs/web/DefaultClient.d.ts +7 -5
  135. package/cjs/web/DefaultClient.js +25 -11
  136. package/cjs/web/WsClient.d.ts +9 -5
  137. package/cjs/web/WsClient.js +16 -18
  138. package/cjs/ws/CamOverlayEvents.d.ts +8 -0
  139. package/cjs/ws/CamOverlayEvents.js +24 -0
  140. package/cjs/ws/CamStreamerEvents.d.ts +8 -0
  141. package/cjs/ws/CamStreamerEvents.js +24 -0
  142. package/cjs/ws/CamSwitcherEvents.d.ts +8 -0
  143. package/cjs/ws/CamSwitcherEvents.js +24 -0
  144. package/cjs/ws/PlaneTrackerEvents.d.ts +9 -0
  145. package/cjs/ws/PlaneTrackerEvents.js +30 -0
  146. package/esm/CamOverlayAPI.js +99 -184
  147. package/esm/CamScripterAPI.js +52 -57
  148. package/esm/CamStreamerAPI.js +172 -51
  149. package/esm/CamSwitcherAPI.js +151 -192
  150. package/esm/PlaneTrackerAPI.js +186 -100
  151. package/esm/VapixAPI.js +402 -209
  152. package/esm/{CreatePackage.js → bin/CreatePackage.js} +16 -16
  153. package/esm/errors/errors.js +124 -6
  154. package/esm/index.js +20 -9
  155. package/esm/internal/BasicAPI.js +89 -0
  156. package/esm/internal/ProxyClient.js +28 -34
  157. package/esm/{CamSwitcherEvents.js → internal/WsEvents.js} +31 -20
  158. package/esm/internal/constants.js +1 -0
  159. package/esm/internal/convertors.js +108 -0
  160. package/esm/internal/transformers.js +1 -1
  161. package/esm/internal/utils.js +0 -9
  162. package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +26 -18
  163. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  164. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
  165. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
  166. package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +11 -11
  167. package/esm/node/DefaultClient.js +12 -16
  168. package/esm/node/Digest.test.js +11 -0
  169. package/esm/node/HttpRequestSender.js +14 -4
  170. package/esm/node/HttpServer.js +1 -1
  171. package/esm/node/TimeZoneDaemon.js +25 -0
  172. package/esm/{VapixEvents.js → node/VapixEvents.js} +10 -10
  173. package/esm/node/WsClient.js +22 -15
  174. package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
  175. package/esm/node/events/GenetecAgent.js +120 -0
  176. package/esm/node/index.js +18 -2
  177. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +113 -0
  178. package/esm/{models → types}/CamOverlayAPI/accuweatherSchema.js +3 -4
  179. package/esm/{models → types}/CamOverlayAPI/customGraphicsSchema.js +3 -4
  180. package/esm/types/CamOverlayAPI/htmlOverlaySchema.js +18 -0
  181. package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
  182. package/esm/{models → types}/CamOverlayAPI/index.js +3 -4
  183. package/esm/{models → types}/CamOverlayAPI/infotickerSchema.js +3 -4
  184. package/esm/{models → types}/CamOverlayAPI/pipSchema.js +4 -5
  185. package/esm/{models → types}/CamOverlayAPI/ptzCompassSchema.js +4 -4
  186. package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
  187. package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
  188. package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
  189. package/esm/{models/CamOverlayAPI/widgetCommonSchema.js → types/CamOverlayAPI/serviceCommonTypes.js} +38 -20
  190. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
  191. package/esm/types/CamOverlayDrawingAPI.js +1 -0
  192. package/esm/types/CamOverlayPainter.js +11 -0
  193. package/esm/types/CamScripterAPI.js +19 -7
  194. package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
  195. package/esm/types/CamStreamerAPI/CamStreamerAPI.js +199 -0
  196. package/esm/types/CamStreamerAPI/facebookSchema.js +17 -0
  197. package/esm/types/CamStreamerAPI/index.js +6 -0
  198. package/esm/types/CamStreamerAPI/oldStreamSchema.js +50 -0
  199. package/esm/types/CamStreamerAPI/streamCommonTypes.js +120 -0
  200. package/esm/types/CamStreamerAPI/streamsSchema.js +75 -0
  201. package/esm/types/CamStreamerAPI/windySchema.js +13 -0
  202. package/esm/types/CamStreamerAPI/youtubeSchema.js +16 -0
  203. package/esm/types/CamSwitcherAPI.js +38 -1
  204. package/esm/types/GenetecAgent.js +28 -0
  205. package/esm/types/PlaneTrackerAPI.js +333 -0
  206. package/esm/types/VapixAPI.js +73 -3
  207. package/esm/types/VapixEvents.js +1 -0
  208. package/esm/types/common.js +16 -1
  209. package/esm/types/ws/CamOverlayEvents.js +16 -0
  210. package/esm/types/ws/CamStreamerEvents.js +33 -0
  211. package/esm/types/ws/PlaneTrackerEvents.js +204 -0
  212. package/esm/web/DefaultClient.js +25 -11
  213. package/esm/web/WsClient.js +16 -18
  214. package/esm/ws/CamOverlayEvents.js +20 -0
  215. package/esm/ws/CamStreamerEvents.js +20 -0
  216. package/esm/ws/CamSwitcherEvents.js +20 -0
  217. package/esm/ws/PlaneTrackerEvents.js +26 -0
  218. package/package.json +46 -12
  219. package/{esm → types}/CamOverlayAPI.d.ts +603 -327
  220. package/types/CamScripterAPI.d.ts +43 -0
  221. package/types/CamStreamerAPI.d.ts +3559 -0
  222. package/types/CamSwitcherAPI.d.ts +168 -0
  223. package/types/PlaneTrackerAPI.d.ts +239 -0
  224. package/types/VapixAPI.d.ts +131 -0
  225. package/types/bin/CreatePackage.d.ts +1 -0
  226. package/types/errors/errors.d.ts +108 -0
  227. package/types/index.d.ts +28 -0
  228. package/types/internal/BasicAPI.d.ts +15 -0
  229. package/types/internal/ProxyClient.d.ts +10 -0
  230. package/types/internal/WsEvents.d.ts +38 -0
  231. package/{esm → types}/internal/constants.d.ts +1 -0
  232. package/types/internal/convertors.d.ts +6 -0
  233. package/types/internal/types.d.ts +47 -0
  234. package/{esm → types}/internal/utils.d.ts +1 -3
  235. package/{esm → types}/internal/versionCompare.d.ts +2 -2
  236. package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
  237. package/{cjs → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
  238. package/{esm → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
  239. package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
  240. package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
  241. package/types/node/DefaultClient.d.ts +16 -0
  242. package/types/node/Digest.test.d.ts +1 -0
  243. package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
  244. package/{esm → types}/node/HttpServer.d.ts +1 -1
  245. package/types/node/TimeZoneDaemon.d.ts +6 -0
  246. package/types/node/VapixEvents.d.ts +16 -0
  247. package/types/node/WsClient.d.ts +30 -0
  248. package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
  249. package/types/node/events/GenetecAgent.d.ts +16 -0
  250. package/types/node/index.d.ts +18 -0
  251. package/{esm/models/CamOverlayAPI/widgetsSchema.d.ts → types/types/CamOverlayAPI/CamOverlayAPI.d.ts} +2794 -767
  252. package/{esm/models → types/types}/CamOverlayAPI/accuweatherSchema.d.ts +19 -19
  253. package/{esm/models → types/types}/CamOverlayAPI/customGraphicsSchema.d.ts +108 -107
  254. package/types/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  255. package/{cjs/models → types/types}/CamOverlayAPI/imagesSchema.d.ts +19 -19
  256. package/{esm/models → types/types}/CamOverlayAPI/index.d.ts +3 -4
  257. package/{esm/models → types/types}/CamOverlayAPI/infotickerSchema.d.ts +27 -27
  258. package/{cjs/models → types/types}/CamOverlayAPI/pipSchema.d.ts +21 -21
  259. package/{cjs/models → types/types}/CamOverlayAPI/ptzCompassSchema.d.ts +18 -15
  260. package/{esm/models → types/types}/CamOverlayAPI/ptzSchema.d.ts +28 -28
  261. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
  262. package/{cjs/models → types/types}/CamOverlayAPI/screenSharingSchema.d.ts +15 -15
  263. package/{cjs/models/CamOverlayAPI/widgetCommonSchema.d.ts → types/types/CamOverlayAPI/serviceCommonTypes.d.ts} +80 -60
  264. package/{cjs/models → types/types}/CamOverlayAPI/webCameraSharingSchema.d.ts +15 -15
  265. package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
  266. package/types/types/CamOverlayPainter.d.ts +76 -0
  267. package/types/types/CamScripterAPI.d.ts +119 -0
  268. package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
  269. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +26085 -0
  270. package/types/types/CamStreamerAPI/facebookSchema.d.ts +574 -0
  271. package/types/types/CamStreamerAPI/index.d.ts +6 -0
  272. package/{esm/types/CamStreamerAPI.d.ts → types/types/CamStreamerAPI/oldStreamSchema.d.ts} +104 -35
  273. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +570 -0
  274. package/types/types/CamStreamerAPI/streamsSchema.d.ts +8642 -0
  275. package/types/types/CamStreamerAPI/windySchema.d.ts +534 -0
  276. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +542 -0
  277. package/{esm → types}/types/CamSwitcherAPI.d.ts +205 -121
  278. package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
  279. package/types/types/PlaneTrackerAPI.d.ts +993 -0
  280. package/{esm → types}/types/VapixAPI.d.ts +281 -22
  281. package/types/types/VapixEvents.d.ts +15 -0
  282. package/types/types/common.d.ts +77 -0
  283. package/types/types/ws/CamOverlayEvents.d.ts +88 -0
  284. package/types/types/ws/CamStreamerEvents.d.ts +282 -0
  285. package/types/types/ws/PlaneTrackerEvents.d.ts +1703 -0
  286. package/types/web/DefaultClient.d.ts +8 -0
  287. package/types/web/WsClient.d.ts +17 -0
  288. package/types/ws/CamOverlayEvents.d.ts +8 -0
  289. package/types/ws/CamStreamerEvents.d.ts +8 -0
  290. package/types/ws/CamSwitcherEvents.d.ts +8 -0
  291. package/types/ws/PlaneTrackerEvents.d.ts +9 -0
  292. package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
  293. package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
  294. package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
  295. package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  296. package/cjs/CamSwitcherEvents.d.ts +0 -18
  297. package/cjs/VapixEvents.d.ts +0 -43
  298. package/cjs/events/AxisCameraStationEvents.d.ts +0 -10
  299. package/cjs/events/GenetecAgent.js +0 -123
  300. package/cjs/models/CamOverlayAPI/constants.d.ts +0 -11
  301. package/cjs/models/CamOverlayAPI/constants.js +0 -14
  302. package/cjs/models/CamOverlayAPI/fileSchema.d.ts +0 -28
  303. package/cjs/models/CamOverlayAPI/fileSchema.js +0 -17
  304. package/cjs/models/CamOverlayAPI/imagesSchema.js +0 -10
  305. package/cjs/models/CamOverlayAPI/ptzSchema.js +0 -13
  306. package/cjs/models/CamOverlayAPI/screenSharingSchema.js +0 -9
  307. package/cjs/models/CamOverlayAPI/webCameraSharingSchema.js +0 -9
  308. package/cjs/models/CamOverlayAPI/widgetsSchema.js +0 -27
  309. package/cjs/node/WsEventClient.d.ts +0 -13
  310. package/cjs/node/WsEventClient.js +0 -22
  311. package/cjs/types/CamOverlayAPI.d.ts +0 -328
  312. package/cjs/types/CamOverlayAPI.js +0 -26
  313. package/cjs/types/CamStreamerAPI.js +0 -28
  314. package/esm/CamOverlayDrawingAPI.d.ts +0 -86
  315. package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
  316. package/esm/CamScripterAPI.d.ts +0 -19
  317. package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  318. package/esm/CamStreamerAPI.d.ts +0 -16
  319. package/esm/CamSwitcherAPI.d.ts +0 -52
  320. package/esm/CamSwitcherEvents.d.ts +0 -18
  321. package/esm/PlaneTrackerAPI.d.ts +0 -30
  322. package/esm/VapixAPI.d.ts +0 -78
  323. package/esm/VapixEvents.d.ts +0 -43
  324. package/esm/errors/errors.d.ts +0 -37
  325. package/esm/events/AxisCameraStationEvents.d.ts +0 -10
  326. package/esm/events/GenetecAgent.js +0 -119
  327. package/esm/index.d.ts +0 -17
  328. package/esm/internal/ProxyClient.d.ts +0 -11
  329. package/esm/internal/types.d.ts +0 -35
  330. package/esm/models/CamOverlayAPI/constants.d.ts +0 -11
  331. package/esm/models/CamOverlayAPI/constants.js +0 -11
  332. package/esm/models/CamOverlayAPI/fileSchema.d.ts +0 -28
  333. package/esm/models/CamOverlayAPI/fileSchema.js +0 -14
  334. package/esm/models/CamOverlayAPI/imagesSchema.js +0 -7
  335. package/esm/models/CamOverlayAPI/ptzSchema.js +0 -10
  336. package/esm/models/CamOverlayAPI/screenSharingSchema.js +0 -6
  337. package/esm/models/CamOverlayAPI/webCameraSharingSchema.js +0 -6
  338. package/esm/models/CamOverlayAPI/widgetsSchema.js +0 -24
  339. package/esm/node/DefaultClient.d.ts +0 -16
  340. package/esm/node/WsClient.d.ts +0 -39
  341. package/esm/node/WsEventClient.d.ts +0 -13
  342. package/esm/node/WsEventClient.js +0 -18
  343. package/esm/types/CamOverlayAPI.d.ts +0 -328
  344. package/esm/types/CamOverlayAPI.js +0 -14
  345. package/esm/types/CamScripterAPI.d.ts +0 -67
  346. package/esm/types/CamStreamerAPI.js +0 -25
  347. package/esm/types/common.d.ts +0 -37
  348. package/esm/web/DefaultClient.d.ts +0 -6
  349. package/esm/web/WsClient.d.ts +0 -13
  350. package/esm/web/index.d.ts +0 -2
  351. package/cjs/{CreatePackage.d.ts → bin/CreatePackage.d.ts} +0 -0
  352. package/cjs/{internal → node}/Digest.d.ts +0 -0
  353. package/{esm/CreatePackage.d.ts → cjs/node/Digest.test.d.ts} +0 -0
  354. package/{esm/types → cjs/types/ws}/CamSwitcherEvents.d.ts +8 -8
  355. package/cjs/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
  356. package/esm/{internal → node}/Digest.js +0 -0
  357. package/esm/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
  358. package/{esm → types}/internal/transformers.d.ts +0 -0
  359. package/{esm/internal → types/node}/Digest.d.ts +0 -0
  360. package/{cjs/types → types/types/ws}/CamSwitcherEvents.d.ts +8 -8
  361. /package/{esm/node → types/web}/index.d.ts +0 -0
@@ -1,30 +1,239 @@
1
- import { IClient, TResponse } from './internal/types';
2
- type ICAO = string;
3
- export declare const BASE_URL = "/local/planetracker";
4
- export declare class PlaneTrackerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
- private client;
6
- constructor(client: Client);
7
- static getProxyUrlPath: () => string;
8
- checkCameraTime(): Promise<boolean>;
9
- fetchCameraSettings: () => Promise<any>;
10
- fetchServerSettings: () => Promise<any>;
11
- fetchMapInfo: () => Promise<any>;
12
- fetchFlightInfo: (icao: ICAO) => Promise<any>;
13
- getZones: () => Promise<any>;
14
- setZones: (zonesJsonString: string) => Promise<any>;
15
- getPriorityList: () => Promise<any>;
16
- setPriorityList: (priorityListJsonString: string) => Promise<any>;
17
- getWhiteList: () => Promise<any>;
18
- setWhiteList: (whiteListJsonString: string) => Promise<any>;
19
- getBlackList: () => Promise<any>;
20
- setBlackList: (blackListJsonString: string) => Promise<any>;
21
- getTrackingMode: () => Promise<any>;
22
- setTrackingMode: (modeJsonString: string) => Promise<any>;
23
- startTrackingPlane: (icao: ICAO) => Promise<TResponse>;
24
- stopTrackingPlane: () => Promise<TResponse>;
25
- goToCoordinates: (lat: number, lon: number, alt?: number) => Promise<TResponse>;
26
- private _get;
27
- private _post;
28
- private _postJsonEncoded;
1
+ import { IClient, TParameters, TResponse } from './internal/types';
2
+ import { ICAO, TApiUser, TBlackList, TCameraSettings, TExportDataType, TGetIcaoByOption, TImportDataType, TPriorityList, TTrackingMode, TTypePriorityList, TWhiteList, TZones } from './types/PlaneTrackerAPI';
3
+ import { THttpRequestOptions } from './types/common';
4
+ import { BasicAPI } from './internal/BasicAPI';
5
+ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> extends BasicAPI<Client> {
6
+ private apiUser;
7
+ constructor(client: Client, apiUser: TApiUser);
8
+ static getProxyPath: () => string;
9
+ static getWsEventsPath: () => string;
10
+ checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
11
+ checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
12
+ serverRunCheck(options?: THttpRequestOptions): Promise<boolean>;
13
+ getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
14
+ ws: string;
15
+ ws_initial_message: string;
16
+ alias: string;
17
+ }>;
18
+ resetPtzCalibration(options?: THttpRequestOptions): Promise<void>;
19
+ resetFocusCalibration(options?: THttpRequestOptions): Promise<void>;
20
+ fetchCameraSettings(options?: THttpRequestOptions): Promise<{
21
+ camera: {
22
+ ip: string;
23
+ port: number;
24
+ pass: string;
25
+ user: string;
26
+ protocol: "https" | "http" | "https_insecure";
27
+ };
28
+ units: "metric" | "imperial";
29
+ trackingDomain: "adsb" | "dronetag";
30
+ adsbSource: {
31
+ ip: string;
32
+ port: number;
33
+ };
34
+ cameraCalibrationProcessConfig: {
35
+ nightSkyCalibrationEnabled: boolean;
36
+ scheduleNightSkyCalibrationTimestamp: number;
37
+ focusCalibrationPoints: string;
38
+ };
39
+ cameraConfig: {
40
+ defaultCaptureSizeMeters: number;
41
+ captureSizeExtensionMeters: number;
42
+ maxZoomLevel?: number | undefined;
43
+ };
44
+ stream: {
45
+ width: number;
46
+ height: number;
47
+ };
48
+ imageConfig: {
49
+ dayAperture: number;
50
+ nightAperture: number;
51
+ maxGain: number;
52
+ };
53
+ airportConfig: {
54
+ icao: string;
55
+ centerLat: number;
56
+ centerLon: number;
57
+ radius: number;
58
+ };
59
+ trackingConfig: {
60
+ prioritizeEmergency: boolean;
61
+ trackingZoneWeightIncrease: number;
62
+ guardTourEnabled: boolean;
63
+ guardTourId: number;
64
+ };
65
+ widget: {
66
+ enabled: boolean;
67
+ scale: number;
68
+ coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
69
+ posX: number;
70
+ posY: number;
71
+ };
72
+ airportWidget: {
73
+ enabled: boolean;
74
+ scale: number;
75
+ coord: "top_left" | "top_right" | "bottom_left" | "bottom_right";
76
+ posX: number;
77
+ posY: number;
78
+ };
79
+ fr24FlightInfoSource: {
80
+ enabled: boolean;
81
+ priority: number;
82
+ apiToken: string;
83
+ validateFlights: boolean;
84
+ };
85
+ radarcapeFlightInfoSource: {
86
+ ip: string;
87
+ enabled: boolean;
88
+ port: number;
89
+ priority: number;
90
+ };
91
+ identificationLabel: {
92
+ firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
93
+ secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
94
+ thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
95
+ fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
96
+ opacity: number;
97
+ };
98
+ acs: {
99
+ ip: string;
100
+ enabled: boolean;
101
+ port: number;
102
+ pass: string;
103
+ user: string;
104
+ protocol: "https" | "http" | "https_insecure";
105
+ sourceKey: string;
106
+ };
107
+ genetec: {
108
+ ip: string;
109
+ enabled: boolean;
110
+ port: number;
111
+ cameraList: string[];
112
+ pass: string;
113
+ appId: string;
114
+ user: string;
115
+ protocol: "https" | "http" | "https_insecure";
116
+ baseUri: string;
117
+ };
118
+ camstreamerIntegration: {
119
+ adPlacementEnabled: boolean;
120
+ adMinIntervalSec: number;
121
+ adShortDurationSec: number;
122
+ adLongDurationSec: number;
123
+ };
124
+ overlayText?: {
125
+ displayIcao?: boolean | undefined;
126
+ displayRegistration?: boolean | undefined;
127
+ displayFlightNumber?: boolean | undefined;
128
+ displayAltitude?: boolean | undefined;
129
+ displayVelocity?: boolean | undefined;
130
+ displayDistance?: boolean | undefined;
131
+ displayFOV?: boolean | undefined;
132
+ displayPTError?: boolean | undefined;
133
+ displayPTZSpeed?: boolean | undefined;
134
+ displayVelocityData?: boolean | undefined;
135
+ displayAdsbVelocityData?: boolean | undefined;
136
+ displaySignalQuality?: boolean | undefined;
137
+ displayAutoTrackingInfo?: boolean | undefined;
138
+ displayGPSCoords?: boolean | undefined;
139
+ displayVapixQuery?: boolean | undefined;
140
+ displayFocus?: boolean | undefined;
141
+ displayAperture?: boolean | undefined;
142
+ displayAircraftInfo?: boolean | undefined;
143
+ displaySunDistance?: boolean | undefined;
144
+ displayTickTime?: boolean | undefined;
145
+ displaySystemInfo?: boolean | undefined;
146
+ } | undefined;
147
+ }>;
148
+ setCameraSettings(settings: TCameraSettings, options?: THttpRequestOptions): Promise<void>;
149
+ fetchServerSettings(options?: THttpRequestOptions): Promise<{
150
+ cameraCalibration: {
151
+ posLat: number;
152
+ posLon: number;
153
+ geoidHN: number;
154
+ altitudeAmsl: number;
155
+ rotationEast: number;
156
+ rotationNorth: number;
157
+ rotationUp: number;
158
+ tiltTransformationCoefA: number;
159
+ tiltCameraKnownPoint: number;
160
+ tiltRealKnownPoint: number;
161
+ panErrorCorrection: {
162
+ cameraPan: number;
163
+ realPan: number;
164
+ }[];
165
+ };
166
+ }>;
167
+ exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
168
+ importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
169
+ fetchFlightInfo(icao: ICAO, options?: THttpRequestOptions): Promise<{
170
+ destinationAirport: {
171
+ icao?: string | undefined;
172
+ iata?: string | undefined;
173
+ city?: string | undefined;
174
+ };
175
+ registration?: string | undefined;
176
+ callsign?: string | undefined;
177
+ flightNumber?: string | undefined;
178
+ aircraftType?: string | undefined;
179
+ airlines?: string | undefined;
180
+ originAirport?: {
181
+ icao?: string | undefined;
182
+ iata?: string | undefined;
183
+ city?: string | undefined;
184
+ } | undefined;
185
+ flightImages?: {
186
+ src?: string | undefined;
187
+ photographer?: string | undefined;
188
+ }[] | undefined;
189
+ }>;
190
+ getTrackingMode(options?: THttpRequestOptions): Promise<{
191
+ mode: "MANUAL" | "AUTOMATIC";
192
+ }>;
193
+ setTrackingMode(mode: TTrackingMode['mode'], options?: THttpRequestOptions): Promise<void>;
194
+ startTrackingPlane(icao: ICAO, options?: THttpRequestOptions): Promise<void>;
195
+ stopTrackingPlane(options?: THttpRequestOptions): Promise<void>;
196
+ getIcao(by: TGetIcaoByOption, value: string, options?: THttpRequestOptions): Promise<string>;
197
+ getPriorityList(options?: THttpRequestOptions): Promise<string[]>;
198
+ setPriorityList(priorityList: TPriorityList['priorityList'], options?: THttpRequestOptions): Promise<void>;
199
+ getTypePriorityList(options?: THttpRequestOptions): Promise<string[]>;
200
+ setTypePriorityList(typePriorityList: TTypePriorityList['typePriorityList'], options?: THttpRequestOptions): Promise<void>;
201
+ getWhiteList(options?: THttpRequestOptions): Promise<string[]>;
202
+ setWhiteList(whiteList: TWhiteList['whiteList'], options?: THttpRequestOptions): Promise<void>;
203
+ getBlackList(options?: THttpRequestOptions): Promise<string[]>;
204
+ setBlackList(blackList: TBlackList['blackList'], options?: THttpRequestOptions): Promise<void>;
205
+ fetchMapInfo(options?: THttpRequestOptions): Promise<{
206
+ minZoom: number;
207
+ maxZoom: number;
208
+ mapTypes: ("roadmap" | "satellite")[];
209
+ tileSize: number;
210
+ }>;
211
+ getZones(options?: THttpRequestOptions): Promise<{
212
+ zones: {
213
+ enabled: boolean;
214
+ area: [{
215
+ lat: number;
216
+ lon: number;
217
+ }, ...{
218
+ lat: number;
219
+ lon: number;
220
+ }[]];
221
+ flightDirection: "all" | "arrival" | "departure";
222
+ weight: number;
223
+ name?: string | undefined;
224
+ minAltitudeAmsl?: number | undefined;
225
+ maxAltitudeAmsl?: number | undefined;
226
+ minSpeedKmph?: number | undefined;
227
+ maxSpeedKmph?: number | undefined;
228
+ }[];
229
+ }>;
230
+ setZones(zones: TZones, options?: THttpRequestOptions): Promise<void>;
231
+ goToCoordinates(lat: number, lon: number, alt?: number, options?: THttpRequestOptions): Promise<void>;
232
+ downloadReport(options?: THttpRequestOptions): Promise<string>;
233
+ checkGenetecConnection(params: TParameters, options?: THttpRequestOptions): Promise<boolean>;
234
+ getGenetecCameraList(params: TParameters, options?: THttpRequestOptions): Promise<{
235
+ value: string;
236
+ label: string;
237
+ index: number;
238
+ }[]>;
29
239
  }
30
- export {};
@@ -1,113 +1,199 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlaneTrackerAPI = exports.BASE_URL = void 0;
3
+ exports.PlaneTrackerAPI = void 0;
4
4
  const zod_1 = require("zod");
5
- const utils_1 = require("./internal/utils");
6
- exports.BASE_URL = '/local/planetracker';
7
- class PlaneTrackerAPI {
8
- client;
9
- constructor(client) {
10
- this.client = client;
11
- }
12
- static getProxyUrlPath = () => `${exports.BASE_URL}/proxy.cgi`;
13
- async checkCameraTime() {
14
- const responseSchema = zod_1.z.discriminatedUnion('state', [
15
- zod_1.z.object({
16
- state: zod_1.z.literal(true),
17
- code: zod_1.z.number(),
18
- }),
19
- zod_1.z.object({
20
- state: zod_1.z.literal(false),
21
- code: zod_1.z.number(),
22
- reason: zod_1.z.union([
23
- zod_1.z.literal('INVALID_TIME'),
24
- zod_1.z.literal('COULDNT_RESOLVE_HOST'),
25
- zod_1.z.literal('CONNECTION_ERROR'),
26
- ]),
27
- message: zod_1.z.string(),
28
- }),
29
- ]);
30
- const response = await this._get(`${exports.BASE_URL}/camera_time.cgi`);
31
- const cameraTime = responseSchema.parse(response);
32
- if (!cameraTime.state) {
33
- console.error(`Camera time check failed: ${cameraTime.reason} - ${cameraTime.message}`);
34
- }
35
- return cameraTime.state;
36
- }
37
- fetchCameraSettings = async () => {
38
- return await this._get(`${exports.BASE_URL}/package_camera_settings.cgi?action=get`);
39
- };
40
- fetchServerSettings = async () => {
41
- return await this._get(`${exports.BASE_URL}/package_server_settings.cgi?action=get`);
42
- };
43
- fetchMapInfo = async () => {
44
- return await this._get(`${exports.BASE_URL}/package/getMapInfo.cgi`);
45
- };
46
- fetchFlightInfo = async (icao) => {
47
- return await this._get(`${exports.BASE_URL}/package/flightInfo.cgi?icao=${icao}`);
48
- };
49
- getZones = async () => {
50
- return await this._get(`${exports.BASE_URL}/package/getZones.cgi`);
51
- };
52
- setZones = async (zonesJsonString) => {
53
- return await this._postJsonEncoded(`${exports.BASE_URL}/package/setZones.cgi`, zonesJsonString);
54
- };
55
- getPriorityList = async () => {
56
- return await this._get(`${exports.BASE_URL}/package/getPriorityList.cgi`);
57
- };
58
- setPriorityList = async (priorityListJsonString) => {
59
- return await this._postJsonEncoded(`${exports.BASE_URL}/package/setPriorityList.cgi`, priorityListJsonString);
60
- };
61
- getWhiteList = async () => {
62
- return await this._get(`${exports.BASE_URL}/package/getWhiteList.cgi`);
63
- };
64
- setWhiteList = async (whiteListJsonString) => {
65
- return await this._postJsonEncoded(`${exports.BASE_URL}/package/setWhiteList.cgi`, whiteListJsonString);
66
- };
67
- getBlackList = async () => {
68
- return await this._get(`${exports.BASE_URL}/package/getBlackList.cgi`);
69
- };
70
- setBlackList = async (blackListJsonString) => {
71
- return await this._postJsonEncoded(`${exports.BASE_URL}/package/setBlackList.cgi`, blackListJsonString);
72
- };
73
- getTrackingMode = async () => {
74
- return await this._get(`${exports.BASE_URL}/package/getTrackingMode.cgi`);
75
- };
76
- setTrackingMode = async (modeJsonString) => {
77
- return await this._postJsonEncoded(`${exports.BASE_URL}/package/setTrackingMode.cgi`, modeJsonString);
78
- };
79
- startTrackingPlane = async (icao) => {
80
- return await this.client.get(`${exports.BASE_URL}/package/trackIcao.cgi?icao=${icao}`);
81
- };
82
- stopTrackingPlane = async () => {
83
- return await this.client.get(`${exports.BASE_URL}/package/resetIcao.cgi`);
84
- };
85
- goToCoordinates = async (lat, lon, alt) => {
86
- const url = `${exports.BASE_URL}/package/goToCoordinates.cgi?lat=${lat}&lon=${lon}`;
87
- return await this.client.get(`${url}${alt !== undefined ? `&alt=${alt}` : ''}`);
88
- };
89
- async _get(...args) {
90
- const res = await this.client.get(...args);
91
- if (res.ok) {
92
- return (await res.json());
5
+ const PlaneTrackerAPI_1 = require("./types/PlaneTrackerAPI");
6
+ const errors_1 = require("./errors/errors");
7
+ const GenetecAgent_1 = require("./types/GenetecAgent");
8
+ const BasicAPI_1 = require("./internal/BasicAPI");
9
+ const BASE_PATH = '/local/planetracker';
10
+ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
11
+ apiUser;
12
+ constructor(client, apiUser) {
13
+ super(client);
14
+ this.apiUser = apiUser;
15
+ }
16
+ static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
17
+ static getWsEventsPath = () => `${BASE_PATH}/package/ws`;
18
+ async checkAPIAvailable(options) {
19
+ await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
20
+ }
21
+ async checkCameraTime(options) {
22
+ const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
23
+ return zod_1.z.boolean().parse(res.state);
24
+ }
25
+ async serverRunCheck(options) {
26
+ const agent = this.getClient(options?.proxyParams);
27
+ const res = await agent.get({
28
+ path: `${BASE_PATH}/package/serverRunCheck.cgi`,
29
+ timeout: options?.timeout,
30
+ });
31
+ return res.status === 200;
32
+ }
33
+ async getLiveViewAlias(rtspUrl, options) {
34
+ const agent = this.getClient(options?.proxyParams);
35
+ const res = await agent.get({
36
+ path: `${BASE_PATH}/getLiveViewAlias.cgi`,
37
+ parameters: { rtsp_url: rtspUrl },
38
+ timeout: options?.timeout,
39
+ });
40
+ return PlaneTrackerAPI_1.wsAliasResponseSchema.parse(await res.json());
41
+ }
42
+ async resetPtzCalibration(options) {
43
+ const agent = this.getClient(options?.proxyParams);
44
+ const res = await agent.get({
45
+ path: `${BASE_PATH}/package/resetPtzCalibration.cgi`,
46
+ parameters: this.apiUser,
47
+ timeout: options?.timeout,
48
+ });
49
+ if (!res.ok) {
50
+ throw new errors_1.ResetCalibrationError('PTZ', res);
93
51
  }
94
- else {
95
- throw new Error(await (0, utils_1.responseStringify)(res));
52
+ }
53
+ async resetFocusCalibration(options) {
54
+ const agent = this.getClient(options?.proxyParams);
55
+ const res = await agent.get({
56
+ path: `${BASE_PATH}/package/resetFocusCalibration.cgi`,
57
+ parameters: this.apiUser,
58
+ timeout: options?.timeout,
59
+ });
60
+ if (!res.ok) {
61
+ throw new errors_1.ResetCalibrationError('FOCUS', res);
96
62
  }
97
63
  }
98
- async _post(...args) {
99
- const res = await this.client.post(...args);
100
- if (res.ok) {
101
- return (await res.json());
64
+ async fetchCameraSettings(options) {
65
+ const res = await this._getJson(`${BASE_PATH}/package_camera_settings.cgi`, { action: 'get' }, options);
66
+ return PlaneTrackerAPI_1.cameraSettingsSchema.parse(res);
67
+ }
68
+ async setCameraSettings(settings, options) {
69
+ await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settings, {
70
+ action: 'set',
71
+ }, options);
72
+ }
73
+ async fetchServerSettings(options) {
74
+ const res = await this._getJson(`${BASE_PATH}/package_server_settings.cgi`, { action: 'get' }, options);
75
+ return PlaneTrackerAPI_1.serverSettingsSchema.parse(res);
76
+ }
77
+ async exportAppSettings(dataType, options) {
78
+ return await this._getBlob(`${BASE_PATH}/package_data.cgi`, { action: 'EXPORT', dataType }, options);
79
+ }
80
+ async importAppSettings(dataType, formData, options) {
81
+ const agent = this.getClient(options?.proxyParams);
82
+ const res = await agent.post({
83
+ path: `${BASE_PATH}/package_data.cgi`,
84
+ data: formData,
85
+ parameters: { action: 'IMPORT', dataType },
86
+ timeout: options?.timeout,
87
+ });
88
+ if (!res.ok) {
89
+ throw new errors_1.ImportSettingsError(res);
102
90
  }
103
- else {
104
- throw new Error(await (0, utils_1.responseStringify)(res));
91
+ }
92
+ async fetchFlightInfo(icao, options) {
93
+ const res = await this._getJson(`${BASE_PATH}/package/flightInfo.cgi`, { icao }, options);
94
+ return PlaneTrackerAPI_1.flightInfoSchema.parse(res);
95
+ }
96
+ async getTrackingMode(options) {
97
+ const res = await this._getJson(`${BASE_PATH}/package/getTrackingMode.cgi`, undefined, options);
98
+ return PlaneTrackerAPI_1.trackingModeSchema.parse(res);
99
+ }
100
+ async setTrackingMode(mode, options) {
101
+ await this._postJsonEncoded(`${BASE_PATH}/package/setTrackingMode.cgi`, { mode }, this.apiUser, options);
102
+ }
103
+ async startTrackingPlane(icao, options) {
104
+ const agent = this.getClient(options?.proxyParams);
105
+ await agent.get({
106
+ path: `${BASE_PATH}/package/trackIcao.cgi`,
107
+ parameters: { icao, ...this.apiUser },
108
+ timeout: options?.timeout,
109
+ });
110
+ }
111
+ async stopTrackingPlane(options) {
112
+ const agent = this.getClient(options?.proxyParams);
113
+ await agent.get({
114
+ path: `${BASE_PATH}/package/resetIcao.cgi`,
115
+ parameters: this.apiUser,
116
+ timeout: options?.timeout,
117
+ });
118
+ }
119
+ async getIcao(by, value, options) {
120
+ const res = await this._getJson(`${BASE_PATH}/package/getIcao.cgi`, { [by]: value }, options);
121
+ return PlaneTrackerAPI_1.getIcaoSchema.parse(res).icao;
122
+ }
123
+ async getPriorityList(options) {
124
+ const res = await this._getJson(`${BASE_PATH}/package/getPriorityList.cgi`, undefined, options);
125
+ return PlaneTrackerAPI_1.priorityListSchema.parse(res).priorityList;
126
+ }
127
+ async setPriorityList(priorityList, options) {
128
+ await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
129
+ }
130
+ async getTypePriorityList(options) {
131
+ const res = await this._getJson(`${BASE_PATH}/package/getTypePriorityList.cgi`, undefined, options);
132
+ return PlaneTrackerAPI_1.typePriorityListSchema.parse(res).typePriorityList;
133
+ }
134
+ async setTypePriorityList(typePriorityList, options) {
135
+ await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
136
+ }
137
+ async getWhiteList(options) {
138
+ const res = await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
139
+ return PlaneTrackerAPI_1.whiteListSchema.parse(res).whiteList;
140
+ }
141
+ async setWhiteList(whiteList, options) {
142
+ await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, { whiteList }, this.apiUser, options);
143
+ }
144
+ async getBlackList(options) {
145
+ const res = await this._getJson(`${BASE_PATH}/package/getBlackList.cgi`, undefined, options);
146
+ return PlaneTrackerAPI_1.blackListSchema.parse(res).blackList;
147
+ }
148
+ async setBlackList(blackList, options) {
149
+ await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, { blackList }, this.apiUser, options);
150
+ }
151
+ async fetchMapInfo(options) {
152
+ const res = await this._getJson(`${BASE_PATH}/package/getMapInfo.cgi`, undefined, options);
153
+ return PlaneTrackerAPI_1.mapInfoSchema.parse(res);
154
+ }
155
+ async getZones(options) {
156
+ const res = await this._getJson(`${BASE_PATH}/package/getZones.cgi`, undefined, options);
157
+ return PlaneTrackerAPI_1.zonesSchema.parse(res);
158
+ }
159
+ async setZones(zones, options) {
160
+ await this._postJsonEncoded(`${BASE_PATH}/package/setZones.cgi`, zones, this.apiUser, options);
161
+ }
162
+ async goToCoordinates(lat, lon, alt, options) {
163
+ const agent = this.getClient(options?.proxyParams);
164
+ const res = await agent.get({
165
+ path: `${BASE_PATH}/package/goToCoordinates.cgi`,
166
+ parameters: { lat, lon, alt, ...this.apiUser },
167
+ timeout: options?.timeout,
168
+ });
169
+ if (!res.ok) {
170
+ if (res.status === 400 && res.statusText === 'Cannot set coordinates in automatic mode') {
171
+ throw new errors_1.CannotSetCoordsInAutoModeError();
172
+ }
173
+ if (res.status === 400 && res.statusText === 'Invalid lat/lon parameters') {
174
+ throw new errors_1.InvalidLatLngError();
175
+ }
176
+ if (res.status === 400 && res.statusText === 'Invalid alt parameter') {
177
+ throw new errors_1.InvalidAltitudeError();
178
+ }
179
+ if (res.status === 400) {
180
+ throw new errors_1.BadRequestError(res);
181
+ }
182
+ if (res.status === 500) {
183
+ throw new errors_1.ServerError();
184
+ }
105
185
  }
106
186
  }
107
- async _postJsonEncoded(...args) {
108
- const [path, data, params, headers] = args;
109
- const baseHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
110
- return this._post(path, data, params, { ...baseHeaders, ...headers });
187
+ downloadReport(options) {
188
+ return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
189
+ }
190
+ async checkGenetecConnection(params, options) {
191
+ const res = await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
192
+ return res.status === 200;
193
+ }
194
+ async getGenetecCameraList(params, options) {
195
+ const res = await this._postUrlEncoded(`${BASE_PATH}/package/getGenetecCameraList.cgi`, params, options);
196
+ return GenetecAgent_1.cameraListSchema.parse(await res.json());
111
197
  }
112
198
  }
113
199
  exports.PlaneTrackerAPI = PlaneTrackerAPI;