camstreamerlib 4.0.0-beta.34 → 4.0.0-beta.36

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.
@@ -29,7 +29,7 @@ class CamOverlayAPI {
29
29
  }
30
30
  async wsAuthorization(options) {
31
31
  const response = await this._get({ path: `${BASE_PATH}/ws_authorization.cgi` }, options);
32
- return CamOverlayAPI_1.WSResponseSchema.parse(response).data;
32
+ return CamOverlayAPI_1.WSResponseSchema.parse(response).message;
33
33
  }
34
34
  async getMjpegStreamImage(mjpegUrl, options) {
35
35
  return await this._getBlob({
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CamOverlayDrawingAPI = void 0;
4
- const EventEmitter = require("events");
7
+ const events_1 = __importDefault(require("events"));
5
8
  const WsClient_1 = require("./node/WsClient");
6
- class CamOverlayDrawingAPI extends EventEmitter {
9
+ class CamOverlayDrawingAPI extends events_1.default {
7
10
  tls;
8
11
  tlsInsecure;
9
12
  ip;
@@ -37,7 +40,7 @@ class CamOverlayDrawingAPI extends EventEmitter {
37
40
  this.sendMessages = {};
38
41
  this.wsConnected = false;
39
42
  this.createWsClient();
40
- EventEmitter.call(this);
43
+ events_1.default.call(this);
41
44
  }
42
45
  connect() {
43
46
  this.ws.open();
@@ -1,7 +1,30 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.ResourceManager = void 0;
4
- const fs = require("fs/promises");
27
+ const fs = __importStar(require("fs/promises"));
5
28
  class ResourceManager {
6
29
  co;
7
30
  imgFileNames = {};
@@ -21,8 +44,9 @@ class ResourceManager {
21
44
  if (this.images[moniker] !== undefined) {
22
45
  return this.images[moniker];
23
46
  }
24
- if (this.imgFileNames[moniker] !== undefined) {
25
- const imgData = await fs.readFile(this.imgFileNames[moniker]);
47
+ const path = this.imgFileNames[moniker];
48
+ if (path !== undefined) {
49
+ const imgData = await fs.readFile(path);
26
50
  this.images[moniker] = await this.co.uploadImageData(imgData);
27
51
  return this.images[moniker];
28
52
  }
@@ -32,8 +56,9 @@ class ResourceManager {
32
56
  if (this.fonts[moniker] !== undefined) {
33
57
  return this.fonts[moniker];
34
58
  }
35
- if (this.fontFileNames[moniker] !== undefined) {
36
- const fontData = await fs.readFile(this.fontFileNames[moniker]);
59
+ const path = this.fontFileNames[moniker];
60
+ if (path !== undefined) {
61
+ const fontData = await fs.readFile(path);
37
62
  this.fonts[moniker] = await this.co.uploadFontData(fontData);
38
63
  return this.fonts[moniker];
39
64
  }
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CamScripterAPICameraEventsGenerator = void 0;
4
- const EventEmitter = require("events");
7
+ const events_1 = __importDefault(require("events"));
5
8
  const WsClient_1 = require("./node/WsClient");
6
- class CamScripterAPICameraEventsGenerator extends EventEmitter {
9
+ class CamScripterAPICameraEventsGenerator extends events_1.default {
7
10
  tls;
8
11
  tlsInsecure;
9
12
  ip;
@@ -27,7 +30,7 @@ class CamScripterAPICameraEventsGenerator extends EventEmitter {
27
30
  this.sendMessages = {};
28
31
  this.wsConnected = false;
29
32
  this.createWsClient();
30
- EventEmitter.call(this);
33
+ events_1.default.call(this);
31
34
  }
32
35
  connect() {
33
36
  this.ws.open();
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.parseCameraStreamResponse = exports.CamStreamerAPI = void 0;
4
- const zod_1 = require("zod");
7
+ const zod_1 = __importDefault(require("zod"));
5
8
  const ProxyClient_1 = require("./internal/ProxyClient");
6
9
  const utils_1 = require("./internal/utils");
7
10
  const CamStreamerAPI_1 = require("./types/CamStreamerAPI");
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AdmZip = require("adm-zip");
4
- const Path = require("path");
5
- const fs = require("fs");
6
+ const adm_zip_1 = __importDefault(require("adm-zip"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
6
9
  const child_process_1 = require("child_process");
7
10
  const productionModulesFolder = 'production_modules';
8
11
  function isDirectory(path) {
9
- const stat = fs.statSync(path);
12
+ const stat = fs_1.default.statSync(path);
10
13
  return stat.isDirectory();
11
14
  }
12
15
  function getPackageInfo(folder) {
13
16
  try {
14
- const manifest = fs.readFileSync(Path.join(folder, 'manifest.json'));
17
+ const manifest = fs_1.default.readFileSync(path_1.default.join(folder, 'manifest.json'));
15
18
  const manifestParsed = JSON.parse(manifest.toString());
16
19
  return {
17
20
  packageName: manifestParsed.package_name,
@@ -23,10 +26,10 @@ function getPackageInfo(folder) {
23
26
  }
24
27
  }
25
28
  function createZipArchive(zip, folder, options) {
26
- const zipFileRegex = new RegExp(`${Path.basename(folder)}(_[0-9]){3}\\.zip`);
27
- const files = fs.readdirSync(folder);
29
+ const zipFileRegex = new RegExp(`${path_1.default.basename(folder)}(_[0-9]){3}\\.zip`);
30
+ const files = fs_1.default.readdirSync(folder);
28
31
  for (const file of files) {
29
- const path = Path.join(folder, file);
32
+ const path = path_1.default.join(folder, file);
30
33
  const isDir = isDirectory(path);
31
34
  if (file[0] === '.' ||
32
35
  zipFileRegex.test(file) ||
@@ -39,7 +42,7 @@ function createZipArchive(zip, folder, options) {
39
42
  zip.addLocalFolder(path);
40
43
  }
41
44
  else if (file === productionModulesFolder && options.includeNodeModules) {
42
- zip.addLocalFolder(Path.join(productionModulesFolder, 'node_modules'), 'node_modules');
45
+ zip.addLocalFolder(path_1.default.join(productionModulesFolder, 'node_modules'), 'node_modules');
43
46
  }
44
47
  else if (isDir) {
45
48
  zip.addLocalFolder(path, file);
@@ -50,13 +53,13 @@ function createZipArchive(zip, folder, options) {
50
53
  }
51
54
  }
52
55
  function installDependencies() {
53
- if (!fs.existsSync(productionModulesFolder)) {
54
- fs.mkdirSync(productionModulesFolder, {});
56
+ if (!fs_1.default.existsSync(productionModulesFolder)) {
57
+ fs_1.default.mkdirSync(productionModulesFolder, {});
55
58
  }
56
- fs.cpSync('package.json', Path.join(productionModulesFolder, 'package.json'));
57
- fs.cpSync('package-lock.json', Path.join(productionModulesFolder, 'package-lock.json'));
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'));
58
61
  (0, child_process_1.execSync)(`npm ci --omit=dev`, {
59
- cwd: Path.join(process.cwd(), productionModulesFolder),
62
+ cwd: path_1.default.join(process.cwd(), productionModulesFolder),
60
63
  });
61
64
  }
62
65
  function main(args) {
@@ -80,26 +83,26 @@ function main(args) {
80
83
  if (options.includeNodeModules) {
81
84
  installDependencies();
82
85
  }
83
- if (fs.existsSync('dist')) {
86
+ if (fs_1.default.existsSync('dist')) {
84
87
  options.typeScriptPackage = true;
85
88
  }
86
- const folder = Path.resolve('.');
89
+ const folder = path_1.default.resolve('.');
87
90
  const packageInfo = getPackageInfo(folder);
88
91
  if (packageInfo === undefined) {
89
92
  console.error('Package info not found');
90
93
  process.exit(1);
91
94
  }
92
95
  const zipFile = `${options.outputFolder}/${packageInfo.packageName}_${packageInfo.packageVersion}.zip`;
93
- if (fs.existsSync(zipFile)) {
96
+ if (fs_1.default.existsSync(zipFile)) {
94
97
  try {
95
- fs.unlinkSync(zipFile);
98
+ fs_1.default.unlinkSync(zipFile);
96
99
  }
97
100
  catch (error) {
98
101
  console.error('An error occured: ', error);
99
102
  process.exit(1);
100
103
  }
101
104
  }
102
- const zip = new AdmZip();
105
+ const zip = new adm_zip_1.default();
103
106
  createZipArchive(zip, folder, options);
104
107
  zip.writeZip(zipFile);
105
108
  }
package/cjs/VapixAPI.js CHANGED
@@ -345,8 +345,9 @@ class VapixAPI {
345
345
  Object.keys(data)
346
346
  .map(Number)
347
347
  .forEach((camera) => {
348
- if (data[camera] !== undefined) {
349
- res[camera - 1] = data[camera]?.map(({ data: itemData, ...d }) => d);
348
+ const item = data[camera];
349
+ if (item !== undefined) {
350
+ res[camera - 1] = item.map(({ data: itemData, ...d }) => d);
350
351
  }
351
352
  });
352
353
  return res;
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.Digest = void 0;
4
- const crypto = require("crypto");
7
+ const crypto_1 = __importDefault(require("crypto"));
5
8
  class Digest {
6
9
  nonceCount = 1;
7
10
  getAuthHeader(user, pass, method, uri, wwwAuthenticateHeader) {
@@ -13,18 +16,18 @@ class Digest {
13
16
  const value = arg.substring(pos + 1).trim();
14
17
  digestItems[key] = value.replace(/"/g, '');
15
18
  }
16
- const HA1 = crypto.createHash('md5').update(`${user}:${digestItems['realm']}:${pass}`).digest('hex');
17
- const HA2 = crypto.createHash('md5').update(`${method}:${uri}`).digest('hex');
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');
18
21
  const ncValue = ('00000000' + this.nonceCount.toString(16)).slice(-8);
19
22
  let response;
20
23
  if (digestItems['qop'] !== undefined) {
21
- response = crypto
24
+ response = crypto_1.default
22
25
  .createHash('md5')
23
26
  .update(`${HA1}:${digestItems['nonce']}:${ncValue}:162d50aa594e9648:auth:${HA2}`)
24
27
  .digest('hex');
25
28
  }
26
29
  else {
27
- response = crypto.createHash('md5').update(`${HA1}:${digestItems['nonce']}:${HA2}`).digest('hex');
30
+ response = crypto_1.default.createHash('md5').update(`${HA1}:${digestItems['nonce']}:${HA2}`).digest('hex');
28
31
  }
29
32
  let header = 'Digest ' +
30
33
  `username="${user}",` +
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.HttpServer = void 0;
4
- const http = require("http");
5
- const url = require("url");
6
- const fs = require("fs");
7
- const path = require("path");
8
- const EventEmitter = require("events");
9
- class HttpServer extends EventEmitter {
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 {
10
13
  host;
11
14
  port;
12
15
  registeredPaths;
@@ -17,9 +20,9 @@ class HttpServer extends EventEmitter {
17
20
  this.host = options?.host ?? process.env.HTTP_HOST ?? '0.0.0.0';
18
21
  this.port = options?.port ?? parseInt(process.env.HTTP_PORT ?? '80');
19
22
  this.registeredPaths = new Map();
20
- this.server = http.createServer((req, res) => {
23
+ this.server = http_1.default.createServer((req, res) => {
21
24
  this.emit('access', req.method + ' ' + req.url);
22
- const parsedUrl = url.parse(req.url ?? '');
25
+ const parsedUrl = url_1.default.parse(req.url ?? '');
23
26
  parsedUrl.pathname ??= '';
24
27
  const requestCallback = this.registeredPaths.get(parsedUrl.pathname);
25
28
  if (requestCallback) {
@@ -27,7 +30,7 @@ class HttpServer extends EventEmitter {
27
30
  return;
28
31
  }
29
32
  let pathname = `./html${parsedUrl.pathname}`;
30
- const ext = path.parse(pathname).ext;
33
+ const ext = path_1.default.parse(pathname).ext;
31
34
  const map = {
32
35
  '.ico': 'image/x-icon',
33
36
  '.html': 'text/html',
@@ -42,17 +45,17 @@ class HttpServer extends EventEmitter {
42
45
  '.pdf': 'application/pdf',
43
46
  '.doc': 'application/msword',
44
47
  };
45
- fs.access(pathname, fs.constants.R_OK, (err) => {
48
+ fs_1.default.access(pathname, fs_1.default.constants.R_OK, (err) => {
46
49
  if (err) {
47
50
  res.statusCode = 404;
48
51
  res.end(`File ${pathname} not found!`);
49
52
  this.emit('error', `File ${pathname} not found!`);
50
53
  return;
51
54
  }
52
- if (fs.statSync(pathname).isDirectory()) {
55
+ if (fs_1.default.statSync(pathname).isDirectory()) {
53
56
  pathname += `/index${ext}`;
54
57
  }
55
- fs.readFile(pathname, (error, data) => {
58
+ fs_1.default.readFile(pathname, (error, data) => {
56
59
  if (error) {
57
60
  res.statusCode = 500;
58
61
  res.end(`Error getting the file: ${error}`);
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.WsClient = void 0;
4
- const EventEmitter = require("events");
5
- const WebSocket = require("ws");
7
+ const events_1 = __importDefault(require("events"));
8
+ const ws_1 = __importDefault(require("ws"));
6
9
  const Digest_1 = require("./Digest");
7
- class WsClient extends EventEmitter {
10
+ class WsClient extends events_1.default {
8
11
  user;
9
12
  pass;
10
13
  address;
@@ -42,15 +45,15 @@ class WsClient extends EventEmitter {
42
45
  }
43
46
  this.isClosed = false;
44
47
  if (this.protocol === undefined) {
45
- this.ws = new WebSocket(this.address, this.wsOptions);
48
+ this.ws = new ws_1.default(this.address, this.wsOptions);
46
49
  }
47
50
  else {
48
- this.ws = new WebSocket(this.address, this.protocol, this.wsOptions);
51
+ this.ws = new ws_1.default(this.address, this.protocol, this.wsOptions);
49
52
  }
50
53
  this.ws.binaryType = 'arraybuffer';
51
54
  this.isAlive = true;
52
55
  this.pingTimer = setInterval(async () => {
53
- if ((this.ws && this.ws.readyState !== WebSocket.OPEN) || this.isAlive === false) {
56
+ if ((this.ws && this.ws.readyState !== ws_1.default.OPEN) || this.isAlive === false) {
54
57
  this.emit('error', new Error('Connection timeout'));
55
58
  await this.closeWsConnection();
56
59
  }
@@ -122,11 +125,11 @@ class WsClient extends EventEmitter {
122
125
  }
123
126
  wsCopy.removeAllListeners();
124
127
  wsCopy.on('error', () => { });
125
- if (wsCopy.readyState !== WebSocket.CLOSING && wsCopy.readyState !== WebSocket.CLOSED) {
128
+ if (wsCopy.readyState !== ws_1.default.CLOSING && wsCopy.readyState !== ws_1.default.CLOSED) {
126
129
  wsCopy.close();
127
130
  }
128
131
  setTimeout(() => {
129
- if (wsCopy.readyState !== WebSocket.CLOSED) {
132
+ if (wsCopy.readyState !== ws_1.default.CLOSED) {
130
133
  wsCopy.terminate();
131
134
  }
132
135
  }, 5000);
@@ -15,7 +15,6 @@ const scoreBoardSchema_1 = require("./scoreBoardSchema");
15
15
  exports.WSResponseSchema = zod_1.z.object({
16
16
  status: zod_1.z.number(),
17
17
  message: zod_1.z.string(),
18
- data: zod_1.z.string(),
19
18
  });
20
19
  exports.widgetsSchema = zod_1.z.discriminatedUnion('name', [
21
20
  infotickerSchema_1.infoTickerSchema,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WsClient = void 0;
4
- const REFRESH_TIMEOUT = 5_000;
4
+ const REFRESH_TIMEOUT = 5000;
5
5
  class WsClient {
6
6
  getUrl;
7
7
  getAuthToken;
@@ -26,7 +26,7 @@ export class CamOverlayAPI {
26
26
  }
27
27
  async wsAuthorization(options) {
28
28
  const response = await this._get({ path: `${BASE_PATH}/ws_authorization.cgi` }, options);
29
- return WSResponseSchema.parse(response).data;
29
+ return WSResponseSchema.parse(response).message;
30
30
  }
31
31
  async getMjpegStreamImage(mjpegUrl, options) {
32
32
  return await this._getBlob({
@@ -1,4 +1,4 @@
1
- import * as EventEmitter from 'events';
1
+ import EventEmitter from 'events';
2
2
  import { WsClient } from './node/WsClient';
3
3
  export class CamOverlayDrawingAPI extends EventEmitter {
4
4
  tls;
@@ -18,8 +18,9 @@ export class ResourceManager {
18
18
  if (this.images[moniker] !== undefined) {
19
19
  return this.images[moniker];
20
20
  }
21
- if (this.imgFileNames[moniker] !== undefined) {
22
- const imgData = await fs.readFile(this.imgFileNames[moniker]);
21
+ const path = this.imgFileNames[moniker];
22
+ if (path !== undefined) {
23
+ const imgData = await fs.readFile(path);
23
24
  this.images[moniker] = await this.co.uploadImageData(imgData);
24
25
  return this.images[moniker];
25
26
  }
@@ -29,8 +30,9 @@ export class ResourceManager {
29
30
  if (this.fonts[moniker] !== undefined) {
30
31
  return this.fonts[moniker];
31
32
  }
32
- if (this.fontFileNames[moniker] !== undefined) {
33
- const fontData = await fs.readFile(this.fontFileNames[moniker]);
33
+ const path = this.fontFileNames[moniker];
34
+ if (path !== undefined) {
35
+ const fontData = await fs.readFile(path);
34
36
  this.fonts[moniker] = await this.co.uploadFontData(fontData);
35
37
  return this.fonts[moniker];
36
38
  }
@@ -1,4 +1,4 @@
1
- import * as EventEmitter from 'events';
1
+ import EventEmitter from 'events';
2
2
  import { WsClient } from './node/WsClient';
3
3
  export class CamScripterAPICameraEventsGenerator extends EventEmitter {
4
4
  tls;
@@ -1,6 +1,6 @@
1
- import * as AdmZip from 'adm-zip';
2
- import * as Path from 'path';
3
- import * as fs from 'fs';
1
+ import AdmZip from 'adm-zip';
2
+ import Path from 'path';
3
+ import fs from 'fs';
4
4
  import { execSync } from 'child_process';
5
5
  const productionModulesFolder = 'production_modules';
6
6
  function isDirectory(path) {
package/esm/VapixAPI.js CHANGED
@@ -342,8 +342,9 @@ export class VapixAPI {
342
342
  Object.keys(data)
343
343
  .map(Number)
344
344
  .forEach((camera) => {
345
- if (data[camera] !== undefined) {
346
- res[camera - 1] = data[camera]?.map(({ data: itemData, ...d }) => d);
345
+ const item = data[camera];
346
+ if (item !== undefined) {
347
+ res[camera - 1] = item.map(({ data: itemData, ...d }) => d);
347
348
  }
348
349
  });
349
350
  return res;
@@ -1,4 +1,4 @@
1
- import * as crypto from 'crypto';
1
+ import 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 * as http from 'http';
2
- import * as url from 'url';
3
- import * as fs from 'fs';
4
- import * as path from 'path';
5
- import * as EventEmitter from 'events';
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';
6
6
  export class HttpServer extends EventEmitter {
7
7
  host;
8
8
  port;
@@ -1,5 +1,5 @@
1
- import * as EventEmitter from 'events';
2
- import * as WebSocket from 'ws';
1
+ import EventEmitter from 'events';
2
+ import WebSocket from 'ws';
3
3
  import { Digest } from './Digest';
4
4
  export class WsClient extends EventEmitter {
5
5
  user;
@@ -12,7 +12,6 @@ import { baseballScoreBoardAutomaticSchema, baseballScoreBoardSchema, scoreBoard
12
12
  export const WSResponseSchema = z.object({
13
13
  status: z.number(),
14
14
  message: z.string(),
15
- data: z.string(),
16
15
  });
17
16
  export const widgetsSchema = z.discriminatedUnion('name', [
18
17
  infoTickerSchema,
@@ -1,4 +1,4 @@
1
- const REFRESH_TIMEOUT = 5_000;
1
+ const REFRESH_TIMEOUT = 5000;
2
2
  export class WsClient {
3
3
  getUrl;
4
4
  getAuthToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.34",
3
+ "version": "4.0.0-beta.36",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -42,7 +42,6 @@
42
42
  "build:cjs": "tsc --project tsconfig.cjs.json",
43
43
  "build:esm": "tsc --project tsconfig.esm.json",
44
44
  "copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/",
45
- "prepublish": "npm run build",
46
45
  "lint": "eslint \"src/**/*.ts\"",
47
46
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
48
47
  "pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
@@ -54,7 +53,6 @@
54
53
  "/**/*.js",
55
54
  "/**/*.ts"
56
55
  ],
57
- "type": "module",
58
56
  "main": "./cjs/index.js",
59
57
  "module": "./esm/index.js",
60
58
  "types": "types/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
- import * as 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;
@@ -9,7 +9,7 @@ export declare class ResourceManager {
9
9
  constructor(co: CamOverlayDrawingAPI);
10
10
  registerImage(moniker: string, fileName: string): void;
11
11
  registerFont(moniker: string, fileName: string): void;
12
- image(moniker: string): Promise<TUploadImageResponse>;
13
- font(moniker: string): Promise<TCairoCreateResponse>;
12
+ image(moniker: string): Promise<TUploadImageResponse | undefined>;
13
+ font(moniker: string): Promise<TCairoCreateResponse | undefined>;
14
14
  clear(): void;
15
15
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import * as EventEmitter from 'events';
2
+ import EventEmitter from 'events';
3
3
  import { WsOptions } from './internal/types';
4
4
  export type CamScripterOptions = WsOptions;
5
5
  export type TDeclaration = {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import * as http from 'http';
4
- import * as EventEmitter from 'events';
3
+ import http from 'http';
4
+ import EventEmitter from 'events';
5
5
  export type HttpServerOptions = {
6
6
  host?: string;
7
7
  port?: number;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
- import * as EventEmitter from 'events';
4
+ import EventEmitter from 'events';
5
5
  import { WsOptions } from '../internal/types';
6
6
  export type WsClientOptions = WsOptions & {
7
7
  address: string;
@@ -13,15 +13,12 @@ import { baseballScoreBoardAutomaticSchema, baseballScoreBoardSchema, scoreBoard
13
13
  export declare const WSResponseSchema: z.ZodObject<{
14
14
  status: z.ZodNumber;
15
15
  message: z.ZodString;
16
- data: z.ZodString;
17
16
  }, "strip", z.ZodTypeAny, {
18
17
  status: number;
19
18
  message: string;
20
- data: string;
21
19
  }, {
22
20
  status: number;
23
21
  message: string;
24
- data: string;
25
22
  }>;
26
23
  export type TWSResponse = z.infer<typeof WSResponseSchema>;
27
24
  export declare const widgetsSchema: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{