camstreamerlib 4.0.0-beta.65 → 4.0.0-beta.67

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.
@@ -150,6 +150,10 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
150
150
  tiltTransformationCoefA: number;
151
151
  tiltCameraKnownPoint: number;
152
152
  tiltRealKnownPoint: number;
153
+ panErrorCorrection: {
154
+ cameraPan: number;
155
+ realPan: number;
156
+ }[];
153
157
  };
154
158
  }>;
155
159
  exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
@@ -1,20 +1,43 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  const adm_zip_1 = __importDefault(require("adm-zip"));
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
30
+ const path = __importStar(require("path"));
31
+ const fs = __importStar(require("fs"));
9
32
  const child_process_1 = require("child_process");
10
33
  const productionModulesFolder = 'production_modules';
11
- function isDirectory(path) {
12
- const stat = fs_1.default.statSync(path);
34
+ function isDirectory(filePath) {
35
+ const stat = fs.statSync(filePath);
13
36
  return stat.isDirectory();
14
37
  }
15
38
  function getPackageInfo(folder) {
16
39
  try {
17
- const manifest = fs_1.default.readFileSync(path_1.default.join(folder, 'manifest.json'));
40
+ const manifest = fs.readFileSync(path.join(folder, 'manifest.json'));
18
41
  const manifestParsed = JSON.parse(manifest.toString());
19
42
  return {
20
43
  packageName: manifestParsed.package_name,
@@ -26,11 +49,11 @@ function getPackageInfo(folder) {
26
49
  }
27
50
  }
28
51
  function createZipArchive(zip, folder, options) {
29
- const zipFileRegex = new RegExp(`${path_1.default.basename(folder)}(_[0-9]){3}\\.zip`);
30
- const files = fs_1.default.readdirSync(folder);
52
+ const zipFileRegex = new RegExp(`${path.basename(folder)}(_[0-9]){3}\\.zip`);
53
+ const files = fs.readdirSync(folder);
31
54
  for (const file of files) {
32
- const path = path_1.default.join(folder, file);
33
- const isDir = isDirectory(path);
55
+ const filePath = path.join(folder, file);
56
+ const isDir = isDirectory(filePath);
34
57
  if (file[0] === '.' ||
35
58
  zipFileRegex.test(file) ||
36
59
  file === 'node_modules' ||
@@ -39,27 +62,27 @@ function createZipArchive(zip, folder, options) {
39
62
  continue;
40
63
  }
41
64
  else if (file === 'dist' && options.typeScriptPackage) {
42
- zip.addLocalFolder(path);
65
+ zip.addLocalFolder(filePath);
43
66
  }
44
67
  else if (file === productionModulesFolder && options.includeNodeModules) {
45
- zip.addLocalFolder(path_1.default.join(productionModulesFolder, 'node_modules'), 'node_modules');
68
+ zip.addLocalFolder(path.join(productionModulesFolder, 'node_modules'), 'node_modules');
46
69
  }
47
70
  else if (isDir) {
48
- zip.addLocalFolder(path, file);
71
+ zip.addLocalFolder(filePath, file);
49
72
  }
50
73
  else {
51
- zip.addLocalFile(path);
74
+ zip.addLocalFile(filePath);
52
75
  }
53
76
  }
54
77
  }
55
78
  function installDependencies() {
56
- if (!fs_1.default.existsSync(productionModulesFolder)) {
57
- fs_1.default.mkdirSync(productionModulesFolder, {});
79
+ if (!fs.existsSync(productionModulesFolder)) {
80
+ fs.mkdirSync(productionModulesFolder, {});
58
81
  }
59
- fs_1.default.cpSync('package.json', path_1.default.join(productionModulesFolder, 'package.json'));
60
- fs_1.default.cpSync('package-lock.json', path_1.default.join(productionModulesFolder, 'package-lock.json'));
82
+ fs.cpSync('package.json', path.join(productionModulesFolder, 'package.json'));
83
+ fs.cpSync('package-lock.json', path.join(productionModulesFolder, 'package-lock.json'));
61
84
  (0, child_process_1.execSync)(`npm ci --omit=dev`, {
62
- cwd: path_1.default.join(process.cwd(), productionModulesFolder),
85
+ cwd: path.join(process.cwd(), productionModulesFolder),
63
86
  });
64
87
  }
65
88
  function main(args) {
@@ -83,19 +106,19 @@ function main(args) {
83
106
  if (options.includeNodeModules) {
84
107
  installDependencies();
85
108
  }
86
- if (fs_1.default.existsSync('dist')) {
109
+ if (fs.existsSync('dist')) {
87
110
  options.typeScriptPackage = true;
88
111
  }
89
- const folder = path_1.default.resolve('.');
112
+ const folder = path.resolve('.');
90
113
  const packageInfo = getPackageInfo(folder);
91
114
  if (packageInfo === undefined) {
92
115
  console.error('Package info not found');
93
116
  process.exit(1);
94
117
  }
95
118
  const zipFile = `${options.outputFolder}/${packageInfo.packageName}_${packageInfo.packageVersion}.zip`;
96
- if (fs_1.default.existsSync(zipFile)) {
119
+ if (fs.existsSync(zipFile)) {
97
120
  try {
98
- fs_1.default.unlinkSync(zipFile);
121
+ fs.unlinkSync(zipFile);
99
122
  }
100
123
  catch (error) {
101
124
  console.error('An error occured: ', error);
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
- import EventEmitter from 'events';
4
+ import { EventEmitter } from 'events';
5
5
  import { CamOverlayDrawingOptions, TCairoCreateResponse, TCairoResponse, TUploadImageResponse, TWriteTextParams } from '../types/CamOverlayDrawingAPI';
6
6
  export declare class CamOverlayDrawingAPI extends EventEmitter {
7
7
  private tls;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.CamOverlayDrawingAPI = void 0;
7
- const events_1 = __importDefault(require("events"));
4
+ const events_1 = require("events");
8
5
  const WsClient_1 = require("./WsClient");
9
- class CamOverlayDrawingAPI extends events_1.default {
6
+ class CamOverlayDrawingAPI extends events_1.EventEmitter {
10
7
  tls;
11
8
  tlsInsecure;
12
9
  ip;
@@ -40,7 +37,7 @@ class CamOverlayDrawingAPI extends events_1.default {
40
37
  this.sendMessages = {};
41
38
  this.wsConnected = false;
42
39
  this.createWsClient();
43
- events_1.default.call(this);
40
+ events_1.EventEmitter.call(this);
44
41
  }
45
42
  connect() {
46
43
  this.ws.open();
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import EventEmitter from 'events';
2
+ import { EventEmitter } from 'events';
3
3
  import { Options } from '../internal/types';
4
4
  import { TCamScripterEvent, TEventDeclaration, TEventUndeclaration, TCamScripterResponse } from '../types/CamScripterAPICameraEventsGenerator';
5
5
  export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.CamScripterAPICameraEventsGenerator = void 0;
7
- const events_1 = __importDefault(require("events"));
4
+ const events_1 = require("events");
8
5
  const WsClient_1 = require("./WsClient");
9
- class CamScripterAPICameraEventsGenerator extends events_1.default {
6
+ class CamScripterAPICameraEventsGenerator extends events_1.EventEmitter {
10
7
  tls;
11
8
  tlsInsecure;
12
9
  ip;
@@ -30,7 +27,7 @@ class CamScripterAPICameraEventsGenerator extends events_1.default {
30
27
  this.sendMessages = {};
31
28
  this.wsConnected = false;
32
29
  this.createWsClient();
33
- events_1.default.call(this);
30
+ events_1.EventEmitter.call(this);
34
31
  }
35
32
  connect() {
36
33
  this.ws.open();
@@ -1,10 +1,30 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.Digest = void 0;
7
- const crypto_1 = __importDefault(require("crypto"));
27
+ const crypto = __importStar(require("crypto"));
8
28
  class Digest {
9
29
  nonceCount = 1;
10
30
  getAuthHeader(user, pass, method, uri, wwwAuthenticateHeader) {
@@ -16,18 +36,18 @@ class Digest {
16
36
  const value = arg.substring(pos + 1).trim();
17
37
  digestItems[key] = value.replace(/"/g, '');
18
38
  }
19
- const HA1 = crypto_1.default.createHash('md5').update(`${user}:${digestItems['realm']}:${pass}`).digest('hex');
20
- const HA2 = crypto_1.default.createHash('md5').update(`${method}:${uri}`).digest('hex');
39
+ const HA1 = crypto.createHash('md5').update(`${user}:${digestItems['realm']}:${pass}`).digest('hex');
40
+ const HA2 = crypto.createHash('md5').update(`${method}:${uri}`).digest('hex');
21
41
  const ncValue = ('00000000' + this.nonceCount.toString(16)).slice(-8);
22
42
  let response;
23
43
  if (digestItems['qop'] !== undefined) {
24
- response = crypto_1.default
44
+ response = crypto
25
45
  .createHash('md5')
26
46
  .update(`${HA1}:${digestItems['nonce']}:${ncValue}:162d50aa594e9648:auth:${HA2}`)
27
47
  .digest('hex');
28
48
  }
29
49
  else {
30
- response = crypto_1.default.createHash('md5').update(`${HA1}:${digestItems['nonce']}:${HA2}`).digest('hex');
50
+ response = crypto.createHash('md5').update(`${HA1}:${digestItems['nonce']}:${HA2}`).digest('hex');
31
51
  }
32
52
  let header = 'Digest ' +
33
53
  `username="${user}",` +
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import http from 'http';
4
- import EventEmitter from 'events';
3
+ import * as http from 'http';
4
+ import { EventEmitter } from 'events';
5
5
  export type HttpServerOptions = {
6
6
  host?: string;
7
7
  port?: number;
@@ -1,15 +1,35 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.HttpServer = void 0;
7
- const http_1 = __importDefault(require("http"));
8
- const url_1 = __importDefault(require("url"));
9
- const fs_1 = __importDefault(require("fs"));
10
- const path_1 = __importDefault(require("path"));
11
- const events_1 = __importDefault(require("events"));
12
- class HttpServer extends events_1.default {
27
+ const http = __importStar(require("http"));
28
+ const url = __importStar(require("url"));
29
+ const fs = __importStar(require("fs"));
30
+ const path = __importStar(require("path"));
31
+ const events_1 = require("events");
32
+ class HttpServer extends events_1.EventEmitter {
13
33
  host;
14
34
  port;
15
35
  registeredPaths;
@@ -20,9 +40,9 @@ class HttpServer extends events_1.default {
20
40
  this.host = options?.host ?? process.env.HTTP_HOST ?? '0.0.0.0';
21
41
  this.port = options?.port ?? parseInt(process.env.HTTP_PORT ?? '80');
22
42
  this.registeredPaths = new Map();
23
- this.server = http_1.default.createServer((req, res) => {
43
+ this.server = http.createServer((req, res) => {
24
44
  this.emit('access', req.method + ' ' + req.url);
25
- const parsedUrl = url_1.default.parse(req.url ?? '');
45
+ const parsedUrl = url.parse(req.url ?? '');
26
46
  parsedUrl.pathname ??= '';
27
47
  const requestCallback = this.registeredPaths.get(parsedUrl.pathname);
28
48
  if (requestCallback) {
@@ -30,7 +50,7 @@ class HttpServer extends events_1.default {
30
50
  return;
31
51
  }
32
52
  let pathname = `./html${parsedUrl.pathname}`;
33
- const ext = path_1.default.parse(pathname).ext;
53
+ const ext = path.parse(pathname).ext;
34
54
  const map = {
35
55
  '.ico': 'image/x-icon',
36
56
  '.html': 'text/html',
@@ -45,17 +65,17 @@ class HttpServer extends events_1.default {
45
65
  '.pdf': 'application/pdf',
46
66
  '.doc': 'application/msword',
47
67
  };
48
- fs_1.default.access(pathname, fs_1.default.constants.R_OK, (err) => {
68
+ fs.access(pathname, fs.constants.R_OK, (err) => {
49
69
  if (err) {
50
70
  res.statusCode = 404;
51
71
  res.end(`File ${pathname} not found!`);
52
72
  this.emit('error', `File ${pathname} not found!`);
53
73
  return;
54
74
  }
55
- if (fs_1.default.statSync(pathname).isDirectory()) {
75
+ if (fs.statSync(pathname).isDirectory()) {
56
76
  pathname += `/index${ext}`;
57
77
  }
58
- fs_1.default.readFile(pathname, (error, data) => {
78
+ fs.readFile(pathname, (error, data) => {
59
79
  if (error) {
60
80
  res.statusCode = 500;
61
81
  res.end(`Error getting the file: ${error}`);
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.WsClient = void 0;
7
- const ws_1 = __importDefault(require("ws"));
4
+ const ws_1 = require("ws");
8
5
  const Digest_1 = require("./Digest");
9
6
  class WsClient {
10
7
  user;
@@ -43,15 +40,15 @@ class WsClient {
43
40
  }
44
41
  this.isClosed = false;
45
42
  if (this.protocol === undefined) {
46
- this.ws = new ws_1.default(this.address, this.wsOptions);
43
+ this.ws = new ws_1.WebSocket(this.address, this.wsOptions);
47
44
  }
48
45
  else {
49
- this.ws = new ws_1.default(this.address, this.protocol, this.wsOptions);
46
+ this.ws = new ws_1.WebSocket(this.address, this.protocol, this.wsOptions);
50
47
  }
51
48
  this.ws.binaryType = 'arraybuffer';
52
49
  this.isAlive = true;
53
50
  this.pingTimer = setInterval(() => {
54
- if ((this.ws && this.ws.readyState !== ws_1.default.OPEN) || this.isAlive === false) {
51
+ if ((this.ws && this.ws.readyState !== ws_1.WebSocket.OPEN) || this.isAlive === false) {
55
52
  this.onError(new Error('Connection timeout'));
56
53
  this.closeWsConnection();
57
54
  }
@@ -132,11 +129,11 @@ class WsClient {
132
129
  }
133
130
  wsCopy.removeAllListeners();
134
131
  wsCopy.on('error', () => { });
135
- if (wsCopy.readyState !== ws_1.default.CLOSING && wsCopy.readyState !== ws_1.default.CLOSED) {
132
+ if (wsCopy.readyState !== ws_1.WebSocket.CLOSING && wsCopy.readyState !== ws_1.WebSocket.CLOSED) {
136
133
  wsCopy.close();
137
134
  }
138
135
  setTimeout(() => {
139
- if (wsCopy.readyState !== ws_1.default.CLOSED) {
136
+ if (wsCopy.readyState !== ws_1.WebSocket.CLOSED) {
140
137
  wsCopy.terminate();
141
138
  }
142
139
  }, 5000);
@@ -629,6 +629,16 @@ export declare const serverSettingsSchema: z.ZodObject<{
629
629
  tiltTransformationCoefA: z.ZodNumber;
630
630
  tiltCameraKnownPoint: z.ZodNumber;
631
631
  tiltRealKnownPoint: z.ZodNumber;
632
+ panErrorCorrection: z.ZodDefault<z.ZodArray<z.ZodObject<{
633
+ cameraPan: z.ZodNumber;
634
+ realPan: z.ZodNumber;
635
+ }, "strip", z.ZodTypeAny, {
636
+ cameraPan: number;
637
+ realPan: number;
638
+ }, {
639
+ cameraPan: number;
640
+ realPan: number;
641
+ }>, "many">>;
632
642
  }, "strip", z.ZodTypeAny, {
633
643
  posLat: number;
634
644
  posLon: number;
@@ -640,6 +650,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
640
650
  tiltTransformationCoefA: number;
641
651
  tiltCameraKnownPoint: number;
642
652
  tiltRealKnownPoint: number;
653
+ panErrorCorrection: {
654
+ cameraPan: number;
655
+ realPan: number;
656
+ }[];
643
657
  }, {
644
658
  posLat: number;
645
659
  posLon: number;
@@ -651,6 +665,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
651
665
  tiltTransformationCoefA: number;
652
666
  tiltCameraKnownPoint: number;
653
667
  tiltRealKnownPoint: number;
668
+ panErrorCorrection?: {
669
+ cameraPan: number;
670
+ realPan: number;
671
+ }[] | undefined;
654
672
  }>>;
655
673
  }, "strip", z.ZodTypeAny, {
656
674
  cameraCalibration: {
@@ -664,6 +682,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
664
682
  tiltTransformationCoefA: number;
665
683
  tiltCameraKnownPoint: number;
666
684
  tiltRealKnownPoint: number;
685
+ panErrorCorrection: {
686
+ cameraPan: number;
687
+ realPan: number;
688
+ }[];
667
689
  };
668
690
  }, {
669
691
  cameraCalibration?: {
@@ -677,6 +699,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
677
699
  tiltTransformationCoefA: number;
678
700
  tiltCameraKnownPoint: number;
679
701
  tiltRealKnownPoint: number;
702
+ panErrorCorrection?: {
703
+ cameraPan: number;
704
+ realPan: number;
705
+ }[] | undefined;
680
706
  } | undefined;
681
707
  }>;
682
708
  export type TServerSettings = z.infer<typeof serverSettingsSchema>;
@@ -227,6 +227,12 @@ exports.serverSettingsSchema = zod_1.z.object({
227
227
  tiltTransformationCoefA: zod_1.z.number(),
228
228
  tiltCameraKnownPoint: zod_1.z.number(),
229
229
  tiltRealKnownPoint: zod_1.z.number(),
230
+ panErrorCorrection: zod_1.z
231
+ .array(zod_1.z.object({
232
+ cameraPan: zod_1.z.number(),
233
+ realPan: zod_1.z.number(),
234
+ }))
235
+ .default([]),
230
236
  })
231
237
  .default({
232
238
  posLat: 50,
@@ -239,6 +245,7 @@ exports.serverSettingsSchema = zod_1.z.object({
239
245
  tiltTransformationCoefA: 1.0,
240
246
  tiltCameraKnownPoint: 90,
241
247
  tiltRealKnownPoint: 90,
248
+ panErrorCorrection: [],
242
249
  }),
243
250
  });
244
251
  exports.getIcaoSchema = zod_1.z.object({
@@ -1,15 +1,15 @@
1
1
  import AdmZip from 'adm-zip';
2
- import Path from 'path';
3
- import fs from 'fs';
2
+ import * as path from 'path';
3
+ import * as fs from 'fs';
4
4
  import { execSync } from 'child_process';
5
5
  const productionModulesFolder = 'production_modules';
6
- function isDirectory(path) {
7
- const stat = fs.statSync(path);
6
+ function isDirectory(filePath) {
7
+ const stat = fs.statSync(filePath);
8
8
  return stat.isDirectory();
9
9
  }
10
10
  function getPackageInfo(folder) {
11
11
  try {
12
- const manifest = fs.readFileSync(Path.join(folder, 'manifest.json'));
12
+ const manifest = fs.readFileSync(path.join(folder, 'manifest.json'));
13
13
  const manifestParsed = JSON.parse(manifest.toString());
14
14
  return {
15
15
  packageName: manifestParsed.package_name,
@@ -21,11 +21,11 @@ function getPackageInfo(folder) {
21
21
  }
22
22
  }
23
23
  function createZipArchive(zip, folder, options) {
24
- const zipFileRegex = new RegExp(`${Path.basename(folder)}(_[0-9]){3}\\.zip`);
24
+ const zipFileRegex = new RegExp(`${path.basename(folder)}(_[0-9]){3}\\.zip`);
25
25
  const files = fs.readdirSync(folder);
26
26
  for (const file of files) {
27
- const path = Path.join(folder, file);
28
- const isDir = isDirectory(path);
27
+ const filePath = path.join(folder, file);
28
+ const isDir = isDirectory(filePath);
29
29
  if (file[0] === '.' ||
30
30
  zipFileRegex.test(file) ||
31
31
  file === 'node_modules' ||
@@ -34,16 +34,16 @@ function createZipArchive(zip, folder, options) {
34
34
  continue;
35
35
  }
36
36
  else if (file === 'dist' && options.typeScriptPackage) {
37
- zip.addLocalFolder(path);
37
+ zip.addLocalFolder(filePath);
38
38
  }
39
39
  else if (file === productionModulesFolder && options.includeNodeModules) {
40
- zip.addLocalFolder(Path.join(productionModulesFolder, 'node_modules'), 'node_modules');
40
+ zip.addLocalFolder(path.join(productionModulesFolder, 'node_modules'), 'node_modules');
41
41
  }
42
42
  else if (isDir) {
43
- zip.addLocalFolder(path, file);
43
+ zip.addLocalFolder(filePath, file);
44
44
  }
45
45
  else {
46
- zip.addLocalFile(path);
46
+ zip.addLocalFile(filePath);
47
47
  }
48
48
  }
49
49
  }
@@ -51,10 +51,10 @@ function installDependencies() {
51
51
  if (!fs.existsSync(productionModulesFolder)) {
52
52
  fs.mkdirSync(productionModulesFolder, {});
53
53
  }
54
- fs.cpSync('package.json', Path.join(productionModulesFolder, 'package.json'));
55
- fs.cpSync('package-lock.json', Path.join(productionModulesFolder, 'package-lock.json'));
54
+ fs.cpSync('package.json', path.join(productionModulesFolder, 'package.json'));
55
+ fs.cpSync('package-lock.json', path.join(productionModulesFolder, 'package-lock.json'));
56
56
  execSync(`npm ci --omit=dev`, {
57
- cwd: Path.join(process.cwd(), productionModulesFolder),
57
+ cwd: path.join(process.cwd(), productionModulesFolder),
58
58
  });
59
59
  }
60
60
  function main(args) {
@@ -81,7 +81,7 @@ function main(args) {
81
81
  if (fs.existsSync('dist')) {
82
82
  options.typeScriptPackage = true;
83
83
  }
84
- const folder = Path.resolve('.');
84
+ const folder = path.resolve('.');
85
85
  const packageInfo = getPackageInfo(folder);
86
86
  if (packageInfo === undefined) {
87
87
  console.error('Package info not found');
@@ -1,4 +1,4 @@
1
- import EventEmitter from 'events';
1
+ import { EventEmitter } from 'events';
2
2
  import { WsClient } from './WsClient';
3
3
  export class CamOverlayDrawingAPI extends EventEmitter {
4
4
  tls;
@@ -1,4 +1,4 @@
1
- import EventEmitter from 'events';
1
+ import { EventEmitter } from 'events';
2
2
  import { WsClient } from './WsClient';
3
3
  export class CamScripterAPICameraEventsGenerator extends EventEmitter {
4
4
  tls;
@@ -1,4 +1,4 @@
1
- import crypto from 'crypto';
1
+ import * as crypto from 'crypto';
2
2
  export class Digest {
3
3
  nonceCount = 1;
4
4
  getAuthHeader(user, pass, method, uri, wwwAuthenticateHeader) {
@@ -1,8 +1,8 @@
1
- import http from 'http';
2
- import url from 'url';
3
- import fs from 'fs';
4
- import path from 'path';
5
- import EventEmitter from 'events';
1
+ import * as http from 'http';
2
+ import * as url from 'url';
3
+ import * as fs from 'fs';
4
+ import * as path from 'path';
5
+ import { EventEmitter } from 'events';
6
6
  export class HttpServer extends EventEmitter {
7
7
  host;
8
8
  port;
@@ -1,4 +1,4 @@
1
- import WebSocket from 'ws';
1
+ import { WebSocket } from 'ws';
2
2
  import { Digest } from './Digest';
3
3
  export class WsClient {
4
4
  user;
@@ -224,6 +224,12 @@ export const serverSettingsSchema = z.object({
224
224
  tiltTransformationCoefA: z.number(),
225
225
  tiltCameraKnownPoint: z.number(),
226
226
  tiltRealKnownPoint: z.number(),
227
+ panErrorCorrection: z
228
+ .array(z.object({
229
+ cameraPan: z.number(),
230
+ realPan: z.number(),
231
+ }))
232
+ .default([]),
227
233
  })
228
234
  .default({
229
235
  posLat: 50,
@@ -236,6 +242,7 @@ export const serverSettingsSchema = z.object({
236
242
  tiltTransformationCoefA: 1.0,
237
243
  tiltCameraKnownPoint: 90,
238
244
  tiltRealKnownPoint: 90,
245
+ panErrorCorrection: [],
239
246
  }),
240
247
  });
241
248
  export const getIcaoSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.65",
3
+ "version": "4.0.0-beta.67",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -150,6 +150,10 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
150
150
  tiltTransformationCoefA: number;
151
151
  tiltCameraKnownPoint: number;
152
152
  tiltRealKnownPoint: number;
153
+ panErrorCorrection: {
154
+ cameraPan: number;
155
+ realPan: number;
156
+ }[];
153
157
  };
154
158
  }>;
155
159
  exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
- import EventEmitter from 'events';
4
+ import { EventEmitter } from 'events';
5
5
  import { CamOverlayDrawingOptions, TCairoCreateResponse, TCairoResponse, TUploadImageResponse, TWriteTextParams } from '../types/CamOverlayDrawingAPI';
6
6
  export declare class CamOverlayDrawingAPI extends EventEmitter {
7
7
  private tls;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import EventEmitter from 'events';
2
+ import { EventEmitter } from 'events';
3
3
  import { Options } from '../internal/types';
4
4
  import { TCamScripterEvent, TEventDeclaration, TEventUndeclaration, TCamScripterResponse } from '../types/CamScripterAPICameraEventsGenerator';
5
5
  export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import http from 'http';
4
- import EventEmitter from 'events';
3
+ import * as http from 'http';
4
+ import { EventEmitter } from 'events';
5
5
  export type HttpServerOptions = {
6
6
  host?: string;
7
7
  port?: number;
@@ -629,6 +629,16 @@ export declare const serverSettingsSchema: z.ZodObject<{
629
629
  tiltTransformationCoefA: z.ZodNumber;
630
630
  tiltCameraKnownPoint: z.ZodNumber;
631
631
  tiltRealKnownPoint: z.ZodNumber;
632
+ panErrorCorrection: z.ZodDefault<z.ZodArray<z.ZodObject<{
633
+ cameraPan: z.ZodNumber;
634
+ realPan: z.ZodNumber;
635
+ }, "strip", z.ZodTypeAny, {
636
+ cameraPan: number;
637
+ realPan: number;
638
+ }, {
639
+ cameraPan: number;
640
+ realPan: number;
641
+ }>, "many">>;
632
642
  }, "strip", z.ZodTypeAny, {
633
643
  posLat: number;
634
644
  posLon: number;
@@ -640,6 +650,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
640
650
  tiltTransformationCoefA: number;
641
651
  tiltCameraKnownPoint: number;
642
652
  tiltRealKnownPoint: number;
653
+ panErrorCorrection: {
654
+ cameraPan: number;
655
+ realPan: number;
656
+ }[];
643
657
  }, {
644
658
  posLat: number;
645
659
  posLon: number;
@@ -651,6 +665,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
651
665
  tiltTransformationCoefA: number;
652
666
  tiltCameraKnownPoint: number;
653
667
  tiltRealKnownPoint: number;
668
+ panErrorCorrection?: {
669
+ cameraPan: number;
670
+ realPan: number;
671
+ }[] | undefined;
654
672
  }>>;
655
673
  }, "strip", z.ZodTypeAny, {
656
674
  cameraCalibration: {
@@ -664,6 +682,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
664
682
  tiltTransformationCoefA: number;
665
683
  tiltCameraKnownPoint: number;
666
684
  tiltRealKnownPoint: number;
685
+ panErrorCorrection: {
686
+ cameraPan: number;
687
+ realPan: number;
688
+ }[];
667
689
  };
668
690
  }, {
669
691
  cameraCalibration?: {
@@ -677,6 +699,10 @@ export declare const serverSettingsSchema: z.ZodObject<{
677
699
  tiltTransformationCoefA: number;
678
700
  tiltCameraKnownPoint: number;
679
701
  tiltRealKnownPoint: number;
702
+ panErrorCorrection?: {
703
+ cameraPan: number;
704
+ realPan: number;
705
+ }[] | undefined;
680
706
  } | undefined;
681
707
  }>;
682
708
  export type TServerSettings = z.infer<typeof serverSettingsSchema>;