camstreamerlib 4.0.0-beta.1 → 4.0.0-beta.11
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/README.md +5 -1
- package/cjs/CamOverlayAPI.d.ts +629 -0
- package/cjs/CamOverlayAPI.js +255 -0
- package/{CamOverlayDrawingAPI.d.ts → cjs/CamOverlayDrawingAPI.d.ts} +1 -1
- package/cjs/CamOverlayDrawingAPI.js +235 -0
- package/cjs/CamOverlayPainter/Frame.js +301 -0
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/Painter.d.ts +14 -3
- package/cjs/CamOverlayPainter/Painter.js +171 -0
- package/cjs/CamOverlayPainter/ResourceManager.js +46 -0
- package/{CamScripterAPI.d.ts → cjs/CamScripterAPI.d.ts} +5 -5
- package/cjs/CamScripterAPI.js +64 -0
- package/{CamScripterAPICameraEventsGenerator.d.ts → cjs/CamScripterAPICameraEventsGenerator.d.ts} +1 -1
- package/cjs/CamScripterAPICameraEventsGenerator.js +162 -0
- package/{CamStreamerAPI.d.ts → cjs/CamStreamerAPI.d.ts} +5 -5
- package/cjs/CamStreamerAPI.js +59 -0
- package/{CamSwitcherAPI.d.ts → cjs/CamSwitcherAPI.d.ts} +10 -6
- package/cjs/CamSwitcherAPI.js +351 -0
- package/{CamSwitcherEvents.d.ts → cjs/CamSwitcherEvents.d.ts} +2 -2
- package/cjs/CamSwitcherEvents.js +67 -0
- package/cjs/CreatePackage.js +106 -0
- package/{VapixAPI.d.ts → cjs/VapixAPI.d.ts} +18 -6
- package/cjs/VapixAPI.js +479 -0
- package/{VapixEvents.d.ts → cjs/VapixEvents.d.ts} +1 -1
- package/cjs/VapixEvents.js +88 -0
- package/{errors → cjs/errors}/errors.d.ts +3 -0
- package/cjs/errors/errors.js +86 -0
- package/{events → cjs/events}/AxisCameraStationEvents.d.ts +3 -2
- package/cjs/events/AxisCameraStationEvents.js +48 -0
- package/cjs/events/GenetecAgent.js +123 -0
- package/cjs/index.d.ts +14 -0
- package/cjs/index.js +35 -0
- package/cjs/internal/Digest.js +42 -0
- package/cjs/internal/ProxyClient.d.ts +11 -0
- package/cjs/internal/ProxyClient.js +46 -0
- package/cjs/internal/constants.js +4 -0
- package/cjs/internal/transformers.js +32 -0
- package/cjs/internal/types.d.ts +35 -0
- package/cjs/internal/types.js +2 -0
- package/{internal → cjs/internal}/utils.d.ts +5 -1
- package/cjs/internal/utils.js +69 -0
- package/{internal → cjs/internal}/versionCompare.d.ts +2 -2
- package/cjs/internal/versionCompare.js +53 -0
- package/cjs/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/cjs/models/CamOverlayAPI/accuweatherSchema.js +48 -0
- package/cjs/models/CamOverlayAPI/constants.d.ts +11 -0
- package/cjs/models/CamOverlayAPI/constants.js +14 -0
- package/cjs/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
- package/cjs/models/CamOverlayAPI/customGraphicsSchema.js +73 -0
- package/cjs/models/CamOverlayAPI/fileSchema.d.ts +28 -0
- package/cjs/models/CamOverlayAPI/fileSchema.js +17 -0
- package/cjs/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/cjs/models/CamOverlayAPI/imagesSchema.js +10 -0
- package/cjs/models/CamOverlayAPI/index.d.ts +13 -0
- package/cjs/models/CamOverlayAPI/index.js +29 -0
- package/cjs/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/cjs/models/CamOverlayAPI/infotickerSchema.js +27 -0
- package/cjs/models/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/cjs/models/CamOverlayAPI/pipSchema.js +40 -0
- package/cjs/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/cjs/models/CamOverlayAPI/ptzCompassSchema.js +26 -0
- package/cjs/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/cjs/models/CamOverlayAPI/ptzSchema.js +13 -0
- package/cjs/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/cjs/models/CamOverlayAPI/screenSharingSchema.js +9 -0
- package/cjs/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/cjs/models/CamOverlayAPI/webCameraSharingSchema.js +9 -0
- package/cjs/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
- package/cjs/models/CamOverlayAPI/widgetCommonSchema.js +76 -0
- package/cjs/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
- package/cjs/models/CamOverlayAPI/widgetsSchema.js +27 -0
- package/cjs/node/DefaultClient.d.ts +16 -0
- package/cjs/node/DefaultClient.js +56 -0
- package/cjs/node/HttpRequestSender.js +89 -0
- package/cjs/node/HttpServer.js +96 -0
- package/{node → cjs/node}/WsClient.d.ts +1 -1
- package/cjs/node/WsClient.js +149 -0
- package/{node → cjs/node}/WsEventClient.d.ts +1 -1
- package/cjs/node/WsEventClient.js +22 -0
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +7 -0
- package/cjs/types/CamOverlayAPI.d.ts +328 -0
- package/cjs/types/CamOverlayAPI.js +26 -0
- package/{types → cjs/types}/CamScripterAPI.d.ts +1 -1
- package/cjs/types/CamScripterAPI.js +20 -0
- package/{types → cjs/types}/CamStreamerAPI.d.ts +5 -5
- package/cjs/types/CamStreamerAPI.js +28 -0
- package/{types → cjs/types}/CamSwitcherAPI.d.ts +5 -5
- package/cjs/types/CamSwitcherAPI.js +137 -0
- package/{types/CamswitcherEvents.d.ts → cjs/types/CamSwitcherEvents.d.ts} +110 -0
- package/cjs/types/CamSwitcherEvents.js +70 -0
- package/{types → cjs/types}/VapixAPI.d.ts +442 -521
- package/cjs/types/VapixAPI.js +125 -0
- package/cjs/types/common.js +14 -0
- package/cjs/web/DefaultClient.d.ts +6 -0
- package/cjs/web/DefaultClient.js +22 -0
- package/cjs/web/WsClient.js +62 -0
- package/cjs/web/index.d.ts +2 -0
- package/cjs/web/index.js +7 -0
- package/esm/CamOverlayAPI.d.ts +629 -0
- package/esm/CamOverlayAPI.js +251 -0
- package/esm/CamOverlayDrawingAPI.d.ts +86 -0
- package/{CamOverlayDrawingAPI.js → esm/CamOverlayDrawingAPI.js} +6 -3
- package/esm/CamOverlayPainter/Frame.d.ts +96 -0
- package/esm/CamOverlayPainter/Painter.d.ts +48 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/Painter.js +4 -1
- package/esm/CamOverlayPainter/ResourceManager.d.ts +14 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/ResourceManager.js +6 -10
- package/esm/CamScripterAPI.d.ts +19 -0
- package/{CamScripterAPI.js → esm/CamScripterAPI.js} +3 -9
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +74 -0
- package/{CamScripterAPICameraEventsGenerator.js → esm/CamScripterAPICameraEventsGenerator.js} +6 -3
- package/esm/CamStreamerAPI.d.ts +16 -0
- package/{CamStreamerAPI.js → esm/CamStreamerAPI.js} +4 -10
- package/esm/CamSwitcherAPI.d.ts +52 -0
- package/{CamSwitcherAPI.js → esm/CamSwitcherAPI.js} +24 -27
- package/esm/CamSwitcherEvents.d.ts +18 -0
- package/{CamSwitcherEvents.js → esm/CamSwitcherEvents.js} +1 -1
- package/esm/CreatePackage.d.ts +1 -0
- package/esm/VapixAPI.d.ts +78 -0
- package/{VapixAPI.js → esm/VapixAPI.js} +76 -56
- package/esm/VapixEvents.d.ts +43 -0
- package/{VapixEvents.js → esm/VapixEvents.js} +3 -3
- package/esm/errors/errors.d.ts +37 -0
- package/{errors → esm/errors}/errors.js +6 -0
- package/esm/events/AxisCameraStationEvents.d.ts +10 -0
- package/{events → esm/events}/AxisCameraStationEvents.js +1 -1
- package/esm/events/GenetecAgent.d.ts +174 -0
- package/{events → esm/events}/GenetecAgent.js +1 -1
- package/esm/index.d.ts +14 -0
- package/esm/index.js +14 -0
- package/esm/internal/Digest.d.ts +4 -0
- package/{internal → esm/internal}/Digest.js +6 -6
- package/esm/internal/ProxyClient.d.ts +11 -0
- package/{internal → esm/internal}/ProxyClient.js +4 -2
- package/esm/internal/constants.d.ts +1 -0
- package/esm/internal/transformers.d.ts +5 -0
- package/esm/internal/types.d.ts +35 -0
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.d.ts +15 -0
- package/{internal → esm/internal}/utils.js +21 -2
- package/esm/internal/versionCompare.d.ts +6 -0
- package/esm/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/esm/models/CamOverlayAPI/accuweatherSchema.js +45 -0
- package/esm/models/CamOverlayAPI/constants.d.ts +11 -0
- package/esm/models/CamOverlayAPI/constants.js +11 -0
- package/esm/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
- package/esm/models/CamOverlayAPI/customGraphicsSchema.js +70 -0
- package/esm/models/CamOverlayAPI/fileSchema.d.ts +28 -0
- package/esm/models/CamOverlayAPI/fileSchema.js +14 -0
- package/esm/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/esm/models/CamOverlayAPI/imagesSchema.js +7 -0
- package/esm/models/CamOverlayAPI/index.d.ts +13 -0
- package/esm/models/CamOverlayAPI/index.js +13 -0
- package/esm/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/esm/models/CamOverlayAPI/infotickerSchema.js +24 -0
- package/esm/models/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/esm/models/CamOverlayAPI/pipSchema.js +37 -0
- package/esm/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/esm/models/CamOverlayAPI/ptzCompassSchema.js +23 -0
- package/esm/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/esm/models/CamOverlayAPI/ptzSchema.js +10 -0
- package/esm/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/esm/models/CamOverlayAPI/screenSharingSchema.js +6 -0
- package/esm/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/esm/models/CamOverlayAPI/webCameraSharingSchema.js +6 -0
- package/esm/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
- package/esm/models/CamOverlayAPI/widgetCommonSchema.js +73 -0
- package/esm/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
- package/esm/models/CamOverlayAPI/widgetsSchema.js +24 -0
- package/esm/node/DefaultClient.d.ts +16 -0
- package/{node → esm/node}/DefaultClient.js +9 -7
- package/esm/node/HttpRequestSender.d.ts +28 -0
- package/esm/node/HttpServer.d.ts +21 -0
- package/{node → esm/node}/HttpServer.js +1 -1
- package/esm/node/WsClient.d.ts +39 -0
- package/esm/node/WsEventClient.d.ts +13 -0
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI.d.ts +328 -0
- package/esm/types/CamOverlayAPI.js +14 -0
- package/esm/types/CamScripterAPI.d.ts +67 -0
- package/esm/types/CamStreamerAPI.d.ts +139 -0
- package/esm/types/CamSwitcherAPI.d.ts +814 -0
- package/esm/types/CamSwitcherEvents.d.ts +568 -0
- package/{types/CamswitcherEvents.js → esm/types/CamSwitcherEvents.js} +12 -0
- package/esm/types/VapixAPI.d.ts +1625 -0
- package/{types → esm/types}/VapixAPI.js +16 -23
- package/esm/types/common.d.ts +37 -0
- package/esm/web/DefaultClient.d.ts +6 -0
- package/{web → esm/web}/DefaultClient.js +6 -4
- package/esm/web/WsClient.d.ts +13 -0
- package/esm/web/index.d.ts +2 -0
- package/esm/web/index.js +2 -0
- package/package.json +6 -6
- package/CamOverlayAPI.d.ts +0 -31
- package/CamOverlayAPI.js +0 -172
- package/internal/ProxyClient.d.ts +0 -11
- package/internal/common.d.ts +0 -40
- package/internal/common.js +0 -23
- package/node/DefaultClient.d.ts +0 -15
- package/types/CamOverlayAPI.d.ts +0 -188
- package/types/CamOverlayAPI.js +0 -44
- package/web/DefaultClient.d.ts +0 -6
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/Frame.d.ts +0 -0
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/ResourceManager.d.ts +0 -0
- package/{CreatePackage.d.ts → cjs/CreatePackage.d.ts} +0 -0
- package/{events → cjs/events}/GenetecAgent.d.ts +0 -0
- package/{internal → cjs/internal}/Digest.d.ts +0 -0
- package/{internal → cjs/internal}/constants.d.ts +0 -0
- package/{internal → cjs/internal}/transformers.d.ts +0 -0
- package/{node → cjs/node}/HttpRequestSender.d.ts +0 -0
- package/{node → cjs/node}/HttpServer.d.ts +0 -0
- package/{types → cjs/types}/common.d.ts +2 -2
- /package/{web → cjs/web}/WsClient.d.ts +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/Frame.js +0 -0
- /package/{CreatePackage.js → esm/CreatePackage.js} +0 -0
- /package/{internal → esm/internal}/constants.js +0 -0
- /package/{internal → esm/internal}/transformers.js +0 -0
- /package/{internal → esm/internal}/versionCompare.js +0 -0
- /package/{node → esm/node}/HttpRequestSender.js +0 -0
- /package/{node → esm/node}/WsClient.js +0 -0
- /package/{node → esm/node}/WsEventClient.js +0 -0
- /package/{types → esm/types}/CamScripterAPI.js +0 -0
- /package/{types → esm/types}/CamStreamerAPI.js +0 -0
- /package/{types → esm/types}/CamSwitcherAPI.js +0 -0
- /package/{types → esm/types}/common.js +0 -0
- /package/{web → esm/web}/WsClient.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNullish = exports.pad = exports.responseStringify = exports.isClient = exports.isLoopPlayType = exports.isPlaylist = exports.isTracker = exports.isClip = exports.isStream = exports.isCamera = exports.arrayToUrl = exports.paramToUrl = exports.addParametersToPath = void 0;
|
|
4
|
+
const addParametersToPath = (path, params) => {
|
|
5
|
+
if (params === undefined || Object.keys(params).length === 0) {
|
|
6
|
+
return path;
|
|
7
|
+
}
|
|
8
|
+
const joinChar = path.indexOf('?') === -1 ? '?' : '&';
|
|
9
|
+
return `${path}${joinChar}${(0, exports.paramToUrl)(params)}`;
|
|
10
|
+
};
|
|
11
|
+
exports.addParametersToPath = addParametersToPath;
|
|
12
|
+
const paramToUrl = (params) => {
|
|
13
|
+
if (params === undefined) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
let output = '';
|
|
17
|
+
for (const key in params) {
|
|
18
|
+
const value = params[key];
|
|
19
|
+
if (isNullish(value)) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
output += `${encodeURIComponent(key)}=${encodeURIComponent(value)}&`;
|
|
23
|
+
}
|
|
24
|
+
return output.slice(0, output.length - 1);
|
|
25
|
+
};
|
|
26
|
+
exports.paramToUrl = paramToUrl;
|
|
27
|
+
const arrayToUrl = (arr) => {
|
|
28
|
+
if (Array.isArray(arr)) {
|
|
29
|
+
return arr.join(',');
|
|
30
|
+
}
|
|
31
|
+
return arr;
|
|
32
|
+
};
|
|
33
|
+
exports.arrayToUrl = arrayToUrl;
|
|
34
|
+
const isCamera = (id) => id?.charAt(0) === 'c';
|
|
35
|
+
exports.isCamera = isCamera;
|
|
36
|
+
const isStream = (id) => id?.charAt(0) === 'c' || id?.charAt(0) === 'a';
|
|
37
|
+
exports.isStream = isStream;
|
|
38
|
+
const isClip = (id) => id?.charAt(0) === 's';
|
|
39
|
+
exports.isClip = isClip;
|
|
40
|
+
const isTracker = (id) => id?.charAt(0) === 't';
|
|
41
|
+
exports.isTracker = isTracker;
|
|
42
|
+
const isPlaylist = (id) => id?.charAt(0) === 'p';
|
|
43
|
+
exports.isPlaylist = isPlaylist;
|
|
44
|
+
const isLoopPlayType = (playType) => playType.includes('LOOP');
|
|
45
|
+
exports.isLoopPlayType = isLoopPlayType;
|
|
46
|
+
function isClient(arg = {}) {
|
|
47
|
+
return 'get' in arg && 'post' in arg;
|
|
48
|
+
}
|
|
49
|
+
exports.isClient = isClient;
|
|
50
|
+
async function responseStringify(res) {
|
|
51
|
+
return JSON.stringify({
|
|
52
|
+
status: res.status,
|
|
53
|
+
body: await res.text(),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.responseStringify = responseStringify;
|
|
57
|
+
function pad(num, size) {
|
|
58
|
+
const sign = Math.sign(num) === -1 ? '-' : '';
|
|
59
|
+
return (sign +
|
|
60
|
+
new Array(size)
|
|
61
|
+
.concat([Math.abs(num)])
|
|
62
|
+
.join('0')
|
|
63
|
+
.slice(-size));
|
|
64
|
+
}
|
|
65
|
+
exports.pad = pad;
|
|
66
|
+
function isNullish(value) {
|
|
67
|
+
return value === null || value === undefined;
|
|
68
|
+
}
|
|
69
|
+
exports.isNullish = isNullish;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const assertVersionString: (s: string, msg?: string) => void;
|
|
2
2
|
export declare const isFirmwareVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
3
3
|
export declare const isVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
4
|
-
export declare const firmwareVersionCompare: (a: string, b: string) =>
|
|
5
|
-
export declare const versionCompare: (a: string, b: string) =>
|
|
4
|
+
export declare const firmwareVersionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const versionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
6
6
|
export declare const fixVersionToDots: (version: string) => string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fixVersionToDots = exports.versionCompare = exports.firmwareVersionCompare = exports.isVersionAtLeast = exports.isFirmwareVersionAtLeast = exports.assertVersionString = void 0;
|
|
4
|
+
const assertVersionString = (s, msg) => {
|
|
5
|
+
if (!s.match(/^[0-9]+(\.[0-9]+){1,3}$/)) {
|
|
6
|
+
throw new Error(msg ?? `${s} is not a version`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
exports.assertVersionString = assertVersionString;
|
|
10
|
+
const isFirmwareVersionAtLeast = (version, compareVersion) => {
|
|
11
|
+
return (0, exports.firmwareVersionCompare)(version, compareVersion) >= 0;
|
|
12
|
+
};
|
|
13
|
+
exports.isFirmwareVersionAtLeast = isFirmwareVersionAtLeast;
|
|
14
|
+
const isVersionAtLeast = (version, compareVersion) => {
|
|
15
|
+
return (0, exports.versionCompare)(version, compareVersion) >= 0;
|
|
16
|
+
};
|
|
17
|
+
exports.isVersionAtLeast = isVersionAtLeast;
|
|
18
|
+
const firmwareVersionCompare = (a, b) => {
|
|
19
|
+
const versions = [a, b];
|
|
20
|
+
const matchBetaFirmwareVersion = (x) => /^CVP-/.test(x) || /^[0-9]+.*beta/.test(x);
|
|
21
|
+
if (versions.every(matchBetaFirmwareVersion)) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
if (matchBetaFirmwareVersion(a)) {
|
|
25
|
+
return -1;
|
|
26
|
+
}
|
|
27
|
+
if (matchBetaFirmwareVersion(b)) {
|
|
28
|
+
return 1;
|
|
29
|
+
}
|
|
30
|
+
return (0, exports.versionCompare)(a, b);
|
|
31
|
+
};
|
|
32
|
+
exports.firmwareVersionCompare = firmwareVersionCompare;
|
|
33
|
+
const versionCompare = (a, b) => {
|
|
34
|
+
(0, exports.assertVersionString)(a);
|
|
35
|
+
(0, exports.assertVersionString)(b);
|
|
36
|
+
const aSplit = parseVersion(a);
|
|
37
|
+
const bSplit = parseVersion(b);
|
|
38
|
+
for (let i = 0; i < aSplit.length; i++) {
|
|
39
|
+
if (aSplit[i] !== bSplit[i]) {
|
|
40
|
+
return aSplit[i] < bSplit[i] ? -1 : 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return 0;
|
|
44
|
+
};
|
|
45
|
+
exports.versionCompare = versionCompare;
|
|
46
|
+
const fixVersionToDots = (version) => version.replaceAll('-', '.');
|
|
47
|
+
exports.fixVersionToDots = fixVersionToDots;
|
|
48
|
+
const parseVersion = (version) => {
|
|
49
|
+
(0, exports.assertVersionString)(version);
|
|
50
|
+
const parsed = version.split('.').map((s) => parseInt(s));
|
|
51
|
+
parsed.push(...Array(4 - parsed.length).fill(0));
|
|
52
|
+
return parsed;
|
|
53
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const accuweatherSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodNumber;
|
|
4
|
+
enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
5
|
+
automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
|
|
6
|
+
invertInput: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
cameraList: z.ZodArray<z.ZodNumber, "many">;
|
|
8
|
+
camera: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
schedule: z.ZodOptional<z.ZodString>;
|
|
10
|
+
customName: z.ZodString;
|
|
11
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
width: z.ZodNumber;
|
|
13
|
+
height: z.ZodNumber;
|
|
14
|
+
} & {
|
|
15
|
+
name: z.ZodLiteral<"accuweather">;
|
|
16
|
+
location: z.ZodString;
|
|
17
|
+
locationName: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
bgStartColor: z.ZodUnion<[z.ZodLiteral<"237,143,73,0.93">, z.ZodLiteral<"0,0,0,0.75">, z.ZodLiteral<"31,32,73,0.9">, z.ZodLiteral<"76,94,127,0.95">]>;
|
|
20
|
+
bgEndColor: z.ZodUnion<[z.ZodLiteral<"234,181,89,0.93">, z.ZodLiteral<"0,0,0,0.75">, z.ZodLiteral<"73,96,213,0.9">, z.ZodLiteral<"140,150,168,0.95">]>;
|
|
21
|
+
clockType: z.ZodUnion<[z.ZodLiteral<"12h">, z.ZodLiteral<"24h">]>;
|
|
22
|
+
lang: z.ZodUnion<[z.ZodLiteral<"en-us">, z.ZodLiteral<"fr-fr">, z.ZodLiteral<"ja-jp">, z.ZodLiteral<"pt-pt">, z.ZodLiteral<"es-es">, z.ZodLiteral<"de-de">, z.ZodLiteral<"ko-kr">, z.ZodLiteral<"zh-hk">, z.ZodLiteral<"zh-cn">, z.ZodLiteral<"nl-nl">, z.ZodLiteral<"cs-cz">, z.ZodLiteral<"ru-ru">, z.ZodLiteral<"sv-se">]>;
|
|
23
|
+
font: z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"digital">, z.ZodType<string, z.ZodTypeDef, string>]>;
|
|
24
|
+
units: z.ZodUnion<[z.ZodLiteral<"Metric">, z.ZodLiteral<"Imperial">]>;
|
|
25
|
+
pos_x: z.ZodNumber;
|
|
26
|
+
pos_y: z.ZodNumber;
|
|
27
|
+
coordSystem: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top">, z.ZodLiteral<"top_right">, z.ZodLiteral<"left">, z.ZodLiteral<"center">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom">, z.ZodLiteral<"bottom_right">]>;
|
|
28
|
+
layout: z.ZodUnion<[z.ZodLiteral<"0">, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"6">, z.ZodLiteral<"7">, z.ZodLiteral<"8">, z.ZodLiteral<"9">, z.ZodLiteral<"10">, z.ZodLiteral<"11">, z.ZodLiteral<"12">, z.ZodLiteral<"13">]>;
|
|
29
|
+
scale: z.ZodNumber;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
name: "accuweather";
|
|
32
|
+
enabled: 0 | 1;
|
|
33
|
+
id: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
37
|
+
cameraList: number[];
|
|
38
|
+
customName: string;
|
|
39
|
+
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
40
|
+
pos_x: number;
|
|
41
|
+
pos_y: number;
|
|
42
|
+
scale: number;
|
|
43
|
+
font: string;
|
|
44
|
+
location: string;
|
|
45
|
+
locationName: string;
|
|
46
|
+
title: string;
|
|
47
|
+
bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
|
|
48
|
+
bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
|
|
49
|
+
clockType: "12h" | "24h";
|
|
50
|
+
lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
|
|
51
|
+
units: "Metric" | "Imperial";
|
|
52
|
+
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
53
|
+
schedule?: string | undefined;
|
|
54
|
+
invertInput?: boolean | undefined;
|
|
55
|
+
camera?: number | undefined;
|
|
56
|
+
zIndex?: number | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
name: "accuweather";
|
|
59
|
+
enabled: 0 | 1;
|
|
60
|
+
id: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
64
|
+
cameraList: number[];
|
|
65
|
+
customName: string;
|
|
66
|
+
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
67
|
+
pos_x: number;
|
|
68
|
+
pos_y: number;
|
|
69
|
+
scale: number;
|
|
70
|
+
font: string;
|
|
71
|
+
location: string;
|
|
72
|
+
locationName: string;
|
|
73
|
+
title: string;
|
|
74
|
+
bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
|
|
75
|
+
bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
|
|
76
|
+
clockType: "12h" | "24h";
|
|
77
|
+
lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
|
|
78
|
+
units: "Metric" | "Imperial";
|
|
79
|
+
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
80
|
+
schedule?: string | undefined;
|
|
81
|
+
invertInput?: boolean | undefined;
|
|
82
|
+
camera?: number | undefined;
|
|
83
|
+
zIndex?: number | undefined;
|
|
84
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accuweatherSchema = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
const widgetCommonSchema_1 = require("./widgetCommonSchema");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.accuweatherSchema = widgetCommonSchema_1.widgetCommonSchema.extend({
|
|
8
|
+
name: zod_1.z.literal(constants_1.allowedWidgetNames.accuweather),
|
|
9
|
+
location: zod_1.z.string(),
|
|
10
|
+
locationName: zod_1.z.string(),
|
|
11
|
+
title: zod_1.z.string(),
|
|
12
|
+
bgStartColor: zod_1.z.union([
|
|
13
|
+
zod_1.z.literal('237,143,73,0.93'),
|
|
14
|
+
zod_1.z.literal('0,0,0,0.75'),
|
|
15
|
+
zod_1.z.literal('31,32,73,0.9'),
|
|
16
|
+
zod_1.z.literal('76,94,127,0.95'),
|
|
17
|
+
]),
|
|
18
|
+
bgEndColor: zod_1.z.union([
|
|
19
|
+
zod_1.z.literal('234,181,89,0.93'),
|
|
20
|
+
zod_1.z.literal('0,0,0,0.75'),
|
|
21
|
+
zod_1.z.literal('73,96,213,0.9'),
|
|
22
|
+
zod_1.z.literal('140,150,168,0.95'),
|
|
23
|
+
]),
|
|
24
|
+
clockType: zod_1.z.union([zod_1.z.literal('12h'), zod_1.z.literal('24h')]),
|
|
25
|
+
lang: widgetCommonSchema_1.languageSchema,
|
|
26
|
+
font: widgetCommonSchema_1.fontSchema,
|
|
27
|
+
units: widgetCommonSchema_1.weatherUnitSchema,
|
|
28
|
+
pos_x: zod_1.z.number(),
|
|
29
|
+
pos_y: zod_1.z.number(),
|
|
30
|
+
coordSystem: widgetCommonSchema_1.coordinateSystemSchema,
|
|
31
|
+
layout: zod_1.z.union([
|
|
32
|
+
zod_1.z.literal('0'),
|
|
33
|
+
zod_1.z.literal('1'),
|
|
34
|
+
zod_1.z.literal('2'),
|
|
35
|
+
zod_1.z.literal('3'),
|
|
36
|
+
zod_1.z.literal('4'),
|
|
37
|
+
zod_1.z.literal('5'),
|
|
38
|
+
zod_1.z.literal('6'),
|
|
39
|
+
zod_1.z.literal('7'),
|
|
40
|
+
zod_1.z.literal('8'),
|
|
41
|
+
zod_1.z.literal('9'),
|
|
42
|
+
zod_1.z.literal('10'),
|
|
43
|
+
zod_1.z.literal('11'),
|
|
44
|
+
zod_1.z.literal('12'),
|
|
45
|
+
zod_1.z.literal('13'),
|
|
46
|
+
]),
|
|
47
|
+
scale: zod_1.z.number().nonnegative(),
|
|
48
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const allowedWidgetNames: {
|
|
2
|
+
readonly accuweather: "accuweather";
|
|
3
|
+
readonly infoticker: "infoticker";
|
|
4
|
+
readonly customGraphics: "customGraphics";
|
|
5
|
+
readonly ptzCompass: "ptzCompass";
|
|
6
|
+
readonly images: "images";
|
|
7
|
+
readonly ptz: "ptz";
|
|
8
|
+
readonly pip: "pip";
|
|
9
|
+
readonly screenSharing: "screenSharing";
|
|
10
|
+
readonly web_camera: "web_camera";
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allowedWidgetNames = void 0;
|
|
4
|
+
exports.allowedWidgetNames = {
|
|
5
|
+
accuweather: 'accuweather',
|
|
6
|
+
infoticker: 'infoticker',
|
|
7
|
+
customGraphics: 'customGraphics',
|
|
8
|
+
ptzCompass: 'ptzCompass',
|
|
9
|
+
images: 'images',
|
|
10
|
+
ptz: 'ptz',
|
|
11
|
+
pip: 'pip',
|
|
12
|
+
screenSharing: 'screenSharing',
|
|
13
|
+
web_camera: 'web_camera',
|
|
14
|
+
};
|