camstreamerlib 4.0.0-beta.2 → 4.0.0-beta.20

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 (236) hide show
  1. package/README.md +5 -1
  2. package/cjs/CamOverlayAPI.d.ts +629 -0
  3. package/cjs/CamOverlayAPI.js +255 -0
  4. package/{CamOverlayDrawingAPI.d.ts → cjs/CamOverlayDrawingAPI.d.ts} +1 -1
  5. package/cjs/CamOverlayDrawingAPI.js +235 -0
  6. package/cjs/CamOverlayPainter/Frame.js +301 -0
  7. package/{CamOverlayPainter → cjs/CamOverlayPainter}/Painter.d.ts +14 -3
  8. package/cjs/CamOverlayPainter/Painter.js +171 -0
  9. package/cjs/CamOverlayPainter/ResourceManager.js +46 -0
  10. package/{CamScripterAPI.d.ts → cjs/CamScripterAPI.d.ts} +5 -5
  11. package/cjs/CamScripterAPI.js +64 -0
  12. package/{CamScripterAPICameraEventsGenerator.d.ts → cjs/CamScripterAPICameraEventsGenerator.d.ts} +1 -1
  13. package/cjs/CamScripterAPICameraEventsGenerator.js +162 -0
  14. package/{CamStreamerAPI.d.ts → cjs/CamStreamerAPI.d.ts} +5 -5
  15. package/cjs/CamStreamerAPI.js +59 -0
  16. package/{CamSwitcherAPI.d.ts → cjs/CamSwitcherAPI.d.ts} +10 -6
  17. package/cjs/CamSwitcherAPI.js +351 -0
  18. package/{CamSwitcherEvents.d.ts → cjs/CamSwitcherEvents.d.ts} +2 -2
  19. package/cjs/CamSwitcherEvents.js +67 -0
  20. package/cjs/CreatePackage.js +106 -0
  21. package/cjs/PlaneTrackerAPI.d.ts +47 -0
  22. package/cjs/PlaneTrackerAPI.js +176 -0
  23. package/{VapixAPI.d.ts → cjs/VapixAPI.d.ts} +19 -7
  24. package/cjs/VapixAPI.js +491 -0
  25. package/{VapixEvents.d.ts → cjs/VapixEvents.d.ts} +1 -1
  26. package/cjs/VapixEvents.js +88 -0
  27. package/{errors → cjs/errors}/errors.d.ts +3 -0
  28. package/cjs/errors/errors.js +86 -0
  29. package/{events → cjs/events}/AxisCameraStationEvents.d.ts +3 -2
  30. package/cjs/events/AxisCameraStationEvents.js +48 -0
  31. package/{events → cjs/events}/GenetecAgent.d.ts +4 -3
  32. package/cjs/events/GenetecAgent.js +123 -0
  33. package/cjs/index.d.ts +18 -0
  34. package/cjs/index.js +42 -0
  35. package/cjs/internal/Digest.js +42 -0
  36. package/cjs/internal/ProxyClient.d.ts +11 -0
  37. package/cjs/internal/ProxyClient.js +46 -0
  38. package/cjs/internal/constants.js +4 -0
  39. package/cjs/internal/transformers.js +32 -0
  40. package/cjs/internal/types.d.ts +35 -0
  41. package/cjs/internal/types.js +2 -0
  42. package/{internal → cjs/internal}/utils.d.ts +5 -1
  43. package/cjs/internal/utils.js +69 -0
  44. package/{internal → cjs/internal}/versionCompare.d.ts +2 -2
  45. package/cjs/internal/versionCompare.js +53 -0
  46. package/cjs/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
  47. package/cjs/models/CamOverlayAPI/accuweatherSchema.js +48 -0
  48. package/cjs/models/CamOverlayAPI/constants.d.ts +11 -0
  49. package/cjs/models/CamOverlayAPI/constants.js +14 -0
  50. package/cjs/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
  51. package/cjs/models/CamOverlayAPI/customGraphicsSchema.js +73 -0
  52. package/cjs/models/CamOverlayAPI/fileSchema.d.ts +28 -0
  53. package/cjs/models/CamOverlayAPI/fileSchema.js +17 -0
  54. package/cjs/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
  55. package/cjs/models/CamOverlayAPI/imagesSchema.js +10 -0
  56. package/cjs/models/CamOverlayAPI/index.d.ts +13 -0
  57. package/cjs/models/CamOverlayAPI/index.js +29 -0
  58. package/cjs/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
  59. package/cjs/models/CamOverlayAPI/infotickerSchema.js +27 -0
  60. package/cjs/models/CamOverlayAPI/pipSchema.d.ts +125 -0
  61. package/cjs/models/CamOverlayAPI/pipSchema.js +40 -0
  62. package/cjs/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
  63. package/cjs/models/CamOverlayAPI/ptzCompassSchema.js +26 -0
  64. package/cjs/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
  65. package/cjs/models/CamOverlayAPI/ptzSchema.js +13 -0
  66. package/cjs/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
  67. package/cjs/models/CamOverlayAPI/screenSharingSchema.js +9 -0
  68. package/cjs/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
  69. package/cjs/models/CamOverlayAPI/webCameraSharingSchema.js +9 -0
  70. package/cjs/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
  71. package/cjs/models/CamOverlayAPI/widgetCommonSchema.js +76 -0
  72. package/cjs/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
  73. package/cjs/models/CamOverlayAPI/widgetsSchema.js +27 -0
  74. package/cjs/node/DefaultClient.d.ts +16 -0
  75. package/cjs/node/DefaultClient.js +56 -0
  76. package/cjs/node/HttpRequestSender.js +89 -0
  77. package/cjs/node/HttpServer.js +96 -0
  78. package/{node → cjs/node}/WsClient.d.ts +1 -1
  79. package/cjs/node/WsClient.js +149 -0
  80. package/{node → cjs/node}/WsEventClient.d.ts +1 -1
  81. package/cjs/node/WsEventClient.js +22 -0
  82. package/cjs/node/index.d.ts +2 -0
  83. package/cjs/node/index.js +7 -0
  84. package/cjs/types/CamOverlayAPI.d.ts +328 -0
  85. package/cjs/types/CamOverlayAPI.js +26 -0
  86. package/{types → cjs/types}/CamScripterAPI.d.ts +55 -7
  87. package/cjs/types/CamScripterAPI.js +31 -0
  88. package/{types → cjs/types}/CamStreamerAPI.d.ts +16 -5
  89. package/cjs/types/CamStreamerAPI.js +32 -0
  90. package/{types → cjs/types}/CamSwitcherAPI.d.ts +5 -5
  91. package/cjs/types/CamSwitcherAPI.js +137 -0
  92. package/{types/CamswitcherEvents.d.ts → cjs/types/CamSwitcherEvents.d.ts} +77 -0
  93. package/cjs/types/CamSwitcherEvents.js +70 -0
  94. package/cjs/types/PlaneTrackerAPI.d.ts +2 -0
  95. package/cjs/types/PlaneTrackerAPI.js +2 -0
  96. package/{types → cjs/types}/VapixAPI.d.ts +479 -519
  97. package/cjs/types/VapixAPI.js +139 -0
  98. package/cjs/types/common.js +14 -0
  99. package/cjs/web/DefaultClient.d.ts +6 -0
  100. package/cjs/web/DefaultClient.js +22 -0
  101. package/cjs/web/WsClient.js +62 -0
  102. package/cjs/web/index.d.ts +2 -0
  103. package/cjs/web/index.js +7 -0
  104. package/esm/CamOverlayAPI.d.ts +629 -0
  105. package/esm/CamOverlayAPI.js +251 -0
  106. package/esm/CamOverlayDrawingAPI.d.ts +86 -0
  107. package/{CamOverlayDrawingAPI.js → esm/CamOverlayDrawingAPI.js} +6 -3
  108. package/esm/CamOverlayPainter/Frame.d.ts +96 -0
  109. package/esm/CamOverlayPainter/Painter.d.ts +48 -0
  110. package/{CamOverlayPainter → esm/CamOverlayPainter}/Painter.js +4 -1
  111. package/esm/CamOverlayPainter/ResourceManager.d.ts +14 -0
  112. package/{CamOverlayPainter → esm/CamOverlayPainter}/ResourceManager.js +6 -10
  113. package/esm/CamScripterAPI.d.ts +19 -0
  114. package/{CamScripterAPI.js → esm/CamScripterAPI.js} +4 -10
  115. package/esm/CamScripterAPICameraEventsGenerator.d.ts +74 -0
  116. package/{CamScripterAPICameraEventsGenerator.js → esm/CamScripterAPICameraEventsGenerator.js} +6 -3
  117. package/esm/CamStreamerAPI.d.ts +16 -0
  118. package/{CamStreamerAPI.js → esm/CamStreamerAPI.js} +4 -10
  119. package/esm/CamSwitcherAPI.d.ts +52 -0
  120. package/{CamSwitcherAPI.js → esm/CamSwitcherAPI.js} +24 -27
  121. package/esm/CamSwitcherEvents.d.ts +18 -0
  122. package/{CamSwitcherEvents.js → esm/CamSwitcherEvents.js} +1 -1
  123. package/esm/CreatePackage.d.ts +1 -0
  124. package/esm/PlaneTrackerAPI.d.ts +47 -0
  125. package/esm/PlaneTrackerAPI.js +172 -0
  126. package/esm/VapixAPI.d.ts +78 -0
  127. package/{VapixAPI.js → esm/VapixAPI.js} +93 -60
  128. package/esm/VapixEvents.d.ts +43 -0
  129. package/{VapixEvents.js → esm/VapixEvents.js} +3 -3
  130. package/esm/errors/errors.d.ts +37 -0
  131. package/{errors → esm/errors}/errors.js +6 -0
  132. package/esm/events/AxisCameraStationEvents.d.ts +10 -0
  133. package/{events → esm/events}/AxisCameraStationEvents.js +1 -1
  134. package/esm/events/GenetecAgent.d.ts +175 -0
  135. package/{events → esm/events}/GenetecAgent.js +5 -5
  136. package/esm/index.d.ts +18 -0
  137. package/esm/index.js +18 -0
  138. package/esm/internal/Digest.d.ts +4 -0
  139. package/{internal → esm/internal}/Digest.js +6 -6
  140. package/esm/internal/ProxyClient.d.ts +11 -0
  141. package/{internal → esm/internal}/ProxyClient.js +6 -4
  142. package/esm/internal/constants.d.ts +1 -0
  143. package/esm/internal/transformers.d.ts +5 -0
  144. package/esm/internal/types.d.ts +35 -0
  145. package/esm/internal/types.js +1 -0
  146. package/esm/internal/utils.d.ts +15 -0
  147. package/{internal → esm/internal}/utils.js +20 -1
  148. package/esm/internal/versionCompare.d.ts +6 -0
  149. package/esm/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
  150. package/esm/models/CamOverlayAPI/accuweatherSchema.js +45 -0
  151. package/esm/models/CamOverlayAPI/constants.d.ts +11 -0
  152. package/esm/models/CamOverlayAPI/constants.js +11 -0
  153. package/esm/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
  154. package/esm/models/CamOverlayAPI/customGraphicsSchema.js +70 -0
  155. package/esm/models/CamOverlayAPI/fileSchema.d.ts +28 -0
  156. package/esm/models/CamOverlayAPI/fileSchema.js +14 -0
  157. package/esm/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
  158. package/esm/models/CamOverlayAPI/imagesSchema.js +7 -0
  159. package/esm/models/CamOverlayAPI/index.d.ts +13 -0
  160. package/esm/models/CamOverlayAPI/index.js +13 -0
  161. package/esm/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
  162. package/esm/models/CamOverlayAPI/infotickerSchema.js +24 -0
  163. package/esm/models/CamOverlayAPI/pipSchema.d.ts +125 -0
  164. package/esm/models/CamOverlayAPI/pipSchema.js +37 -0
  165. package/esm/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
  166. package/esm/models/CamOverlayAPI/ptzCompassSchema.js +23 -0
  167. package/esm/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
  168. package/esm/models/CamOverlayAPI/ptzSchema.js +10 -0
  169. package/esm/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
  170. package/esm/models/CamOverlayAPI/screenSharingSchema.js +6 -0
  171. package/esm/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
  172. package/esm/models/CamOverlayAPI/webCameraSharingSchema.js +6 -0
  173. package/esm/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
  174. package/esm/models/CamOverlayAPI/widgetCommonSchema.js +73 -0
  175. package/esm/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
  176. package/esm/models/CamOverlayAPI/widgetsSchema.js +24 -0
  177. package/esm/node/DefaultClient.d.ts +16 -0
  178. package/{node → esm/node}/DefaultClient.js +9 -7
  179. package/esm/node/HttpRequestSender.d.ts +28 -0
  180. package/esm/node/HttpServer.d.ts +21 -0
  181. package/{node → esm/node}/HttpServer.js +1 -1
  182. package/esm/node/WsClient.d.ts +39 -0
  183. package/esm/node/WsEventClient.d.ts +13 -0
  184. package/esm/node/index.d.ts +2 -0
  185. package/esm/node/index.js +2 -0
  186. package/esm/types/CamOverlayAPI.d.ts +328 -0
  187. package/esm/types/CamOverlayAPI.js +14 -0
  188. package/esm/types/CamScripterAPI.d.ts +115 -0
  189. package/esm/types/CamScripterAPI.js +28 -0
  190. package/esm/types/CamStreamerAPI.d.ts +150 -0
  191. package/{types → esm/types}/CamStreamerAPI.js +4 -0
  192. package/esm/types/CamSwitcherAPI.d.ts +814 -0
  193. package/esm/types/CamSwitcherEvents.d.ts +568 -0
  194. package/{types/CamswitcherEvents.js → esm/types/CamSwitcherEvents.js} +8 -0
  195. package/esm/types/PlaneTrackerAPI.d.ts +2 -0
  196. package/esm/types/PlaneTrackerAPI.js +1 -0
  197. package/esm/types/VapixAPI.d.ts +1664 -0
  198. package/{types → esm/types}/VapixAPI.js +30 -23
  199. package/esm/types/common.d.ts +37 -0
  200. package/esm/web/DefaultClient.d.ts +6 -0
  201. package/{web → esm/web}/DefaultClient.js +6 -4
  202. package/esm/web/WsClient.d.ts +13 -0
  203. package/{web → esm/web}/WsClient.js +2 -2
  204. package/esm/web/index.d.ts +2 -0
  205. package/esm/web/index.js +2 -0
  206. package/package.json +6 -6
  207. package/CamOverlayAPI.d.ts +0 -31
  208. package/CamOverlayAPI.js +0 -172
  209. package/internal/ProxyClient.d.ts +0 -11
  210. package/internal/common.d.ts +0 -40
  211. package/internal/common.js +0 -23
  212. package/node/DefaultClient.d.ts +0 -15
  213. package/types/CamOverlayAPI.d.ts +0 -188
  214. package/types/CamOverlayAPI.js +0 -44
  215. package/types/CamScripterAPI.js +0 -17
  216. package/web/DefaultClient.d.ts +0 -6
  217. package/{CamOverlayPainter → cjs/CamOverlayPainter}/Frame.d.ts +0 -0
  218. package/{CamOverlayPainter → cjs/CamOverlayPainter}/ResourceManager.d.ts +0 -0
  219. package/{CreatePackage.d.ts → cjs/CreatePackage.d.ts} +0 -0
  220. package/{internal → cjs/internal}/Digest.d.ts +0 -0
  221. package/{internal → cjs/internal}/constants.d.ts +0 -0
  222. package/{internal → cjs/internal}/transformers.d.ts +0 -0
  223. package/{node → cjs/node}/HttpRequestSender.d.ts +0 -0
  224. package/{node → cjs/node}/HttpServer.d.ts +0 -0
  225. package/{types → cjs/types}/common.d.ts +2 -2
  226. /package/{web → cjs/web}/WsClient.d.ts +0 -0
  227. /package/{CamOverlayPainter → esm/CamOverlayPainter}/Frame.js +0 -0
  228. /package/{CreatePackage.js → esm/CreatePackage.js} +0 -0
  229. /package/{internal → esm/internal}/constants.js +0 -0
  230. /package/{internal → esm/internal}/transformers.js +0 -0
  231. /package/{internal → esm/internal}/versionCompare.js +0 -0
  232. /package/{node → esm/node}/HttpRequestSender.js +0 -0
  233. /package/{node → esm/node}/WsClient.js +0 -0
  234. /package/{node → esm/node}/WsEventClient.js +0 -0
  235. /package/{types → esm/types}/CamSwitcherAPI.js +0 -0
  236. /package/{types → esm/types}/common.js +0 -0
@@ -0,0 +1,74 @@
1
+ /// <reference types="node" />
2
+ import * as EventEmitter from 'events';
3
+ import { WsOptions } from './internal/types';
4
+ export type CamScripterOptions = WsOptions;
5
+ export type TDeclaration = {
6
+ type?: '' | 'SOURCE' | 'DATA';
7
+ namespace: string;
8
+ key: string;
9
+ value: string | boolean | number;
10
+ value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
11
+ key_nice_name?: string;
12
+ value_nice_name?: string;
13
+ };
14
+ export type TEventDeclaration = {
15
+ declaration_id: string;
16
+ stateless: boolean;
17
+ declaration: TDeclaration[];
18
+ };
19
+ export type TEventUndeclaration = {
20
+ declaration_id: string;
21
+ };
22
+ export type TEventData = {
23
+ namespace: string;
24
+ key: string;
25
+ value: string | boolean | number;
26
+ value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
27
+ };
28
+ export type TEvent = {
29
+ declaration_id: string;
30
+ event_data: TEventData[];
31
+ };
32
+ export type TResponse = {
33
+ call_id: number;
34
+ message: string;
35
+ };
36
+ export type TErrorResponse = {
37
+ error: string;
38
+ call_id?: number;
39
+ };
40
+ export interface CamScripterAPICameraEventsGenerator {
41
+ on(event: 'open', listener: () => void): this;
42
+ on(event: 'close', listener: () => void): this;
43
+ on(event: 'error', listener: (err: Error) => void): this;
44
+ emit(event: 'open'): boolean;
45
+ emit(event: 'close'): boolean;
46
+ emit(event: 'error', err: Error): boolean;
47
+ }
48
+ export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
49
+ private tls;
50
+ private tlsInsecure;
51
+ private ip;
52
+ private port;
53
+ private user;
54
+ private pass;
55
+ private callId;
56
+ private sendMessages;
57
+ private timeoutCheckTimer;
58
+ private wsConnected;
59
+ private ws;
60
+ constructor(options?: CamScripterOptions);
61
+ connect(): void;
62
+ disconnect(): void;
63
+ declareEvent(eventDeclaration: TEventDeclaration): Promise<TResponse>;
64
+ undeclareEvent(eventUndeclaration: TEventUndeclaration): Promise<TResponse>;
65
+ sendEvent(event: TEvent): Promise<TResponse>;
66
+ private createWsClient;
67
+ private incomingWsMessageHandler;
68
+ private sendMessage;
69
+ private startMsgsTimeoutCheck;
70
+ private stopMsgsTimeoutCheck;
71
+ private reconnectWithError;
72
+ private reportErr;
73
+ private reportClose;
74
+ }
@@ -88,10 +88,10 @@ export class CamScripterAPICameraEventsGenerator extends EventEmitter {
88
88
  }
89
89
  if (dataJSON.call_id !== undefined) {
90
90
  if (errorResponse !== undefined) {
91
- this.sendMessages[dataJSON.call_id].reject(new Error(errorResponse.error));
91
+ this.sendMessages[dataJSON.call_id]?.reject(new Error(errorResponse.error));
92
92
  }
93
93
  else {
94
- this.sendMessages[dataJSON.call_id].resolve(dataJSON);
94
+ this.sendMessages[dataJSON.call_id]?.resolve(dataJSON);
95
95
  }
96
96
  delete this.sendMessages[dataJSON.call_id];
97
97
  }
@@ -124,6 +124,9 @@ export class CamScripterAPICameraEventsGenerator extends EventEmitter {
124
124
  const now = Date.now();
125
125
  for (const callId in this.sendMessages) {
126
126
  const msg = this.sendMessages[callId];
127
+ if (!msg) {
128
+ continue;
129
+ }
127
130
  if (now - msg.sentTimestamp > 10000) {
128
131
  reconnect = true;
129
132
  msg.reject(new Error('Message timeout'));
@@ -147,7 +150,7 @@ export class CamScripterAPICameraEventsGenerator extends EventEmitter {
147
150
  }
148
151
  reportClose() {
149
152
  for (const callId in this.sendMessages) {
150
- this.sendMessages[callId].reject(new Error('Connection lost'));
153
+ this.sendMessages[callId]?.reject(new Error('Connection lost'));
151
154
  }
152
155
  this.sendMessages = {};
153
156
  this.emit('close');
@@ -0,0 +1,16 @@
1
+ import { IClient, TResponse } from './internal/types';
2
+ import { TStreamAttributes, TStreamList } from './types/CamStreamerAPI';
3
+ export declare class CamStreamerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
4
+ client: Client;
5
+ constructor(client: Client);
6
+ getStreamList(): Promise<TStreamList>;
7
+ getStream(streamID: string): Promise<TStreamAttributes>;
8
+ getStreamParameter(streamID: string, paramName: string): Promise<string>;
9
+ setStream(streamID: string, params: Partial<TStreamAttributes>): Promise<void>;
10
+ setStreamParameter(streamID: string, paramName: string, value: string): Promise<void>;
11
+ isStreaming(streamID: string): Promise<boolean>;
12
+ deleteStream(streamID: string): Promise<void>;
13
+ wsAutoratization(): Promise<string>;
14
+ getUtcTime(): Promise<number>;
15
+ private get;
16
+ }
@@ -1,15 +1,9 @@
1
- import { isClient, responseStringify } from './internal/common';
2
- import { DefaultClient } from './node/DefaultClient';
3
- import { streamAttributesSchema, streamListSchema, } from './types/CamStreamerAPI';
1
+ import { responseStringify } from './internal/utils';
2
+ import { streamAttributesSchema, streamListSchema } from './types/CamStreamerAPI';
4
3
  export class CamStreamerAPI {
5
4
  client;
6
- constructor(options = {}) {
7
- if (isClient(options)) {
8
- this.client = options;
9
- }
10
- else {
11
- this.client = new DefaultClient(options);
12
- }
5
+ constructor(client) {
6
+ this.client = client;
13
7
  }
14
8
  async getStreamList() {
15
9
  const streamListRes = await this.get('/local/camstreamer/stream/list.cgi');
@@ -0,0 +1,52 @@
1
+ import { IClient, TResponse } from './internal/types';
2
+ import { TAudioPushInfo, TOutputInfo, TStorageInfo, TStreamSaveList, TClipList, TStreamSaveLoadList, TClipSaveLoadList, TPlaylistSaveLoadList, TTrackerSaveList, TrackerSaveLoadList, TClipSaveList, TPlaylistSaveList, TCameraOptions, TGlobalAudioSettings, TSecondaryAudioSettings } from './types/CamSwitcherAPI';
3
+ import { TAudioChannel, TNetworkCamera, TStorageType } from './types/common';
4
+ export declare class CamSwitcherAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
+ client: Client;
6
+ private CustomFormData;
7
+ private vapixAgent;
8
+ constructor(client: Client, CustomFormData?: {
9
+ new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
10
+ prototype: FormData;
11
+ });
12
+ static getProxyUrlPath: () => string;
13
+ static getWsEventsUrlPath: () => string;
14
+ static getClipPreviewUrlPath: (id: string, storage: TStorageType) => string;
15
+ generateSilence(sampleRate: number, channels: TAudioChannel): Promise<void>;
16
+ checkCameraTime(): Promise<boolean>;
17
+ getIpListFromNetworkCheck(): Promise<TNetworkCamera[]>;
18
+ getMaxFps(source: number): Promise<number>;
19
+ getStorageInfo(): Promise<TStorageInfo[]>;
20
+ wsAuthorization(): Promise<string>;
21
+ getOutputInfo(): Promise<TOutputInfo>;
22
+ getAudioPushInfo(): Promise<TAudioPushInfo>;
23
+ getStreamSaveList(): Promise<TStreamSaveLoadList>;
24
+ getClipSaveList(): Promise<TClipSaveLoadList>;
25
+ getPlaylistSaveList(): Promise<TPlaylistSaveLoadList>;
26
+ getTrackerSaveList(): Promise<TrackerSaveLoadList>;
27
+ setStreamSaveList(data: TStreamSaveList): Promise<boolean>;
28
+ setClipSaveList(data: TClipSaveList): Promise<boolean>;
29
+ setPlaylistSaveList(data: TPlaylistSaveList): Promise<boolean>;
30
+ setTrackerSaveList(data: TTrackerSaveList): Promise<boolean>;
31
+ playlistSwitch(playlistName: string): Promise<void>;
32
+ playlistQueuePush(playlistName: string): Promise<void>;
33
+ playlistQueueClear(): Promise<void>;
34
+ playlistQueueList(): Promise<string[]>;
35
+ playlistQueuePlayNext(): Promise<void>;
36
+ addNewClip(file: any, clipType: 'video' | 'audio', storage: TStorageType, id: string, fileName?: string): Promise<void>;
37
+ removeClip(id: string, storage: TStorageType): Promise<any>;
38
+ getClipList(): Promise<TClipList>;
39
+ setCamSwitchOptions(data: TCameraOptions, cameraFWVersion: string): Promise<boolean>;
40
+ setGlobalAudioSettings(settings: TGlobalAudioSettings): Promise<boolean>;
41
+ setSecondaryAudioSettings(settings: TSecondaryAudioSettings): Promise<boolean>;
42
+ setDefaultPlaylist(id: string): Promise<boolean>;
43
+ setPermanentRtspUrlToken(token: string): Promise<boolean>;
44
+ getCamSwitchOptions(): Promise<Partial<TCameraOptions>>;
45
+ getGlobalAudioSettings(): Promise<TGlobalAudioSettings>;
46
+ getSecondaryAudioSettings(): Promise<TSecondaryAudioSettings>;
47
+ getPermanentRtspUrlToken(): Promise<string>;
48
+ private get;
49
+ private set;
50
+ private setParamFromCameraJSON;
51
+ private getParamFromCameraAndJSONParse;
52
+ }
@@ -1,23 +1,24 @@
1
1
  import { z } from 'zod';
2
2
  import { AddNewClipError } from './errors/errors';
3
- import { isNullish, responseStringify } from './internal/common';
3
+ import { isClip, isNullish, responseStringify } from './internal/utils';
4
4
  import { storageInfoListSchema, outputInfoSchema, audioPushInfoSchema, clipListSchema, playlistQueueSchema, streamSaveLoadSchema, clipSaveLoadSchema, playlistSaveLoadSchema, trackerSaveLoadSchema, } from './types/CamSwitcherAPI';
5
5
  import { networkCameraListSchema } from './types/common';
6
6
  import { VapixAPI } from './VapixAPI';
7
7
  import { isFirmwareVersionAtLeast } from './internal/versionCompare';
8
- import { isClip } from './internal/utils';
9
8
  import { FIRMWARE_WITH_BITRATE_MODES_SUPPORT } from './internal/constants';
10
9
  const baseUrl = '/local/camswitcher/api';
11
10
  export class CamSwitcherAPI {
12
11
  client;
12
+ CustomFormData;
13
13
  vapixAgent;
14
- constructor(client) {
14
+ constructor(client, CustomFormData = FormData) {
15
15
  this.client = client;
16
+ this.CustomFormData = CustomFormData;
16
17
  this.vapixAgent = new VapixAPI(client, () => '');
17
18
  }
18
- static getProxyUrl = () => `${baseUrl}/proxy.cgi`;
19
- static getWsEventsUrl = () => `/local/camswitcher/events`;
20
- static getClipPreview = (id, storage) => `${baseUrl}/clip_preview.cgi?clip_name=${id}&storage=${storage}`;
19
+ static getProxyUrlPath = () => `${baseUrl}/proxy.cgi`;
20
+ static getWsEventsUrlPath = () => `/local/camswitcher/events`;
21
+ static getClipPreviewUrlPath = (id, storage) => `${baseUrl}/clip_preview.cgi?clip_name=${id}&storage=${storage}`;
21
22
  async generateSilence(sampleRate, channels) {
22
23
  await this.client.get(`${baseUrl}/generate_silence.cgi`, {
23
24
  sample_rate: sampleRate.toString(),
@@ -99,7 +100,7 @@ export class CamSwitcherAPI {
99
100
  await this.get(`${baseUrl}/playlist_queue_play_next.cgi`);
100
101
  }
101
102
  async addNewClip(file, clipType, storage, id, fileName) {
102
- const formData = new FormData();
103
+ const formData = new this.CustomFormData();
103
104
  formData.append('clip_name', id);
104
105
  formData.append('clip_type', clipType);
105
106
  formData.append('file', file, fileName);
@@ -292,16 +293,12 @@ const parseBitrateOptionsToBitrateVapixParams = (firmWareVersion, bitrateMode, c
292
293
  if (bitrateMode === null) {
293
294
  return '';
294
295
  }
295
- if (bitrateMode === 'VBR') {
296
- return 'videobitratemode=vbr';
297
- }
298
- if (bitrateMode === 'MBR') {
299
- return `videobitratemode=mbr&videomaxbitrate=${cameraOptions.maximumBitRate}`;
300
- }
301
- if (bitrateMode === 'ABR') {
302
- return `videobitratemode=abr&videoabrtargetbitrate=${cameraOptions.maximumBitRate}&videoabrretentiontime=${cameraOptions.retentionTime}&videoabrmaxbitrate=${cameraOptions.bitRateLimit}`;
303
- }
304
- throw new Error('Unknown bitrateMode param in getVapixParams method.');
296
+ const data = {
297
+ VBR: 'videobitratemode=vbr',
298
+ MBR: `videobitratemode=mbr&videomaxbitrate=${cameraOptions.maximumBitRate}`,
299
+ ABR: `videobitratemode=abr&videoabrtargetbitrate=${cameraOptions.maximumBitRate}&videoabrretentiontime=${cameraOptions.retentionTime}&videoabrmaxbitrate=${cameraOptions.bitRateLimit}`,
300
+ };
301
+ return data[bitrateMode];
305
302
  };
306
303
  const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
307
304
  const params = {};
@@ -312,7 +309,7 @@ const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
312
309
  const bitrateMode = params['videobitratemode'] !== undefined ? params['videobitratemode'].toUpperCase() : undefined;
313
310
  const hasLowerFw = bitrateMode === undefined && params['videomaxbitrate'] !== undefined;
314
311
  if (hasLowerFw) {
315
- const maximumBitRate = parseInt(params['videomaxbitrate'], 10);
312
+ const maximumBitRate = parseInt(params['videomaxbitrate'] ?? '0', 10);
316
313
  return {
317
314
  bitrateMode: 'MBR',
318
315
  maximumBitRate: maximumBitRate,
@@ -321,19 +318,19 @@ const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
321
318
  };
322
319
  }
323
320
  if (bitrateMode === 'ABR') {
324
- const maximumBitRate = parseInt(params['videoabrtargetbitrate'], 10);
325
- const retentionTime = parseInt(params['videoabrretentiontime'], 10);
326
- const bitrateLimit = parseInt(params['videoabrmaxbitrate'], 10);
321
+ const maximumBitRate = parseInt(params['videoabrtargetbitrate'] ?? '0', 10);
322
+ const retentionTime = parseInt(params['videoabrretentiontime'] ?? '0', 10);
323
+ const bitRateLimit = parseInt(params['videoabrmaxbitrate'] ?? '0', 10);
327
324
  return {
328
- bitrateMode: bitrateMode,
329
- maximumBitRate: maximumBitRate,
330
- retentionTime: retentionTime,
331
- bitRateLimit: bitrateLimit,
325
+ bitrateMode,
326
+ maximumBitRate,
327
+ retentionTime,
328
+ bitRateLimit,
332
329
  };
333
330
  }
334
331
  else if (bitrateMode === 'MBR') {
335
- const maximumBitRate = parseInt(params['videomaxbitrate'], 10);
336
- const oldMaximumBitrateParamValue = parseInt(params['videombrmaxbitrate'], 10);
332
+ const maximumBitRate = params['videomaxbitrate'] !== undefined ? parseInt(params['videomaxbitrate'], 10) : null;
333
+ const oldMaximumBitrateParamValue = parseInt(params['videombrmaxbitrate'] ?? '0', 10);
337
334
  return {
338
335
  bitrateMode: bitrateMode,
339
336
  maximumBitRate: maximumBitRate ?? oldMaximumBitrateParamValue,
@@ -0,0 +1,18 @@
1
+ import { IWebsocket } from './internal/types';
2
+ import { TCamSwitcherEventOfType, TCamSwitcherEventType } from './types/CamSwitcherEvents';
3
+ type TListenerFunction<T extends TCamSwitcherEventType> = (data: TCamSwitcherEventOfType<T>, isInit: boolean) => void;
4
+ export declare class CamSwitcherEvents<Event extends {
5
+ data: string;
6
+ }> {
7
+ isDestroyed: boolean;
8
+ private ws;
9
+ private listeners;
10
+ setWebsocket(ws: IWebsocket<Event>): void;
11
+ resendInitData(): void;
12
+ addListener<T extends TCamSwitcherEventType>(type: T, listener: TListenerFunction<T>, id: string): void;
13
+ removeListener<T extends TCamSwitcherEventType>(type: T, id: string): void;
14
+ private onMessage;
15
+ private processMessage;
16
+ destroy(): void;
17
+ }
18
+ export {};
@@ -1,4 +1,4 @@
1
- import { cswEventsSchema, } from './types/CamswitcherEvents';
1
+ import { cswEventsSchema, } from './types/CamSwitcherEvents';
2
2
  export class CamSwitcherEvents {
3
3
  isDestroyed = false;
4
4
  ws = null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import { IClient, TBlobResponse, TParameters, TResponse } from './internal/types';
2
+ import { TExportDataType, TImportDataType } from './types/PlaneTrackerAPI';
3
+ export type TApiUser = {
4
+ userId: string;
5
+ userName: string;
6
+ userPriority: number;
7
+ };
8
+ type ICAO = string;
9
+ export declare const BASE_URL = "/local/planetracker";
10
+ export declare class PlaneTrackerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
11
+ private client;
12
+ private apiUser;
13
+ private _apiUserQuery;
14
+ constructor(client: Client, apiUser: TApiUser);
15
+ static getProxyUrlPath: () => string;
16
+ checkCameraTime(): Promise<boolean>;
17
+ fetchCameraSettings: () => Promise<any>;
18
+ setCameraSettings: (settingsJsonString: string) => Promise<TResponse>;
19
+ fetchServerSettings: () => Promise<any>;
20
+ fetchMapInfo: () => Promise<any>;
21
+ fetchFlightInfo: (icao: ICAO) => Promise<any>;
22
+ getZones: () => Promise<any>;
23
+ setZones: (zonesJsonString: string) => Promise<TResponse>;
24
+ getPriorityList: () => Promise<any>;
25
+ setPriorityList: (priorityListJsonString: string) => Promise<TResponse>;
26
+ getWhiteList: () => Promise<any>;
27
+ setWhiteList: (whiteListJsonString: string) => Promise<TResponse>;
28
+ getBlackList: () => Promise<any>;
29
+ setBlackList: (blackListJsonString: string) => Promise<TResponse>;
30
+ getTrackingMode: () => Promise<any>;
31
+ setTrackingMode: (modeJsonString: string) => Promise<TResponse>;
32
+ startTrackingPlane: (icao: ICAO) => Promise<TResponse>;
33
+ stopTrackingPlane: () => Promise<TResponse>;
34
+ goToCoordinates: (lat: number, lon: number, alt?: number) => Promise<TResponse>;
35
+ exportAppSettings: (dataType: TExportDataType) => Promise<TBlobResponse<Client>>;
36
+ importAppSettings: (dataType: TImportDataType, formData: FormData) => Promise<TResponse>;
37
+ resetPtzCalibration: () => Promise<TResponse>;
38
+ checkGenetecConnection: (params: TParameters) => Promise<TResponse>;
39
+ getGenetecCameraList: (params: TParameters) => Promise<any>;
40
+ serverRunCheck: () => Promise<TResponse>;
41
+ private _getJson;
42
+ private _getBlob;
43
+ private parseBlobResponse;
44
+ private _postJsonEncoded;
45
+ private _postUrlEncoded;
46
+ }
47
+ export {};
@@ -0,0 +1,172 @@
1
+ import { z } from 'zod';
2
+ import { paramToUrl, responseStringify } from './internal/utils';
3
+ import { ParsingBlobError } from './errors/errors';
4
+ export const BASE_URL = '/local/planetracker';
5
+ export class PlaneTrackerAPI {
6
+ client;
7
+ apiUser;
8
+ _apiUserQuery;
9
+ constructor(client, apiUser) {
10
+ this.client = client;
11
+ this.apiUser = apiUser;
12
+ this._apiUserQuery = paramToUrl(this.apiUser);
13
+ }
14
+ static getProxyUrlPath = () => `${BASE_URL}/proxy.cgi`;
15
+ async checkCameraTime() {
16
+ const responseSchema = z.discriminatedUnion('state', [
17
+ z.object({
18
+ state: z.literal(true),
19
+ code: z.number(),
20
+ }),
21
+ z.object({
22
+ state: z.literal(false),
23
+ code: z.number(),
24
+ reason: z.union([
25
+ z.literal('INVALID_TIME'),
26
+ z.literal('COULDNT_RESOLVE_HOST'),
27
+ z.literal('CONNECTION_ERROR'),
28
+ ]),
29
+ message: z.string(),
30
+ }),
31
+ ]);
32
+ const response = await this._getJson(`${BASE_URL}/camera_time.cgi`);
33
+ const cameraTime = responseSchema.parse(response);
34
+ if (!cameraTime.state) {
35
+ console.error(`Camera time check failed: ${cameraTime.reason} - ${cameraTime.message}`);
36
+ }
37
+ return cameraTime.state;
38
+ }
39
+ fetchCameraSettings = async () => {
40
+ return await this._getJson(`${BASE_URL}/package_camera_settings.cgi`, { action: 'get' });
41
+ };
42
+ setCameraSettings = async (settingsJsonString) => {
43
+ return await this._postJsonEncoded(`${BASE_URL}/package_camera_settings.cgi`, settingsJsonString, {
44
+ action: 'set',
45
+ });
46
+ };
47
+ fetchServerSettings = async () => {
48
+ return await this._getJson(`${BASE_URL}/package_server_settings.cgi`, { action: 'get' });
49
+ };
50
+ fetchMapInfo = async () => {
51
+ return await this._getJson(`${BASE_URL}/package/getMapInfo.cgi`);
52
+ };
53
+ fetchFlightInfo = async (icao) => {
54
+ return await this._getJson(`${BASE_URL}/package/flightInfo.cgi`, { icao: encodeURIComponent(icao) });
55
+ };
56
+ getZones = async () => {
57
+ return await this._getJson(`${BASE_URL}/package/getZones.cgi`);
58
+ };
59
+ setZones = async (zonesJsonString) => {
60
+ return await this._postJsonEncoded(`${BASE_URL}/package/setZones.cgi?${this._apiUserQuery}`, zonesJsonString);
61
+ };
62
+ getPriorityList = async () => {
63
+ return await this._getJson(`${BASE_URL}/package/getPriorityList.cgi`);
64
+ };
65
+ setPriorityList = async (priorityListJsonString) => {
66
+ return await this._postJsonEncoded(`${BASE_URL}/package/setPriorityList.cgi?${this._apiUserQuery}`, priorityListJsonString);
67
+ };
68
+ getWhiteList = async () => {
69
+ return await this._getJson(`${BASE_URL}/package/getWhiteList.cgi`);
70
+ };
71
+ setWhiteList = async (whiteListJsonString) => {
72
+ return await this._postJsonEncoded(`${BASE_URL}/package/setWhiteList.cgi?${this._apiUserQuery}`, whiteListJsonString);
73
+ };
74
+ getBlackList = async () => {
75
+ return await this._getJson(`${BASE_URL}/package/getBlackList.cgi`);
76
+ };
77
+ setBlackList = async (blackListJsonString) => {
78
+ return await this._postJsonEncoded(`${BASE_URL}/package/setBlackList.cgi?${this._apiUserQuery}`, blackListJsonString);
79
+ };
80
+ getTrackingMode = async () => {
81
+ return await this._getJson(`${BASE_URL}/package/getTrackingMode.cgi`);
82
+ };
83
+ setTrackingMode = async (modeJsonString) => {
84
+ return await this._postJsonEncoded(`${BASE_URL}/package/setTrackingMode.cgi?${this._apiUserQuery}`, modeJsonString);
85
+ };
86
+ startTrackingPlane = async (icao) => {
87
+ return await this.client.get(`${BASE_URL}/package/trackIcao.cgi`, {
88
+ icao: encodeURIComponent(icao),
89
+ userId: encodeURIComponent(this.apiUser.userId),
90
+ userName: encodeURIComponent(this.apiUser.userName),
91
+ userPriority: this.apiUser.userPriority,
92
+ });
93
+ };
94
+ stopTrackingPlane = async () => {
95
+ return await this.client.get(`${BASE_URL}/package/resetIcao.cgi?${this._apiUserQuery}`);
96
+ };
97
+ goToCoordinates = async (lat, lon, alt) => {
98
+ const url = `${BASE_URL}/package/goToCoordinates.cgi?lat=${lat}&lon=${lon}&${this._apiUserQuery}`;
99
+ return await this.client.get(`${url}${alt !== undefined ? `&alt=${alt}` : ''}`);
100
+ };
101
+ exportAppSettings = async (dataType) => {
102
+ return await this._getBlob(`${BASE_URL}/package_data.cgi`, { action: 'EXPORT', dataType });
103
+ };
104
+ importAppSettings = async (dataType, formData) => {
105
+ return await this.client.post(`${BASE_URL}/package_data.cgi`, formData, { action: 'IMPORT', dataType });
106
+ };
107
+ resetPtzCalibration = async () => {
108
+ return await this.client.get(`${BASE_URL}/package/resetPtzCalibration.cgi`, {
109
+ userId: encodeURIComponent(this.apiUser.userId),
110
+ userName: encodeURIComponent(this.apiUser.userName),
111
+ userPriority: this.apiUser.userPriority,
112
+ });
113
+ };
114
+ checkGenetecConnection = async (params) => {
115
+ return await this._postUrlEncoded(`${BASE_URL}/package/checkGenetecConnection.cgi`, params);
116
+ };
117
+ getGenetecCameraList = async (params) => {
118
+ const res = await this._postUrlEncoded(`${BASE_URL}/package/getGenetecCameraList.cgi`, params);
119
+ return await res.json();
120
+ };
121
+ serverRunCheck = async () => {
122
+ return await this.client.get(`${BASE_URL}/package/serverRunCheck.cgi`);
123
+ };
124
+ async _getJson(...args) {
125
+ const res = await this.client.get(...args);
126
+ if (res.ok) {
127
+ return await res.json();
128
+ }
129
+ else {
130
+ throw new Error(await responseStringify(res));
131
+ }
132
+ }
133
+ async _getBlob(...args) {
134
+ const res = await this.client.get(...args);
135
+ if (res.ok) {
136
+ return await this.parseBlobResponse(res);
137
+ }
138
+ else {
139
+ throw new Error(await responseStringify(res));
140
+ }
141
+ }
142
+ async parseBlobResponse(response) {
143
+ try {
144
+ return (await response.blob());
145
+ }
146
+ catch (err) {
147
+ throw new ParsingBlobError(err);
148
+ }
149
+ }
150
+ async _postJsonEncoded(...args) {
151
+ const [path, data, params, headers] = args;
152
+ const baseHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
153
+ const res = await this.client.post(path, data, params, { ...baseHeaders, ...headers });
154
+ if (res.ok) {
155
+ return res;
156
+ }
157
+ else {
158
+ throw new Error(await responseStringify(res));
159
+ }
160
+ }
161
+ async _postUrlEncoded(path, params, headers) {
162
+ const data = paramToUrl(params);
163
+ const baseHeaders = { 'Content-Type': 'application/x-www-form-urlencoded' };
164
+ const res = await this.client.post(path, data, {}, { ...baseHeaders, ...headers });
165
+ if (res.ok) {
166
+ return res;
167
+ }
168
+ else {
169
+ throw new Error(await responseStringify(res));
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,78 @@
1
+ import { IClient, TParameters, TResponse } from './internal/types';
2
+ import { TAudioSampleRates, TSDCardInfo, TPtzOverview, TCameraPTZItem, TCameraPTZItemData, TAudioDevice } from './types/VapixAPI';
3
+ import { ProxyClient } from './internal/ProxyClient';
4
+ import { TCameraImageConfig, TProxyParam } from './types/common';
5
+ export declare class VapixAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
6
+ client: ProxyClient<Client>;
7
+ constructor(client: Client, getProxyUrl: () => string);
8
+ getUrlEncoded(proxy: TProxyParam, path: string, parameters?: TParameters, headers?: Record<string, string>): Promise<TResponse>;
9
+ postJson(proxy: TProxyParam, path: string, jsonData: Record<string, any>, headers?: Record<string, string>): Promise<TResponse>;
10
+ getCameraImage(params: TCameraImageConfig, proxy?: TProxyParam): Promise<TResponse>;
11
+ getEventDeclarations(proxy?: TProxyParam): Promise<string>;
12
+ getSupportedAudioSampleRate(proxy?: TProxyParam): Promise<TAudioSampleRates[]>;
13
+ performAutofocus(proxy?: TProxyParam): Promise<void>;
14
+ checkSDCard(proxy?: TProxyParam): Promise<TSDCardInfo>;
15
+ mountSDCard(proxy?: TProxyParam): Promise<number>;
16
+ unmountSDCard(proxy?: TProxyParam): Promise<number>;
17
+ private _doSDCardMountAction;
18
+ fetchSDCardJobProgress(jobId: number, proxy?: TProxyParam): Promise<number>;
19
+ downloadCameraReport(proxy?: TProxyParam): Promise<TResponse>;
20
+ getSystemLog(proxy?: TProxyParam): Promise<TResponse>;
21
+ getMaxFps(channel: number, proxy?: TProxyParam): Promise<number>;
22
+ getTimezone(proxy?: TProxyParam): Promise<string>;
23
+ getDateTimeInfo(proxy?: TProxyParam): Promise<{
24
+ data: {
25
+ dateTime: string;
26
+ dstEnabled: boolean;
27
+ localDateTime: string;
28
+ posixTimeZone: string;
29
+ timeZone?: string | undefined;
30
+ };
31
+ }>;
32
+ getDevicesSettings(proxy?: TProxyParam): Promise<TAudioDevice[]>;
33
+ fetchRemoteDeviceInfo<T extends Record<string, any>>(payload: T, proxy?: TProxyParam): Promise<any>;
34
+ getHeaders(proxy?: TProxyParam): Promise<Record<string, string>>;
35
+ setHeaders(headers: Record<string, string>, proxy?: TProxyParam): Promise<TResponse>;
36
+ getParameter(paramNames: string | string[], proxy?: TProxyParam): Promise<Record<string, string>>;
37
+ setParameter(params: Record<string, string | number | boolean>, proxy?: TProxyParam): Promise<boolean>;
38
+ getGuardTourList(proxy?: TProxyParam): Promise<{
39
+ name: string;
40
+ id: string;
41
+ running: string;
42
+ tour: {
43
+ moveSpeed?: unknown;
44
+ position?: unknown;
45
+ presetNbr?: unknown;
46
+ waitTime?: unknown;
47
+ waitTimeViewType?: unknown;
48
+ }[];
49
+ camNbr?: unknown;
50
+ randomEnabled?: unknown;
51
+ timeBetweenSequences?: unknown;
52
+ }[]>;
53
+ setGuardTourEnabled(guardTourID: string, enable: boolean, proxy?: TProxyParam): Promise<boolean>;
54
+ getPTZPresetList(channel: number, proxy?: TProxyParam): Promise<string[]>;
55
+ listPTZ(camera: number, proxy?: TProxyParam): Promise<TCameraPTZItem[]>;
56
+ listPtzVideoSourceOverview(proxy?: TProxyParam): Promise<TPtzOverview>;
57
+ goToPreset(channel: number, presetName: string, proxy?: TProxyParam): Promise<TResponse>;
58
+ getPtzPosition(camera: number, proxy?: TProxyParam): Promise<TCameraPTZItemData>;
59
+ getInputState(port: number, proxy?: TProxyParam): Promise<boolean>;
60
+ setOutputState(port: number, active: boolean, proxy?: TProxyParam): Promise<TResponse>;
61
+ getApplicationList(proxy?: TProxyParam): Promise<{
62
+ appId: "CamStreamer" | "CamSwitcher" | "CamOverlay" | "CamScripter" | "PlaneTracker" | "Ndihxplugin" | "SportTracker" | null;
63
+ Name: string;
64
+ NiceName: string;
65
+ Vendor: string;
66
+ Version: string;
67
+ License: string;
68
+ Status: string;
69
+ ApplicationID?: string | undefined;
70
+ ConfigurationPage?: string | undefined;
71
+ VendorHomePage?: string | undefined;
72
+ LicenseName?: string | undefined;
73
+ }[]>;
74
+ startApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
75
+ restartApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
76
+ stopApplication(applicationID: string, proxy?: TProxyParam): Promise<void>;
77
+ installApplication(data: Blob, fileName: string): Promise<void>;
78
+ }