camstreamerlib 4.0.0-beta.30 → 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.
Files changed (91) hide show
  1. package/cjs/CamOverlayAPI.d.ts +4 -15
  2. package/cjs/CamOverlayAPI.js +10 -21
  3. package/cjs/CamScripterAPI.d.ts +3 -2
  4. package/cjs/CamScripterAPI.js +5 -5
  5. package/cjs/CamStreamerAPI.d.ts +3 -2
  6. package/cjs/CamStreamerAPI.js +4 -4
  7. package/cjs/CamSwitcherAPI.d.ts +3 -2
  8. package/cjs/CamSwitcherAPI.js +7 -7
  9. package/cjs/PlaneTrackerAPI.d.ts +3 -2
  10. package/cjs/PlaneTrackerAPI.js +15 -15
  11. package/cjs/VapixAPI.d.ts +3 -2
  12. package/cjs/VapixAPI.js +13 -13
  13. package/cjs/events/AxisCameraStationEvents.d.ts +4 -2
  14. package/cjs/events/AxisCameraStationEvents.js +4 -4
  15. package/cjs/index.d.ts +0 -1
  16. package/cjs/index.js +0 -1
  17. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  18. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +35 -82
  19. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  20. package/cjs/types/CamOverlayAPI/accuweatherSchema.js +8 -11
  21. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  22. package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +6 -9
  23. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  24. package/cjs/types/CamOverlayAPI/imagesSchema.js +5 -8
  25. package/cjs/types/CamOverlayAPI/index.d.ts +2 -0
  26. package/cjs/types/CamOverlayAPI/index.js +2 -0
  27. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  28. package/cjs/types/CamOverlayAPI/infotickerSchema.js +7 -10
  29. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  30. package/cjs/types/CamOverlayAPI/pipSchema.js +5 -8
  31. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  32. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +5 -8
  33. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  34. package/cjs/types/CamOverlayAPI/ptzSchema.js +5 -8
  35. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  36. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +4 -7
  37. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  38. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +4 -7
  39. package/cjs/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  40. package/cjs/types/CamOverlayAPI/widgetCommonTypes.js +87 -0
  41. package/cjs/types/CamStreamerAPI.d.ts +4 -4
  42. package/cjs/types/CamSwitcherAPI.d.ts +0 -2
  43. package/cjs/types/VapixAPI.d.ts +0 -2
  44. package/esm/CamOverlayAPI.d.ts +4 -15
  45. package/esm/CamOverlayAPI.js +9 -20
  46. package/esm/CamScripterAPI.d.ts +3 -2
  47. package/esm/CamScripterAPI.js +5 -5
  48. package/esm/CamStreamerAPI.d.ts +3 -2
  49. package/esm/CamStreamerAPI.js +4 -4
  50. package/esm/CamSwitcherAPI.d.ts +3 -2
  51. package/esm/CamSwitcherAPI.js +7 -7
  52. package/esm/PlaneTrackerAPI.d.ts +3 -2
  53. package/esm/PlaneTrackerAPI.js +15 -15
  54. package/esm/VapixAPI.d.ts +3 -2
  55. package/esm/VapixAPI.js +13 -13
  56. package/esm/events/AxisCameraStationEvents.d.ts +4 -2
  57. package/esm/events/AxisCameraStationEvents.js +4 -4
  58. package/esm/index.d.ts +0 -1
  59. package/esm/index.js +0 -1
  60. package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  61. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +17 -73
  62. package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  63. package/esm/types/CamOverlayAPI/accuweatherSchema.js +1 -3
  64. package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  65. package/esm/types/CamOverlayAPI/customGraphicsSchema.js +1 -3
  66. package/esm/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  67. package/esm/types/CamOverlayAPI/imagesSchema.js +1 -3
  68. package/esm/types/CamOverlayAPI/index.d.ts +2 -0
  69. package/esm/types/CamOverlayAPI/index.js +2 -0
  70. package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  71. package/esm/types/CamOverlayAPI/infotickerSchema.js +1 -3
  72. package/esm/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  73. package/esm/types/CamOverlayAPI/pipSchema.js +1 -3
  74. package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  75. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +1 -3
  76. package/esm/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  77. package/esm/types/CamOverlayAPI/ptzSchema.js +1 -3
  78. package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  79. package/esm/types/CamOverlayAPI/screenSharingSchema.js +1 -3
  80. package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  81. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +1 -3
  82. package/esm/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  83. package/esm/types/CamOverlayAPI/widgetCommonTypes.js +84 -0
  84. package/esm/types/CamStreamerAPI.d.ts +4 -4
  85. package/esm/types/CamSwitcherAPI.d.ts +0 -2
  86. package/esm/types/VapixAPI.d.ts +0 -2
  87. package/package.json +2 -2
  88. package/cjs/node/WsEventClient.d.ts +0 -13
  89. package/cjs/node/WsEventClient.js +0 -22
  90. package/esm/node/WsEventClient.d.ts +0 -13
  91. package/esm/node/WsEventClient.js +0 -18
@@ -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 { infoTickerSchema, accuweatherSchema, ptzCompassSchema, imagesSchema, ptzSchema, pipSchema, screenSharingSchema, webCameraSharingSchema, } from './index';
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 sharingSchema = widgetCommonSchema.extend({
78
- pos_x: z.number().nonnegative(),
79
- pos_y: z.number().nonnegative(),
80
- coordSystem: coordinateSystemSchema,
81
- screenSize: z.number().positive(),
82
- fps: z.number(),
83
- });
84
- export const overlaySchema = z.object({
85
- active: z.boolean(),
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';