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,109 +1,195 @@
1
1
  import { z } from 'zod';
2
- import { responseStringify } from './internal/utils';
3
- export const BASE_URL = '/local/planetracker';
4
- export class PlaneTrackerAPI {
5
- client;
6
- constructor(client) {
7
- this.client = client;
8
- }
9
- static getProxyUrlPath = () => `${BASE_URL}/proxy.cgi`;
10
- async checkCameraTime() {
11
- const responseSchema = z.discriminatedUnion('state', [
12
- z.object({
13
- state: z.literal(true),
14
- code: z.number(),
15
- }),
16
- z.object({
17
- state: z.literal(false),
18
- code: z.number(),
19
- reason: z.union([
20
- z.literal('INVALID_TIME'),
21
- z.literal('COULDNT_RESOLVE_HOST'),
22
- z.literal('CONNECTION_ERROR'),
23
- ]),
24
- message: z.string(),
25
- }),
26
- ]);
27
- const response = await this._get(`${BASE_URL}/camera_time.cgi`);
28
- const cameraTime = responseSchema.parse(response);
29
- if (!cameraTime.state) {
30
- console.error(`Camera time check failed: ${cameraTime.reason} - ${cameraTime.message}`);
31
- }
32
- return cameraTime.state;
33
- }
34
- fetchCameraSettings = async () => {
35
- return await this._get(`${BASE_URL}/package_camera_settings.cgi?action=get`);
36
- };
37
- fetchServerSettings = async () => {
38
- return await this._get(`${BASE_URL}/package_server_settings.cgi?action=get`);
39
- };
40
- fetchMapInfo = async () => {
41
- return await this._get(`${BASE_URL}/package/getMapInfo.cgi`);
42
- };
43
- fetchFlightInfo = async (icao) => {
44
- return await this._get(`${BASE_URL}/package/flightInfo.cgi?icao=${icao}`);
45
- };
46
- getZones = async () => {
47
- return await this._get(`${BASE_URL}/package/getZones.cgi`);
48
- };
49
- setZones = async (zonesJsonString) => {
50
- return await this._postJsonEncoded(`${BASE_URL}/package/setZones.cgi`, zonesJsonString);
51
- };
52
- getPriorityList = async () => {
53
- return await this._get(`${BASE_URL}/package/getPriorityList.cgi`);
54
- };
55
- setPriorityList = async (priorityListJsonString) => {
56
- return await this._postJsonEncoded(`${BASE_URL}/package/setPriorityList.cgi`, priorityListJsonString);
57
- };
58
- getWhiteList = async () => {
59
- return await this._get(`${BASE_URL}/package/getWhiteList.cgi`);
60
- };
61
- setWhiteList = async (whiteListJsonString) => {
62
- return await this._postJsonEncoded(`${BASE_URL}/package/setWhiteList.cgi`, whiteListJsonString);
63
- };
64
- getBlackList = async () => {
65
- return await this._get(`${BASE_URL}/package/getBlackList.cgi`);
66
- };
67
- setBlackList = async (blackListJsonString) => {
68
- return await this._postJsonEncoded(`${BASE_URL}/package/setBlackList.cgi`, blackListJsonString);
69
- };
70
- getTrackingMode = async () => {
71
- return await this._get(`${BASE_URL}/package/getTrackingMode.cgi`);
72
- };
73
- setTrackingMode = async (modeJsonString) => {
74
- return await this._postJsonEncoded(`${BASE_URL}/package/setTrackingMode.cgi`, modeJsonString);
75
- };
76
- startTrackingPlane = async (icao) => {
77
- return await this.client.get(`${BASE_URL}/package/trackIcao.cgi?icao=${icao}`);
78
- };
79
- stopTrackingPlane = async () => {
80
- return await this.client.get(`${BASE_URL}/package/resetIcao.cgi`);
81
- };
82
- goToCoordinates = async (lat, lon, alt) => {
83
- const url = `${BASE_URL}/package/goToCoordinates.cgi?lat=${lat}&lon=${lon}`;
84
- return await this.client.get(`${url}${alt !== undefined ? `&alt=${alt}` : ''}`);
85
- };
86
- async _get(...args) {
87
- const res = await this.client.get(...args);
88
- if (res.ok) {
89
- return (await res.json());
2
+ import { blackListSchema, cameraSettingsSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, typePriorityListSchema, whiteListSchema, wsAliasResponseSchema, zonesSchema, } from './types/PlaneTrackerAPI';
3
+ import { CannotSetCoordsInAutoModeError, ImportSettingsError, InvalidAltitudeError, InvalidLatLngError, ResetCalibrationError, ServerError, BadRequestError, } from './errors/errors';
4
+ import { cameraListSchema } from './types/GenetecAgent';
5
+ import { BasicAPI } from './internal/BasicAPI';
6
+ const BASE_PATH = '/local/planetracker';
7
+ export class PlaneTrackerAPI extends BasicAPI {
8
+ apiUser;
9
+ constructor(client, apiUser) {
10
+ super(client);
11
+ this.apiUser = apiUser;
12
+ }
13
+ static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
14
+ static getWsEventsPath = () => `${BASE_PATH}/package/ws`;
15
+ async checkAPIAvailable(options) {
16
+ await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
17
+ }
18
+ async checkCameraTime(options) {
19
+ const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
20
+ return z.boolean().parse(res.state);
21
+ }
22
+ async serverRunCheck(options) {
23
+ const agent = this.getClient(options?.proxyParams);
24
+ const res = await agent.get({
25
+ path: `${BASE_PATH}/package/serverRunCheck.cgi`,
26
+ timeout: options?.timeout,
27
+ });
28
+ return res.status === 200;
29
+ }
30
+ async getLiveViewAlias(rtspUrl, options) {
31
+ const agent = this.getClient(options?.proxyParams);
32
+ const res = await agent.get({
33
+ path: `${BASE_PATH}/getLiveViewAlias.cgi`,
34
+ parameters: { rtsp_url: rtspUrl },
35
+ timeout: options?.timeout,
36
+ });
37
+ return wsAliasResponseSchema.parse(await res.json());
38
+ }
39
+ async resetPtzCalibration(options) {
40
+ const agent = this.getClient(options?.proxyParams);
41
+ const res = await agent.get({
42
+ path: `${BASE_PATH}/package/resetPtzCalibration.cgi`,
43
+ parameters: this.apiUser,
44
+ timeout: options?.timeout,
45
+ });
46
+ if (!res.ok) {
47
+ throw new ResetCalibrationError('PTZ', res);
90
48
  }
91
- else {
92
- throw new Error(await responseStringify(res));
49
+ }
50
+ async resetFocusCalibration(options) {
51
+ const agent = this.getClient(options?.proxyParams);
52
+ const res = await agent.get({
53
+ path: `${BASE_PATH}/package/resetFocusCalibration.cgi`,
54
+ parameters: this.apiUser,
55
+ timeout: options?.timeout,
56
+ });
57
+ if (!res.ok) {
58
+ throw new ResetCalibrationError('FOCUS', res);
93
59
  }
94
60
  }
95
- async _post(...args) {
96
- const res = await this.client.post(...args);
97
- if (res.ok) {
98
- return (await res.json());
61
+ async fetchCameraSettings(options) {
62
+ const res = await this._getJson(`${BASE_PATH}/package_camera_settings.cgi`, { action: 'get' }, options);
63
+ return cameraSettingsSchema.parse(res);
64
+ }
65
+ async setCameraSettings(settings, options) {
66
+ await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settings, {
67
+ action: 'set',
68
+ }, options);
69
+ }
70
+ async fetchServerSettings(options) {
71
+ const res = await this._getJson(`${BASE_PATH}/package_server_settings.cgi`, { action: 'get' }, options);
72
+ return serverSettingsSchema.parse(res);
73
+ }
74
+ async exportAppSettings(dataType, options) {
75
+ return await this._getBlob(`${BASE_PATH}/package_data.cgi`, { action: 'EXPORT', dataType }, options);
76
+ }
77
+ async importAppSettings(dataType, formData, options) {
78
+ const agent = this.getClient(options?.proxyParams);
79
+ const res = await agent.post({
80
+ path: `${BASE_PATH}/package_data.cgi`,
81
+ data: formData,
82
+ parameters: { action: 'IMPORT', dataType },
83
+ timeout: options?.timeout,
84
+ });
85
+ if (!res.ok) {
86
+ throw new ImportSettingsError(res);
99
87
  }
100
- else {
101
- throw new Error(await responseStringify(res));
88
+ }
89
+ async fetchFlightInfo(icao, options) {
90
+ const res = await this._getJson(`${BASE_PATH}/package/flightInfo.cgi`, { icao }, options);
91
+ return flightInfoSchema.parse(res);
92
+ }
93
+ async getTrackingMode(options) {
94
+ const res = await this._getJson(`${BASE_PATH}/package/getTrackingMode.cgi`, undefined, options);
95
+ return trackingModeSchema.parse(res);
96
+ }
97
+ async setTrackingMode(mode, options) {
98
+ await this._postJsonEncoded(`${BASE_PATH}/package/setTrackingMode.cgi`, { mode }, this.apiUser, options);
99
+ }
100
+ async startTrackingPlane(icao, options) {
101
+ const agent = this.getClient(options?.proxyParams);
102
+ await agent.get({
103
+ path: `${BASE_PATH}/package/trackIcao.cgi`,
104
+ parameters: { icao, ...this.apiUser },
105
+ timeout: options?.timeout,
106
+ });
107
+ }
108
+ async stopTrackingPlane(options) {
109
+ const agent = this.getClient(options?.proxyParams);
110
+ await agent.get({
111
+ path: `${BASE_PATH}/package/resetIcao.cgi`,
112
+ parameters: this.apiUser,
113
+ timeout: options?.timeout,
114
+ });
115
+ }
116
+ async getIcao(by, value, options) {
117
+ const res = await this._getJson(`${BASE_PATH}/package/getIcao.cgi`, { [by]: value }, options);
118
+ return getIcaoSchema.parse(res).icao;
119
+ }
120
+ async getPriorityList(options) {
121
+ const res = await this._getJson(`${BASE_PATH}/package/getPriorityList.cgi`, undefined, options);
122
+ return priorityListSchema.parse(res).priorityList;
123
+ }
124
+ async setPriorityList(priorityList, options) {
125
+ await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
126
+ }
127
+ async getTypePriorityList(options) {
128
+ const res = await this._getJson(`${BASE_PATH}/package/getTypePriorityList.cgi`, undefined, options);
129
+ return typePriorityListSchema.parse(res).typePriorityList;
130
+ }
131
+ async setTypePriorityList(typePriorityList, options) {
132
+ await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
133
+ }
134
+ async getWhiteList(options) {
135
+ const res = await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
136
+ return whiteListSchema.parse(res).whiteList;
137
+ }
138
+ async setWhiteList(whiteList, options) {
139
+ await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, { whiteList }, this.apiUser, options);
140
+ }
141
+ async getBlackList(options) {
142
+ const res = await this._getJson(`${BASE_PATH}/package/getBlackList.cgi`, undefined, options);
143
+ return blackListSchema.parse(res).blackList;
144
+ }
145
+ async setBlackList(blackList, options) {
146
+ await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, { blackList }, this.apiUser, options);
147
+ }
148
+ async fetchMapInfo(options) {
149
+ const res = await this._getJson(`${BASE_PATH}/package/getMapInfo.cgi`, undefined, options);
150
+ return mapInfoSchema.parse(res);
151
+ }
152
+ async getZones(options) {
153
+ const res = await this._getJson(`${BASE_PATH}/package/getZones.cgi`, undefined, options);
154
+ return zonesSchema.parse(res);
155
+ }
156
+ async setZones(zones, options) {
157
+ await this._postJsonEncoded(`${BASE_PATH}/package/setZones.cgi`, zones, this.apiUser, options);
158
+ }
159
+ async goToCoordinates(lat, lon, alt, options) {
160
+ const agent = this.getClient(options?.proxyParams);
161
+ const res = await agent.get({
162
+ path: `${BASE_PATH}/package/goToCoordinates.cgi`,
163
+ parameters: { lat, lon, alt, ...this.apiUser },
164
+ timeout: options?.timeout,
165
+ });
166
+ if (!res.ok) {
167
+ if (res.status === 400 && res.statusText === 'Cannot set coordinates in automatic mode') {
168
+ throw new CannotSetCoordsInAutoModeError();
169
+ }
170
+ if (res.status === 400 && res.statusText === 'Invalid lat/lon parameters') {
171
+ throw new InvalidLatLngError();
172
+ }
173
+ if (res.status === 400 && res.statusText === 'Invalid alt parameter') {
174
+ throw new InvalidAltitudeError();
175
+ }
176
+ if (res.status === 400) {
177
+ throw new BadRequestError(res);
178
+ }
179
+ if (res.status === 500) {
180
+ throw new ServerError();
181
+ }
102
182
  }
103
183
  }
104
- async _postJsonEncoded(...args) {
105
- const [path, data, params, headers] = args;
106
- const baseHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
107
- return this._post(path, data, params, { ...baseHeaders, ...headers });
184
+ downloadReport(options) {
185
+ return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
186
+ }
187
+ async checkGenetecConnection(params, options) {
188
+ const res = await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
189
+ return res.status === 200;
190
+ }
191
+ async getGenetecCameraList(params, options) {
192
+ const res = await this._postUrlEncoded(`${BASE_PATH}/package/getGenetecCameraList.cgi`, params, options);
193
+ return cameraListSchema.parse(await res.json());
108
194
  }
109
195
  }