camstreamerlib 4.0.15 → 4.0.17-979db019

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.
@@ -11,6 +11,13 @@ export const connectionSchema = z.object({
11
11
  user: z.string(),
12
12
  pass: z.string(),
13
13
  });
14
+ export const milestoneCameraListSchema = z
15
+ .object({
16
+ index: z.number(),
17
+ value: z.string(),
18
+ label: z.string(),
19
+ })
20
+ .array();
14
21
  export const widgetSchema = z.object({
15
22
  enabled: z.boolean().default(true),
16
23
  coord: z.union([
@@ -199,6 +206,20 @@ export const cameraSettingsSchema = z.object({
199
206
  pass: '',
200
207
  sourceKey: '',
201
208
  }),
209
+ milestone: connectionSchema
210
+ .extend({
211
+ enabled: z.boolean(),
212
+ cameraList: z.string().array().default([]),
213
+ })
214
+ .default({
215
+ enabled: false,
216
+ protocol: 'https_insecure',
217
+ ip: '',
218
+ port: 443,
219
+ user: '',
220
+ pass: '',
221
+ cameraList: [],
222
+ }),
202
223
  camstreamerIntegration: z
203
224
  .object({
204
225
  adPlacementEnabled: z.boolean(),
@@ -8,6 +8,9 @@ const wsApiFlightDataSchema = z.object({
8
8
  groupId: z.string().optional(),
9
9
  lat: z.number(),
10
10
  lon: z.number(),
11
+ observedLat: z.number(),
12
+ observedLon: z.number(),
13
+ positionTimestamp: z.number(),
11
14
  heading: z.number(),
12
15
  groundSpeed: z.number(),
13
16
  altitudeAMSL: z.number(),
@@ -29,6 +32,7 @@ const wsCameraPositionDataSchema = z.object({
29
32
  azimuth: z.number().min(0).max(360),
30
33
  elevation: z.number().min(-90).max(90),
31
34
  fov: z.number(),
35
+ sampledAt: z.number(),
32
36
  });
33
37
  const userSchema = z.object({
34
38
  userId: z.string(),
@@ -44,6 +48,7 @@ export var EUserActions;
44
48
  EUserActions["TRACK_ICAO"] = "trackIcao.cgi";
45
49
  EUserActions["TRACK_TARGET"] = "trackTarget.cgi";
46
50
  EUserActions["RESET_ICAO"] = "resetIcao.cgi";
51
+ EUserActions["RESET_TARGET"] = "resetTarget.cgi";
47
52
  EUserActions["SET_PRIORITY_LIST"] = "setPriorityList.cgi";
48
53
  EUserActions["SET_BLACK_LIST"] = "setBlackList.cgi";
49
54
  EUserActions["SET_WHITE_LIST"] = "setWhiteList.cgi";
@@ -86,6 +91,13 @@ const eventsDataSchema = z.union([
86
91
  params: userSchema,
87
92
  postJsonBody: z.any(),
88
93
  }),
94
+ z.object({
95
+ type: z.literal('USER_ACTION'),
96
+ cgi: z.literal(EUserActions.RESET_TARGET),
97
+ ip: z.string(),
98
+ params: userSchema,
99
+ postJsonBody: z.any(),
100
+ }),
89
101
  z.object({
90
102
  type: z.literal('USER_ACTION'),
91
103
  cgi: z.literal(EUserActions.SET_PRIORITY_LIST),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.15",
3
+ "version": "4.0.17-979db019",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -1,5 +1,5 @@
1
1
  import { IClient, TResponse } from './internal/types';
2
- import { ICAO, TBlackList, TCameraSettings, TExportDataType, TGetIcaoByOption, TImportDataType, TPriorityList, TTrackingMode, TWhiteList, TZones } from './types/PlaneTrackerAPI';
2
+ import { ICAO, TBlackList, TCameraSettings, TConnection, TExportDataType, TGetIcaoByOption, TImportDataType, TMilestoneCameraOption, TPriorityList, TTrackingMode, TWhiteList, TZones } from './types/PlaneTrackerAPI';
3
3
  import { THttpRequestOptions } from './types/common';
4
4
  import { BasicAPI } from './internal/BasicAPI';
5
5
  import { TApiUser } from './types/ws/PlaneTrackerEvents';
@@ -107,6 +107,15 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
107
107
  protocol: "https" | "http" | "https_insecure";
108
108
  sourceKey: string;
109
109
  };
110
+ milestone: {
111
+ ip: string;
112
+ enabled: boolean;
113
+ port: number;
114
+ cameraList: string[];
115
+ pass: string;
116
+ user: string;
117
+ protocol: "https" | "http" | "https_insecure";
118
+ };
110
119
  camstreamerIntegration: {
111
120
  adPlacementEnabled: boolean;
112
121
  adMinIntervalSec: number;
@@ -250,5 +259,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
250
259
  }>;
251
260
  setZones(zones: TZones, options?: THttpRequestOptions): Promise<void>;
252
261
  goToCoordinates(lat: number, lon: number, alt?: number, options?: THttpRequestOptions): Promise<void>;
262
+ checkMilestoneConnection(params: TConnection, options?: THttpRequestOptions): Promise<boolean>;
263
+ getMilestoneCameraList(params: TConnection, options?: THttpRequestOptions): Promise<TMilestoneCameraOption[]>;
253
264
  downloadReport(options?: THttpRequestOptions): Promise<string>;
254
265
  }
@@ -0,0 +1,14 @@
1
+ import { MilestoneAgentOptions, TBookmark, TMilestoneCamera } from '../../types/MilestoneAgent';
2
+ export declare class MilestoneAgent {
3
+ private settings;
4
+ private protocol;
5
+ private sender;
6
+ private token?;
7
+ constructor(options?: MilestoneAgentOptions);
8
+ checkConnection(): Promise<void>;
9
+ getAllCameras(): Promise<TMilestoneCamera[]>;
10
+ sendBookmark(cameraId: string, bookmark: TBookmark): Promise<void>;
11
+ private getCamerasPage;
12
+ private getToken;
13
+ private getRequestOptions;
14
+ }
@@ -6,6 +6,8 @@ export * from './events/AxisCameraStationEvents';
6
6
  export * from './TimeZoneDaemon';
7
7
  export * from './events/GenetecAgent';
8
8
  export * from '../types/GenetecAgent';
9
+ export * from './events/MilestoneAgent';
10
+ export * from '../types/MilestoneAgent';
9
11
  export { ResourceManager } from './CamOverlayPainter/ResourceManager';
10
12
  export { Painter } from './CamOverlayPainter/Painter';
11
13
  export { Frame } from './CamOverlayPainter/Frame';
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ export type MilestoneAgentOptions = {
3
+ protocol?: 'http' | 'https' | 'https_insecure';
4
+ ip?: string;
5
+ port?: number;
6
+ user?: string;
7
+ pass?: string;
8
+ timeout?: number;
9
+ };
10
+ export declare const tokenResponseSchema: z.ZodObject<{
11
+ access_token: z.ZodString;
12
+ expires_in: z.ZodNumber;
13
+ token_type: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ access_token: string;
16
+ expires_in: number;
17
+ token_type: string;
18
+ }, {
19
+ access_token: string;
20
+ expires_in: number;
21
+ token_type: string;
22
+ }>;
23
+ export type TTokenResponse = z.infer<typeof tokenResponseSchema>;
24
+ export declare const milestoneCameraSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ name: z.ZodOptional<z.ZodString>;
27
+ displayName: z.ZodOptional<z.ZodString>;
28
+ enabled: z.ZodOptional<z.ZodBoolean>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ id: string;
31
+ name?: string | undefined;
32
+ enabled?: boolean | undefined;
33
+ displayName?: string | undefined;
34
+ }, {
35
+ id: string;
36
+ name?: string | undefined;
37
+ enabled?: boolean | undefined;
38
+ displayName?: string | undefined;
39
+ }>;
40
+ export type TMilestoneCamera = z.infer<typeof milestoneCameraSchema>;
41
+ export declare const camerasResponseSchema: z.ZodObject<{
42
+ array: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ name: z.ZodOptional<z.ZodString>;
45
+ displayName: z.ZodOptional<z.ZodString>;
46
+ enabled: z.ZodOptional<z.ZodBoolean>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ id: string;
49
+ name?: string | undefined;
50
+ enabled?: boolean | undefined;
51
+ displayName?: string | undefined;
52
+ }, {
53
+ id: string;
54
+ name?: string | undefined;
55
+ enabled?: boolean | undefined;
56
+ displayName?: string | undefined;
57
+ }>, "many">;
58
+ }, "strip", z.ZodTypeAny, {
59
+ array: {
60
+ id: string;
61
+ name?: string | undefined;
62
+ enabled?: boolean | undefined;
63
+ displayName?: string | undefined;
64
+ }[];
65
+ }, {
66
+ array: {
67
+ id: string;
68
+ name?: string | undefined;
69
+ enabled?: boolean | undefined;
70
+ displayName?: string | undefined;
71
+ }[];
72
+ }>;
73
+ export type TCamerasResponse = z.infer<typeof camerasResponseSchema>;
74
+ export type TBookmark = {
75
+ header: string;
76
+ description: string;
77
+ timeBegin: string;
78
+ timeEnd: string;
79
+ timeTriggered: string;
80
+ reference: string;
81
+ };
@@ -33,6 +33,21 @@ export declare const connectionSchema: z.ZodObject<{
33
33
  user: string;
34
34
  protocol: "https" | "http" | "https_insecure";
35
35
  }>;
36
+ export type TConnection = z.infer<typeof connectionSchema>;
37
+ export declare const milestoneCameraListSchema: z.ZodArray<z.ZodObject<{
38
+ index: z.ZodNumber;
39
+ value: z.ZodString;
40
+ label: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ value: string;
43
+ label: string;
44
+ index: number;
45
+ }, {
46
+ value: string;
47
+ label: string;
48
+ index: number;
49
+ }>, "many">;
50
+ export type TMilestoneCameraOption = z.infer<typeof milestoneCameraListSchema>[number];
36
51
  export declare const widgetSchema: z.ZodObject<{
37
52
  enabled: z.ZodDefault<z.ZodBoolean>;
38
53
  coord: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top_right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom_right">]>;
@@ -358,6 +373,32 @@ export declare const cameraSettingsSchema: z.ZodObject<{
358
373
  protocol: "https" | "http" | "https_insecure";
359
374
  sourceKey: string;
360
375
  }>>;
376
+ milestone: z.ZodDefault<z.ZodObject<{
377
+ protocol: z.ZodUnion<[z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodLiteral<"https_insecure">]>;
378
+ ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
379
+ port: z.ZodNumber;
380
+ user: z.ZodString;
381
+ pass: z.ZodString;
382
+ } & {
383
+ enabled: z.ZodBoolean;
384
+ cameraList: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
385
+ }, "strip", z.ZodTypeAny, {
386
+ ip: string;
387
+ enabled: boolean;
388
+ port: number;
389
+ cameraList: string[];
390
+ pass: string;
391
+ user: string;
392
+ protocol: "https" | "http" | "https_insecure";
393
+ }, {
394
+ ip: string;
395
+ enabled: boolean;
396
+ port: number;
397
+ pass: string;
398
+ user: string;
399
+ protocol: "https" | "http" | "https_insecure";
400
+ cameraList?: string[] | undefined;
401
+ }>>;
361
402
  camstreamerIntegration: z.ZodDefault<z.ZodObject<{
362
403
  adPlacementEnabled: z.ZodBoolean;
363
404
  adMinIntervalSec: z.ZodNumber;
@@ -463,6 +504,15 @@ export declare const cameraSettingsSchema: z.ZodObject<{
463
504
  protocol: "https" | "http" | "https_insecure";
464
505
  sourceKey: string;
465
506
  };
507
+ milestone: {
508
+ ip: string;
509
+ enabled: boolean;
510
+ port: number;
511
+ cameraList: string[];
512
+ pass: string;
513
+ user: string;
514
+ protocol: "https" | "http" | "https_insecure";
515
+ };
466
516
  camstreamerIntegration: {
467
517
  adPlacementEnabled: boolean;
468
518
  adMinIntervalSec: number;
@@ -606,6 +656,15 @@ export declare const cameraSettingsSchema: z.ZodObject<{
606
656
  protocol: "https" | "http" | "https_insecure";
607
657
  sourceKey: string;
608
658
  } | undefined;
659
+ milestone?: {
660
+ ip: string;
661
+ enabled: boolean;
662
+ port: number;
663
+ pass: string;
664
+ user: string;
665
+ protocol: "https" | "http" | "https_insecure";
666
+ cameraList?: string[] | undefined;
667
+ } | undefined;
609
668
  camstreamerIntegration?: {
610
669
  adPlacementEnabled: boolean;
611
670
  adMinIntervalSec: number;