camstreamerlib 4.0.0-beta.31 → 4.0.0-beta.32
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.d.ts +1 -13
- package/cjs/CamOverlayAPI.js +2 -13
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +0 -1
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -519
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +35 -82
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +8 -11
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +6 -9
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
- package/cjs/types/CamOverlayAPI/imagesSchema.js +5 -8
- package/cjs/types/CamOverlayAPI/index.d.ts +2 -0
- package/cjs/types/CamOverlayAPI/index.js +2 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +7 -10
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +5 -46
- package/cjs/types/CamOverlayAPI/pipSchema.js +5 -8
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +5 -8
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
- package/cjs/types/CamOverlayAPI/ptzSchema.js +5 -8
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +4 -7
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +4 -7
- package/cjs/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
- package/cjs/types/CamOverlayAPI/widgetCommonTypes.js +87 -0
- package/cjs/types/CamStreamerAPI.d.ts +4 -4
- package/esm/CamOverlayAPI.d.ts +1 -13
- package/esm/CamOverlayAPI.js +1 -12
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -519
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +17 -73
- package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +1 -3
- package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +1 -3
- package/esm/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
- package/esm/types/CamOverlayAPI/imagesSchema.js +1 -3
- package/esm/types/CamOverlayAPI/index.d.ts +2 -0
- package/esm/types/CamOverlayAPI/index.js +2 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
- package/esm/types/CamOverlayAPI/infotickerSchema.js +1 -3
- package/esm/types/CamOverlayAPI/pipSchema.d.ts +5 -46
- package/esm/types/CamOverlayAPI/pipSchema.js +1 -3
- package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +1 -3
- package/esm/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
- package/esm/types/CamOverlayAPI/ptzSchema.js +1 -3
- package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +1 -3
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +1 -3
- package/esm/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
- package/esm/types/CamOverlayAPI/widgetCommonTypes.js +84 -0
- package/esm/types/CamStreamerAPI.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,65 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { infoTickerSchema } from './infotickerSchema';
|
|
3
|
+
import { accuweatherSchema } from './accuweatherSchema';
|
|
4
|
+
import { ptzCompassSchema } from './ptzCompassSchema';
|
|
5
|
+
import { imagesSchema } from './imagesSchema';
|
|
6
|
+
import { ptzSchema } from './ptzSchema';
|
|
7
|
+
import { pipSchema } from './pipSchema';
|
|
2
8
|
import { customGraphicsSchema } from './customGraphicsSchema';
|
|
3
|
-
import {
|
|
9
|
+
import { screenSharingSchema } from './screenSharingSchema';
|
|
10
|
+
import { webCameraSharingSchema } from './webCameraSharingSchema';
|
|
4
11
|
export const WSResponseSchema = z.object({
|
|
5
12
|
status: z.number(),
|
|
6
13
|
message: z.string(),
|
|
7
14
|
data: z.string(),
|
|
8
15
|
});
|
|
9
|
-
export const coordinateSystemSchema = z.union([
|
|
10
|
-
z.literal('top_left'),
|
|
11
|
-
z.literal('top'),
|
|
12
|
-
z.literal('top_right'),
|
|
13
|
-
z.literal('left'),
|
|
14
|
-
z.literal('center'),
|
|
15
|
-
z.literal('right'),
|
|
16
|
-
z.literal('bottom_left'),
|
|
17
|
-
z.literal('bottom'),
|
|
18
|
-
z.literal('bottom_right'),
|
|
19
|
-
]);
|
|
20
|
-
export const languageSchema = z.union([
|
|
21
|
-
z.literal('en-us'),
|
|
22
|
-
z.literal('fr-fr'),
|
|
23
|
-
z.literal('ja-jp'),
|
|
24
|
-
z.literal('pt-pt'),
|
|
25
|
-
z.literal('es-es'),
|
|
26
|
-
z.literal('de-de'),
|
|
27
|
-
z.literal('ko-kr'),
|
|
28
|
-
z.literal('zh-hk'),
|
|
29
|
-
z.literal('zh-cn'),
|
|
30
|
-
z.literal('nl-nl'),
|
|
31
|
-
z.literal('cs-cz'),
|
|
32
|
-
z.literal('ru-ru'),
|
|
33
|
-
z.literal('sv-se'),
|
|
34
|
-
]);
|
|
35
|
-
export const fontSchema = z.union([
|
|
36
|
-
z.literal('classic'),
|
|
37
|
-
z.literal('digital'),
|
|
38
|
-
z.custom((val) => {
|
|
39
|
-
return typeof val === 'string';
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
export const weatherUnitSchema = z.union([z.literal('Metric'), z.literal('Imperial')]);
|
|
43
|
-
export const widgetCommonSchema = z.object({
|
|
44
|
-
id: z.number().nonnegative(),
|
|
45
|
-
enabled: z.union([z.literal(0), z.literal(1)]),
|
|
46
|
-
automationType: z.union([
|
|
47
|
-
z.literal('time'),
|
|
48
|
-
z.literal('manual'),
|
|
49
|
-
z.literal('schedule'),
|
|
50
|
-
z.custom((val) => {
|
|
51
|
-
return typeof val === 'string' ? /^input\d+$/.test(val) : false;
|
|
52
|
-
}),
|
|
53
|
-
]),
|
|
54
|
-
invertInput: z.boolean().optional(),
|
|
55
|
-
cameraList: z.array(z.number()),
|
|
56
|
-
camera: z.number().nonnegative().optional(),
|
|
57
|
-
schedule: z.string().optional(),
|
|
58
|
-
customName: z.string(),
|
|
59
|
-
zIndex: z.number().optional(),
|
|
60
|
-
width: z.number().nonnegative(),
|
|
61
|
-
height: z.number().nonnegative(),
|
|
62
|
-
});
|
|
63
16
|
export const widgetsSchema = z.discriminatedUnion('name', [
|
|
64
17
|
infoTickerSchema,
|
|
65
18
|
accuweatherSchema,
|
|
@@ -74,24 +27,15 @@ export const widgetsSchema = z.discriminatedUnion('name', [
|
|
|
74
27
|
export const widgetListSchema = z.object({
|
|
75
28
|
services: z.array(widgetsSchema),
|
|
76
29
|
});
|
|
77
|
-
export const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export const
|
|
85
|
-
|
|
86
|
-
coordSystem: coordinateSystemSchema,
|
|
87
|
-
pos_x: z.number(),
|
|
88
|
-
pos_y: z.number(),
|
|
89
|
-
imgPath: z.string(),
|
|
90
|
-
imgName: z.string(),
|
|
91
|
-
duration: z.number(),
|
|
92
|
-
scale: z.number(),
|
|
93
|
-
fps: z.number().optional(),
|
|
94
|
-
});
|
|
30
|
+
export const isAccuweather = (widget) => widget.name === 'accuweather';
|
|
31
|
+
export const isCustomGraphics = (widget) => widget.name === 'customGraphics';
|
|
32
|
+
export const isImages = (widget) => widget.name === 'images';
|
|
33
|
+
export const isInfoticker = (widget) => widget.name === 'infoticker';
|
|
34
|
+
export const isPip = (widget) => widget.name === 'pip';
|
|
35
|
+
export const isPtzCompass = (widget) => widget.name === 'ptzCompass';
|
|
36
|
+
export const isPtz = (widget) => widget.name === 'ptz';
|
|
37
|
+
export const isScreenSharing = (widget) => widget.name === 'screenSharing';
|
|
38
|
+
export const isWebCameraSharing = (widget) => widget.name === 'web_camera';
|
|
95
39
|
export var ImageType;
|
|
96
40
|
(function (ImageType) {
|
|
97
41
|
ImageType[ImageType["PNG"] = 0] = "PNG";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TWidget } from './CamOverlayAPI';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
export declare const accuweatherSchema: z.ZodObject<{
|
|
4
3
|
id: z.ZodNumber;
|
|
@@ -34,14 +33,15 @@ export declare const accuweatherSchema: z.ZodObject<{
|
|
|
34
33
|
id: number;
|
|
35
34
|
width: number;
|
|
36
35
|
height: number;
|
|
37
|
-
pos_x: number;
|
|
38
|
-
pos_y: number;
|
|
39
|
-
font: string;
|
|
40
36
|
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
41
37
|
cameraList: number[];
|
|
42
38
|
customName: string;
|
|
39
|
+
pos_x: number;
|
|
40
|
+
pos_y: number;
|
|
43
41
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
42
|
+
scale: number;
|
|
44
43
|
clockType: "12h" | "24h";
|
|
44
|
+
font: string;
|
|
45
45
|
location: string;
|
|
46
46
|
locationName: string;
|
|
47
47
|
title: string;
|
|
@@ -50,7 +50,6 @@ export declare const accuweatherSchema: z.ZodObject<{
|
|
|
50
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
51
|
units: "Metric" | "Imperial";
|
|
52
52
|
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
53
|
-
scale: number;
|
|
54
53
|
camera?: number | undefined;
|
|
55
54
|
schedule?: string | undefined;
|
|
56
55
|
invertInput?: boolean | undefined;
|
|
@@ -61,43 +60,15 @@ export declare const accuweatherSchema: z.ZodObject<{
|
|
|
61
60
|
id: number;
|
|
62
61
|
width: number;
|
|
63
62
|
height: number;
|
|
64
|
-
pos_x: number;
|
|
65
|
-
pos_y: number;
|
|
66
|
-
font: string;
|
|
67
63
|
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
68
64
|
cameraList: number[];
|
|
69
65
|
customName: string;
|
|
70
|
-
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
71
|
-
clockType: "12h" | "24h";
|
|
72
|
-
location: string;
|
|
73
|
-
locationName: string;
|
|
74
|
-
title: string;
|
|
75
|
-
bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
|
|
76
|
-
bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
|
|
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
|
-
scale: number;
|
|
81
|
-
camera?: number | undefined;
|
|
82
|
-
schedule?: string | undefined;
|
|
83
|
-
invertInput?: boolean | undefined;
|
|
84
|
-
zIndex?: number | undefined;
|
|
85
|
-
}>;
|
|
86
|
-
export type TAccuweather = z.infer<typeof accuweatherSchema>;
|
|
87
|
-
export declare const isAccuweather: (widget: TWidget) => widget is {
|
|
88
|
-
name: "accuweather";
|
|
89
|
-
enabled: 0 | 1;
|
|
90
|
-
id: number;
|
|
91
|
-
width: number;
|
|
92
|
-
height: number;
|
|
93
66
|
pos_x: number;
|
|
94
67
|
pos_y: number;
|
|
95
|
-
font: string;
|
|
96
|
-
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
97
|
-
cameraList: number[];
|
|
98
|
-
customName: string;
|
|
99
68
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
69
|
+
scale: number;
|
|
100
70
|
clockType: "12h" | "24h";
|
|
71
|
+
font: string;
|
|
101
72
|
location: string;
|
|
102
73
|
locationName: string;
|
|
103
74
|
title: string;
|
|
@@ -106,9 +77,8 @@ export declare const isAccuweather: (widget: TWidget) => widget is {
|
|
|
106
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";
|
|
107
78
|
units: "Metric" | "Imperial";
|
|
108
79
|
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
109
|
-
scale: number;
|
|
110
80
|
camera?: number | undefined;
|
|
111
81
|
schedule?: string | undefined;
|
|
112
82
|
invertInput?: boolean | undefined;
|
|
113
83
|
zIndex?: number | undefined;
|
|
114
|
-
}
|
|
84
|
+
}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { allowedWidgetNames } from '../../CamOverlayAPI';
|
|
2
|
-
import { coordinateSystemSchema, fontSchema, languageSchema, weatherUnitSchema, widgetCommonSchema, } from './CamOverlayAPI';
|
|
3
1
|
import { z } from 'zod';
|
|
2
|
+
import { allowedWidgetNames, coordinateSystemSchema, fontSchema, languageSchema, weatherUnitSchema, widgetCommonSchema, } from './widgetCommonTypes';
|
|
4
3
|
export const accuweatherSchema = widgetCommonSchema.extend({
|
|
5
4
|
name: z.literal(allowedWidgetNames.accuweather),
|
|
6
5
|
location: z.string(),
|
|
@@ -43,4 +42,3 @@ export const accuweatherSchema = widgetCommonSchema.extend({
|
|
|
43
42
|
]),
|
|
44
43
|
scale: z.number().nonnegative(),
|
|
45
44
|
});
|
|
46
|
-
export const isAccuweather = (widget) => widget.name === 'accuweather';
|