camstreamerlib 4.0.24 → 4.0.25-9526055

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.
@@ -32,6 +32,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
32
32
  ip: string;
33
33
  enabled: boolean;
34
34
  port: number;
35
+ useSystemTime: boolean;
35
36
  };
36
37
  dronetagSource: {
37
38
  enabled: boolean;
package/cjs/VapixAPI.d.ts CHANGED
@@ -56,6 +56,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
56
56
  fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
57
57
  getParameter(paramNames: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
58
58
  setParameter(params: Record<string, string | number | boolean>, options?: THttpRequestOptions): Promise<void>;
59
+ listDefinitions(group: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
60
+ private static collectParameterDefinitions;
59
61
  getGuardTourList(options?: THttpRequestOptions): Promise<{
60
62
  name: string;
61
63
  id: string;
package/cjs/VapixAPI.js CHANGED
@@ -285,6 +285,38 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
285
285
  throw new errors_1.SettingParameterError(responseText);
286
286
  }
287
287
  }
288
+ async listDefinitions(group, options) {
289
+ const xml = await this._getText('/axis-cgi/param.cgi', {
290
+ action: 'listdefinitions',
291
+ listformat: 'xmlschema',
292
+ group: (0, utils_1.arrayToUrl)(group),
293
+ }, options);
294
+ const parser = new fast_xml_parser_1.XMLParser({
295
+ ignoreAttributes: false,
296
+ attributeNamePrefix: '',
297
+ allowBooleanAttributes: true,
298
+ });
299
+ const definitions = {};
300
+ VapixAPI.collectParameterDefinitions(parser.parse(xml), definitions);
301
+ return definitions;
302
+ }
303
+ static collectParameterDefinitions(node, acc) {
304
+ if (node === null || typeof node !== 'object') {
305
+ return;
306
+ }
307
+ for (const [key, value] of Object.entries(node)) {
308
+ if (key === 'parameter') {
309
+ for (const parameter of Array.isArray(value) ? value : [value]) {
310
+ if (!(0, utils_1.isNullish)(parameter?.name) && !(0, utils_1.isNullish)(parameter?.value)) {
311
+ acc[parameter.name] = String(parameter.value);
312
+ }
313
+ }
314
+ }
315
+ else if (value !== null && typeof value === 'object') {
316
+ VapixAPI.collectParameterDefinitions(value, acc);
317
+ }
318
+ }
319
+ }
288
320
  async getGuardTourList(options) {
289
321
  const gTourList = new Array();
290
322
  const response = await this.getParameter('GuardTour', options);
@@ -75,14 +75,17 @@ export declare const cameraSettingsSchema: z.ZodObject<{
75
75
  enabled: z.ZodDefault<z.ZodBoolean>;
76
76
  ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
77
77
  port: z.ZodNumber;
78
+ useSystemTime: z.ZodDefault<z.ZodBoolean>;
78
79
  }, "strip", z.ZodTypeAny, {
79
80
  ip: string;
80
81
  enabled: boolean;
81
82
  port: number;
83
+ useSystemTime: boolean;
82
84
  }, {
83
85
  ip: string;
84
86
  port: number;
85
87
  enabled?: boolean | undefined;
88
+ useSystemTime?: boolean | undefined;
86
89
  }>>;
87
90
  dronetagSource: z.ZodDefault<z.ZodObject<{
88
91
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -441,6 +444,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
441
444
  ip: string;
442
445
  enabled: boolean;
443
446
  port: number;
447
+ useSystemTime: boolean;
444
448
  };
445
449
  dronetagSource: {
446
450
  enabled: boolean;
@@ -573,6 +577,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
573
577
  ip: string;
574
578
  port: number;
575
579
  enabled?: boolean | undefined;
580
+ useSystemTime?: boolean | undefined;
576
581
  } | undefined;
577
582
  dronetagSource?: {
578
583
  enabled?: boolean | undefined;
@@ -54,8 +54,9 @@ exports.cameraSettingsSchema = zod_1.z.object({
54
54
  enabled: zod_1.z.boolean().default(true),
55
55
  ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
56
56
  port: zod_1.z.number().positive().lt(65535),
57
+ useSystemTime: zod_1.z.boolean().default(false),
57
58
  })
58
- .default({ enabled: true, ip: '', port: 30334 }),
59
+ .default({ enabled: true, ip: '', port: 30334, useSystemTime: false }),
59
60
  dronetagSource: zod_1.z
60
61
  .object({
61
62
  enabled: zod_1.z.boolean().default(false),
package/esm/VapixAPI.js CHANGED
@@ -282,6 +282,38 @@ export class VapixAPI extends BasicAPI {
282
282
  throw new SettingParameterError(responseText);
283
283
  }
284
284
  }
285
+ async listDefinitions(group, options) {
286
+ const xml = await this._getText('/axis-cgi/param.cgi', {
287
+ action: 'listdefinitions',
288
+ listformat: 'xmlschema',
289
+ group: arrayToUrl(group),
290
+ }, options);
291
+ const parser = new XMLParser({
292
+ ignoreAttributes: false,
293
+ attributeNamePrefix: '',
294
+ allowBooleanAttributes: true,
295
+ });
296
+ const definitions = {};
297
+ VapixAPI.collectParameterDefinitions(parser.parse(xml), definitions);
298
+ return definitions;
299
+ }
300
+ static collectParameterDefinitions(node, acc) {
301
+ if (node === null || typeof node !== 'object') {
302
+ return;
303
+ }
304
+ for (const [key, value] of Object.entries(node)) {
305
+ if (key === 'parameter') {
306
+ for (const parameter of Array.isArray(value) ? value : [value]) {
307
+ if (!isNullish(parameter?.name) && !isNullish(parameter?.value)) {
308
+ acc[parameter.name] = String(parameter.value);
309
+ }
310
+ }
311
+ }
312
+ else if (value !== null && typeof value === 'object') {
313
+ VapixAPI.collectParameterDefinitions(value, acc);
314
+ }
315
+ }
316
+ }
285
317
  async getGuardTourList(options) {
286
318
  const gTourList = new Array();
287
319
  const response = await this.getParameter('GuardTour', options);
@@ -51,8 +51,9 @@ export const cameraSettingsSchema = z.object({
51
51
  enabled: z.boolean().default(true),
52
52
  ip: z.union([z.string().ip(), z.literal('')]),
53
53
  port: z.number().positive().lt(65535),
54
+ useSystemTime: z.boolean().default(false),
54
55
  })
55
- .default({ enabled: true, ip: '', port: 30334 }),
56
+ .default({ enabled: true, ip: '', port: 30334, useSystemTime: false }),
56
57
  dronetagSource: z
57
58
  .object({
58
59
  enabled: z.boolean().default(false),
package/package.json CHANGED
@@ -1,110 +1,110 @@
1
1
  {
2
- "name": "camstreamerlib",
3
- "version": "4.0.24",
4
- "description": "Helper library for CamStreamer ACAP applications.",
5
- "prettier": "@camstreamer/prettier-config",
6
- "engine": {
7
- "node": ">=18.0.0"
2
+ "name": "camstreamerlib",
3
+ "version": "4.0.25-9526055",
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.5.9",
11
+ "eventemitter2": "^5.0.1",
12
+ "fast-xml-parser": "^5.3.6",
13
+ "type-fest": "^4.41.0",
14
+ "undici": "^6.27.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"
8
66
  },
9
- "dependencies": {
10
- "adm-zip": "^0.5.9",
11
- "eventemitter2": "^5.0.1",
12
- "fast-xml-parser": "^5.3.6",
13
- "type-fest": "^4.41.0",
14
- "undici": "^6.27.0",
15
- "ws": "^8.18.0",
16
- "zod": "^3.25.76"
67
+ "./web": {
68
+ "import": "./esm/web/index.js",
69
+ "require": "./cjs/web/index.js",
70
+ "types": "./types/web/index.d.ts"
17
71
  },
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"
72
+ "./node": {
73
+ "import": "./esm/node/index.js",
74
+ "require": "./cjs/node/index.js",
75
+ "types": "./types/node/index.d.ts"
36
76
  },
37
- "overrides": {
38
- "js-yaml": "^4.2.0"
77
+ "./cjs/index": {
78
+ "import": "./esm/index.js",
79
+ "require": "./cjs/index.js",
80
+ "types": "./types/index.d.ts"
39
81
  },
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"
82
+ "./cjs/node": {
83
+ "import": "./esm/node/index.js",
84
+ "require": "./cjs/node/index.js",
85
+ "types": "./types/node/index.js"
53
86
  },
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"
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
  }
@@ -32,6 +32,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
32
32
  ip: string;
33
33
  enabled: boolean;
34
34
  port: number;
35
+ useSystemTime: boolean;
35
36
  };
36
37
  dronetagSource: {
37
38
  enabled: boolean;
@@ -56,6 +56,8 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
56
56
  fetchSDCardJobProgress(jobId: number, options?: THttpRequestOptions): Promise<number>;
57
57
  getParameter(paramNames: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
58
58
  setParameter(params: Record<string, string | number | boolean>, options?: THttpRequestOptions): Promise<void>;
59
+ listDefinitions(group: string | string[], options?: THttpRequestOptions): Promise<Record<string, string>>;
60
+ private static collectParameterDefinitions;
59
61
  getGuardTourList(options?: THttpRequestOptions): Promise<{
60
62
  name: string;
61
63
  id: string;
@@ -75,14 +75,17 @@ export declare const cameraSettingsSchema: z.ZodObject<{
75
75
  enabled: z.ZodDefault<z.ZodBoolean>;
76
76
  ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
77
77
  port: z.ZodNumber;
78
+ useSystemTime: z.ZodDefault<z.ZodBoolean>;
78
79
  }, "strip", z.ZodTypeAny, {
79
80
  ip: string;
80
81
  enabled: boolean;
81
82
  port: number;
83
+ useSystemTime: boolean;
82
84
  }, {
83
85
  ip: string;
84
86
  port: number;
85
87
  enabled?: boolean | undefined;
88
+ useSystemTime?: boolean | undefined;
86
89
  }>>;
87
90
  dronetagSource: z.ZodDefault<z.ZodObject<{
88
91
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -441,6 +444,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
441
444
  ip: string;
442
445
  enabled: boolean;
443
446
  port: number;
447
+ useSystemTime: boolean;
444
448
  };
445
449
  dronetagSource: {
446
450
  enabled: boolean;
@@ -573,6 +577,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
573
577
  ip: string;
574
578
  port: number;
575
579
  enabled?: boolean | undefined;
580
+ useSystemTime?: boolean | undefined;
576
581
  } | undefined;
577
582
  dronetagSource?: {
578
583
  enabled?: boolean | undefined;