camstreamerlib 4.0.31-e0ed433 → 4.0.31

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 (60) hide show
  1. package/README.md +1 -1
  2. package/cjs/PlaneTrackerAPI.d.ts +1 -0
  3. package/cjs/internal/types.d.ts +2 -0
  4. package/cjs/node/CamOverlayDrawingAPI.d.ts +2 -1
  5. package/cjs/node/CamOverlayDrawingAPI.js +6 -3
  6. package/cjs/node/CamScripterAPICameraEventsGenerator.d.ts +2 -1
  7. package/cjs/node/CamScripterAPICameraEventsGenerator.js +6 -3
  8. package/cjs/node/DefaultClient.d.ts +4 -3
  9. package/cjs/node/DefaultClient.js +8 -6
  10. package/cjs/node/DeviceConnectClient.d.ts +9 -0
  11. package/cjs/node/DeviceConnectClient.js +15 -0
  12. package/cjs/node/DeviceConnectWsClient.d.ts +12 -0
  13. package/cjs/node/DeviceConnectWsClient.js +21 -0
  14. package/cjs/node/VapixEvents.d.ts +2 -1
  15. package/cjs/node/VapixEvents.js +6 -3
  16. package/cjs/node/WsClient.d.ts +7 -2
  17. package/cjs/node/WsClient.js +3 -3
  18. package/cjs/node/index.d.ts +2 -0
  19. package/cjs/node/index.js +4 -1
  20. package/cjs/types/PlaneTrackerAPI.d.ts +5 -0
  21. package/cjs/types/PlaneTrackerAPI.js +1 -0
  22. package/cjs/types/ws/PlaneTrackerEvents.d.ts +23 -0
  23. package/cjs/web/DefaultClient.d.ts +2 -1
  24. package/cjs/web/DefaultClient.js +5 -3
  25. package/cjs/web/DeviceConnectClient.d.ts +4 -0
  26. package/cjs/web/DeviceConnectClient.js +10 -0
  27. package/cjs/web/DeviceConnectWsClient.d.ts +4 -0
  28. package/cjs/web/DeviceConnectWsClient.js +14 -0
  29. package/cjs/web/index.d.ts +2 -0
  30. package/cjs/web/index.js +5 -1
  31. package/esm/node/CamOverlayDrawingAPI.js +6 -3
  32. package/esm/node/CamScripterAPICameraEventsGenerator.js +6 -3
  33. package/esm/node/DefaultClient.js +8 -6
  34. package/esm/node/DeviceConnectClient.js +11 -0
  35. package/esm/node/DeviceConnectWsClient.js +17 -0
  36. package/esm/node/VapixEvents.js +6 -3
  37. package/esm/node/WsClient.js +3 -3
  38. package/esm/node/index.js +2 -0
  39. package/esm/types/PlaneTrackerAPI.js +1 -0
  40. package/esm/web/DefaultClient.js +5 -3
  41. package/esm/web/DeviceConnectClient.js +6 -0
  42. package/esm/web/DeviceConnectWsClient.js +10 -0
  43. package/esm/web/index.js +2 -0
  44. package/package.json +103 -103
  45. package/types/PlaneTrackerAPI.d.ts +1 -0
  46. package/types/internal/types.d.ts +2 -0
  47. package/types/node/CamOverlayDrawingAPI.d.ts +2 -1
  48. package/types/node/CamScripterAPICameraEventsGenerator.d.ts +2 -1
  49. package/types/node/DefaultClient.d.ts +4 -3
  50. package/types/node/DeviceConnectClient.d.ts +9 -0
  51. package/types/node/DeviceConnectWsClient.d.ts +12 -0
  52. package/types/node/VapixEvents.d.ts +2 -1
  53. package/types/node/WsClient.d.ts +7 -2
  54. package/types/node/index.d.ts +2 -0
  55. package/types/types/PlaneTrackerAPI.d.ts +5 -0
  56. package/types/types/ws/PlaneTrackerEvents.d.ts +23 -0
  57. package/types/web/DefaultClient.d.ts +2 -1
  58. package/types/web/DeviceConnectClient.d.ts +4 -0
  59. package/types/web/DeviceConnectWsClient.d.ts +4 -0
  60. package/types/web/index.d.ts +2 -0
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceConnectClient = void 0;
4
+ const DefaultClient_1 = require("./DefaultClient");
5
+ class DeviceConnectClient extends DefaultClient_1.DefaultClient {
6
+ constructor(deviceAccessToken, host) {
7
+ super(`https://${host}`, { authorization: `Bearer ${deviceAccessToken}` });
8
+ }
9
+ }
10
+ exports.DeviceConnectClient = DeviceConnectClient;
@@ -0,0 +1,4 @@
1
+ import { WsClient } from './WsClient';
2
+ export declare class DeviceConnectWsClient extends WsClient {
3
+ constructor(deviceAccessToken: string, host: string, getPath: () => string);
4
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceConnectWsClient = void 0;
4
+ const WsClient_1 = require("./WsClient");
5
+ class DeviceConnectWsClient extends WsClient_1.WsClient {
6
+ constructor(deviceAccessToken, host, getPath) {
7
+ super(() => {
8
+ const path = getPath();
9
+ const andChar = path.includes('?') ? '&' : '?';
10
+ return `wss://${host}${path}${andChar}DEVICE_ACCESS_TOKEN=${deviceAccessToken}`;
11
+ });
12
+ }
13
+ }
14
+ exports.DeviceConnectWsClient = DeviceConnectWsClient;
@@ -1,2 +1,4 @@
1
1
  export { DefaultClient } from './DefaultClient';
2
+ export { DeviceConnectClient } from './DeviceConnectClient';
3
+ export { DeviceConnectWsClient } from './DeviceConnectWsClient';
2
4
  export { WsClient } from './WsClient';
package/cjs/web/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WsClient = exports.DefaultClient = void 0;
3
+ exports.WsClient = exports.DeviceConnectWsClient = exports.DeviceConnectClient = exports.DefaultClient = void 0;
4
4
  var DefaultClient_1 = require("./DefaultClient");
5
5
  Object.defineProperty(exports, "DefaultClient", { enumerable: true, get: function () { return DefaultClient_1.DefaultClient; } });
6
+ var DeviceConnectClient_1 = require("./DeviceConnectClient");
7
+ Object.defineProperty(exports, "DeviceConnectClient", { enumerable: true, get: function () { return DeviceConnectClient_1.DeviceConnectClient; } });
8
+ var DeviceConnectWsClient_1 = require("./DeviceConnectWsClient");
9
+ Object.defineProperty(exports, "DeviceConnectWsClient", { enumerable: true, get: function () { return DeviceConnectWsClient_1.DeviceConnectWsClient; } });
6
10
  var WsClient_1 = require("./WsClient");
7
11
  Object.defineProperty(exports, "WsClient", { enumerable: true, get: function () { return WsClient_1.WsClient; } });
@@ -3,10 +3,11 @@ import { WsClient } from './WsClient';
3
3
  export class CamOverlayDrawingAPI extends EventEmitter {
4
4
  tls;
5
5
  tlsInsecure;
6
- ip;
6
+ host;
7
7
  port;
8
8
  user;
9
9
  pass;
10
+ headers;
10
11
  cameraList;
11
12
  zIndex;
12
13
  callId;
@@ -18,10 +19,11 @@ export class CamOverlayDrawingAPI extends EventEmitter {
18
19
  super();
19
20
  this.tls = options?.tls ?? false;
20
21
  this.tlsInsecure = options?.tlsInsecure ?? false;
21
- this.ip = options?.ip ?? '127.0.0.1';
22
+ this.host = options?.host ?? options?.ip ?? '127.0.0.1';
22
23
  this.port = options?.port ?? (this.tls ? 443 : 80);
23
24
  this.user = options?.user ?? '';
24
25
  this.pass = options?.pass ?? '';
26
+ this.headers = options?.headers;
25
27
  this.zIndex = options?.zIndex ?? 0;
26
28
  this.cameraList = [0];
27
29
  if (options && Array.isArray(options.camera)) {
@@ -88,7 +90,7 @@ export class CamOverlayDrawingAPI extends EventEmitter {
88
90
  }
89
91
  createWsClient() {
90
92
  const options = {
91
- ip: this.ip,
93
+ host: this.host,
92
94
  port: this.port,
93
95
  address: '/local/camoverlay/ws',
94
96
  protocol: 'cairo-api',
@@ -96,6 +98,7 @@ export class CamOverlayDrawingAPI extends EventEmitter {
96
98
  pass: this.pass,
97
99
  tls: this.tls,
98
100
  tlsInsecure: this.tlsInsecure,
101
+ headers: this.headers,
99
102
  };
100
103
  this.ws = new WsClient(options);
101
104
  this.ws.onOpen = () => {
@@ -3,10 +3,11 @@ import { WsClient } from './WsClient';
3
3
  export class CamScripterAPICameraEventsGenerator extends EventEmitter {
4
4
  tls;
5
5
  tlsInsecure;
6
- ip;
6
+ host;
7
7
  port;
8
8
  user;
9
9
  pass;
10
+ headers;
10
11
  callId;
11
12
  sendMessages;
12
13
  timeoutCheckTimer;
@@ -16,10 +17,11 @@ export class CamScripterAPICameraEventsGenerator extends EventEmitter {
16
17
  super();
17
18
  this.tls = options?.tls ?? false;
18
19
  this.tlsInsecure = options?.tlsInsecure ?? false;
19
- this.ip = options?.ip ?? '127.0.0.1';
20
+ this.host = options?.host ?? options?.ip ?? '127.0.0.1';
20
21
  this.port = options?.port ?? (this.tls ? 443 : 80);
21
22
  this.user = options?.user ?? '';
22
23
  this.pass = options?.pass ?? '';
24
+ this.headers = options?.headers;
23
25
  this.callId = 0;
24
26
  this.sendMessages = {};
25
27
  this.wsConnected = false;
@@ -61,10 +63,11 @@ export class CamScripterAPICameraEventsGenerator extends EventEmitter {
61
63
  pass: this.pass,
62
64
  tlsInsecure: this.tlsInsecure,
63
65
  tls: this.tls,
64
- ip: this.ip,
66
+ host: this.host,
65
67
  port: this.port,
66
68
  address: `/local/camscripter/ws`,
67
69
  protocol: 'camera-events',
70
+ headers: this.headers,
68
71
  };
69
72
  this.ws = new WsClient(options);
70
73
  this.ws.onOpen = () => {
@@ -2,17 +2,19 @@ import { addParametersToPath } from '../internal/utils';
2
2
  import { HttpRequestSender } from './HttpRequestSender';
3
3
  export class DefaultClient {
4
4
  tls;
5
- ip;
5
+ host;
6
6
  port;
7
7
  user;
8
8
  pass;
9
+ headers;
9
10
  httpRequestSender;
10
11
  constructor(opt = {}) {
11
12
  this.tls = opt.tls ?? false;
12
- this.ip = opt.ip ?? '127.0.0.1';
13
+ this.host = opt.host ?? opt.ip ?? '127.0.0.1';
13
14
  this.port = opt.port ?? (this.tls ? 443 : 80);
14
- this.user = opt.user ?? '';
15
- this.pass = opt.pass ?? '';
15
+ this.user = opt.user;
16
+ this.pass = opt.pass;
17
+ this.headers = opt.headers ?? {};
16
18
  let agentOptions;
17
19
  if (opt.tlsInsecure !== undefined || opt.keepAlive !== undefined) {
18
20
  agentOptions = {
@@ -36,12 +38,12 @@ export class DefaultClient {
36
38
  return {
37
39
  method: method,
38
40
  protocol: this.tls ? 'https:' : 'http:',
39
- host: this.ip,
41
+ host: this.host,
40
42
  port: this.port,
41
43
  path: addParametersToPath(path, params),
42
44
  user: this.user,
43
45
  pass: this.pass,
44
- headers,
46
+ headers: { ...this.headers, ...headers },
45
47
  timeout,
46
48
  };
47
49
  }
@@ -0,0 +1,11 @@
1
+ import { DefaultClient } from './DefaultClient';
2
+ export class DeviceConnectClient extends DefaultClient {
3
+ constructor(deviceAccessToken, host, opt = {}) {
4
+ super({
5
+ ...opt,
6
+ tls: true,
7
+ host: host,
8
+ headers: { authorization: `Bearer ${deviceAccessToken}` },
9
+ });
10
+ }
11
+ }
@@ -0,0 +1,17 @@
1
+ import { WsClient } from './WsClient';
2
+ export class DeviceConnectWsClient extends WsClient {
3
+ constructor(deviceAccessToken, host, opt) {
4
+ const andChar = opt.path.includes('?') ? '&' : '?';
5
+ super({
6
+ ...opt,
7
+ tls: true,
8
+ host: host,
9
+ address: `${opt.path}${andChar}DEVICE_ACCESS_TOKEN=${deviceAccessToken}`,
10
+ });
11
+ this.wsOptions = {
12
+ auth: undefined,
13
+ rejectUnauthorized: !opt.tlsInsecure,
14
+ headers: { ...opt.headers },
15
+ };
16
+ }
17
+ }
@@ -3,19 +3,21 @@ import { WsClient } from './WsClient';
3
3
  export class VapixEvents extends EventEmitter {
4
4
  tls;
5
5
  tlsInsecure;
6
- ip;
6
+ host;
7
7
  port;
8
8
  user;
9
9
  pass;
10
+ headers;
10
11
  ws;
11
12
  constructor(options = {}) {
12
13
  super();
13
14
  this.tls = options.tls ?? false;
14
15
  this.tlsInsecure = options.tlsInsecure ?? false;
15
- this.ip = options.ip ?? '127.0.0.1';
16
+ this.host = options.host ?? options.ip ?? '127.0.0.1';
16
17
  this.port = options.port ?? (this.tls ? 443 : 80);
17
18
  this.user = options.user ?? 'root';
18
19
  this.pass = options.pass ?? '';
20
+ this.headers = options.headers;
19
21
  this.createWsClient();
20
22
  EventEmitter.call(this);
21
23
  }
@@ -31,9 +33,10 @@ export class VapixEvents extends EventEmitter {
31
33
  tlsInsecure: this.tlsInsecure,
32
34
  user: this.user,
33
35
  pass: this.pass,
34
- ip: this.ip,
36
+ host: this.host,
35
37
  port: this.port,
36
38
  address: '/vapix/ws-data-stream?sources=events',
39
+ headers: this.headers,
37
40
  };
38
41
  this.ws = new WsClient(options);
39
42
  this.ws.onOpen = () => {
@@ -15,12 +15,12 @@ export class WsClient {
15
15
  constructor(options) {
16
16
  const tls = options.tls ?? false;
17
17
  const tlsInsecure = options.tlsInsecure ?? false;
18
- const ip = options.ip ?? '127.0.0.1';
18
+ const host = options.host ?? options.ip ?? '127.0.0.1';
19
19
  const port = options.port ?? (tls ? 443 : 80);
20
20
  this.user = options.user ?? '';
21
21
  this.pass = options.pass ?? '';
22
22
  const protocol = tls ? 'wss' : 'ws';
23
- this.address = `${protocol}://${ip}:${port}${options.address}`;
23
+ this.address = `${protocol}://${host}:${port}${options.address}`;
24
24
  this.digestAddress = options.address;
25
25
  this.pingInterval = options.pingInterval ?? 30000;
26
26
  this.protocol = options.protocol;
@@ -58,7 +58,7 @@ export class WsClient {
58
58
  this.isAlive = true;
59
59
  });
60
60
  if (wwwAuthenticateHeader !== undefined) {
61
- this.wsOptions.headers['Authorization'] = new Digest().getAuthHeader(this.user, this.pass, 'GET', this.digestAddress, wwwAuthenticateHeader);
61
+ this.wsOptions.headers['authorization'] = new Digest().getAuthHeader(this.user, this.pass, 'GET', this.digestAddress, wwwAuthenticateHeader);
62
62
  }
63
63
  this.ws.on('unexpected-response', (req, res) => {
64
64
  if (res.statusCode === 401 && res.headers['www-authenticate'] !== undefined) {
package/esm/node/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './DefaultClient';
2
+ export * from './DeviceConnectClient';
3
+ export { DeviceConnectWsClient } from './DeviceConnectWsClient';
2
4
  export * from './WsClient';
3
5
  export * from './HttpServer';
4
6
  export * from './HttpRequestSender';
@@ -369,6 +369,7 @@ export const zonesSchema = z.object({
369
369
  minSpeedKmph: z.number().optional(),
370
370
  maxSpeedKmph: z.number().optional(),
371
371
  flightDirection: z.enum(['all', 'arrival', 'departure']).default('all'),
372
+ runwayDirectionDeg: z.number().min(0).max(360).optional(),
372
373
  weight: z.number(),
373
374
  perimeter: zonePerimeterSchema.default('none'),
374
375
  trackingDomains: z.array(domainIdSchema).default(['adsb', 'remoteId']),
@@ -1,20 +1,22 @@
1
1
  import { addParametersToPath } from '../internal/utils';
2
2
  export class DefaultClient {
3
3
  domain;
4
- constructor(domain = '') {
4
+ headers;
5
+ constructor(domain = '', headers = {}) {
5
6
  this.domain = domain;
7
+ this.headers = headers;
6
8
  }
7
9
  get = (params) => {
8
10
  return this.fetchWithTimeout(addParametersToPath(params.path, params.parameters), {
9
11
  method: 'GET',
10
- headers: params.headers,
12
+ headers: { ...this.headers, ...params.headers },
11
13
  }, params.timeout);
12
14
  };
13
15
  post = (params) => {
14
16
  return this.fetchWithTimeout(addParametersToPath(params.path, params.parameters), {
15
17
  method: 'POST',
16
18
  body: params.data,
17
- headers: params.headers,
19
+ headers: { ...this.headers, ...params.headers },
18
20
  }, params.timeout);
19
21
  };
20
22
  async fetchWithTimeout(path, options, timeout) {
@@ -0,0 +1,6 @@
1
+ import { DefaultClient } from './DefaultClient';
2
+ export class DeviceConnectClient extends DefaultClient {
3
+ constructor(deviceAccessToken, host) {
4
+ super(`https://${host}`, { authorization: `Bearer ${deviceAccessToken}` });
5
+ }
6
+ }
@@ -0,0 +1,10 @@
1
+ import { WsClient } from './WsClient';
2
+ export class DeviceConnectWsClient extends WsClient {
3
+ constructor(deviceAccessToken, host, getPath) {
4
+ super(() => {
5
+ const path = getPath();
6
+ const andChar = path.includes('?') ? '&' : '?';
7
+ return `wss://${host}${path}${andChar}DEVICE_ACCESS_TOKEN=${deviceAccessToken}`;
8
+ });
9
+ }
10
+ }
package/esm/web/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export { DefaultClient } from './DefaultClient';
2
+ export { DeviceConnectClient } from './DeviceConnectClient';
3
+ export { DeviceConnectWsClient } from './DeviceConnectWsClient';
2
4
  export { WsClient } from './WsClient';
package/package.json CHANGED
@@ -1,110 +1,110 @@
1
1
  {
2
- "name": "camstreamerlib",
3
- "version": "4.0.31-e0ed433",
4
- "description": "Helper library for CamStreamer ACAP applications.",
5
- "prettier": "@camstreamer/prettier-config",
6
- "engine": {
7
- "node": ">=18.0.0"
8
- },
9
- "dependencies": {
10
- "adm-zip": "^0.6.0",
11
- "eventemitter2": "^5.0.1",
12
- "fast-xml-parser": "^5.3.6",
13
- "type-fest": "^4.41.0",
14
- "undici": "^6.28.0",
15
- "ws": "^8.18.0",
16
- "zod": "^3.25.76"
17
- },
18
- "devDependencies": {
19
- "@camstreamer/eslint-config": "^1.0.2",
20
- "@camstreamer/prettier-config": "^2.0.4",
21
- "@types/adm-zip": "^0.5.5",
22
- "@types/jest": "^28.0.0",
23
- "@types/node": "^18.19.127",
24
- "@types/ws": "^8.5.10",
25
- "@typescript-eslint/eslint-plugin": "^6.8.0",
26
- "@typescript-eslint/parser": "^6.8.0",
27
- "eslint": "^8.51.0",
28
- "eslint-plugin-deprecation": "^2.0.0",
29
- "eslint-plugin-unused-imports": "^3.0.0",
30
- "jest": "^28.1.3",
31
- "npm-run-all": "^4.1.5",
32
- "prettier": "^2.7.1",
33
- "ts-jest": "^28.0.0",
34
- "ts-node": "^10.7.0",
35
- "typescript": "5.3.3"
36
- },
37
- "overrides": {
38
- "js-yaml": "^4.2.0"
39
- },
40
- "scripts": {
41
- "clean": "rimraf dist/*",
42
- "build": "npm-run-all clean build:cjs build:esm copyPackage",
43
- "build:cjs": "tsc --project tsconfig.cjs.json",
44
- "build:esm": "tsc --project tsconfig.esm.json",
45
- "copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/",
46
- "publishPackage": "./publish.sh",
47
- "lint": "eslint \"src/**/*.ts\"",
48
- "lint:fix": "eslint \"src/**/*.ts\" --fix",
49
- "pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
50
- "pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
51
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
52
- "audit": "npm audit --audit-level=high"
53
- },
54
- "files": [
55
- "/**/*.js",
56
- "/**/*.ts"
57
- ],
58
- "main": "./cjs/index.js",
59
- "module": "./esm/index.js",
60
- "types": "types/index.d.ts",
61
- "exports": {
62
- ".": {
63
- "import": "./esm/index.js",
64
- "require": "./cjs/index.js",
65
- "types": "./types/index.d.ts"
2
+ "name": "camstreamerlib",
3
+ "version": "4.0.31",
4
+ "description": "Helper library for CamStreamer ACAP applications.",
5
+ "prettier": "@camstreamer/prettier-config",
6
+ "engine": {
7
+ "node": ">=18.0.0"
66
8
  },
67
- "./web": {
68
- "import": "./esm/web/index.js",
69
- "require": "./cjs/web/index.js",
70
- "types": "./types/web/index.d.ts"
9
+ "dependencies": {
10
+ "adm-zip": "^0.6.0",
11
+ "eventemitter2": "^5.0.1",
12
+ "fast-xml-parser": "^5.3.6",
13
+ "type-fest": "^4.41.0",
14
+ "undici": "^6.28.0",
15
+ "ws": "^8.18.0",
16
+ "zod": "^3.25.76"
71
17
  },
72
- "./node": {
73
- "import": "./esm/node/index.js",
74
- "require": "./cjs/node/index.js",
75
- "types": "./types/node/index.d.ts"
18
+ "devDependencies": {
19
+ "@camstreamer/eslint-config": "^1.0.2",
20
+ "@camstreamer/prettier-config": "^2.0.4",
21
+ "@types/adm-zip": "^0.5.5",
22
+ "@types/jest": "^28.0.0",
23
+ "@types/node": "^18.19.127",
24
+ "@types/ws": "^8.5.10",
25
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
26
+ "@typescript-eslint/parser": "^6.8.0",
27
+ "eslint": "^8.51.0",
28
+ "eslint-plugin-deprecation": "^2.0.0",
29
+ "eslint-plugin-unused-imports": "^3.0.0",
30
+ "jest": "^28.1.3",
31
+ "npm-run-all": "^4.1.5",
32
+ "prettier": "^2.7.1",
33
+ "ts-jest": "^28.0.0",
34
+ "ts-node": "^10.7.0",
35
+ "typescript": "5.3.3"
76
36
  },
77
- "./cjs/index": {
78
- "import": "./esm/index.js",
79
- "require": "./cjs/index.js",
80
- "types": "./types/index.d.ts"
37
+ "overrides": {
38
+ "js-yaml": "^4.2.0"
81
39
  },
82
- "./cjs/node": {
83
- "import": "./esm/node/index.js",
84
- "require": "./cjs/node/index.js",
85
- "types": "./types/node/index.js"
40
+ "scripts": {
41
+ "clean": "rimraf dist/*",
42
+ "build": "npm-run-all clean build:cjs build:esm copyPackage",
43
+ "build:cjs": "tsc --project tsconfig.cjs.json",
44
+ "build:esm": "tsc --project tsconfig.esm.json",
45
+ "copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/",
46
+ "publishPackage": "./publish.sh",
47
+ "lint": "eslint \"src/**/*.ts\"",
48
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
49
+ "pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
50
+ "pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
51
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
52
+ "audit": "npm audit --audit-level=high"
86
53
  },
87
- "./cjs/node/index": {
88
- "import": "./esm/node/index.js",
89
- "require": "./cjs/node/index.js",
90
- "types": "./types/node/index.js"
91
- }
92
- },
93
- "repository": {
94
- "type": "git",
95
- "url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
96
- },
97
- "keywords": [
98
- "CamStreamer",
99
- "CamOverlay",
100
- "CamScripter",
101
- "Camera",
102
- "Axis"
103
- ],
104
- "author": "CamStreamer s.r.o",
105
- "license": "ISC",
106
- "bugs": {
107
- "url": "https://github.com/CamStreamer/CamStreamerLib/issues"
108
- },
109
- "homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
54
+ "files": [
55
+ "/**/*.js",
56
+ "/**/*.ts"
57
+ ],
58
+ "main": "./cjs/index.js",
59
+ "module": "./esm/index.js",
60
+ "types": "types/index.d.ts",
61
+ "exports": {
62
+ ".": {
63
+ "import": "./esm/index.js",
64
+ "require": "./cjs/index.js",
65
+ "types": "./types/index.d.ts"
66
+ },
67
+ "./web": {
68
+ "import": "./esm/web/index.js",
69
+ "require": "./cjs/web/index.js",
70
+ "types": "./types/web/index.d.ts"
71
+ },
72
+ "./node": {
73
+ "import": "./esm/node/index.js",
74
+ "require": "./cjs/node/index.js",
75
+ "types": "./types/node/index.d.ts"
76
+ },
77
+ "./cjs/index": {
78
+ "import": "./esm/index.js",
79
+ "require": "./cjs/index.js",
80
+ "types": "./types/index.d.ts"
81
+ },
82
+ "./cjs/node": {
83
+ "import": "./esm/node/index.js",
84
+ "require": "./cjs/node/index.js",
85
+ "types": "./types/node/index.js"
86
+ },
87
+ "./cjs/node/index": {
88
+ "import": "./esm/node/index.js",
89
+ "require": "./cjs/node/index.js",
90
+ "types": "./types/node/index.js"
91
+ }
92
+ },
93
+ "repository": {
94
+ "type": "git",
95
+ "url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
96
+ },
97
+ "keywords": [
98
+ "CamStreamer",
99
+ "CamOverlay",
100
+ "CamScripter",
101
+ "Camera",
102
+ "Axis"
103
+ ],
104
+ "author": "CamStreamer s.r.o",
105
+ "license": "ISC",
106
+ "bugs": {
107
+ "url": "https://github.com/CamStreamer/CamStreamerLib/issues"
108
+ },
109
+ "homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
110
110
  }
@@ -268,6 +268,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
268
268
  maxAltitudeAmsl?: number | undefined;
269
269
  minSpeedKmph?: number | undefined;
270
270
  maxSpeedKmph?: number | undefined;
271
+ runwayDirectionDeg?: number | undefined;
271
272
  }[];
272
273
  }>;
273
274
  setZones(zones: TZones, options?: THttpRequestOptions): Promise<void>;
@@ -1,10 +1,12 @@
1
1
  export type Options = {
2
2
  ip?: string;
3
+ host?: string;
3
4
  port?: number;
4
5
  user?: string;
5
6
  pass?: string;
6
7
  tls?: boolean;
7
8
  tlsInsecure?: boolean;
9
+ headers?: Record<string, string>;
8
10
  };
9
11
  export type HttpOptions = Options & {
10
12
  keepAlive?: boolean;
@@ -6,10 +6,11 @@ import { CamOverlayDrawingOptions, TCairoCreateResponse, TCairoResponse, TUpload
6
6
  export declare class CamOverlayDrawingAPI extends EventEmitter {
7
7
  private tls;
8
8
  private tlsInsecure;
9
- private ip;
9
+ private host;
10
10
  private port;
11
11
  private user;
12
12
  private pass;
13
+ private headers?;
13
14
  private cameraList;
14
15
  private zIndex;
15
16
  private callId;
@@ -5,10 +5,11 @@ import { TCamScripterEvent, TEventDeclaration, TEventUndeclaration, TCamScripter
5
5
  export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
6
6
  private tls;
7
7
  private tlsInsecure;
8
- private ip;
8
+ private host;
9
9
  private port;
10
10
  private user;
11
11
  private pass;
12
+ private headers?;
12
13
  private callId;
13
14
  private sendMessages;
14
15
  private timeoutCheckTimer;
@@ -4,10 +4,11 @@ import { IClient, HttpOptions, TGetParams, TPostParams } from '../internal/types
4
4
  import { FormData as UndiciFormData, Response as UndiciResponse } from 'undici';
5
5
  export declare class DefaultClient implements IClient<UndiciResponse, UndiciFormData | Buffer> {
6
6
  private tls;
7
- private ip;
7
+ private host;
8
8
  private port;
9
- private user;
10
- private pass;
9
+ private user?;
10
+ private pass?;
11
+ private headers;
11
12
  private httpRequestSender;
12
13
  constructor(opt?: HttpOptions);
13
14
  get(params: TGetParams): Promise<UndiciResponse>;
@@ -0,0 +1,9 @@
1
+ import { DefaultClient } from './DefaultClient';
2
+ type THttpOptions = {
3
+ tlsInsecure?: boolean;
4
+ keepAlive?: boolean;
5
+ };
6
+ export declare class DeviceConnectClient extends DefaultClient {
7
+ constructor(deviceAccessToken: string, host: string, opt?: THttpOptions);
8
+ }
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import { WsClient } from './WsClient';
2
+ type TWsClientOptions = {
3
+ path: string;
4
+ headers?: Record<string, string>;
5
+ tlsInsecure?: boolean;
6
+ pingInterval?: number;
7
+ protocol?: string;
8
+ };
9
+ export declare class DeviceConnectWsClient extends WsClient {
10
+ constructor(deviceAccessToken: string, host: string, opt: TWsClientOptions);
11
+ }
12
+ export {};