camstreamerlib 4.0.0-beta.35 → 4.0.0-beta.37
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.
- package/cjs/CamOverlayAPI.js +15 -15
- package/cjs/CamOverlayDrawingAPI.js +6 -3
- package/cjs/CamOverlayPainter/ResourceManager.js +30 -5
- package/cjs/CamScripterAPICameraEventsGenerator.js +6 -3
- package/cjs/CamStreamerAPI.js +4 -1
- package/cjs/CreatePackage.js +22 -19
- package/cjs/VapixAPI.js +3 -2
- package/cjs/node/Digest.js +8 -5
- package/cjs/node/HttpServer.js +15 -12
- package/cjs/node/WsClient.js +11 -8
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +17 -17
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +7 -7
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +5 -5
- package/cjs/types/CamOverlayAPI/imagesSchema.js +4 -4
- package/cjs/types/CamOverlayAPI/index.js +1 -1
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +6 -6
- package/cjs/types/CamOverlayAPI/pipSchema.js +4 -4
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +4 -4
- package/cjs/types/CamOverlayAPI/ptzSchema.js +4 -4
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +8 -8
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +3 -3
- package/cjs/types/CamOverlayAPI/{widgetCommonTypes.js → serviceCommonTypes.js} +8 -4
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +3 -3
- package/cjs/web/WsClient.js +1 -1
- package/esm/CamOverlayAPI.js +16 -16
- package/esm/CamOverlayDrawingAPI.js +1 -1
- package/esm/CamOverlayPainter/ResourceManager.js +6 -4
- package/esm/CamScripterAPICameraEventsGenerator.js +1 -1
- package/esm/CreatePackage.js +3 -3
- package/esm/VapixAPI.js +3 -2
- package/esm/node/Digest.js +1 -1
- package/esm/node/HttpServer.js +5 -5
- package/esm/node/WsClient.js +2 -2
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +16 -16
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +3 -3
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +3 -3
- package/esm/types/CamOverlayAPI/imagesSchema.js +3 -3
- package/esm/types/CamOverlayAPI/index.js +1 -1
- package/esm/types/CamOverlayAPI/infotickerSchema.js +3 -3
- package/esm/types/CamOverlayAPI/pipSchema.js +3 -3
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +3 -3
- package/esm/types/CamOverlayAPI/ptzSchema.js +3 -3
- package/esm/types/CamOverlayAPI/scoreBoardSchema.js +5 -5
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +2 -2
- package/esm/types/CamOverlayAPI/{widgetCommonTypes.js → serviceCommonTypes.js} +7 -3
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +2 -2
- package/esm/web/WsClient.js +1 -1
- package/package.json +1 -3
- package/types/CamOverlayAPI.d.ts +821 -5
- package/types/CamOverlayDrawingAPI.d.ts +1 -1
- package/types/CamOverlayPainter/ResourceManager.d.ts +2 -2
- package/types/CamScripterAPICameraEventsGenerator.d.ts +1 -1
- package/types/node/HttpServer.d.ts +2 -2
- package/types/node/WsClient.d.ts +1 -1
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +18 -18
- package/types/types/CamOverlayAPI/index.d.ts +1 -1
- package/types/types/CamOverlayAPI/{widgetCommonTypes.d.ts → serviceCommonTypes.d.ts} +6 -2
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ptzCompassSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
exports.ptzCompassSchema =
|
|
7
|
-
name: zod_1.z.literal(
|
|
5
|
+
const serviceCommonTypes_1 = require("./serviceCommonTypes");
|
|
6
|
+
exports.ptzCompassSchema = serviceCommonTypes_1.serviceCommonSchema.extend({
|
|
7
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.ptzCompass),
|
|
8
8
|
pos_x: zod_1.z.number(),
|
|
9
9
|
pos_y: zod_1.z.number(),
|
|
10
|
-
coordSystem:
|
|
10
|
+
coordSystem: serviceCommonTypes_1.coordinateSystemSchema,
|
|
11
11
|
scale: zod_1.z.number().nonnegative(),
|
|
12
12
|
type: zod_1.z.union([zod_1.z.literal('compass'), zod_1.z.literal('map'), zod_1.z.literal('image')]),
|
|
13
13
|
image: zod_1.z.union([zod_1.z.string().url(), zod_1.z.literal('')]),
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ptzSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
exports.ptzSchema =
|
|
7
|
-
name: zod_1.z.literal(
|
|
5
|
+
const serviceCommonTypes_1 = require("./serviceCommonTypes");
|
|
6
|
+
exports.ptzSchema = serviceCommonTypes_1.serviceCommonSchema.extend({
|
|
7
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.ptz),
|
|
8
8
|
ptz_positions: zod_1.z.record(zod_1.z.string(), zod_1.z.object({
|
|
9
|
-
overlayList: zod_1.z.array(
|
|
9
|
+
overlayList: zod_1.z.array(serviceCommonTypes_1.overlaySchema.omit({ active: true, fps: true })),
|
|
10
10
|
loop: zod_1.z.boolean(),
|
|
11
11
|
})),
|
|
12
12
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.scoreOverviewSchema = exports.baseballScoreBoardAutomaticSchema = exports.baseballScoreBoardSchema = exports.scoreBoardSchema = exports.sportFontSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const serviceCommonTypes_1 = require("./serviceCommonTypes");
|
|
6
6
|
exports.sportFontSchema = zod_1.z.union([zod_1.z.literal('classic'), zod_1.z.intersection(zod_1.z.string(), zod_1.z.object({}))]);
|
|
7
7
|
exports.scoreBoardSchema = zod_1.z.object({
|
|
8
8
|
id: zod_1.z.number().nonnegative(),
|
|
@@ -10,10 +10,10 @@ exports.scoreBoardSchema = zod_1.z.object({
|
|
|
10
10
|
schedule: zod_1.z.string().optional(),
|
|
11
11
|
cameraList: zod_1.z.array(zod_1.z.number()),
|
|
12
12
|
zIndex: zod_1.z.number().nonnegative(),
|
|
13
|
-
name: zod_1.z.literal(
|
|
13
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.scoreBoard),
|
|
14
14
|
pos_x: zod_1.z.number(),
|
|
15
15
|
pos_y: zod_1.z.number(),
|
|
16
|
-
coordSystem:
|
|
16
|
+
coordSystem: serviceCommonTypes_1.coordinateSystemSchema,
|
|
17
17
|
width: zod_1.z.number(),
|
|
18
18
|
height: zod_1.z.number(),
|
|
19
19
|
scale: zod_1.z.number(),
|
|
@@ -41,10 +41,10 @@ exports.baseballScoreBoardSchema = zod_1.z.object({
|
|
|
41
41
|
schedule: zod_1.z.string().optional(),
|
|
42
42
|
cameraList: zod_1.z.array(zod_1.z.number()),
|
|
43
43
|
zIndex: zod_1.z.number().nonnegative(),
|
|
44
|
-
name: zod_1.z.literal(
|
|
44
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.baseballScoreBoard),
|
|
45
45
|
pos_x: zod_1.z.number(),
|
|
46
46
|
pos_y: zod_1.z.number(),
|
|
47
|
-
coordSystem:
|
|
47
|
+
coordSystem: serviceCommonTypes_1.coordinateSystemSchema,
|
|
48
48
|
width: zod_1.z.number(),
|
|
49
49
|
height: zod_1.z.number(),
|
|
50
50
|
scale: zod_1.z.number(),
|
|
@@ -78,7 +78,7 @@ exports.baseballScoreBoardAutomaticSchema = zod_1.z.object({
|
|
|
78
78
|
schedule: zod_1.z.string().optional(),
|
|
79
79
|
cameraList: zod_1.z.array(zod_1.z.number()),
|
|
80
80
|
zIndex: zod_1.z.number().nonnegative(),
|
|
81
|
-
name: zod_1.z.literal(
|
|
81
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.myBallBaseballWidgets),
|
|
82
82
|
width: zod_1.z.number(),
|
|
83
83
|
height: zod_1.z.number(),
|
|
84
84
|
scale: zod_1.z.number(),
|
|
@@ -103,10 +103,10 @@ exports.scoreOverviewSchema = zod_1.z.object({
|
|
|
103
103
|
enabled: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]),
|
|
104
104
|
cameraList: zod_1.z.array(zod_1.z.number()),
|
|
105
105
|
zIndex: zod_1.z.number().nonnegative(),
|
|
106
|
-
name: zod_1.z.literal(
|
|
106
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.scoreOverview),
|
|
107
107
|
pos_x: zod_1.z.number(),
|
|
108
108
|
pos_y: zod_1.z.number(),
|
|
109
|
-
coordSystem:
|
|
109
|
+
coordSystem: serviceCommonTypes_1.coordinateSystemSchema,
|
|
110
110
|
width: zod_1.z.number(),
|
|
111
111
|
height: zod_1.z.number(),
|
|
112
112
|
scale: zod_1.z.number(),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.screenSharingSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
exports.screenSharingSchema =
|
|
7
|
-
name: zod_1.z.literal(
|
|
5
|
+
const serviceCommonTypes_1 = require("./serviceCommonTypes");
|
|
6
|
+
exports.screenSharingSchema = serviceCommonTypes_1.sharingSchema.extend({
|
|
7
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.screenSharing),
|
|
8
8
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.overlaySchema = exports.sharingSchema = exports.
|
|
3
|
+
exports.overlaySchema = exports.sharingSchema = exports.serviceCommonSchema = exports.weatherUnitSchema = exports.fontSchema = exports.languageSchema = exports.coordinateSystemSchema = exports.serviceNames = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
5
|
+
exports.serviceNames = {
|
|
6
6
|
accuweather: 'accuweather',
|
|
7
7
|
infoticker: 'infoticker',
|
|
8
8
|
customGraphics: 'customGraphics',
|
|
@@ -12,6 +12,10 @@ exports.allowedWidgetNames = {
|
|
|
12
12
|
pip: 'pip',
|
|
13
13
|
screenSharing: 'screenSharing',
|
|
14
14
|
web_camera: 'web_camera',
|
|
15
|
+
scoreBoard: 'scoreBoard',
|
|
16
|
+
baseballScoreBoard: 'baseballScoreBoard',
|
|
17
|
+
myBallBaseballWidgets: 'myBallBaseballWidgets',
|
|
18
|
+
scoreOverview: 'scoreOverview',
|
|
15
19
|
};
|
|
16
20
|
exports.coordinateSystemSchema = zod_1.z.union([
|
|
17
21
|
zod_1.z.literal('top_left'),
|
|
@@ -47,7 +51,7 @@ exports.fontSchema = zod_1.z.union([
|
|
|
47
51
|
}),
|
|
48
52
|
]);
|
|
49
53
|
exports.weatherUnitSchema = zod_1.z.union([zod_1.z.literal('Metric'), zod_1.z.literal('Imperial')]);
|
|
50
|
-
exports.
|
|
54
|
+
exports.serviceCommonSchema = zod_1.z.object({
|
|
51
55
|
id: zod_1.z.number().nonnegative(),
|
|
52
56
|
enabled: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]),
|
|
53
57
|
automationType: zod_1.z.union([
|
|
@@ -67,7 +71,7 @@ exports.widgetCommonSchema = zod_1.z.object({
|
|
|
67
71
|
width: zod_1.z.number().nonnegative(),
|
|
68
72
|
height: zod_1.z.number().nonnegative(),
|
|
69
73
|
});
|
|
70
|
-
exports.sharingSchema = exports.
|
|
74
|
+
exports.sharingSchema = exports.serviceCommonSchema.extend({
|
|
71
75
|
pos_x: zod_1.z.number().nonnegative(),
|
|
72
76
|
pos_y: zod_1.z.number().nonnegative(),
|
|
73
77
|
coordSystem: exports.coordinateSystemSchema,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webCameraSharingSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
exports.webCameraSharingSchema =
|
|
7
|
-
name: zod_1.z.literal(
|
|
5
|
+
const serviceCommonTypes_1 = require("./serviceCommonTypes");
|
|
6
|
+
exports.webCameraSharingSchema = serviceCommonTypes_1.sharingSchema.extend({
|
|
7
|
+
name: zod_1.z.literal(serviceCommonTypes_1.serviceNames.web_camera),
|
|
8
8
|
});
|
package/cjs/web/WsClient.js
CHANGED
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ParsingBlobError, ServiceNotFoundError } from './errors/errors';
|
|
|
3
3
|
import { networkCameraListSchema } from './types/common';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ProxyClient } from './internal/ProxyClient';
|
|
6
|
-
import { fileListSchema, ImageType, storageDataListSchema,
|
|
6
|
+
import { fileListSchema, ImageType, storageDataListSchema, serviceListSchema, servicesSchema, WSResponseSchema, } from './types/CamOverlayAPI';
|
|
7
7
|
const BASE_PATH = '/local/camoverlay/api';
|
|
8
8
|
export class CamOverlayAPI {
|
|
9
9
|
client;
|
|
@@ -96,7 +96,7 @@ export class CamOverlayAPI {
|
|
|
96
96
|
throw new Error(await responseStringify(res));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
async
|
|
99
|
+
async getSingleService(serviceId, options) {
|
|
100
100
|
const data = await this._get({
|
|
101
101
|
path: `${BASE_PATH}/services.cgi`,
|
|
102
102
|
parameters: {
|
|
@@ -104,34 +104,34 @@ export class CamOverlayAPI {
|
|
|
104
104
|
service_id: serviceId.toString(),
|
|
105
105
|
},
|
|
106
106
|
}, options);
|
|
107
|
-
return
|
|
107
|
+
return servicesSchema.parse(data);
|
|
108
108
|
}
|
|
109
|
-
async
|
|
110
|
-
const
|
|
109
|
+
async getServices(options) {
|
|
110
|
+
const serviceList = await this._get({
|
|
111
111
|
path: `${BASE_PATH}/services.cgi`,
|
|
112
112
|
parameters: {
|
|
113
113
|
action: 'get',
|
|
114
114
|
},
|
|
115
115
|
}, options);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
console.warn(`[SERVICE SCHEMA MISMATCH]: Service ${
|
|
116
|
+
const services = serviceListSchema.parse(serviceList).services;
|
|
117
|
+
services.forEach((service) => {
|
|
118
|
+
const parsedService = servicesSchema.safeParse(service);
|
|
119
|
+
if (!parsedService.success) {
|
|
120
|
+
console.warn(`[SERVICE SCHEMA MISMATCH]: Service ${service.name} (${service.id}) does not match the current schema, or is a hidden service.`);
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
-
return
|
|
123
|
+
return services;
|
|
124
124
|
}
|
|
125
|
-
async
|
|
125
|
+
async updateSingleService(service, options) {
|
|
126
126
|
const path = `${BASE_PATH}/services.cgi`;
|
|
127
|
-
await this._postJsonEncoded(path, JSON.stringify(
|
|
127
|
+
await this._postJsonEncoded(path, JSON.stringify(service), {
|
|
128
128
|
action: 'set',
|
|
129
|
-
service_id:
|
|
129
|
+
service_id: service.id.toString(),
|
|
130
130
|
}, undefined, options);
|
|
131
131
|
}
|
|
132
|
-
async
|
|
132
|
+
async updateServices(services, options) {
|
|
133
133
|
const path = `${BASE_PATH}/services.cgi`;
|
|
134
|
-
await this._postJsonEncoded(path, JSON.stringify({ services:
|
|
134
|
+
await this._postJsonEncoded(path, JSON.stringify({ services: services }), {
|
|
135
135
|
action: 'set',
|
|
136
136
|
}, undefined, options);
|
|
137
137
|
}
|
|
@@ -18,8 +18,9 @@ export class ResourceManager {
|
|
|
18
18
|
if (this.images[moniker] !== undefined) {
|
|
19
19
|
return this.images[moniker];
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
}
|
package/esm/CreatePackage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
|
|
346
|
-
|
|
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;
|
package/esm/node/Digest.js
CHANGED
package/esm/node/HttpServer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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;
|
package/esm/node/WsClient.js
CHANGED
|
@@ -13,7 +13,7 @@ export const WSResponseSchema = z.object({
|
|
|
13
13
|
status: z.number(),
|
|
14
14
|
message: z.string(),
|
|
15
15
|
});
|
|
16
|
-
export const
|
|
16
|
+
export const servicesSchema = z.discriminatedUnion('name', [
|
|
17
17
|
infoTickerSchema,
|
|
18
18
|
accuweatherSchema,
|
|
19
19
|
ptzCompassSchema,
|
|
@@ -28,22 +28,22 @@ export const widgetsSchema = z.discriminatedUnion('name', [
|
|
|
28
28
|
baseballScoreBoardAutomaticSchema,
|
|
29
29
|
scoreOverviewSchema,
|
|
30
30
|
]);
|
|
31
|
-
export const
|
|
32
|
-
services: z.array(
|
|
31
|
+
export const serviceListSchema = z.object({
|
|
32
|
+
services: z.array(servicesSchema),
|
|
33
33
|
});
|
|
34
|
-
export const isAccuweather = (
|
|
35
|
-
export const isCustomGraphics = (
|
|
36
|
-
export const isImages = (
|
|
37
|
-
export const isInfoticker = (
|
|
38
|
-
export const isPip = (
|
|
39
|
-
export const isPtzCompass = (
|
|
40
|
-
export const isPtz = (
|
|
41
|
-
export const isScreenSharing = (
|
|
42
|
-
export const isWebCameraSharing = (
|
|
43
|
-
export const isScoreBoard = (
|
|
44
|
-
export const isBaseballScoreBoard = (
|
|
45
|
-
export const isBaseballScoreBoardAutomatic = (
|
|
46
|
-
export const isScoreOverview = (
|
|
34
|
+
export const isAccuweather = (service) => service.name === 'accuweather';
|
|
35
|
+
export const isCustomGraphics = (service) => service.name === 'customGraphics';
|
|
36
|
+
export const isImages = (service) => service.name === 'images';
|
|
37
|
+
export const isInfoticker = (service) => service.name === 'infoticker';
|
|
38
|
+
export const isPip = (service) => service.name === 'pip';
|
|
39
|
+
export const isPtzCompass = (service) => service.name === 'ptzCompass';
|
|
40
|
+
export const isPtz = (service) => service.name === 'ptz';
|
|
41
|
+
export const isScreenSharing = (service) => service.name === 'screenSharing';
|
|
42
|
+
export const isWebCameraSharing = (service) => service.name === 'web_camera';
|
|
43
|
+
export const isScoreBoard = (service) => service.name === 'scoreBoard';
|
|
44
|
+
export const isBaseballScoreBoard = (service) => service.name === 'baseballScoreBoard';
|
|
45
|
+
export const isBaseballScoreBoardAutomatic = (service) => service.name === 'myBallBaseballWidgets';
|
|
46
|
+
export const isScoreOverview = (service) => service.name === 'scoreOverview';
|
|
47
47
|
export var ImageType;
|
|
48
48
|
(function (ImageType) {
|
|
49
49
|
ImageType[ImageType["PNG"] = 0] = "PNG";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const accuweatherSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, coordinateSystemSchema, fontSchema, languageSchema, weatherUnitSchema, serviceCommonSchema, } from './serviceCommonTypes';
|
|
3
|
+
export const accuweatherSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.accuweather),
|
|
5
5
|
location: z.string(),
|
|
6
6
|
locationName: z.string(),
|
|
7
7
|
title: z.string(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { serviceNames, coordinateSystemSchema, fontSchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
3
|
const mappingZonesCommonSchema = z.object({
|
|
4
4
|
name: z.string(),
|
|
5
5
|
pos_x: z.number(),
|
|
@@ -48,8 +48,8 @@ const mappingZoneCountdownSchema = mappingZonesCommonSchema.extend({
|
|
|
48
48
|
settings: mappingZonesCountdownSettingsSchema,
|
|
49
49
|
});
|
|
50
50
|
export const mappingZoneSchema = z.discriminatedUnion('type', [mappingZonePlainSchema, mappingZoneCountdownSchema]);
|
|
51
|
-
export const customGraphicsSchema =
|
|
52
|
-
name: z.literal(
|
|
51
|
+
export const customGraphicsSchema = serviceCommonSchema.extend({
|
|
52
|
+
name: z.literal(serviceNames.customGraphics),
|
|
53
53
|
pos_x: z.number(),
|
|
54
54
|
pos_y: z.number(),
|
|
55
55
|
coordSystem: coordinateSystemSchema,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const imagesSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, overlaySchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
|
+
export const imagesSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.images),
|
|
5
5
|
overlayList: z.array(overlaySchema),
|
|
6
6
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const infoTickerSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, fontSchema, languageSchema, weatherUnitSchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
|
+
export const infoTickerSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.infoticker),
|
|
5
5
|
showClock: z.union([z.literal(0), z.literal(1)]),
|
|
6
6
|
clockType: z.union([z.literal('12h'), z.literal('24h')]),
|
|
7
7
|
textColor: z.string(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const pipSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, coordinateSystemSchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
|
+
export const pipSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.pip),
|
|
5
5
|
coordSystem: coordinateSystemSchema,
|
|
6
6
|
pos_x: z.number(),
|
|
7
7
|
pos_y: z.number(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const ptzCompassSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, coordinateSystemSchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
|
+
export const ptzCompassSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.ptzCompass),
|
|
5
5
|
pos_x: z.number(),
|
|
6
6
|
pos_y: z.number(),
|
|
7
7
|
coordSystem: coordinateSystemSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const ptzSchema =
|
|
4
|
-
name: z.literal(
|
|
2
|
+
import { serviceNames, overlaySchema, serviceCommonSchema } from './serviceCommonTypes';
|
|
3
|
+
export const ptzSchema = serviceCommonSchema.extend({
|
|
4
|
+
name: z.literal(serviceNames.ptz),
|
|
5
5
|
ptz_positions: z.record(z.string(), z.object({
|
|
6
6
|
overlayList: z.array(overlaySchema.omit({ active: true, fps: true })),
|
|
7
7
|
loop: z.boolean(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { coordinateSystemSchema } from './
|
|
2
|
+
import { coordinateSystemSchema, serviceNames } from './serviceCommonTypes';
|
|
3
3
|
export const sportFontSchema = z.union([z.literal('classic'), z.intersection(z.string(), z.object({}))]);
|
|
4
4
|
export const scoreBoardSchema = z.object({
|
|
5
5
|
id: z.number().nonnegative(),
|
|
@@ -7,7 +7,7 @@ export const scoreBoardSchema = z.object({
|
|
|
7
7
|
schedule: z.string().optional(),
|
|
8
8
|
cameraList: z.array(z.number()),
|
|
9
9
|
zIndex: z.number().nonnegative(),
|
|
10
|
-
name: z.literal(
|
|
10
|
+
name: z.literal(serviceNames.scoreBoard),
|
|
11
11
|
pos_x: z.number(),
|
|
12
12
|
pos_y: z.number(),
|
|
13
13
|
coordSystem: coordinateSystemSchema,
|
|
@@ -38,7 +38,7 @@ export const baseballScoreBoardSchema = z.object({
|
|
|
38
38
|
schedule: z.string().optional(),
|
|
39
39
|
cameraList: z.array(z.number()),
|
|
40
40
|
zIndex: z.number().nonnegative(),
|
|
41
|
-
name: z.literal(
|
|
41
|
+
name: z.literal(serviceNames.baseballScoreBoard),
|
|
42
42
|
pos_x: z.number(),
|
|
43
43
|
pos_y: z.number(),
|
|
44
44
|
coordSystem: coordinateSystemSchema,
|
|
@@ -75,7 +75,7 @@ export const baseballScoreBoardAutomaticSchema = z.object({
|
|
|
75
75
|
schedule: z.string().optional(),
|
|
76
76
|
cameraList: z.array(z.number()),
|
|
77
77
|
zIndex: z.number().nonnegative(),
|
|
78
|
-
name: z.literal(
|
|
78
|
+
name: z.literal(serviceNames.myBallBaseballWidgets),
|
|
79
79
|
width: z.number(),
|
|
80
80
|
height: z.number(),
|
|
81
81
|
scale: z.number(),
|
|
@@ -100,7 +100,7 @@ export const scoreOverviewSchema = z.object({
|
|
|
100
100
|
enabled: z.union([z.literal(0), z.literal(1)]),
|
|
101
101
|
cameraList: z.array(z.number()),
|
|
102
102
|
zIndex: z.number().nonnegative(),
|
|
103
|
-
name: z.literal(
|
|
103
|
+
name: z.literal(serviceNames.scoreOverview),
|
|
104
104
|
pos_x: z.number(),
|
|
105
105
|
pos_y: z.number(),
|
|
106
106
|
coordSystem: coordinateSystemSchema,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { serviceNames, sharingSchema } from './serviceCommonTypes';
|
|
3
3
|
export const screenSharingSchema = sharingSchema.extend({
|
|
4
|
-
name: z.literal(
|
|
4
|
+
name: z.literal(serviceNames.screenSharing),
|
|
5
5
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const
|
|
2
|
+
export const serviceNames = {
|
|
3
3
|
accuweather: 'accuweather',
|
|
4
4
|
infoticker: 'infoticker',
|
|
5
5
|
customGraphics: 'customGraphics',
|
|
@@ -9,6 +9,10 @@ export const allowedWidgetNames = {
|
|
|
9
9
|
pip: 'pip',
|
|
10
10
|
screenSharing: 'screenSharing',
|
|
11
11
|
web_camera: 'web_camera',
|
|
12
|
+
scoreBoard: 'scoreBoard',
|
|
13
|
+
baseballScoreBoard: 'baseballScoreBoard',
|
|
14
|
+
myBallBaseballWidgets: 'myBallBaseballWidgets',
|
|
15
|
+
scoreOverview: 'scoreOverview',
|
|
12
16
|
};
|
|
13
17
|
export const coordinateSystemSchema = z.union([
|
|
14
18
|
z.literal('top_left'),
|
|
@@ -44,7 +48,7 @@ export const fontSchema = z.union([
|
|
|
44
48
|
}),
|
|
45
49
|
]);
|
|
46
50
|
export const weatherUnitSchema = z.union([z.literal('Metric'), z.literal('Imperial')]);
|
|
47
|
-
export const
|
|
51
|
+
export const serviceCommonSchema = z.object({
|
|
48
52
|
id: z.number().nonnegative(),
|
|
49
53
|
enabled: z.union([z.literal(0), z.literal(1)]),
|
|
50
54
|
automationType: z.union([
|
|
@@ -64,7 +68,7 @@ export const widgetCommonSchema = z.object({
|
|
|
64
68
|
width: z.number().nonnegative(),
|
|
65
69
|
height: z.number().nonnegative(),
|
|
66
70
|
});
|
|
67
|
-
export const sharingSchema =
|
|
71
|
+
export const sharingSchema = serviceCommonSchema.extend({
|
|
68
72
|
pos_x: z.number().nonnegative(),
|
|
69
73
|
pos_y: z.number().nonnegative(),
|
|
70
74
|
coordSystem: coordinateSystemSchema,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { serviceNames, sharingSchema } from './serviceCommonTypes';
|
|
3
3
|
export const webCameraSharingSchema = sharingSchema.extend({
|
|
4
|
-
name: z.literal(
|
|
4
|
+
name: z.literal(serviceNames.web_camera),
|
|
5
5
|
});
|
package/esm/web/WsClient.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camstreamerlib",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.37",
|
|
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",
|