UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

92 lines (91 loc) 3.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.overlaySchema = exports.sharingSchema = exports.serviceCommonSchema = exports.weatherUnitSchema = exports.fontSchema = exports.languageSchema = exports.coordinateSystemSchema = exports.serviceNames = void 0; const zod_1 = require("zod"); exports.serviceNames = { accuweather: 'accuweather', infoticker: 'infoticker', customGraphics: 'customGraphics', ptzCompass: 'ptzCompass', images: 'images', ptz: 'ptz', pip: 'pip', screenSharing: 'screenSharing', web_camera: 'web_camera', scoreBoard: 'scoreBoard', baseballScoreBoard: 'baseballScoreBoard', myBallBaseballWidgets: 'myBallBaseballWidgets', scoreOverview: 'scoreOverview', }; exports.coordinateSystemSchema = zod_1.z.union([ zod_1.z.literal('top_left'), zod_1.z.literal('top'), zod_1.z.literal('top_right'), zod_1.z.literal('left'), zod_1.z.literal('center'), zod_1.z.literal('right'), zod_1.z.literal('bottom_left'), zod_1.z.literal('bottom'), zod_1.z.literal('bottom_right'), ]); exports.languageSchema = zod_1.z.union([ zod_1.z.literal('en-us'), zod_1.z.literal('fr-fr'), zod_1.z.literal('ja-jp'), zod_1.z.literal('pt-pt'), zod_1.z.literal('es-es'), zod_1.z.literal('de-de'), zod_1.z.literal('ko-kr'), zod_1.z.literal('zh-hk'), zod_1.z.literal('zh-cn'), zod_1.z.literal('nl-nl'), zod_1.z.literal('cs-cz'), zod_1.z.literal('ru-ru'), zod_1.z.literal('sv-se'), ]); exports.fontSchema = zod_1.z.union([ zod_1.z.literal('classic'), zod_1.z.literal('digital'), zod_1.z.custom((val) => { return typeof val === 'string'; }), ]); exports.weatherUnitSchema = zod_1.z.union([zod_1.z.literal('Metric'), zod_1.z.literal('Imperial')]); exports.serviceCommonSchema = zod_1.z.object({ id: zod_1.z.number().nonnegative(), enabled: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]), automationType: zod_1.z.union([ zod_1.z.literal('time'), zod_1.z.literal('manual'), zod_1.z.literal('schedule'), zod_1.z.custom((val) => { return typeof val === 'string' ? /^input\d+$/.test(val) : false; }), ]), invertInput: zod_1.z.boolean().optional(), cameraList: zod_1.z.array(zod_1.z.number()), camera: zod_1.z.number().nonnegative().optional(), schedule: zod_1.z.string().optional(), customName: zod_1.z.string().default(''), zIndex: zod_1.z.number().optional(), width: zod_1.z.number().nonnegative(), height: zod_1.z.number().nonnegative(), }); exports.sharingSchema = exports.serviceCommonSchema.extend({ pos_x: zod_1.z.number().nonnegative(), pos_y: zod_1.z.number().nonnegative(), coordSystem: exports.coordinateSystemSchema, screenSize: zod_1.z.number().positive(), fps: zod_1.z.number(), }); exports.overlaySchema = zod_1.z.object({ active: zod_1.z.boolean(), coordSystem: exports.coordinateSystemSchema, pos_x: zod_1.z.number(), pos_y: zod_1.z.number(), imgPath: zod_1.z.string(), imgName: zod_1.z.string(), duration: zod_1.z.number(), scale: zod_1.z.number(), fps: zod_1.z.number().optional(), });