camstreamerlib 4.0.0-beta.55 → 4.0.0-beta.57

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 (43) hide show
  1. package/cjs/PlaneTrackerAPI.js +24 -5
  2. package/cjs/errors/errors.js +36 -1
  3. package/cjs/internal/WsEvents.js +4 -4
  4. package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +1 -1
  5. package/cjs/types/CamScripterAPI.js +4 -3
  6. package/cjs/types/common.js +4 -2
  7. package/cjs/types/ws/PlaneTrackerEvents.js +77 -1
  8. package/cjs/ws/CamOverlayEvents.js +1 -1
  9. package/cjs/ws/CamStreamerEvents.js +1 -1
  10. package/cjs/ws/CamSwitcherEvents.js +1 -1
  11. package/cjs/ws/PlaneTrackerEvents.js +9 -1
  12. package/esm/PlaneTrackerAPI.js +25 -6
  13. package/esm/errors/errors.js +30 -0
  14. package/esm/internal/WsEvents.js +4 -4
  15. package/esm/types/CamOverlayAPI/serviceCommonTypes.js +1 -1
  16. package/esm/types/CamScripterAPI.js +4 -3
  17. package/esm/types/common.js +3 -1
  18. package/esm/types/ws/PlaneTrackerEvents.js +76 -0
  19. package/esm/ws/CamOverlayEvents.js +1 -1
  20. package/esm/ws/CamStreamerEvents.js +1 -1
  21. package/esm/ws/CamSwitcherEvents.js +1 -1
  22. package/esm/ws/PlaneTrackerEvents.js +10 -2
  23. package/package.json +1 -1
  24. package/types/CamScripterAPI.d.ts +3 -3
  25. package/types/CamSwitcherAPI.d.ts +5 -5
  26. package/types/PlaneTrackerAPI.d.ts +3 -9
  27. package/types/errors/errors.d.ts +15 -0
  28. package/types/internal/WsEvents.d.ts +7 -9
  29. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +45 -45
  30. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +2 -2
  31. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +2 -2
  32. package/types/types/CamOverlayAPI/imagesSchema.d.ts +2 -2
  33. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +2 -2
  34. package/types/types/CamOverlayAPI/pipSchema.d.ts +2 -2
  35. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +2 -2
  36. package/types/types/CamOverlayAPI/ptzSchema.d.ts +2 -2
  37. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +2 -2
  38. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +4 -4
  39. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +2 -2
  40. package/types/types/CamScripterAPI.d.ts +9 -9
  41. package/types/types/CamSwitcherAPI.d.ts +32 -32
  42. package/types/types/common.d.ts +2 -0
  43. package/types/types/ws/PlaneTrackerEvents.d.ts +560 -0
@@ -22,7 +22,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> {
22
22
  generateSilence(sampleRate: number, channels: TAudioChannel, options?: THttpRequestOptions): Promise<void>;
23
23
  getMaxFps(source: number, options?: THttpRequestOptions): Promise<number>;
24
24
  getStorageInfo(options?: THttpRequestOptions): Promise<{
25
- storage: "SD_DISK" | "FLASH";
25
+ storage: "FLASH" | "SD_DISK";
26
26
  writable: boolean;
27
27
  size: number;
28
28
  available: number;
@@ -68,7 +68,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> {
68
68
  stream_list?: {
69
69
  repeat: number;
70
70
  video: {
71
- storage?: "SD_DISK" | "FLASH" | undefined;
71
+ storage?: "FLASH" | "SD_DISK" | undefined;
72
72
  stream_name?: string | undefined;
73
73
  clip_name?: string | undefined;
74
74
  tracker_name?: string | undefined;
@@ -78,7 +78,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> {
78
78
  ptz_preset_pos_name: string;
79
79
  timeout: number;
80
80
  audio?: {
81
- storage?: "SD_DISK" | "FLASH" | undefined;
81
+ storage?: "FLASH" | "SD_DISK" | undefined;
82
82
  stream_name?: string | undefined;
83
83
  clip_name?: string | undefined;
84
84
  tracker_name?: string | undefined;
@@ -122,7 +122,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> {
122
122
  addNewClip(file: any, clipType: 'video' | 'audio', storage: TStorageType, clipId: string, fileName?: string, options?: THttpRequestOptions): Promise<void>;
123
123
  removeClip(clipId: string, storage: TStorageType, options?: THttpRequestOptions): Promise<void>;
124
124
  getClipList(options?: THttpRequestOptions): Promise<Record<string, {
125
- storage: "SD_DISK" | "FLASH";
125
+ storage: "FLASH" | "SD_DISK";
126
126
  stream_list: ({
127
127
  type: "video";
128
128
  width: number;
@@ -153,7 +153,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> {
153
153
  }>;
154
154
  getSecondaryAudioSettings(options?: THttpRequestOptions): Promise<{
155
155
  type: "CLIP" | "STREAM" | "NONE";
156
- storage: "SD_DISK" | "FLASH";
156
+ storage: "FLASH" | "SD_DISK";
157
157
  secondaryAudioLevel: number;
158
158
  masterAudioLevel: number;
159
159
  streamName?: string | undefined;
@@ -182,17 +182,11 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
182
182
  startTrackingPlane(icao: ICAO, options?: THttpRequestOptions): Promise<void>;
183
183
  stopTrackingPlane(options?: THttpRequestOptions): Promise<void>;
184
184
  getIcao(by: TGetIcaoByOption, value: string, options?: THttpRequestOptions): Promise<string>;
185
- getPriorityList(options?: THttpRequestOptions): Promise<{
186
- priorityList: string[];
187
- }>;
185
+ getPriorityList(options?: THttpRequestOptions): Promise<string[]>;
188
186
  setPriorityList(priorityList: TPriorityList['priorityList'], options?: THttpRequestOptions): Promise<TResponse>;
189
- getWhiteList(options?: THttpRequestOptions): Promise<{
190
- whiteList: string[];
191
- }>;
187
+ getWhiteList(options?: THttpRequestOptions): Promise<string[]>;
192
188
  setWhiteList(whiteList: TWhiteList['whiteList'], options?: THttpRequestOptions): Promise<TResponse>;
193
- getBlackList(options?: THttpRequestOptions): Promise<{
194
- blackList: string[];
195
- }>;
189
+ getBlackList(options?: THttpRequestOptions): Promise<string[]>;
196
190
  setBlackList(blackList: TBlackList['blackList'], options?: THttpRequestOptions): Promise<TResponse>;
197
191
  fetchMapInfo(options?: THttpRequestOptions): Promise<{
198
192
  minZoom: number;
@@ -65,4 +65,19 @@ export declare class ResetCalibrationError extends Error {
65
65
  export declare class ImportSettingsError extends Error {
66
66
  constructor(err: unknown);
67
67
  }
68
+ export declare class CannotSetCoordsInAutoModeError extends Error {
69
+ constructor();
70
+ }
71
+ export declare class InvalidLatLngError extends Error {
72
+ constructor();
73
+ }
74
+ export declare class InvalidAltitudeError extends Error {
75
+ constructor();
76
+ }
77
+ export declare class ServerError extends Error {
78
+ constructor();
79
+ }
80
+ export declare class BadRequestError extends Error {
81
+ constructor(err: unknown);
82
+ }
68
83
  export {};
@@ -9,25 +9,23 @@ type TEvent<T extends {
9
9
  }, Type extends TEventType<T>> = T extends {
10
10
  type: Type;
11
11
  } ? T : never;
12
- type TZodSchema<T extends {
12
+ type TValidate<T extends {
13
13
  type: string;
14
- }> = {
15
- parse: (data: string) => {
16
- type: 'init';
17
- data: TEvent<T, TEventType<T>>;
18
- } | TEvent<T, TEventType<T>>;
19
- };
14
+ }> = (data: string) => {
15
+ type: 'init';
16
+ data: TEvent<T, TEventType<T>>;
17
+ } | TEvent<T, TEventType<T>>;
20
18
  type TListenerFunction<T extends {
21
19
  type: string;
22
20
  }, Type extends TEventType<T>> = (data: TEvent<T, Type>, isInit: boolean) => void;
23
21
  export declare class WsEvents<T extends {
24
22
  type: string;
25
23
  }> {
26
- private zodSchema;
24
+ private validate;
27
25
  ws: IWsClient;
28
26
  private _isDestroyed;
29
27
  private listeners;
30
- constructor(zodSchema: TZodSchema<T>, ws: IWsClient);
28
+ constructor(validate: TValidate<T>, ws: IWsClient);
31
29
  get isDestroyed(): boolean;
32
30
  resendInitData(): void;
33
31
  addListener<Type extends TEventType<T>>(type: Type, listener: TListenerFunction<T, Type>, id: string): void;