camstreamerlib 4.0.0-beta.99 → 4.0.2

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 (218) hide show
  1. package/README.md +44 -15
  2. package/cjs/CamOverlayAPI.d.ts +145 -107
  3. package/cjs/CamOverlayAPI.js +14 -63
  4. package/cjs/CamScripterAPI.d.ts +5 -8
  5. package/cjs/CamScripterAPI.js +11 -29
  6. package/cjs/CamStreamerAPI.d.ts +2362 -806
  7. package/cjs/CamStreamerAPI.js +68 -76
  8. package/cjs/CamSwitcherAPI.d.ts +23 -22
  9. package/cjs/CamSwitcherAPI.js +30 -88
  10. package/cjs/PlaneTrackerAPI.d.ts +31 -31
  11. package/cjs/PlaneTrackerAPI.js +20 -75
  12. package/cjs/VapixAPI.d.ts +36 -23
  13. package/cjs/VapixAPI.js +227 -106
  14. package/cjs/errors/errors.d.ts +11 -5
  15. package/cjs/errors/errors.js +5 -1
  16. package/cjs/index.d.ts +1 -0
  17. package/cjs/index.js +1 -0
  18. package/cjs/internal/BasicAPI.d.ts +15 -0
  19. package/cjs/internal/BasicAPI.js +93 -0
  20. package/cjs/internal/WsEvents.d.ts +1 -0
  21. package/cjs/internal/WsEvents.js +5 -0
  22. package/cjs/internal/constants.d.ts +1 -0
  23. package/cjs/internal/constants.js +2 -1
  24. package/cjs/internal/convertors.d.ts +6 -0
  25. package/cjs/internal/convertors.js +115 -0
  26. package/cjs/internal/transformers.js +8 -8
  27. package/cjs/internal/types.d.ts +3 -0
  28. package/cjs/internal/versionCompare.d.ts +2 -2
  29. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +878 -358
  30. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +54 -11
  31. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
  32. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +28 -28
  33. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  34. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.js +21 -0
  35. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
  36. package/cjs/types/CamOverlayAPI/index.d.ts +1 -0
  37. package/cjs/types/CamOverlayAPI/index.js +1 -0
  38. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
  39. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +8 -8
  40. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
  41. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
  42. package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  43. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
  44. package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
  45. package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
  46. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
  47. package/cjs/types/CamScripterAPI.d.ts +0 -11
  48. package/cjs/types/CamScripterAPI.js +1 -5
  49. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +17745 -4940
  50. package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +126 -57
  51. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +395 -86
  52. package/cjs/types/CamStreamerAPI/facebookSchema.js +13 -1
  53. package/cjs/types/CamStreamerAPI/index.d.ts +1 -3
  54. package/cjs/types/CamStreamerAPI/index.js +1 -3
  55. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
  56. package/cjs/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  57. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +392 -304
  58. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +116 -76
  59. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
  60. package/cjs/types/CamStreamerAPI/streamsSchema.js +81 -0
  61. package/cjs/types/CamStreamerAPI/windySchema.d.ts +356 -87
  62. package/cjs/types/CamStreamerAPI/windySchema.js +9 -1
  63. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +351 -119
  64. package/cjs/types/CamStreamerAPI/youtubeSchema.js +5 -9
  65. package/cjs/types/CamSwitcherAPI.d.ts +96 -91
  66. package/cjs/types/CamSwitcherAPI.js +9 -9
  67. package/cjs/types/GenetecAgent.d.ts +2 -2
  68. package/cjs/types/PlaneTrackerAPI.d.ts +75 -52
  69. package/cjs/types/PlaneTrackerAPI.js +11 -5
  70. package/cjs/types/VapixAPI.d.ts +51 -32
  71. package/cjs/types/VapixAPI.js +10 -3
  72. package/cjs/types/common.d.ts +27 -0
  73. package/cjs/types/common.js +13 -1
  74. package/cjs/types/ws/CamStreamerEvents.d.ts +110 -77
  75. package/cjs/types/ws/CamStreamerEvents.js +11 -7
  76. package/cjs/types/ws/CamSwitcherEvents.d.ts +8 -8
  77. package/cjs/types/ws/PlaneTrackerEvents.d.ts +3 -3
  78. package/esm/CamOverlayAPI.js +16 -65
  79. package/esm/CamScripterAPI.js +9 -30
  80. package/esm/CamStreamerAPI.js +70 -78
  81. package/esm/CamSwitcherAPI.js +31 -89
  82. package/esm/PlaneTrackerAPI.js +21 -76
  83. package/esm/VapixAPI.js +228 -107
  84. package/esm/errors/errors.js +5 -1
  85. package/esm/index.js +1 -0
  86. package/esm/internal/BasicAPI.js +89 -0
  87. package/esm/internal/WsEvents.js +5 -0
  88. package/esm/internal/constants.js +1 -0
  89. package/esm/internal/convertors.js +108 -0
  90. package/esm/internal/transformers.js +1 -1
  91. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +47 -10
  92. package/esm/types/CamOverlayAPI/htmlOverlaySchema.js +18 -0
  93. package/esm/types/CamOverlayAPI/index.js +1 -0
  94. package/esm/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
  95. package/esm/types/CamScripterAPI.js +0 -4
  96. package/esm/types/CamStreamerAPI/CamStreamerAPI.js +109 -41
  97. package/esm/types/CamStreamerAPI/facebookSchema.js +13 -1
  98. package/esm/types/CamStreamerAPI/index.js +1 -3
  99. package/esm/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  100. package/esm/types/CamStreamerAPI/streamCommonTypes.js +116 -76
  101. package/esm/types/CamStreamerAPI/streamsSchema.js +75 -0
  102. package/esm/types/CamStreamerAPI/windySchema.js +9 -1
  103. package/esm/types/CamStreamerAPI/youtubeSchema.js +5 -9
  104. package/esm/types/CamSwitcherAPI.js +8 -8
  105. package/esm/types/PlaneTrackerAPI.js +11 -5
  106. package/esm/types/VapixAPI.js +9 -2
  107. package/esm/types/common.js +12 -0
  108. package/esm/types/ws/CamStreamerEvents.js +11 -7
  109. package/package.json +4 -4
  110. package/types/CamOverlayAPI.d.ts +145 -107
  111. package/types/CamScripterAPI.d.ts +5 -8
  112. package/types/CamStreamerAPI.d.ts +2362 -806
  113. package/types/CamSwitcherAPI.d.ts +23 -22
  114. package/types/PlaneTrackerAPI.d.ts +31 -31
  115. package/types/VapixAPI.d.ts +36 -23
  116. package/types/errors/errors.d.ts +11 -5
  117. package/types/index.d.ts +1 -0
  118. package/types/internal/BasicAPI.d.ts +15 -0
  119. package/types/internal/WsEvents.d.ts +1 -0
  120. package/types/internal/constants.d.ts +1 -0
  121. package/types/internal/convertors.d.ts +6 -0
  122. package/types/internal/types.d.ts +3 -0
  123. package/types/internal/versionCompare.d.ts +2 -2
  124. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +878 -358
  125. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
  126. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +28 -28
  127. package/types/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  128. package/types/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
  129. package/types/types/CamOverlayAPI/index.d.ts +1 -0
  130. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
  131. package/types/types/CamOverlayAPI/pipSchema.d.ts +8 -8
  132. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
  133. package/types/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
  134. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  135. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
  136. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
  137. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
  138. package/types/types/CamScripterAPI.d.ts +0 -11
  139. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +17745 -4940
  140. package/types/types/CamStreamerAPI/facebookSchema.d.ts +395 -86
  141. package/types/types/CamStreamerAPI/index.d.ts +1 -3
  142. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
  143. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +392 -304
  144. package/types/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
  145. package/types/types/CamStreamerAPI/windySchema.d.ts +356 -87
  146. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +351 -119
  147. package/types/types/CamSwitcherAPI.d.ts +96 -91
  148. package/types/types/GenetecAgent.d.ts +2 -2
  149. package/types/types/PlaneTrackerAPI.d.ts +75 -52
  150. package/types/types/VapixAPI.d.ts +51 -32
  151. package/types/types/common.d.ts +27 -0
  152. package/types/types/ws/CamStreamerEvents.d.ts +110 -77
  153. package/types/types/ws/CamSwitcherEvents.d.ts +8 -8
  154. package/types/types/ws/PlaneTrackerEvents.d.ts +3 -3
  155. package/cjs/types/CamStreamerAPI/churchSchema.d.ts +0 -275
  156. package/cjs/types/CamStreamerAPI/churchSchema.js +0 -11
  157. package/cjs/types/CamStreamerAPI/daCastSchema.d.ts +0 -275
  158. package/cjs/types/CamStreamerAPI/daCastSchema.js +0 -11
  159. package/cjs/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -275
  160. package/cjs/types/CamStreamerAPI/dailymotionSchema.js +0 -11
  161. package/cjs/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -275
  162. package/cjs/types/CamStreamerAPI/gameChangerSchema.js +0 -11
  163. package/cjs/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -275
  164. package/cjs/types/CamStreamerAPI/hlsPullSchema.js +0 -11
  165. package/cjs/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -275
  166. package/cjs/types/CamStreamerAPI/hlsPushSchema.js +0 -11
  167. package/cjs/types/CamStreamerAPI/ibmSchema.d.ts +0 -275
  168. package/cjs/types/CamStreamerAPI/ibmSchema.js +0 -11
  169. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -275
  170. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.js +0 -11
  171. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -275
  172. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.js +0 -11
  173. package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -323
  174. package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +0 -27
  175. package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +0 -284
  176. package/cjs/types/CamStreamerAPI/rtmpSchema.js +0 -14
  177. package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +0 -275
  178. package/cjs/types/CamStreamerAPI/sdCardSchema.js +0 -11
  179. package/cjs/types/CamStreamerAPI/srtSchema.d.ts +0 -275
  180. package/cjs/types/CamStreamerAPI/srtSchema.js +0 -11
  181. package/cjs/types/CamStreamerAPI/twitchSchema.d.ts +0 -275
  182. package/cjs/types/CamStreamerAPI/twitchSchema.js +0 -11
  183. package/cjs/types/CamStreamerAPI/vimeoSchema.d.ts +0 -275
  184. package/cjs/types/CamStreamerAPI/vimeoSchema.js +0 -11
  185. package/cjs/types/CamStreamerAPI/wowzaSchema.d.ts +0 -275
  186. package/cjs/types/CamStreamerAPI/wowzaSchema.js +0 -11
  187. package/esm/types/CamStreamerAPI/churchSchema.js +0 -5
  188. package/esm/types/CamStreamerAPI/daCastSchema.js +0 -5
  189. package/esm/types/CamStreamerAPI/dailymotionSchema.js +0 -5
  190. package/esm/types/CamStreamerAPI/gameChangerSchema.js +0 -5
  191. package/esm/types/CamStreamerAPI/hlsPullSchema.js +0 -5
  192. package/esm/types/CamStreamerAPI/hlsPushSchema.js +0 -5
  193. package/esm/types/CamStreamerAPI/ibmSchema.js +0 -5
  194. package/esm/types/CamStreamerAPI/microsoftAzureSchema.js +0 -5
  195. package/esm/types/CamStreamerAPI/microsoftStreamSchema.js +0 -5
  196. package/esm/types/CamStreamerAPI/mpegDvbSchema.js +0 -21
  197. package/esm/types/CamStreamerAPI/rtmpSchema.js +0 -8
  198. package/esm/types/CamStreamerAPI/sdCardSchema.js +0 -5
  199. package/esm/types/CamStreamerAPI/srtSchema.js +0 -5
  200. package/esm/types/CamStreamerAPI/twitchSchema.js +0 -5
  201. package/esm/types/CamStreamerAPI/vimeoSchema.js +0 -5
  202. package/esm/types/CamStreamerAPI/wowzaSchema.js +0 -5
  203. package/types/types/CamStreamerAPI/churchSchema.d.ts +0 -275
  204. package/types/types/CamStreamerAPI/daCastSchema.d.ts +0 -275
  205. package/types/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -275
  206. package/types/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -275
  207. package/types/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -275
  208. package/types/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -275
  209. package/types/types/CamStreamerAPI/ibmSchema.d.ts +0 -275
  210. package/types/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -275
  211. package/types/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -275
  212. package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -323
  213. package/types/types/CamStreamerAPI/rtmpSchema.d.ts +0 -284
  214. package/types/types/CamStreamerAPI/sdCardSchema.d.ts +0 -275
  215. package/types/types/CamStreamerAPI/srtSchema.d.ts +0 -275
  216. package/types/types/CamStreamerAPI/twitchSchema.d.ts +0 -275
  217. package/types/types/CamStreamerAPI/vimeoSchema.d.ts +0 -275
  218. package/types/types/CamStreamerAPI/wowzaSchema.d.ts +0 -275
@@ -1,16 +1,15 @@
1
- import { IClient, TBlobResponse, TParameters, TResponse } from './internal/types';
1
+ import { IClient, TParameters, TResponse } from './internal/types';
2
2
  import { ICAO, TApiUser, TBlackList, TCameraSettings, TExportDataType, TGetIcaoByOption, TImportDataType, TPriorityList, TTrackingMode, TTypePriorityList, TWhiteList, TZones } from './types/PlaneTrackerAPI';
3
- import { THttpRequestOptions, TProxyParams } from './types/common';
4
- import { ProxyClient } from './internal/ProxyClient';
5
- export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
6
- private client;
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> {
7
6
  private apiUser;
8
7
  constructor(client: Client, apiUser: TApiUser);
9
8
  static getProxyPath: () => string;
10
9
  static getWsEventsPath: () => string;
11
- getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
10
+ checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
12
11
  checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
13
- serverRunCheck(options?: THttpRequestOptions): Promise<TResponse>;
12
+ serverRunCheck(options?: THttpRequestOptions): Promise<boolean>;
14
13
  getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
15
14
  ws: string;
16
15
  ws_initial_message: string;
@@ -22,15 +21,19 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
22
21
  camera: {
23
22
  ip: string;
24
23
  port: number;
25
- protocol: "https" | "http" | "https_insecure";
26
- user: string;
27
24
  pass: string;
25
+ user: string;
26
+ protocol: "https" | "http" | "https_insecure";
28
27
  };
29
28
  units: "metric" | "imperial";
30
29
  adsbSource: {
31
30
  ip: string;
31
+ enabled: boolean;
32
32
  port: number;
33
33
  };
34
+ dronetagSource: {
35
+ enabled: boolean;
36
+ };
34
37
  cameraCalibrationProcessConfig: {
35
38
  nightSkyCalibrationEnabled: boolean;
36
39
  scheduleNightSkyCalibrationTimestamp: number;
@@ -39,7 +42,6 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
39
42
  cameraConfig: {
40
43
  defaultCaptureSizeMeters: number;
41
44
  captureSizeExtensionMeters: number;
42
- maxZoomLevel?: number | undefined;
43
45
  };
44
46
  stream: {
45
47
  width: number;
@@ -84,8 +86,8 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
84
86
  };
85
87
  radarcapeFlightInfoSource: {
86
88
  ip: string;
87
- port: number;
88
89
  enabled: boolean;
90
+ port: number;
89
91
  priority: number;
90
92
  };
91
93
  identificationLabel: {
@@ -97,22 +99,22 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
97
99
  };
98
100
  acs: {
99
101
  ip: string;
100
- port: number;
101
102
  enabled: boolean;
102
- protocol: "https" | "http" | "https_insecure";
103
- user: string;
103
+ port: number;
104
104
  pass: string;
105
+ user: string;
106
+ protocol: "https" | "http" | "https_insecure";
105
107
  sourceKey: string;
106
108
  };
107
109
  genetec: {
108
110
  ip: string;
109
- port: number;
110
111
  enabled: boolean;
112
+ port: number;
111
113
  cameraList: string[];
114
+ pass: string;
112
115
  appId: string;
113
- protocol: "https" | "http" | "https_insecure";
114
116
  user: string;
115
- pass: string;
117
+ protocol: "https" | "http" | "https_insecure";
116
118
  baseUri: string;
117
119
  };
118
120
  camstreamerIntegration: {
@@ -132,18 +134,20 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
132
134
  displayPTError?: boolean | undefined;
133
135
  displayPTZSpeed?: boolean | undefined;
134
136
  displayVelocityData?: boolean | undefined;
137
+ displayAdsbVelocityData?: boolean | undefined;
135
138
  displaySignalQuality?: boolean | undefined;
136
139
  displayAutoTrackingInfo?: boolean | undefined;
137
140
  displayGPSCoords?: boolean | undefined;
138
141
  displayVapixQuery?: boolean | undefined;
139
142
  displayFocus?: boolean | undefined;
140
143
  displayAperture?: boolean | undefined;
144
+ displayAircraftInfo?: boolean | undefined;
141
145
  displaySunDistance?: boolean | undefined;
142
146
  displayTickTime?: boolean | undefined;
143
- displayAircraftInfo?: boolean | undefined;
147
+ displaySystemInfo?: boolean | undefined;
144
148
  } | undefined;
145
149
  }>;
146
- setCameraSettings(settings: TCameraSettings, options?: THttpRequestOptions): Promise<TResponse>;
150
+ setCameraSettings(settings: TCameraSettings, options?: THttpRequestOptions): Promise<void>;
147
151
  fetchServerSettings(options?: THttpRequestOptions): Promise<{
148
152
  cameraCalibration: {
149
153
  posLat: number;
@@ -162,7 +166,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
162
166
  }[];
163
167
  };
164
168
  }>;
165
- exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
169
+ exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
166
170
  importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
167
171
  fetchFlightInfo(icao: ICAO, options?: THttpRequestOptions): Promise<{
168
172
  destinationAirport: {
@@ -193,13 +197,13 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
193
197
  stopTrackingPlane(options?: THttpRequestOptions): Promise<void>;
194
198
  getIcao(by: TGetIcaoByOption, value: string, options?: THttpRequestOptions): Promise<string>;
195
199
  getPriorityList(options?: THttpRequestOptions): Promise<string[]>;
196
- setPriorityList(priorityList: TPriorityList['priorityList'], options?: THttpRequestOptions): Promise<TResponse>;
200
+ setPriorityList(priorityList: TPriorityList['priorityList'], options?: THttpRequestOptions): Promise<void>;
197
201
  getTypePriorityList(options?: THttpRequestOptions): Promise<string[]>;
198
- setTypePriorityList(typePriorityList: TTypePriorityList['typePriorityList'], options?: THttpRequestOptions): Promise<TResponse>;
202
+ setTypePriorityList(typePriorityList: TTypePriorityList['typePriorityList'], options?: THttpRequestOptions): Promise<void>;
199
203
  getWhiteList(options?: THttpRequestOptions): Promise<string[]>;
200
- setWhiteList(whiteList: TWhiteList['whiteList'], options?: THttpRequestOptions): Promise<TResponse>;
204
+ setWhiteList(whiteList: TWhiteList['whiteList'], options?: THttpRequestOptions): Promise<void>;
201
205
  getBlackList(options?: THttpRequestOptions): Promise<string[]>;
202
- setBlackList(blackList: TBlackList['blackList'], options?: THttpRequestOptions): Promise<TResponse>;
206
+ setBlackList(blackList: TBlackList['blackList'], options?: THttpRequestOptions): Promise<void>;
203
207
  fetchMapInfo(options?: THttpRequestOptions): Promise<{
204
208
  minZoom: number;
205
209
  maxZoom: number;
@@ -227,15 +231,11 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
227
231
  }>;
228
232
  setZones(zones: TZones, options?: THttpRequestOptions): Promise<void>;
229
233
  goToCoordinates(lat: number, lon: number, alt?: number, options?: THttpRequestOptions): Promise<void>;
230
- checkGenetecConnection(params: TParameters, options?: THttpRequestOptions): Promise<TResponse>;
234
+ downloadReport(options?: THttpRequestOptions): Promise<string>;
235
+ checkGenetecConnection(params: TParameters, options?: THttpRequestOptions): Promise<boolean>;
231
236
  getGenetecCameraList(params: TParameters, options?: THttpRequestOptions): Promise<{
232
237
  value: string;
233
- index: number;
234
238
  label: string;
239
+ index: number;
235
240
  }[]>;
236
- private _getJson;
237
- private _getBlob;
238
- private parseBlobResponse;
239
- private _postJsonEncoded;
240
- private _postUrlEncoded;
241
241
  }
@@ -2,23 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlaneTrackerAPI = void 0;
4
4
  const zod_1 = require("zod");
5
- const utils_1 = require("./internal/utils");
6
5
  const PlaneTrackerAPI_1 = require("./types/PlaneTrackerAPI");
7
6
  const errors_1 = require("./errors/errors");
8
- const ProxyClient_1 = require("./internal/ProxyClient");
9
7
  const GenetecAgent_1 = require("./types/GenetecAgent");
8
+ const BasicAPI_1 = require("./internal/BasicAPI");
10
9
  const BASE_PATH = '/local/planetracker';
11
- class PlaneTrackerAPI {
12
- client;
10
+ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
13
11
  apiUser;
14
12
  constructor(client, apiUser) {
15
- this.client = client;
13
+ super(client);
16
14
  this.apiUser = apiUser;
17
15
  }
18
16
  static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
19
17
  static getWsEventsPath = () => `${BASE_PATH}/package/ws`;
20
- getClient(proxyParams) {
21
- return proxyParams ? new ProxyClient_1.ProxyClient(this.client, proxyParams) : this.client;
18
+ async checkAPIAvailable(options) {
19
+ await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
22
20
  }
23
21
  async checkCameraTime(options) {
24
22
  const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
@@ -26,7 +24,11 @@ class PlaneTrackerAPI {
26
24
  }
27
25
  async serverRunCheck(options) {
28
26
  const agent = this.getClient(options?.proxyParams);
29
- return await agent.get({ path: `${BASE_PATH}/package/serverRunCheck.cgi`, timeout: options?.timeout });
27
+ const res = await agent.get({
28
+ path: `${BASE_PATH}/package/serverRunCheck.cgi`,
29
+ timeout: options?.timeout,
30
+ });
31
+ return res.status === 200;
30
32
  }
31
33
  async getLiveViewAlias(rtspUrl, options) {
32
34
  const agent = this.getClient(options?.proxyParams);
@@ -64,7 +66,7 @@ class PlaneTrackerAPI {
64
66
  return PlaneTrackerAPI_1.cameraSettingsSchema.parse(res);
65
67
  }
66
68
  async setCameraSettings(settings, options) {
67
- return await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settings, {
69
+ await this._postJsonEncoded(`${BASE_PATH}/package_camera_settings.cgi`, settings, {
68
70
  action: 'set',
69
71
  }, options);
70
72
  }
@@ -123,28 +125,28 @@ class PlaneTrackerAPI {
123
125
  return PlaneTrackerAPI_1.priorityListSchema.parse(res).priorityList;
124
126
  }
125
127
  async setPriorityList(priorityList, options) {
126
- return await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
128
+ await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
127
129
  }
128
130
  async getTypePriorityList(options) {
129
131
  const res = await this._getJson(`${BASE_PATH}/package/getTypePriorityList.cgi`, undefined, options);
130
132
  return PlaneTrackerAPI_1.typePriorityListSchema.parse(res).typePriorityList;
131
133
  }
132
134
  async setTypePriorityList(typePriorityList, options) {
133
- return await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
135
+ await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
134
136
  }
135
137
  async getWhiteList(options) {
136
138
  const res = await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
137
139
  return PlaneTrackerAPI_1.whiteListSchema.parse(res).whiteList;
138
140
  }
139
141
  async setWhiteList(whiteList, options) {
140
- return await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, { whiteList }, this.apiUser, options);
142
+ await this._postJsonEncoded(`${BASE_PATH}/package/setWhiteList.cgi`, { whiteList }, this.apiUser, options);
141
143
  }
142
144
  async getBlackList(options) {
143
145
  const res = await this._getJson(`${BASE_PATH}/package/getBlackList.cgi`, undefined, options);
144
146
  return PlaneTrackerAPI_1.blackListSchema.parse(res).blackList;
145
147
  }
146
148
  async setBlackList(blackList, options) {
147
- return await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, { blackList }, this.apiUser, options);
149
+ await this._postJsonEncoded(`${BASE_PATH}/package/setBlackList.cgi`, { blackList }, this.apiUser, options);
148
150
  }
149
151
  async fetchMapInfo(options) {
150
152
  const res = await this._getJson(`${BASE_PATH}/package/getMapInfo.cgi`, undefined, options);
@@ -182,73 +184,16 @@ class PlaneTrackerAPI {
182
184
  }
183
185
  }
184
186
  }
187
+ downloadReport(options) {
188
+ return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
189
+ }
185
190
  async checkGenetecConnection(params, options) {
186
- return await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
191
+ const res = await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
192
+ return res.status === 200;
187
193
  }
188
194
  async getGenetecCameraList(params, options) {
189
195
  const res = await this._postUrlEncoded(`${BASE_PATH}/package/getGenetecCameraList.cgi`, params, options);
190
196
  return GenetecAgent_1.cameraListSchema.parse(await res.json());
191
197
  }
192
- async _getJson(path, parameters, options, headers) {
193
- const agent = this.getClient(options?.proxyParams);
194
- const res = await agent.get({ path, parameters, timeout: options?.timeout, headers });
195
- if (res.ok) {
196
- return await res.json();
197
- }
198
- else {
199
- throw new errors_1.ErrorWithResponse(res);
200
- }
201
- }
202
- async _getBlob(path, parameters, options) {
203
- const agent = this.getClient(options?.proxyParams);
204
- const res = await agent.get({ path, parameters, timeout: options?.timeout });
205
- if (res.ok) {
206
- return await this.parseBlobResponse(res);
207
- }
208
- else {
209
- throw new errors_1.ErrorWithResponse(res);
210
- }
211
- }
212
- async parseBlobResponse(response) {
213
- try {
214
- return (await response.blob());
215
- }
216
- catch (err) {
217
- throw new errors_1.ParsingBlobError(err);
218
- }
219
- }
220
- async _postJsonEncoded(path, data, parameters, options) {
221
- const agent = this.getClient(options?.proxyParams);
222
- const jsonData = JSON.stringify(data);
223
- const res = await agent.post({
224
- path,
225
- data: jsonData,
226
- parameters,
227
- headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
228
- timeout: options?.timeout,
229
- });
230
- if (res.ok) {
231
- return res;
232
- }
233
- else {
234
- throw new errors_1.ErrorWithResponse(res);
235
- }
236
- }
237
- async _postUrlEncoded(path, params, options) {
238
- const data = (0, utils_1.paramToUrl)(params);
239
- const agent = this.getClient(options?.proxyParams);
240
- const res = await agent.post({
241
- path,
242
- data,
243
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
244
- timeout: options?.timeout,
245
- });
246
- if (res.ok) {
247
- return res;
248
- }
249
- else {
250
- throw new errors_1.ErrorWithResponse(res);
251
- }
252
- }
253
198
  }
254
199
  exports.PlaneTrackerAPI = PlaneTrackerAPI;
package/cjs/VapixAPI.d.ts CHANGED
@@ -1,17 +1,15 @@
1
1
  import { IClient, TParameters, TResponse } from './internal/types';
2
2
  import { TAudioDevice, TPortSetSchema, TPortSequenceStateSchema } from './types/VapixAPI';
3
- import { ProxyClient } from './internal/ProxyClient';
4
- import { TCameraImageConfig, THttpRequestOptions, TProxyParams } from './types/common';
5
- export declare class VapixAPI<Client extends IClient<TResponse, any>> {
6
- private client;
3
+ import { TCameraImageConfig, THttpRequestOptions } from './types/common';
4
+ import { BasicAPI } from './internal/BasicAPI';
5
+ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends BasicAPI<Client> {
7
6
  private CustomFormData;
8
7
  constructor(client: Client, CustomFormData?: {
9
8
  new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
10
9
  prototype: FormData;
11
10
  });
12
- getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
13
11
  postUrlEncoded(path: string, parameters?: TParameters, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
14
- postJson(path: string, jsonData: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
12
+ postJson(path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
15
13
  getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
16
14
  getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
17
15
  getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<{
@@ -19,17 +17,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
19
17
  bitRates: number[];
20
18
  }[]>;
21
19
  performAutofocus(options?: THttpRequestOptions): Promise<void>;
22
- checkSDCard(options?: THttpRequestOptions): Promise<{
23
- status: "OK" | "connected" | "disconnected";
24
- totalSize: number;
25
- freeSize: number;
26
- }>;
27
- mountSDCard(options?: THttpRequestOptions): Promise<number>;
28
- unmountSDCard(options?: THttpRequestOptions): Promise<number>;
29
- private _doSDCardMountAction;
30
- fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
31
- downloadCameraReport(options?: THttpRequestOptions): Promise<TResponse>;
32
- getSystemLog(options?: THttpRequestOptions): Promise<TResponse>;
20
+ downloadCameraReport(options?: THttpRequestOptions): Promise<string>;
21
+ getSystemLog(options?: THttpRequestOptions): Promise<string>;
33
22
  getMaxFps(channel: number, options?: THttpRequestOptions): Promise<number>;
34
23
  getTimezone(options?: THttpRequestOptions): Promise<string>;
35
24
  getDateTimeInfo(options?: THttpRequestOptions): Promise<{
@@ -44,7 +33,16 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
44
33
  getDevicesSettings(options?: THttpRequestOptions): Promise<TAudioDevice[]>;
45
34
  fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T, options?: THttpRequestOptions): Promise<any>;
46
35
  getHeaders(options?: THttpRequestOptions): Promise<Record<string, string>>;
47
- setHeaders(headers: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
36
+ setHeaders(headers: Record<string, string>, options?: THttpRequestOptions): Promise<void>;
37
+ checkSDCard(options?: THttpRequestOptions): Promise<{
38
+ status: "OK" | "connected" | "disconnected";
39
+ totalSize: number;
40
+ freeSize: number;
41
+ }>;
42
+ mountSDCard(options?: THttpRequestOptions): Promise<number>;
43
+ unmountSDCard(options?: THttpRequestOptions): Promise<number>;
44
+ private _doSDCardMountAction;
45
+ fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
48
46
  getParameter(paramNames: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
49
47
  setParameter(params: Record<string, string | number | boolean>, options?: THttpRequestOptions): Promise<void>;
50
48
  getGuardTourList(options?: THttpRequestOptions): Promise<{
@@ -52,8 +50,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
52
50
  id: string;
53
51
  running: string;
54
52
  tour: {
55
- moveSpeed?: unknown;
56
53
  position?: unknown;
54
+ moveSpeed?: unknown;
57
55
  presetNbr?: unknown;
58
56
  waitTime?: unknown;
59
57
  waitTimeViewType?: unknown;
@@ -66,18 +64,18 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
66
64
  getPTZPresetList(channel: number, options?: THttpRequestOptions): Promise<string[]>;
67
65
  listPTZ(camera: number, options?: THttpRequestOptions): Promise<{
68
66
  name: string;
69
- id: number;
70
67
  data: {
71
68
  pan?: number | undefined;
72
69
  tilt?: number | undefined;
73
70
  zoom?: number | undefined;
74
71
  };
72
+ id: number;
75
73
  }[]>;
76
74
  listPtzVideoSourceOverview(options?: THttpRequestOptions): Promise<Record<number, {
77
75
  name: string;
78
76
  id: number;
79
77
  }[]>>;
80
- goToPreset(channel: number, presetName: string, options?: THttpRequestOptions): Promise<TResponse>;
78
+ goToPreset(channel: number, presetName: string, options?: THttpRequestOptions): Promise<void>;
81
79
  getPtzPosition(camera: number, options?: THttpRequestOptions): Promise<{
82
80
  pan?: number | undefined;
83
81
  tilt?: number | undefined;
@@ -86,15 +84,27 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
86
84
  getPorts(options?: THttpRequestOptions): Promise<{
87
85
  name: string;
88
86
  port: string;
87
+ direction: "output" | "input";
89
88
  state: "open" | "closed";
90
89
  configurable: boolean;
91
90
  usage: string;
92
- direction: "input" | "output";
93
91
  normalState: "open" | "closed";
94
92
  readonly?: boolean | undefined;
95
93
  }[]>;
96
94
  setPorts(ports: TPortSetSchema[], options?: THttpRequestOptions): Promise<void>;
97
95
  setPortStateSequence(port: number, sequence: TPortSequenceStateSchema[], options?: THttpRequestOptions): Promise<void>;
96
+ addCameraUser(username: string, pass: string, sgrp: string, comment?: string, options?: THttpRequestOptions): Promise<void>;
97
+ getCameraUsers(options?: THttpRequestOptions): Promise<string[]>;
98
+ editCameraUser(username: string, pass: string, options?: THttpRequestOptions): Promise<void>;
99
+ getRecordingRuleList(options?: THttpRequestOptions): Promise<{
100
+ options: Record<string, string>;
101
+ diskid: string;
102
+ eventid: string;
103
+ profile: string;
104
+ }[]>;
105
+ addRecordingRule(params: Record<string, string>, options?: THttpRequestOptions): Promise<string | null>;
106
+ removeRecordingRule(profileId: string, options?: THttpRequestOptions): Promise<void>;
107
+ getDiskInfo(diskId?: string, options?: THttpRequestOptions): Promise<boolean>;
98
108
  getApplicationList(options?: THttpRequestOptions): Promise<{
99
109
  Name: string;
100
110
  NiceName: string;
@@ -102,7 +112,7 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
102
112
  Version: string;
103
113
  License: string;
104
114
  Status: string;
105
- appId: "CamStreamer" | "CamSwitcher" | "CamOverlay" | "CamScripter" | "PlaneTracker" | "Ndihxplugin" | "SportTracker" | null;
115
+ appId: "CamStreamer" | "CamSwitcher" | "CamOverlay" | "CamScripter" | "PlaneTracker" | "Ndihxplugin" | "SportTracker" | "CamOverlayHtmlplugin" | null;
106
116
  ApplicationID?: string | undefined;
107
117
  ConfigurationPage?: string | undefined;
108
118
  VendorHomePage?: string | undefined;
@@ -112,7 +122,10 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
112
122
  restartApplication(applicationId: string, options?: THttpRequestOptions): Promise<void>;
113
123
  stopApplication(applicationId: string, options?: THttpRequestOptions): Promise<void>;
114
124
  installApplication(data: Parameters<typeof FormData.prototype.append>[1], fileName: string, options?: THttpRequestOptions): Promise<void>;
125
+ private static parseQueryString;
126
+ private static checkTextResponseForError;
115
127
  private static parseParameters;
116
128
  private static parseCameraPtzResponse;
117
129
  private static parsePtz;
130
+ private static parseXmlResponse;
118
131
  }