camstreamerlib 4.0.0-beta.76 → 4.0.0-beta.78

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 (91) hide show
  1. package/cjs/CamOverlayAPI.d.ts +22 -22
  2. package/cjs/CamStreamerAPI.d.ts +47 -49
  3. package/cjs/CamStreamerAPI.js +36 -23
  4. package/cjs/PlaneTrackerAPI.d.ts +1 -3
  5. package/cjs/PlaneTrackerAPI.js +0 -7
  6. package/cjs/errors/errors.d.ts +7 -0
  7. package/cjs/errors/errors.js +12 -1
  8. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +81 -81
  9. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +4 -4
  10. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +2 -2
  11. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +6 -6
  12. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +2 -2
  13. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +2 -2
  14. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +2 -2
  15. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +2 -2
  16. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +2 -2
  17. package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +6 -6
  18. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +2 -2
  19. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +199 -0
  20. package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +48 -0
  21. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +21 -0
  22. package/cjs/types/CamStreamerAPI/facebookSchema.js +11 -0
  23. package/cjs/types/CamStreamerAPI/hlsSchema.d.ts +21 -0
  24. package/cjs/types/CamStreamerAPI/hlsSchema.js +11 -0
  25. package/cjs/types/CamStreamerAPI/index.d.ts +9 -0
  26. package/cjs/types/CamStreamerAPI/index.js +25 -0
  27. package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +21 -0
  28. package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +11 -0
  29. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +137 -0
  30. package/cjs/types/{CamStreamerAPI.js → CamStreamerAPI/oldStreamSchema.js} +3 -12
  31. package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +21 -0
  32. package/cjs/types/CamStreamerAPI/rtmpSchema.js +11 -0
  33. package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +21 -0
  34. package/cjs/types/CamStreamerAPI/sdCardSchema.js +11 -0
  35. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +20 -0
  36. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +19 -0
  37. package/cjs/types/CamStreamerAPI/windySchema.d.ts +21 -0
  38. package/cjs/types/CamStreamerAPI/windySchema.js +11 -0
  39. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +21 -0
  40. package/cjs/types/CamStreamerAPI/youtubeSchema.js +11 -0
  41. package/cjs/types/common.d.ts +1 -0
  42. package/cjs/types/common.js +2 -1
  43. package/cjs/types/ws/PlaneTrackerEvents.d.ts +3 -69
  44. package/cjs/types/ws/PlaneTrackerEvents.js +0 -11
  45. package/esm/CamStreamerAPI.js +37 -24
  46. package/esm/PlaneTrackerAPI.js +1 -8
  47. package/esm/errors/errors.js +10 -0
  48. package/esm/types/CamStreamerAPI/CamStreamerAPI.js +38 -0
  49. package/esm/types/CamStreamerAPI/facebookSchema.js +5 -0
  50. package/esm/types/CamStreamerAPI/hlsSchema.js +5 -0
  51. package/esm/types/CamStreamerAPI/index.js +9 -0
  52. package/esm/types/CamStreamerAPI/mpegDvbSchema.js +5 -0
  53. package/esm/types/{CamStreamerAPI.js → CamStreamerAPI/oldStreamSchema.js} +2 -11
  54. package/esm/types/CamStreamerAPI/rtmpSchema.js +5 -0
  55. package/esm/types/CamStreamerAPI/sdCardSchema.js +5 -0
  56. package/esm/types/CamStreamerAPI/streamCommonTypes.js +16 -0
  57. package/esm/types/CamStreamerAPI/windySchema.js +5 -0
  58. package/esm/types/CamStreamerAPI/youtubeSchema.js +5 -0
  59. package/esm/types/common.js +1 -0
  60. package/esm/types/ws/PlaneTrackerEvents.js +0 -11
  61. package/package.json +1 -1
  62. package/types/CamOverlayAPI.d.ts +22 -22
  63. package/types/CamStreamerAPI.d.ts +47 -49
  64. package/types/PlaneTrackerAPI.d.ts +1 -3
  65. package/types/errors/errors.d.ts +7 -0
  66. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +81 -81
  67. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +4 -4
  68. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +2 -2
  69. package/types/types/CamOverlayAPI/imagesSchema.d.ts +6 -6
  70. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +2 -2
  71. package/types/types/CamOverlayAPI/pipSchema.d.ts +2 -2
  72. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +2 -2
  73. package/types/types/CamOverlayAPI/ptzSchema.d.ts +2 -2
  74. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +2 -2
  75. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +6 -6
  76. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +2 -2
  77. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +199 -0
  78. package/types/types/CamStreamerAPI/facebookSchema.d.ts +21 -0
  79. package/types/types/CamStreamerAPI/hlsSchema.d.ts +21 -0
  80. package/types/types/CamStreamerAPI/index.d.ts +9 -0
  81. package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +21 -0
  82. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +137 -0
  83. package/types/types/CamStreamerAPI/rtmpSchema.d.ts +21 -0
  84. package/types/types/CamStreamerAPI/sdCardSchema.d.ts +21 -0
  85. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +20 -0
  86. package/types/types/CamStreamerAPI/windySchema.d.ts +21 -0
  87. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +21 -0
  88. package/types/types/common.d.ts +1 -0
  89. package/types/types/ws/PlaneTrackerEvents.d.ts +3 -69
  90. package/cjs/types/CamStreamerAPI.d.ts +0 -272
  91. package/types/types/CamStreamerAPI.d.ts +0 -272
@@ -1,13 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  import { ProxyClient } from './internal/ProxyClient';
3
- import { cameraStreamSchema } from './types/CamStreamerAPI';
4
- import { ErrorWithResponse, UtcTimeFetchError, WsAuthorizationError } from './errors/errors';
3
+ import { streamSchema } from './types/CamStreamerAPI/CamStreamerAPI';
4
+ import { ErrorWithResponse, UtcTimeFetchError, WsAuthorizationError, MigrationError } from './errors/errors';
5
+ import { oldStringStreamSchema } from './types/CamStreamerAPI/oldStreamSchema';
5
6
  const BASE_PATH = '/local/camstreamer';
6
7
  export class CamStreamerAPI {
7
8
  client;
8
9
  constructor(client) {
9
10
  this.client = client;
10
11
  }
12
+ static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
11
13
  getClient(proxyParams) {
12
14
  return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
13
15
  }
@@ -27,35 +29,46 @@ export class CamStreamerAPI {
27
29
  }
28
30
  async getStreamList(options) {
29
31
  const res = await this._getJson(`${BASE_PATH}/stream/list.cgi`, undefined, options);
30
- const list = z.record(z.string(), cameraStreamSchema).parse(res.data);
31
32
  const streamList = {};
32
- for (const [key, data] of Object.entries(list)) {
33
- const streamId = parseInt(key);
34
- streamList[streamId] = parseCameraStreamResponse(data);
33
+ const invalidList = {};
34
+ for (const [key, value] of Object.entries(res.data)) {
35
+ const id = parseInt(key);
36
+ try {
37
+ const parsed = streamSchema.parse(value);
38
+ streamList[id] = parsed;
39
+ }
40
+ catch (err) {
41
+ const oldStream = oldStringStreamSchema.parse(value);
42
+ const parsedOldStream = parseCameraStreamResponse(oldStream);
43
+ invalidList[id] = parsedOldStream;
44
+ }
45
+ }
46
+ if (Object.keys(invalidList).length > 0) {
47
+ throw new MigrationError(streamList, invalidList);
35
48
  }
36
49
  return streamList;
37
50
  }
38
51
  async getStream(streamId, options) {
39
52
  const res = await this._getJson(`${BASE_PATH}/stream/get.cgi`, { stream_id: streamId }, options);
40
- const cameraData = cameraStreamSchema.parse(res.data);
41
- return parseCameraStreamResponse(cameraData);
42
- }
43
- async getStreamParameter(streamId, paramName, options) {
44
- const res = await this._getJson(`${BASE_PATH}/stream/get.cgi`, { stream_id: streamId }, options);
45
- return z.string().parse(res.data[paramName]);
46
- }
47
- async setStream(streamId, params, options) {
48
- const { streamDelay, startTime, stopTime, ...rest } = params;
49
- await this._getJson(`${BASE_PATH}/stream/set.cgi`, {
50
- stream_id: streamId,
51
- streamDelay: streamDelay ?? '',
52
- startTime: startTime ?? null,
53
- stopTime: stopTime ?? null,
54
- ...rest,
55
- }, options);
53
+ try {
54
+ return streamSchema.parse(res.data);
55
+ }
56
+ catch (err) {
57
+ const oldStream = oldStringStreamSchema.parse(res.data);
58
+ const parsedOldStream = parseCameraStreamResponse(oldStream);
59
+ throw new MigrationError({}, { [streamId]: parsedOldStream });
60
+ }
56
61
  }
57
- async setStreamParameter(streamId, paramName, value, options) {
58
- await this._getJson(`${BASE_PATH}/stream/set.cgi`, { stream_id: streamId, [paramName]: value }, options);
62
+ async setStream(streamId, streamData, options) {
63
+ const agent = this.getClient(options?.proxyParams);
64
+ await agent.post({
65
+ path: `${BASE_PATH}/stream/set.cgi`,
66
+ data: streamData,
67
+ parameters: {
68
+ stream_id: streamId,
69
+ },
70
+ timeout: options?.timeout,
71
+ });
59
72
  }
60
73
  async isStreaming(streamId, options) {
61
74
  const res = await this._getJson(`${BASE_PATH}/get_streamstat.cgi`, { stream_id: streamId }, options);
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { paramToUrl } from './internal/utils';
3
- import { blackListSchema, cameraSettingsSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, typePriorityListSchema, whiteListSchema, wsAliasResponseSchema, zonesSchema, } from './types/PlaneTrackerAPI';
3
+ import { blackListSchema, cameraSettingsSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, whiteListSchema, wsAliasResponseSchema, zonesSchema, } from './types/PlaneTrackerAPI';
4
4
  import { CannotSetCoordsInAutoModeError, ImportSettingsError, InvalidAltitudeError, InvalidLatLngError, ParsingBlobError, ResetCalibrationError, ServerError, BadRequestError, ErrorWithResponse, } from './errors/errors';
5
5
  import { ProxyClient } from './internal/ProxyClient';
6
6
  import { cameraListSchema } from './types/GenetecAgent';
@@ -122,13 +122,6 @@ export class PlaneTrackerAPI {
122
122
  async setPriorityList(priorityList, options) {
123
123
  return await this._postJsonEncoded(`${BASE_PATH}/package/setPriorityList.cgi`, { priorityList }, this.apiUser, options);
124
124
  }
125
- async getTypePriorityList(options) {
126
- const res = await this._getJson(`${BASE_PATH}/package/getTypePriorityList.cgi`, undefined, options);
127
- return typePriorityListSchema.parse(res).typePriorityList;
128
- }
129
- async setTypePriorityList(typePriorityList, options) {
130
- return await this._postJsonEncoded(`${BASE_PATH}/package/setTypePriorityList.cgi`, { typePriorityList }, this.apiUser, options);
131
- }
132
125
  async getWhiteList(options) {
133
126
  const res = await this._getJson(`${BASE_PATH}/package/getWhiteList.cgi`, undefined, options);
134
127
  return whiteListSchema.parse(res).whiteList;
@@ -174,3 +174,13 @@ export class BadRequestError extends ErrorWithResponse {
174
174
  this.name = 'BadRequestError';
175
175
  }
176
176
  }
177
+ export class MigrationError extends Error {
178
+ valid;
179
+ invalid;
180
+ constructor(valid, invalid) {
181
+ super('Migration to newer version is needed: some stream entries failed to parse.');
182
+ this.name = 'MigrationError';
183
+ this.valid = valid;
184
+ this.invalid = invalid;
185
+ }
186
+ }
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { facebookSchema } from './facebookSchema';
3
+ import { hlsSchema } from './hlsSchema';
4
+ import { mpegDvbSchema } from './mpegDvbSchema';
5
+ import { rtmpSchema } from './rtmpSchema';
6
+ import { sdCardSchema } from './sdCardSchema';
7
+ import { windySchema } from './windySchema';
8
+ import { youtubeSchema } from './youtubeSchema';
9
+ export const streamSchema = z.discriminatedUnion('type', [
10
+ facebookSchema,
11
+ hlsSchema,
12
+ mpegDvbSchema,
13
+ rtmpSchema,
14
+ sdCardSchema,
15
+ windySchema,
16
+ youtubeSchema,
17
+ ]);
18
+ export const isFacebookStream = (stream) => {
19
+ return stream.type === 'facebook';
20
+ };
21
+ export const isHlsStream = (stream) => {
22
+ return stream.type === 'hls';
23
+ };
24
+ export const isMpegDvbStream = (stream) => {
25
+ return stream.type === 'mpeg_dvb';
26
+ };
27
+ export const isRtmpStream = (stream) => {
28
+ return stream.type === 'rtmp';
29
+ };
30
+ export const isSdCardStream = (stream) => {
31
+ return stream.type === 'sd_card';
32
+ };
33
+ export const isWindyStream = (stream) => {
34
+ return stream.type === 'windy';
35
+ };
36
+ export const isYouTubeStream = (stream) => {
37
+ return stream.type === 'youtube';
38
+ };
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const facebookSchema = streamCommonSchema.extend({
4
+ type: z.literal('facebook'),
5
+ });
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const hlsSchema = streamCommonSchema.extend({
4
+ type: z.literal('hls'),
5
+ });
@@ -0,0 +1,9 @@
1
+ export * from './CamStreamerAPI';
2
+ export * from './streamCommonTypes';
3
+ export * from './facebookSchema';
4
+ export * from './hlsSchema';
5
+ export * from './mpegDvbSchema';
6
+ export * from './rtmpSchema';
7
+ export * from './sdCardSchema';
8
+ export * from './windySchema';
9
+ export * from './youtubeSchema';
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const mpegDvbSchema = streamCommonSchema.extend({
4
+ type: z.literal('mpeg_dvb'),
5
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export const cameraStreamSchema = z.object({
2
+ export const oldStringStreamSchema = z.object({
3
3
  enabled: z.string(),
4
4
  active: z.string(),
5
5
  audioSource: z.string(),
@@ -22,7 +22,7 @@ export const cameraStreamSchema = z.object({
22
22
  startTime: z.string(),
23
23
  stopTime: z.string(),
24
24
  });
25
- export const streamSchema = z.object({
25
+ export const oldStreamSchema = z.object({
26
26
  enabled: z.union([z.literal(0), z.literal(1)]),
27
27
  active: z.union([z.literal(0), z.literal(1)]),
28
28
  audioSource: z.string(),
@@ -45,12 +45,3 @@ export const streamSchema = z.object({
45
45
  startTime: z.number().nullable(),
46
46
  stopTime: z.number().nullable(),
47
47
  });
48
- export const cameraStreamResponseSchema = z.object({
49
- data: cameraStreamSchema,
50
- code: z.number(),
51
- message: z.string(),
52
- });
53
- export const camstreamerServerResponseSchema = z.object({
54
- code: z.number(),
55
- message: z.string(),
56
- });
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const rtmpSchema = streamCommonSchema.extend({
4
+ type: z.literal('rtmp'),
5
+ });
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const sdCardSchema = streamCommonSchema.extend({
4
+ type: z.literal('sd_card'),
5
+ });
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export const streamTypeSchema = z.union([
3
+ z.literal('youtube'),
4
+ z.literal('facebook'),
5
+ z.literal('sd_card'),
6
+ z.literal('windy'),
7
+ z.literal('mpeg_dvb'),
8
+ z.literal('hls'),
9
+ z.literal('rtmp'),
10
+ ]);
11
+ export const streamCommonSchema = z.object({
12
+ enabled: z.boolean(),
13
+ active: z.boolean(),
14
+ title: z.string(),
15
+ order: z.number(),
16
+ });
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const windySchema = streamCommonSchema.extend({
4
+ type: z.literal('windy'),
5
+ });
@@ -0,0 +1,5 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const youtubeSchema = streamCommonSchema.extend({
4
+ type: z.literal('youtube'),
5
+ });
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export const booleanSchema = z.union([z.literal(0), z.literal(1)]);
2
3
  export const audioChannelSchema = z.union([z.literal('mono'), z.literal('stereo')]);
3
4
  export const audioChannelCountSchema = z.union([z.literal(1), z.literal(2)]);
4
5
  export const h264ProfileSchema = z.union([z.literal('high'), z.literal('main'), z.literal('baseline')]);
@@ -12,7 +12,6 @@ const apiFlightDataSchema = z.object({
12
12
  whiteListed: z.boolean(),
13
13
  blackListed: z.boolean(),
14
14
  priorityListed: z.boolean(),
15
- typePriorityListed: z.boolean().default(false),
16
15
  autoSelectionIgnored: z.boolean(),
17
16
  signalQuality: z.number(),
18
17
  emitterCategorySet: z.number().default(4),
@@ -46,7 +45,6 @@ export var PlaneTrackerUserActions;
46
45
  PlaneTrackerUserActions["TRACK_ICAO"] = "trackIcao.cgi";
47
46
  PlaneTrackerUserActions["RESET_ICAO"] = "resetIcao.cgi";
48
47
  PlaneTrackerUserActions["SET_PRIORITY_LIST"] = "setPriorityList.cgi";
49
- PlaneTrackerUserActions["SET_TYPE_PRIORITY_LIST"] = "setTypePriorityList.cgi";
50
48
  PlaneTrackerUserActions["SET_BLACK_LIST"] = "setBlackList.cgi";
51
49
  PlaneTrackerUserActions["SET_WHITE_LIST"] = "setWhiteList.cgi";
52
50
  PlaneTrackerUserActions["GO_TO_COORDINATES"] = "goToCoordinates.cgi";
@@ -77,14 +75,6 @@ export const planeTrackerUserActionData = z.discriminatedUnion('cgi', [
77
75
  priorityList: z.array(z.string()),
78
76
  }),
79
77
  }),
80
- z.object({
81
- cgi: z.literal(PlaneTrackerUserActions.SET_TYPE_PRIORITY_LIST),
82
- ip: z.string(),
83
- params: apiStringUserSchema,
84
- postJsonBody: z.object({
85
- typePriorityList: z.array(z.string()),
86
- }),
87
- }),
88
78
  z.object({
89
79
  cgi: z.literal(PlaneTrackerUserActions.SET_BLACK_LIST),
90
80
  ip: z.string(),
@@ -171,7 +161,6 @@ const ptrEventsDataSchema = z.discriminatedUnion('type', [
171
161
  PlaneTrackerUserActions.TRACK_ICAO,
172
162
  PlaneTrackerUserActions.RESET_ICAO,
173
163
  PlaneTrackerUserActions.SET_PRIORITY_LIST,
174
- PlaneTrackerUserActions.SET_TYPE_PRIORITY_LIST,
175
164
  PlaneTrackerUserActions.SET_BLACK_LIST,
176
165
  PlaneTrackerUserActions.SET_WHITE_LIST,
177
166
  PlaneTrackerUserActions.GO_TO_COORDINATES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.76",
3
+ "version": "4.0.0-beta.78",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -38,7 +38,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
38
38
  width: number;
39
39
  height: number;
40
40
  source: string;
41
- automationType: "time" | "manual" | "schedule" | `input${number}`;
41
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
42
42
  cameraList: number[];
43
43
  customName: string;
44
44
  pos_y: number;
@@ -68,7 +68,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
68
68
  id: number;
69
69
  width: number;
70
70
  height: number;
71
- automationType: "time" | "manual" | "schedule" | `input${number}`;
71
+ title: string;
72
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
72
73
  cameraList: number[];
73
74
  customName: string;
74
75
  pos_x: number;
@@ -79,7 +80,6 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
79
80
  font: string;
80
81
  location: string;
81
82
  locationName: string;
82
- title: string;
83
83
  bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
84
84
  bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
85
85
  lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
@@ -96,7 +96,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
96
96
  id: number;
97
97
  width: number;
98
98
  height: number;
99
- automationType: "time" | "manual" | "schedule" | `input${number}`;
99
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
100
100
  cameraList: number[];
101
101
  customName: string;
102
102
  pos_x: number;
@@ -126,15 +126,15 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
126
126
  id: number;
127
127
  width: number;
128
128
  height: number;
129
- automationType: "time" | "manual" | "schedule" | `input${number}`;
129
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
130
130
  cameraList: number[];
131
131
  customName: string;
132
132
  overlayList: {
133
133
  duration: number;
134
+ active: boolean;
134
135
  pos_x: number;
135
136
  pos_y: number;
136
137
  coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
137
- active: boolean;
138
138
  imgPath: string;
139
139
  imgName: string;
140
140
  scale: number;
@@ -150,7 +150,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
150
150
  id: number;
151
151
  width: number;
152
152
  height: number;
153
- automationType: "time" | "manual" | "schedule" | `input${number}`;
153
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
154
154
  cameraList: number[];
155
155
  customName: string;
156
156
  ptz_positions: Record<string, {
@@ -177,7 +177,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
177
177
  width: number;
178
178
  height: number;
179
179
  fps: number;
180
- automationType: "time" | "manual" | "schedule" | `input${number}`;
180
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
181
181
  cameraList: number[];
182
182
  customName: string;
183
183
  pos_x: number;
@@ -213,7 +213,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
213
213
  id: number;
214
214
  width: number;
215
215
  height: number;
216
- automationType: "time" | "manual" | "schedule" | `input${number}`;
216
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
217
217
  cameraList: number[];
218
218
  customName: string;
219
219
  pos_x: number;
@@ -294,7 +294,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
294
294
  width: number;
295
295
  height: number;
296
296
  fps: number;
297
- automationType: "time" | "manual" | "schedule" | `input${number}`;
297
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
298
298
  cameraList: number[];
299
299
  customName: string;
300
300
  pos_x: number;
@@ -312,7 +312,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
312
312
  width: number;
313
313
  height: number;
314
314
  fps: number;
315
- automationType: "time" | "manual" | "schedule" | `input${number}`;
315
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
316
316
  cameraList: number[];
317
317
  customName: string;
318
318
  pos_x: number;
@@ -448,7 +448,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
448
448
  width: number;
449
449
  height: number;
450
450
  source: string;
451
- automationType: "time" | "manual" | "schedule" | `input${number}`;
451
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
452
452
  cameraList: number[];
453
453
  customName: string;
454
454
  pos_y: number;
@@ -478,7 +478,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
478
478
  id: number;
479
479
  width: number;
480
480
  height: number;
481
- automationType: "time" | "manual" | "schedule" | `input${number}`;
481
+ title: string;
482
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
482
483
  cameraList: number[];
483
484
  customName: string;
484
485
  pos_x: number;
@@ -489,7 +490,6 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
489
490
  font: string;
490
491
  location: string;
491
492
  locationName: string;
492
- title: string;
493
493
  bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
494
494
  bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
495
495
  lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
@@ -506,7 +506,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
506
506
  id: number;
507
507
  width: number;
508
508
  height: number;
509
- automationType: "time" | "manual" | "schedule" | `input${number}`;
509
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
510
510
  cameraList: number[];
511
511
  customName: string;
512
512
  pos_x: number;
@@ -536,15 +536,15 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
536
536
  id: number;
537
537
  width: number;
538
538
  height: number;
539
- automationType: "time" | "manual" | "schedule" | `input${number}`;
539
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
540
540
  cameraList: number[];
541
541
  customName: string;
542
542
  overlayList: {
543
543
  duration: number;
544
+ active: boolean;
544
545
  pos_x: number;
545
546
  pos_y: number;
546
547
  coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
547
- active: boolean;
548
548
  imgPath: string;
549
549
  imgName: string;
550
550
  scale: number;
@@ -560,7 +560,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
560
560
  id: number;
561
561
  width: number;
562
562
  height: number;
563
- automationType: "time" | "manual" | "schedule" | `input${number}`;
563
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
564
564
  cameraList: number[];
565
565
  customName: string;
566
566
  ptz_positions: Record<string, {
@@ -587,7 +587,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
587
587
  width: number;
588
588
  height: number;
589
589
  fps: number;
590
- automationType: "time" | "manual" | "schedule" | `input${number}`;
590
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
591
591
  cameraList: number[];
592
592
  customName: string;
593
593
  pos_x: number;
@@ -623,7 +623,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
623
623
  id: number;
624
624
  width: number;
625
625
  height: number;
626
- automationType: "time" | "manual" | "schedule" | `input${number}`;
626
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
627
627
  cameraList: number[];
628
628
  customName: string;
629
629
  pos_x: number;
@@ -704,7 +704,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
704
704
  width: number;
705
705
  height: number;
706
706
  fps: number;
707
- automationType: "time" | "manual" | "schedule" | `input${number}`;
707
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
708
708
  cameraList: number[];
709
709
  customName: string;
710
710
  pos_x: number;
@@ -722,7 +722,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
722
722
  width: number;
723
723
  height: number;
724
724
  fps: number;
725
- automationType: "time" | "manual" | "schedule" | `input${number}`;
725
+ automationType: "schedule" | "time" | "manual" | `input${number}`;
726
726
  cameraList: number[];
727
727
  customName: string;
728
728
  pos_x: number;
@@ -1,64 +1,62 @@
1
1
  import { ProxyClient } from './internal/ProxyClient';
2
2
  import { IClient, TResponse } from './internal/types';
3
- import { TCameraStream, TStream } from './types/CamStreamerAPI';
3
+ import { TStream } from './types/CamStreamerAPI/CamStreamerAPI';
4
4
  import { THttpRequestOptions, TProxyParams } from './types/common';
5
+ import { TOldStream, TOldStringStream } from './types/CamStreamerAPI/oldStreamSchema';
5
6
  export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
6
7
  private client;
7
8
  constructor(client: Client);
9
+ static getProxyPath: () => string;
8
10
  getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
9
11
  wsAuthorization(options?: THttpRequestOptions): Promise<string>;
10
12
  getUtcTime(options?: THttpRequestOptions): Promise<number>;
11
- getStreamList(options?: THttpRequestOptions): Promise<Record<number, {
12
- enabled: 0 | 1;
13
- schedule: string;
14
- active: 0 | 1;
15
- audioSource: string;
16
- avSyncMsec: number;
17
- internalVapixParameters: string;
18
- userVapixParameters: string;
19
- outputParameters: string;
20
- outputType: "video" | "none" | "images";
21
- mediaServerUrl: string;
22
- inputType: "RTSP_URL" | "CSw" | "CRS";
23
- inputUrl: string;
24
- forceStereo: 0 | 1;
25
- streamDelay: number | null;
26
- statusLed: number;
27
- statusPort: string;
28
- callApi: number;
29
- trigger: string;
30
- prepareAhead: number;
31
- startTime: number | null;
32
- stopTime: number | null;
33
- }>>;
13
+ getStreamList(options?: THttpRequestOptions): Promise<Record<number, TStream>>;
34
14
  getStream(streamId: number, options?: THttpRequestOptions): Promise<{
35
- enabled: 0 | 1;
36
- schedule: string;
37
- active: 0 | 1;
38
- audioSource: string;
39
- avSyncMsec: number;
40
- internalVapixParameters: string;
41
- userVapixParameters: string;
42
- outputParameters: string;
43
- outputType: "video" | "none" | "images";
44
- mediaServerUrl: string;
45
- inputType: "RTSP_URL" | "CSw" | "CRS";
46
- inputUrl: string;
47
- forceStereo: 0 | 1;
48
- streamDelay: number | null;
49
- statusLed: number;
50
- statusPort: string;
51
- callApi: number;
52
- trigger: string;
53
- prepareAhead: number;
54
- startTime: number | null;
55
- stopTime: number | null;
15
+ type: "facebook";
16
+ enabled: boolean;
17
+ active: boolean;
18
+ title: string;
19
+ order: number;
20
+ } | {
21
+ type: "hls";
22
+ enabled: boolean;
23
+ active: boolean;
24
+ title: string;
25
+ order: number;
26
+ } | {
27
+ type: "mpeg_dvb";
28
+ enabled: boolean;
29
+ active: boolean;
30
+ title: string;
31
+ order: number;
32
+ } | {
33
+ type: "rtmp";
34
+ enabled: boolean;
35
+ active: boolean;
36
+ title: string;
37
+ order: number;
38
+ } | {
39
+ type: "sd_card";
40
+ enabled: boolean;
41
+ active: boolean;
42
+ title: string;
43
+ order: number;
44
+ } | {
45
+ type: "windy";
46
+ enabled: boolean;
47
+ active: boolean;
48
+ title: string;
49
+ order: number;
50
+ } | {
51
+ type: "youtube";
52
+ enabled: boolean;
53
+ active: boolean;
54
+ title: string;
55
+ order: number;
56
56
  }>;
57
- getStreamParameter(streamId: number, paramName: string, options?: THttpRequestOptions): Promise<string>;
58
- setStream(streamId: number, params: Partial<TStream>, options?: THttpRequestOptions): Promise<void>;
59
- setStreamParameter(streamId: number, paramName: string, value: string, options?: THttpRequestOptions): Promise<void>;
57
+ setStream(streamId: number, streamData: Partial<TStream>, options?: THttpRequestOptions): Promise<void>;
60
58
  isStreaming(streamId: number, options?: THttpRequestOptions): Promise<boolean>;
61
59
  deleteStream(streamId: number, options?: THttpRequestOptions): Promise<boolean>;
62
60
  private _getJson;
63
61
  }
64
- export declare const parseCameraStreamResponse: (cameraStreamData: TCameraStream) => TStream;
62
+ export declare const parseCameraStreamResponse: (cameraStreamData: TOldStringStream) => TOldStream;
@@ -1,5 +1,5 @@
1
1
  import { IClient, TBlobResponse, TParameters, TResponse } from './internal/types';
2
- import { ICAO, TApiUser, TBlackList, TCameraSettings, TExportDataType, TGetIcaoByOption, TImportDataType, TPriorityList, TTrackingMode, TTypePriorityList, TWhiteList, TZones } from './types/PlaneTrackerAPI';
2
+ import { ICAO, TApiUser, TBlackList, TCameraSettings, TExportDataType, TGetIcaoByOption, TImportDataType, TPriorityList, TTrackingMode, TWhiteList, TZones } from './types/PlaneTrackerAPI';
3
3
  import { THttpRequestOptions, TProxyParams } from './types/common';
4
4
  import { ProxyClient } from './internal/ProxyClient';
5
5
  export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
@@ -194,8 +194,6 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
194
194
  getIcao(by: TGetIcaoByOption, value: string, options?: THttpRequestOptions): Promise<string>;
195
195
  getPriorityList(options?: THttpRequestOptions): Promise<string[]>;
196
196
  setPriorityList(priorityList: TPriorityList['priorityList'], options?: THttpRequestOptions): Promise<TResponse>;
197
- getTypePriorityList(options?: THttpRequestOptions): Promise<string[]>;
198
- setTypePriorityList(typePriorityList: TTypePriorityList['typePriorityList'], options?: THttpRequestOptions): Promise<TResponse>;
199
197
  getWhiteList(options?: THttpRequestOptions): Promise<string[]>;
200
198
  setWhiteList(whiteList: TWhiteList['whiteList'], options?: THttpRequestOptions): Promise<TResponse>;
201
199
  getBlackList(options?: THttpRequestOptions): Promise<string[]>;