camstreamerlib 4.0.0-beta.97 → 4.0.1

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 (218) hide show
  1. package/README.md +44 -15
  2. package/cjs/CamOverlayAPI.d.ts +147 -109
  3. package/cjs/CamOverlayAPI.js +14 -63
  4. package/cjs/CamScripterAPI.d.ts +5 -8
  5. package/cjs/CamScripterAPI.js +11 -29
  6. package/cjs/CamStreamerAPI.d.ts +2745 -589
  7. package/cjs/CamStreamerAPI.js +68 -76
  8. package/cjs/CamSwitcherAPI.d.ts +23 -22
  9. package/cjs/CamSwitcherAPI.js +30 -88
  10. package/cjs/PlaneTrackerAPI.d.ts +28 -30
  11. package/cjs/PlaneTrackerAPI.js +20 -75
  12. package/cjs/VapixAPI.d.ts +36 -23
  13. package/cjs/VapixAPI.js +227 -106
  14. package/cjs/errors/errors.d.ts +11 -5
  15. package/cjs/errors/errors.js +5 -1
  16. package/cjs/index.d.ts +1 -0
  17. package/cjs/index.js +1 -0
  18. package/cjs/internal/BasicAPI.d.ts +15 -0
  19. package/cjs/internal/BasicAPI.js +93 -0
  20. package/cjs/internal/WsEvents.d.ts +1 -0
  21. package/cjs/internal/WsEvents.js +5 -0
  22. package/cjs/internal/constants.d.ts +1 -0
  23. package/cjs/internal/constants.js +2 -1
  24. package/cjs/internal/convertors.d.ts +6 -0
  25. package/cjs/internal/convertors.js +115 -0
  26. package/cjs/internal/transformers.js +8 -8
  27. package/cjs/internal/types.d.ts +3 -0
  28. package/cjs/internal/versionCompare.d.ts +2 -2
  29. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +894 -374
  30. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +54 -11
  31. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
  32. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +40 -40
  33. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  34. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.js +21 -0
  35. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
  36. package/cjs/types/CamOverlayAPI/index.d.ts +1 -0
  37. package/cjs/types/CamOverlayAPI/index.js +1 -0
  38. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
  39. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +8 -8
  40. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
  41. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
  42. package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  43. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
  44. package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
  45. package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
  46. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
  47. package/cjs/types/CamScripterAPI.d.ts +0 -11
  48. package/cjs/types/CamScripterAPI.js +1 -5
  49. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +19642 -3073
  50. package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +126 -57
  51. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +434 -52
  52. package/cjs/types/CamStreamerAPI/facebookSchema.js +13 -1
  53. package/cjs/types/CamStreamerAPI/index.d.ts +1 -3
  54. package/cjs/types/CamStreamerAPI/index.js +1 -3
  55. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
  56. package/cjs/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  57. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +430 -219
  58. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +116 -58
  59. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
  60. package/cjs/types/CamStreamerAPI/streamsSchema.js +81 -0
  61. package/cjs/types/CamStreamerAPI/windySchema.d.ts +394 -52
  62. package/cjs/types/CamStreamerAPI/windySchema.js +9 -1
  63. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +402 -52
  64. package/cjs/types/CamStreamerAPI/youtubeSchema.js +12 -1
  65. package/cjs/types/CamSwitcherAPI.d.ts +96 -91
  66. package/cjs/types/CamSwitcherAPI.js +9 -9
  67. package/cjs/types/GenetecAgent.d.ts +2 -2
  68. package/cjs/types/PlaneTrackerAPI.d.ts +60 -47
  69. package/cjs/types/PlaneTrackerAPI.js +5 -2
  70. package/cjs/types/VapixAPI.d.ts +51 -32
  71. package/cjs/types/VapixAPI.js +10 -3
  72. package/cjs/types/common.d.ts +27 -0
  73. package/cjs/types/common.js +13 -1
  74. package/cjs/types/ws/CamStreamerEvents.d.ts +110 -77
  75. package/cjs/types/ws/CamStreamerEvents.js +11 -7
  76. package/cjs/types/ws/CamSwitcherEvents.d.ts +8 -8
  77. package/cjs/types/ws/PlaneTrackerEvents.d.ts +3 -3
  78. package/esm/CamOverlayAPI.js +16 -65
  79. package/esm/CamScripterAPI.js +9 -30
  80. package/esm/CamStreamerAPI.js +70 -78
  81. package/esm/CamSwitcherAPI.js +31 -89
  82. package/esm/PlaneTrackerAPI.js +21 -76
  83. package/esm/VapixAPI.js +228 -107
  84. package/esm/errors/errors.js +5 -1
  85. package/esm/index.js +1 -0
  86. package/esm/internal/BasicAPI.js +89 -0
  87. package/esm/internal/WsEvents.js +5 -0
  88. package/esm/internal/constants.js +1 -0
  89. package/esm/internal/convertors.js +108 -0
  90. package/esm/internal/transformers.js +1 -1
  91. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +47 -10
  92. package/esm/types/CamOverlayAPI/htmlOverlaySchema.js +18 -0
  93. package/esm/types/CamOverlayAPI/index.js +1 -0
  94. package/esm/types/CamOverlayAPI/serviceCommonTypes.js +6 -3
  95. package/esm/types/CamScripterAPI.js +0 -4
  96. package/esm/types/CamStreamerAPI/CamStreamerAPI.js +109 -41
  97. package/esm/types/CamStreamerAPI/facebookSchema.js +13 -1
  98. package/esm/types/CamStreamerAPI/index.js +1 -3
  99. package/esm/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  100. package/esm/types/CamStreamerAPI/streamCommonTypes.js +116 -58
  101. package/esm/types/CamStreamerAPI/streamsSchema.js +75 -0
  102. package/esm/types/CamStreamerAPI/windySchema.js +9 -1
  103. package/esm/types/CamStreamerAPI/youtubeSchema.js +12 -1
  104. package/esm/types/CamSwitcherAPI.js +8 -8
  105. package/esm/types/PlaneTrackerAPI.js +5 -2
  106. package/esm/types/VapixAPI.js +9 -2
  107. package/esm/types/common.js +12 -0
  108. package/esm/types/ws/CamStreamerEvents.js +11 -7
  109. package/package.json +4 -4
  110. package/types/CamOverlayAPI.d.ts +147 -109
  111. package/types/CamScripterAPI.d.ts +5 -8
  112. package/types/CamStreamerAPI.d.ts +2745 -589
  113. package/types/CamSwitcherAPI.d.ts +23 -22
  114. package/types/PlaneTrackerAPI.d.ts +28 -30
  115. package/types/VapixAPI.d.ts +36 -23
  116. package/types/errors/errors.d.ts +11 -5
  117. package/types/index.d.ts +1 -0
  118. package/types/internal/BasicAPI.d.ts +15 -0
  119. package/types/internal/WsEvents.d.ts +1 -0
  120. package/types/internal/constants.d.ts +1 -0
  121. package/types/internal/convertors.d.ts +6 -0
  122. package/types/internal/types.d.ts +3 -0
  123. package/types/internal/versionCompare.d.ts +2 -2
  124. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +894 -374
  125. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +10 -10
  126. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +40 -40
  127. package/types/types/CamOverlayAPI/htmlOverlaySchema.d.ts +81 -0
  128. package/types/types/CamOverlayAPI/imagesSchema.d.ts +10 -10
  129. package/types/types/CamOverlayAPI/index.d.ts +1 -0
  130. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +8 -8
  131. package/types/types/CamOverlayAPI/pipSchema.d.ts +8 -8
  132. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +10 -10
  133. package/types/types/CamOverlayAPI/ptzSchema.d.ts +13 -13
  134. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  135. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +8 -8
  136. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +17 -16
  137. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +8 -8
  138. package/types/types/CamScripterAPI.d.ts +0 -11
  139. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +19642 -3073
  140. package/types/types/CamStreamerAPI/facebookSchema.d.ts +434 -52
  141. package/types/types/CamStreamerAPI/index.d.ts +1 -3
  142. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +47 -47
  143. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +430 -219
  144. package/types/types/CamStreamerAPI/streamsSchema.d.ts +8812 -0
  145. package/types/types/CamStreamerAPI/windySchema.d.ts +394 -52
  146. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +402 -52
  147. package/types/types/CamSwitcherAPI.d.ts +96 -91
  148. package/types/types/GenetecAgent.d.ts +2 -2
  149. package/types/types/PlaneTrackerAPI.d.ts +60 -47
  150. package/types/types/VapixAPI.d.ts +51 -32
  151. package/types/types/common.d.ts +27 -0
  152. package/types/types/ws/CamStreamerEvents.d.ts +110 -77
  153. package/types/types/ws/CamSwitcherEvents.d.ts +8 -8
  154. package/types/types/ws/PlaneTrackerEvents.d.ts +3 -3
  155. package/cjs/types/CamStreamerAPI/churchSchema.d.ts +0 -202
  156. package/cjs/types/CamStreamerAPI/churchSchema.js +0 -11
  157. package/cjs/types/CamStreamerAPI/daCastSchema.d.ts +0 -202
  158. package/cjs/types/CamStreamerAPI/daCastSchema.js +0 -11
  159. package/cjs/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -202
  160. package/cjs/types/CamStreamerAPI/dailymotionSchema.js +0 -11
  161. package/cjs/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -202
  162. package/cjs/types/CamStreamerAPI/gameChangerSchema.js +0 -11
  163. package/cjs/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -202
  164. package/cjs/types/CamStreamerAPI/hlsPullSchema.js +0 -11
  165. package/cjs/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -202
  166. package/cjs/types/CamStreamerAPI/hlsPushSchema.js +0 -11
  167. package/cjs/types/CamStreamerAPI/ibmSchema.d.ts +0 -202
  168. package/cjs/types/CamStreamerAPI/ibmSchema.js +0 -11
  169. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -202
  170. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.js +0 -11
  171. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -202
  172. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.js +0 -11
  173. package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -250
  174. package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +0 -27
  175. package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +0 -211
  176. package/cjs/types/CamStreamerAPI/rtmpSchema.js +0 -14
  177. package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +0 -202
  178. package/cjs/types/CamStreamerAPI/sdCardSchema.js +0 -11
  179. package/cjs/types/CamStreamerAPI/srtSchema.d.ts +0 -202
  180. package/cjs/types/CamStreamerAPI/srtSchema.js +0 -11
  181. package/cjs/types/CamStreamerAPI/twitchSchema.d.ts +0 -202
  182. package/cjs/types/CamStreamerAPI/twitchSchema.js +0 -11
  183. package/cjs/types/CamStreamerAPI/vimeoSchema.d.ts +0 -202
  184. package/cjs/types/CamStreamerAPI/vimeoSchema.js +0 -11
  185. package/cjs/types/CamStreamerAPI/wowzaSchema.d.ts +0 -202
  186. package/cjs/types/CamStreamerAPI/wowzaSchema.js +0 -11
  187. package/esm/types/CamStreamerAPI/churchSchema.js +0 -5
  188. package/esm/types/CamStreamerAPI/daCastSchema.js +0 -5
  189. package/esm/types/CamStreamerAPI/dailymotionSchema.js +0 -5
  190. package/esm/types/CamStreamerAPI/gameChangerSchema.js +0 -5
  191. package/esm/types/CamStreamerAPI/hlsPullSchema.js +0 -5
  192. package/esm/types/CamStreamerAPI/hlsPushSchema.js +0 -5
  193. package/esm/types/CamStreamerAPI/ibmSchema.js +0 -5
  194. package/esm/types/CamStreamerAPI/microsoftAzureSchema.js +0 -5
  195. package/esm/types/CamStreamerAPI/microsoftStreamSchema.js +0 -5
  196. package/esm/types/CamStreamerAPI/mpegDvbSchema.js +0 -21
  197. package/esm/types/CamStreamerAPI/rtmpSchema.js +0 -8
  198. package/esm/types/CamStreamerAPI/sdCardSchema.js +0 -5
  199. package/esm/types/CamStreamerAPI/srtSchema.js +0 -5
  200. package/esm/types/CamStreamerAPI/twitchSchema.js +0 -5
  201. package/esm/types/CamStreamerAPI/vimeoSchema.js +0 -5
  202. package/esm/types/CamStreamerAPI/wowzaSchema.js +0 -5
  203. package/types/types/CamStreamerAPI/churchSchema.d.ts +0 -202
  204. package/types/types/CamStreamerAPI/daCastSchema.d.ts +0 -202
  205. package/types/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -202
  206. package/types/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -202
  207. package/types/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -202
  208. package/types/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -202
  209. package/types/types/CamStreamerAPI/ibmSchema.d.ts +0 -202
  210. package/types/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -202
  211. package/types/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -202
  212. package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -250
  213. package/types/types/CamStreamerAPI/rtmpSchema.d.ts +0 -211
  214. package/types/types/CamStreamerAPI/sdCardSchema.d.ts +0 -202
  215. package/types/types/CamStreamerAPI/srtSchema.d.ts +0 -202
  216. package/types/types/CamStreamerAPI/twitchSchema.d.ts +0 -202
  217. package/types/types/CamStreamerAPI/vimeoSchema.d.ts +0 -202
  218. package/types/types/CamStreamerAPI/wowzaSchema.d.ts +0 -202
@@ -1,64 +1,122 @@
1
1
  import { z } from 'zod';
2
- import { booleanSchema } from '../common';
3
- export const streamTypeSchema = z.union([
4
- z.literal('youtube'),
5
- z.literal('facebook'),
6
- z.literal('sd_card'),
7
- z.literal('windy'),
8
- z.literal('mpeg_dvb'),
9
- z.literal('rtmp'),
10
- z.literal('dailymotion'),
11
- z.literal('ibm'),
12
- z.literal('hls_pull'),
13
- z.literal('hls_push'),
14
- z.literal('wowza'),
15
- z.literal('microsoft_stream'),
16
- z.literal('microsoft_azure'),
17
- z.literal('vimeo'),
18
- z.literal('twitch'),
19
- z.literal('church'),
20
- z.literal('srt'),
21
- z.literal('da_cast'),
22
- z.literal('game_changer'),
23
- ]);
24
- const scheduleSchema = z.object({
25
- start: z.object({
26
- day: z.number().int().min(0).max(6),
27
- timeS: z.number().int().min(0).max(86400),
28
- }),
29
- stop: z.object({
30
- day: z.number().int().min(0).max(6),
31
- timeS: z.number().int().min(0).max(86400),
32
- }),
33
- isActive: z.boolean(),
34
- });
35
- export const streamTriggerSchema = z.discriminatedUnion('type', [
36
- z.object({
37
- type: z.literal('manual'),
38
- ioPort: z.string().nullable(),
39
- }),
40
- z.object({ type: z.literal('onetime'), startTime: z.number(), stopTime: z.number() }),
41
- z.object({
42
- type: z.literal('recurrent'),
43
- schedule: z.array(scheduleSchema),
44
- }),
45
- ]);
46
- export const streamInputTypeSchema = z.union([z.literal('CSw'), z.literal('CRS'), z.literal('RTSP_URL')]);
47
- export const internalVapixParametersSchema = z.object({
48
- camera: z.string(),
49
- resolution: z.string().optional(),
50
- compression: z.number().optional(),
51
- fps: z.number().int().optional(),
52
- videobitrate: z.number().int().optional(),
53
- videomaxbitrate: z.number().int().optional(),
54
- audio: booleanSchema.optional(),
55
- });
2
+ import { bitrateVapixParamsSchema, booleanSchema, h264ProfileSchema } from '../common';
56
3
  export const streamCommonSchema = z.object({
57
- id: z.number(),
4
+ streamId: z.string(),
58
5
  enabled: z.boolean(),
59
6
  active: z.boolean(),
60
7
  title: z.string(),
61
- trigger: streamTriggerSchema,
62
- inputType: streamInputTypeSchema,
63
- internalVapixParameters: internalVapixParametersSchema,
8
+ callApi: z.boolean(),
9
+ trigger: z.discriminatedUnion('type', [
10
+ z.object({
11
+ type: z.literal('manual'),
12
+ port: z.number().optional(),
13
+ }),
14
+ z.object({
15
+ type: z.literal('onetime'),
16
+ startTime: z.number(),
17
+ stopTime: z.number(),
18
+ everActivated: z.boolean(),
19
+ prepareAheadS: z.number().int().optional(),
20
+ }),
21
+ z.object({
22
+ type: z.literal('recurrent'),
23
+ schedule: z.array(z.object({
24
+ start: z.object({
25
+ day: z.number().int().min(0).max(6),
26
+ timeS: z.number().int().min(0).max(86400),
27
+ }),
28
+ stop: z.object({
29
+ day: z.number().int().min(0).max(6),
30
+ timeS: z.number().int().min(0).max(86400),
31
+ }),
32
+ isActive: z.boolean(),
33
+ })),
34
+ prepareAheadS: z.number().int().optional(),
35
+ }),
36
+ ]),
37
+ video: z.object({
38
+ output: z.discriminatedUnion('type', [
39
+ z.object({
40
+ type: z.literal('video'),
41
+ url: z.string().nullable(),
42
+ parameters: z.string(),
43
+ saveToSdCard: z
44
+ .object({
45
+ ruleId: z.string(),
46
+ configurationId: z.string(),
47
+ })
48
+ .optional(),
49
+ }),
50
+ z.object({
51
+ type: z.literal('images'),
52
+ url: z.string().nullable(),
53
+ imageIntervalS: z.number(),
54
+ }),
55
+ z.object({
56
+ type: z.literal('none'),
57
+ saveToSdCard: z.object({
58
+ ruleId: z.string(),
59
+ configurationId: z.string(),
60
+ }),
61
+ }),
62
+ ]),
63
+ input: z.discriminatedUnion('type', [
64
+ z.object({
65
+ type: z.literal('RTSP_URL'),
66
+ url: z.string(),
67
+ internalVapixParameters: z.string(),
68
+ }),
69
+ z.object({
70
+ type: z.literal('CSw'),
71
+ internalVapixParameters: z.string(),
72
+ }),
73
+ z.object({
74
+ type: z.literal('CRS'),
75
+ internalVapixParameters: z.string(),
76
+ userVapixParameters: z.string(),
77
+ }),
78
+ ]),
79
+ delayS: z.number().int().nonnegative().optional(),
80
+ }),
81
+ audio: z.discriminatedUnion('source', [
82
+ z.object({
83
+ source: z.literal('none'),
84
+ }),
85
+ z.object({
86
+ source: z.literal('microphone'),
87
+ audioChannelNbr: z.number().int(),
88
+ forceStereo: z.boolean(),
89
+ }),
90
+ z.object({
91
+ source: z.literal('file'),
92
+ name: z.string(),
93
+ path: z.string(),
94
+ forceStereo: z.boolean(),
95
+ }),
96
+ z.object({
97
+ source: z.literal('url'),
98
+ name: z.string(),
99
+ url: z.string(),
100
+ avSyncMsec: z.number().int().nonnegative(),
101
+ forceStereo: z.boolean(),
102
+ }),
103
+ ]),
104
+ status: z.object({
105
+ led: z.boolean(),
106
+ port: z.number().optional(),
107
+ }),
108
+ });
109
+ export const internalVapixParametersSchema = bitrateVapixParamsSchema.extend({
110
+ camera: z.string(),
111
+ resolution: z.string(),
112
+ fps: z.number().int(),
113
+ compression: z.number().int(),
114
+ govLength: z.number().int(),
115
+ videoCodec: z.union([z.literal('h264'), z.literal('h265'), z.literal('av1')]),
116
+ h264Profile: h264ProfileSchema.optional(),
117
+ audio: booleanSchema,
118
+ nbrOfChannels: z.union([z.literal(1), z.literal(2)]).optional(),
119
+ overlays: z
120
+ .union([z.literal('all'), z.literal('text'), z.literal('image'), z.literal('application'), z.literal('off')])
121
+ .optional(),
64
122
  });
@@ -0,0 +1,75 @@
1
+ import z from 'zod';
2
+ import { streamCommonSchema } from './streamCommonTypes';
3
+ export const streamPlatforms = {
4
+ da_cast: 'da_cast',
5
+ dailymotion: 'dailymotion',
6
+ facebook_rtmp: 'facebook_rtmp',
7
+ game_changer: 'game_changer',
8
+ hls_pull: 'hls_pull',
9
+ hls_push: 'hls_push',
10
+ ibm: 'ibm',
11
+ mpeg_dvb: 'mpeg_dvb',
12
+ microsoft_azure: 'microsoft_azure',
13
+ microsoft_stream: 'microsoft_stream',
14
+ rtmp: 'rtmp',
15
+ sd_card: 'sd_card',
16
+ srt: 'srt',
17
+ twitch: 'twitch',
18
+ vimeo: 'vimeo',
19
+ wowza: 'wowza',
20
+ youtube_rtmp: 'youtube_rtmp',
21
+ windy: 'windy',
22
+ youtube: 'youtube',
23
+ facebook: 'facebook',
24
+ };
25
+ export const daCastSchema = streamCommonSchema.extend({
26
+ platform: z.literal(streamPlatforms.da_cast),
27
+ });
28
+ export const dailymotionSchema = streamCommonSchema.extend({
29
+ platform: z.literal(streamPlatforms.dailymotion),
30
+ });
31
+ export const facebookRtmpSchema = streamCommonSchema.extend({
32
+ platform: z.literal(streamPlatforms.facebook_rtmp),
33
+ });
34
+ export const gameChangerSchema = streamCommonSchema.extend({
35
+ platform: z.literal(streamPlatforms.game_changer),
36
+ });
37
+ export const hlsPullSchema = streamCommonSchema.extend({
38
+ platform: z.literal(streamPlatforms.hls_pull),
39
+ });
40
+ export const hlsPushSchema = streamCommonSchema.extend({
41
+ platform: z.literal(streamPlatforms.hls_push),
42
+ });
43
+ export const ibmSchema = streamCommonSchema.extend({
44
+ platform: z.literal(streamPlatforms.ibm),
45
+ });
46
+ export const mpegDvbSchema = streamCommonSchema.extend({
47
+ platform: z.literal(streamPlatforms.mpeg_dvb),
48
+ });
49
+ export const microsoftAzureSchema = streamCommonSchema.extend({
50
+ platform: z.literal(streamPlatforms.microsoft_azure),
51
+ });
52
+ export const microsoftStreamSchema = streamCommonSchema.extend({
53
+ platform: z.literal(streamPlatforms.microsoft_stream),
54
+ });
55
+ export const rtmpSchema = streamCommonSchema.extend({
56
+ platform: z.literal(streamPlatforms.rtmp),
57
+ });
58
+ export const sdCardSchema = streamCommonSchema.extend({
59
+ platform: z.literal(streamPlatforms.sd_card),
60
+ });
61
+ export const srtSchema = streamCommonSchema.extend({
62
+ platform: z.literal(streamPlatforms.srt),
63
+ });
64
+ export const twitchSchema = streamCommonSchema.extend({
65
+ platform: z.literal(streamPlatforms.twitch),
66
+ });
67
+ export const vimeoSchema = streamCommonSchema.extend({
68
+ platform: z.literal(streamPlatforms.vimeo),
69
+ });
70
+ export const wowzaSchema = streamCommonSchema.extend({
71
+ platform: z.literal(streamPlatforms.wowza),
72
+ });
73
+ export const youtubeRtmpSchema = streamCommonSchema.extend({
74
+ platform: z.literal(streamPlatforms.youtube_rtmp),
75
+ });
@@ -1,5 +1,13 @@
1
1
  import z from 'zod';
2
2
  import { streamCommonSchema } from './streamCommonTypes';
3
3
  export const windySchema = streamCommonSchema.extend({
4
- type: z.literal('windy'),
4
+ platform: z.literal('windy'),
5
+ locationLat: z.number(),
6
+ locationLon: z.number(),
7
+ locationName: z.string(),
8
+ locationAddress: z.string(),
9
+ mapZoom: z.number(),
10
+ direction: z.enum(['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']).nullable(),
11
+ position: z.union([z.literal('fix'), z.literal('rotating'), z.literal('controllable')]),
12
+ webPageUrl: z.string(),
5
13
  });
@@ -1,5 +1,16 @@
1
1
  import z from 'zod';
2
2
  import { streamCommonSchema } from './streamCommonTypes';
3
3
  export const youtubeSchema = streamCommonSchema.extend({
4
- type: z.literal('youtube'),
4
+ platform: z.literal('youtube'),
5
+ description: z.string().optional(),
6
+ playlists: z.array(z.string()),
7
+ tags: z.array(z.string()),
8
+ notificationEmails: z.array(z.string().email()),
9
+ streamPrivacy: z.union([z.literal('public'), z.literal('unlisted'), z.literal('private')]),
10
+ latency: z.union([z.literal('normal'), z.literal('low'), z.literal('ultra_low')]),
11
+ afterEndStatus: z.union([z.literal('no_change'), z.literal('public'), z.literal('unlisted'), z.literal('private')]),
12
+ dvr: z.boolean(),
13
+ hasWatchdogs: z.boolean(),
14
+ countdown: z.boolean().optional(),
15
+ streamingProtocol: z.union([z.literal('RTMP'), z.literal('RTMPS'), z.literal('HLS')]),
5
16
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { toCamelCase, toCamelCaseDeep } from '../internal/transformers';
3
- import { storageTypeSchema, keyboardShortcutsSchema, h264ProfileSchema, audioChannelCountSchema, keyboardShortcutSchema, } from './common';
3
+ import { storageTypeSchema, keyboardShortcutsSchema, h264ProfileSchema, audioChannelCountSchema, keyboardShortcutSchema, bitrateVapixParamsSchema, } from './common';
4
4
  const channelTypeSchema = z.union([z.literal('audio'), z.literal('video'), z.literal('av')]);
5
5
  const playlistPlayTypeSchema = z.union([
6
6
  z.literal('PLAY_ALL'),
@@ -132,13 +132,6 @@ export const clipListSchema = z.object({
132
132
  ])),
133
133
  })),
134
134
  });
135
- export const bitrateModeSchema = z.union([z.literal('VBR'), z.literal('MBR'), z.literal('ABR')]);
136
- export const bitrateVapixParamsSchema = z.object({
137
- bitrateMode: bitrateModeSchema,
138
- maximumBitRate: z.number(),
139
- retentionTime: z.number(),
140
- bitRateLimit: z.number(),
141
- });
142
135
  export const cameraOptionsSchema = bitrateVapixParamsSchema
143
136
  .extend({
144
137
  resolution: z.string(),
@@ -169,3 +162,10 @@ export const secondaryAudioSettingsSchema = z.object({
169
162
  secondaryAudioLevel: z.number(),
170
163
  masterAudioLevel: z.number(),
171
164
  });
165
+ export const clipFilesListSchema = z.object({
166
+ status: z.number(),
167
+ message: z.string(),
168
+ data: z.object({
169
+ files: z.array(z.string()),
170
+ }),
171
+ });
@@ -38,6 +38,7 @@ const identificationLabelSchema = z.object({
38
38
  opacity: z.number().positive(),
39
39
  });
40
40
  export const cameraSettingsSchema = z.object({
41
+ trackingDomain: z.union([z.literal('adsb'), z.literal('dronetag')]).default('adsb'),
41
42
  units: z.union([z.literal('metric'), z.literal('imperial')]).default('imperial'),
42
43
  adsbSource: z
43
44
  .object({
@@ -120,15 +121,17 @@ export const cameraSettingsSchema = z.object({
120
121
  displayPTError: z.boolean().optional(),
121
122
  displayPTZSpeed: z.boolean().optional(),
122
123
  displayVelocityData: z.boolean().optional(),
124
+ displayAdsbVelocityData: z.boolean().optional(),
123
125
  displaySignalQuality: z.boolean().optional(),
124
126
  displayAutoTrackingInfo: z.boolean().optional(),
125
127
  displayGPSCoords: z.boolean().optional(),
126
128
  displayVapixQuery: z.boolean().optional(),
127
129
  displayFocus: z.boolean().optional(),
128
130
  displayAperture: z.boolean().optional(),
131
+ displayAircraftInfo: z.boolean().optional(),
129
132
  displaySunDistance: z.boolean().optional(),
130
133
  displayTickTime: z.boolean().optional(),
131
- displayAircraftInfo: z.boolean().optional(),
134
+ displaySystemInfo: z.boolean().optional(),
132
135
  })
133
136
  .optional(),
134
137
  widget: widgetSchema.default({
@@ -262,7 +265,7 @@ export const getIcaoSchema = z.object({
262
265
  icao: z.string(),
263
266
  });
264
267
  export const trackingModeSchema = z.object({
265
- mode: z.union([z.literal('MANUAL'), z.literal('AUTOMATIC')]),
268
+ mode: z.union([z.literal('MANUAL'), z.literal('AUTOMATIC')]).default('AUTOMATIC'),
266
269
  });
267
270
  export const flightInfoSchema = z.object({
268
271
  callsign: z.string().optional(),
@@ -22,6 +22,7 @@ export const applicationListSchema = z.array(applicationSchema.extend({
22
22
  z.literal('PlaneTracker'),
23
23
  z.literal('Ndihxplugin'),
24
24
  z.literal('SportTracker'),
25
+ z.literal('CamOverlayHtmlplugin'),
25
26
  ])
26
27
  .nullable(),
27
28
  }));
@@ -32,8 +33,8 @@ export const APP_IDS = [
32
33
  'CamScripter',
33
34
  'PlaneTracker',
34
35
  'Ndihxplugin',
35
- 'SportTracker',
36
36
  ];
37
+ export const ALL_APP_IDS = [...APP_IDS, 'SportTracker', 'CamOverlayHtmlplugin'];
37
38
  export const guardTourSchema = z.object({
38
39
  id: z.string(),
39
40
  camNbr: z.unknown(),
@@ -168,7 +169,7 @@ export const getPortsResponseSchema = z.object({
168
169
  method: z.literal('getPorts'),
169
170
  data: z.object({
170
171
  numberOfPorts: z.number(),
171
- items: z.array(portStatusSchema),
172
+ items: z.array(portStatusSchema).optional(),
172
173
  }),
173
174
  });
174
175
  export const portSetSchema = z.object({
@@ -183,3 +184,9 @@ export const portSequenceStateSchema = z.object({
183
184
  state: z.enum(['open', 'closed']),
184
185
  time: z.number().min(0).max(65535),
185
186
  });
187
+ export const recordingConfigItemSchema = z.object({
188
+ diskid: z.string(),
189
+ eventid: z.string(),
190
+ options: z.record(z.string()),
191
+ profile: z.string(),
192
+ });
@@ -12,3 +12,15 @@ export const networkCameraListSchema = z.array(z.object({
12
12
  }));
13
13
  export const keyboardShortcutSchema = z.string().nullable();
14
14
  export const keyboardShortcutsSchema = z.record(keyboardShortcutSchema);
15
+ export const bitrateModeSchema = z.union([z.literal('VBR'), z.literal('MBR'), z.literal('ABR')]);
16
+ export const bitrateVapixParamsSchema = z.object({
17
+ bitrateMode: bitrateModeSchema,
18
+ maximumBitRate: z.number(),
19
+ retentionTime: z.number(),
20
+ bitRateLimit: z.number(),
21
+ });
22
+ export const fileSchema = typeof File !== 'undefined'
23
+ ? z.instanceof(File)
24
+ : z.custom((val) => {
25
+ return val !== null && typeof val === 'object' && 'name' in val && 'size' in val && 'type' in val;
26
+ });
@@ -3,25 +3,29 @@ const csEventsDataSchema = z.discriminatedUnion('type', [
3
3
  z.object({ type: z.literal('authorization'), state: z.string() }),
4
4
  z.object({
5
5
  type: z.literal('StreamState'),
6
- streamID: z.number(),
7
- enabled: z.union([z.literal(0), z.literal(1)]),
8
- active: z.union([z.literal(0), z.literal(1)]),
9
- automationState: z.union([z.literal(0), z.literal(1)]),
10
- isStreaming: z.union([z.literal(0), z.literal(1)]),
6
+ streamId: z.string(),
7
+ isStreaming: z.boolean(),
8
+ active: z.boolean(),
9
+ enabled: z.boolean(),
11
10
  }),
12
11
  z.object({
13
12
  type: z.literal('CS_API_SUCCESS'),
14
13
  apiCall: z.string(),
15
14
  message: z.string(),
16
- streamID: z.string(),
15
+ streamId: z.string(),
17
16
  }),
18
17
  z.object({
19
18
  type: z.literal('CS_API_ERROR'),
20
19
  apiCall: z.string(),
21
20
  message: z.string(),
22
- streamID: z.string(),
21
+ streamId: z.string(),
23
22
  code: z.string(),
24
23
  }),
24
+ z.object({
25
+ type: z.literal('PortChanged'),
26
+ port: z.number(),
27
+ value: z.boolean(),
28
+ }),
25
29
  ]);
26
30
  export const csEventsSchema = z.discriminatedUnion('type', [
27
31
  z.object({ type: z.literal('init'), data: csEventsDataSchema }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.97",
3
+ "version": "4.0.1",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "adm-zip": "^0.5.9",
11
11
  "eventemitter2": "^5.0.1",
12
- "fast-xml-parser": "^5.2.5",
13
- "lodash": "^4.17.21",
12
+ "fast-xml-parser": "^5.3.6",
13
+ "lodash-es": "^4.18.1",
14
14
  "type-fest": "^4.41.0",
15
15
  "undici": "^6.21.3",
16
16
  "ws": "^8.18.0",
@@ -21,7 +21,7 @@
21
21
  "@camstreamer/prettier-config": "^2.0.4",
22
22
  "@types/adm-zip": "^0.5.5",
23
23
  "@types/jest": "^28.0.0",
24
- "@types/lodash": "^4.17.18",
24
+ "@types/lodash-es": "^4.17.12",
25
25
  "@types/node": "^18.19.127",
26
26
  "@types/ws": "^8.5.10",
27
27
  "@typescript-eslint/eslint-plugin": "^6.8.0",