camstreamerlib 4.0.0-beta.115 → 4.0.0-beta.116

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 (115) hide show
  1. package/cjs/CamStreamerAPI.d.ts +1155 -485
  2. package/cjs/CamStreamerAPI.js +4 -4
  3. package/cjs/VapixAPI.d.ts +1 -1
  4. package/cjs/errors/errors.d.ts +2 -2
  5. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +8076 -2678
  6. package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +39 -55
  7. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +183 -55
  8. package/cjs/types/CamStreamerAPI/facebookSchema.js +6 -10
  9. package/cjs/types/CamStreamerAPI/index.d.ts +1 -5
  10. package/cjs/types/CamStreamerAPI/index.js +1 -5
  11. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +39 -39
  12. package/cjs/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  13. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +224 -341
  14. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +89 -75
  15. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +7333 -0
  16. package/cjs/types/CamStreamerAPI/streamsSchema.js +63 -0
  17. package/cjs/types/CamStreamerAPI/windySchema.d.ts +159 -45
  18. package/cjs/types/CamStreamerAPI/windySchema.js +1 -1
  19. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +159 -54
  20. package/cjs/types/CamStreamerAPI/youtubeSchema.js +1 -4
  21. package/cjs/types/VapixAPI.d.ts +10 -10
  22. package/cjs/types/ws/CamStreamerEvents.d.ts +33 -33
  23. package/cjs/types/ws/CamStreamerEvents.js +3 -3
  24. package/esm/CamStreamerAPI.js +4 -4
  25. package/esm/types/CamStreamerAPI/CamStreamerAPI.js +22 -38
  26. package/esm/types/CamStreamerAPI/facebookSchema.js +5 -9
  27. package/esm/types/CamStreamerAPI/index.js +1 -5
  28. package/esm/types/CamStreamerAPI/oldStreamSchema.js +1 -1
  29. package/esm/types/CamStreamerAPI/streamCommonTypes.js +88 -74
  30. package/esm/types/CamStreamerAPI/streamsSchema.js +57 -0
  31. package/esm/types/CamStreamerAPI/windySchema.js +1 -1
  32. package/esm/types/CamStreamerAPI/youtubeSchema.js +1 -4
  33. package/esm/types/ws/CamStreamerEvents.js +3 -3
  34. package/package.json +1 -1
  35. package/types/CamStreamerAPI.d.ts +1155 -485
  36. package/types/VapixAPI.d.ts +1 -1
  37. package/types/errors/errors.d.ts +2 -2
  38. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +8076 -2678
  39. package/types/types/CamStreamerAPI/facebookSchema.d.ts +183 -55
  40. package/types/types/CamStreamerAPI/index.d.ts +1 -5
  41. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +39 -39
  42. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +224 -341
  43. package/types/types/CamStreamerAPI/streamsSchema.d.ts +7333 -0
  44. package/types/types/CamStreamerAPI/windySchema.d.ts +159 -45
  45. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +159 -54
  46. package/types/types/VapixAPI.d.ts +10 -10
  47. package/types/types/ws/CamStreamerEvents.d.ts +33 -33
  48. package/cjs/types/CamStreamerAPI/churchSchema.d.ts +0 -293
  49. package/cjs/types/CamStreamerAPI/churchSchema.js +0 -11
  50. package/cjs/types/CamStreamerAPI/daCastSchema.d.ts +0 -293
  51. package/cjs/types/CamStreamerAPI/daCastSchema.js +0 -11
  52. package/cjs/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -293
  53. package/cjs/types/CamStreamerAPI/dailymotionSchema.js +0 -11
  54. package/cjs/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -312
  55. package/cjs/types/CamStreamerAPI/gameChangerSchema.js +0 -11
  56. package/cjs/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -293
  57. package/cjs/types/CamStreamerAPI/hlsPullSchema.js +0 -11
  58. package/cjs/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -293
  59. package/cjs/types/CamStreamerAPI/hlsPushSchema.js +0 -11
  60. package/cjs/types/CamStreamerAPI/ibmSchema.d.ts +0 -293
  61. package/cjs/types/CamStreamerAPI/ibmSchema.js +0 -11
  62. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -293
  63. package/cjs/types/CamStreamerAPI/microsoftAzureSchema.js +0 -11
  64. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -293
  65. package/cjs/types/CamStreamerAPI/microsoftStreamSchema.js +0 -11
  66. package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -314
  67. package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +0 -18
  68. package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +0 -619
  69. package/cjs/types/CamStreamerAPI/rtmpSchema.js +0 -19
  70. package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +0 -293
  71. package/cjs/types/CamStreamerAPI/sdCardSchema.js +0 -11
  72. package/cjs/types/CamStreamerAPI/srtSchema.d.ts +0 -293
  73. package/cjs/types/CamStreamerAPI/srtSchema.js +0 -11
  74. package/cjs/types/CamStreamerAPI/twitchSchema.d.ts +0 -293
  75. package/cjs/types/CamStreamerAPI/twitchSchema.js +0 -11
  76. package/cjs/types/CamStreamerAPI/vimeoSchema.d.ts +0 -293
  77. package/cjs/types/CamStreamerAPI/vimeoSchema.js +0 -11
  78. package/cjs/types/CamStreamerAPI/wowzaSchema.d.ts +0 -293
  79. package/cjs/types/CamStreamerAPI/wowzaSchema.js +0 -11
  80. package/cjs/types/CamStreamerAPI/youtubeRtmpSchema.d.ts +0 -312
  81. package/cjs/types/CamStreamerAPI/youtubeRtmpSchema.js +0 -11
  82. package/esm/types/CamStreamerAPI/churchSchema.js +0 -5
  83. package/esm/types/CamStreamerAPI/daCastSchema.js +0 -5
  84. package/esm/types/CamStreamerAPI/dailymotionSchema.js +0 -5
  85. package/esm/types/CamStreamerAPI/gameChangerSchema.js +0 -5
  86. package/esm/types/CamStreamerAPI/hlsPullSchema.js +0 -5
  87. package/esm/types/CamStreamerAPI/hlsPushSchema.js +0 -5
  88. package/esm/types/CamStreamerAPI/ibmSchema.js +0 -5
  89. package/esm/types/CamStreamerAPI/microsoftAzureSchema.js +0 -5
  90. package/esm/types/CamStreamerAPI/microsoftStreamSchema.js +0 -5
  91. package/esm/types/CamStreamerAPI/mpegDvbSchema.js +0 -12
  92. package/esm/types/CamStreamerAPI/rtmpSchema.js +0 -13
  93. package/esm/types/CamStreamerAPI/sdCardSchema.js +0 -5
  94. package/esm/types/CamStreamerAPI/srtSchema.js +0 -5
  95. package/esm/types/CamStreamerAPI/twitchSchema.js +0 -5
  96. package/esm/types/CamStreamerAPI/vimeoSchema.js +0 -5
  97. package/esm/types/CamStreamerAPI/wowzaSchema.js +0 -5
  98. package/esm/types/CamStreamerAPI/youtubeRtmpSchema.js +0 -5
  99. package/types/types/CamStreamerAPI/churchSchema.d.ts +0 -293
  100. package/types/types/CamStreamerAPI/daCastSchema.d.ts +0 -293
  101. package/types/types/CamStreamerAPI/dailymotionSchema.d.ts +0 -293
  102. package/types/types/CamStreamerAPI/gameChangerSchema.d.ts +0 -312
  103. package/types/types/CamStreamerAPI/hlsPullSchema.d.ts +0 -293
  104. package/types/types/CamStreamerAPI/hlsPushSchema.d.ts +0 -293
  105. package/types/types/CamStreamerAPI/ibmSchema.d.ts +0 -293
  106. package/types/types/CamStreamerAPI/microsoftAzureSchema.d.ts +0 -293
  107. package/types/types/CamStreamerAPI/microsoftStreamSchema.d.ts +0 -293
  108. package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +0 -314
  109. package/types/types/CamStreamerAPI/rtmpSchema.d.ts +0 -619
  110. package/types/types/CamStreamerAPI/sdCardSchema.d.ts +0 -293
  111. package/types/types/CamStreamerAPI/srtSchema.d.ts +0 -293
  112. package/types/types/CamStreamerAPI/twitchSchema.d.ts +0 -293
  113. package/types/types/CamStreamerAPI/vimeoSchema.d.ts +0 -293
  114. package/types/types/CamStreamerAPI/wowzaSchema.d.ts +0 -293
  115. package/types/types/CamStreamerAPI/youtubeRtmpSchema.d.ts +0 -312
@@ -10,54 +10,54 @@ declare const csEventsDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10
10
  state: string;
11
11
  }>, z.ZodObject<{
12
12
  type: z.ZodLiteral<"StreamState">;
13
- streamID: z.ZodNumber;
13
+ streamId: z.ZodString;
14
14
  isStreaming: z.ZodBoolean;
15
15
  active: z.ZodBoolean;
16
16
  enabled: z.ZodBoolean;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  type: "StreamState";
19
19
  enabled: boolean;
20
+ streamId: string;
20
21
  active: boolean;
21
- streamID: number;
22
22
  isStreaming: boolean;
23
23
  }, {
24
24
  type: "StreamState";
25
25
  enabled: boolean;
26
+ streamId: string;
26
27
  active: boolean;
27
- streamID: number;
28
28
  isStreaming: boolean;
29
29
  }>, z.ZodObject<{
30
30
  type: z.ZodLiteral<"CS_API_SUCCESS">;
31
31
  apiCall: z.ZodString;
32
32
  message: z.ZodString;
33
- streamID: z.ZodNumber;
33
+ streamId: z.ZodString;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  message: string;
36
36
  type: "CS_API_SUCCESS";
37
- streamID: number;
37
+ streamId: string;
38
38
  apiCall: string;
39
39
  }, {
40
40
  message: string;
41
41
  type: "CS_API_SUCCESS";
42
- streamID: number;
42
+ streamId: string;
43
43
  apiCall: string;
44
44
  }>, z.ZodObject<{
45
45
  type: z.ZodLiteral<"CS_API_ERROR">;
46
46
  apiCall: z.ZodString;
47
47
  message: z.ZodString;
48
- streamID: z.ZodNumber;
48
+ streamId: z.ZodString;
49
49
  code: z.ZodString;
50
50
  }, "strip", z.ZodTypeAny, {
51
51
  code: string;
52
52
  message: string;
53
53
  type: "CS_API_ERROR";
54
- streamID: number;
54
+ streamId: string;
55
55
  apiCall: string;
56
56
  }, {
57
57
  code: string;
58
58
  message: string;
59
59
  type: "CS_API_ERROR";
60
- streamID: number;
60
+ streamId: string;
61
61
  apiCall: string;
62
62
  }>, z.ZodObject<{
63
63
  type: z.ZodLiteral<"PortChanged">;
@@ -85,54 +85,54 @@ export declare const csEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
85
85
  state: string;
86
86
  }>, z.ZodObject<{
87
87
  type: z.ZodLiteral<"StreamState">;
88
- streamID: z.ZodNumber;
88
+ streamId: z.ZodString;
89
89
  isStreaming: z.ZodBoolean;
90
90
  active: z.ZodBoolean;
91
91
  enabled: z.ZodBoolean;
92
92
  }, "strip", z.ZodTypeAny, {
93
93
  type: "StreamState";
94
94
  enabled: boolean;
95
+ streamId: string;
95
96
  active: boolean;
96
- streamID: number;
97
97
  isStreaming: boolean;
98
98
  }, {
99
99
  type: "StreamState";
100
100
  enabled: boolean;
101
+ streamId: string;
101
102
  active: boolean;
102
- streamID: number;
103
103
  isStreaming: boolean;
104
104
  }>, z.ZodObject<{
105
105
  type: z.ZodLiteral<"CS_API_SUCCESS">;
106
106
  apiCall: z.ZodString;
107
107
  message: z.ZodString;
108
- streamID: z.ZodNumber;
108
+ streamId: z.ZodString;
109
109
  }, "strip", z.ZodTypeAny, {
110
110
  message: string;
111
111
  type: "CS_API_SUCCESS";
112
- streamID: number;
112
+ streamId: string;
113
113
  apiCall: string;
114
114
  }, {
115
115
  message: string;
116
116
  type: "CS_API_SUCCESS";
117
- streamID: number;
117
+ streamId: string;
118
118
  apiCall: string;
119
119
  }>, z.ZodObject<{
120
120
  type: z.ZodLiteral<"CS_API_ERROR">;
121
121
  apiCall: z.ZodString;
122
122
  message: z.ZodString;
123
- streamID: z.ZodNumber;
123
+ streamId: z.ZodString;
124
124
  code: z.ZodString;
125
125
  }, "strip", z.ZodTypeAny, {
126
126
  code: string;
127
127
  message: string;
128
128
  type: "CS_API_ERROR";
129
- streamID: number;
129
+ streamId: string;
130
130
  apiCall: string;
131
131
  }, {
132
132
  code: string;
133
133
  message: string;
134
134
  type: "CS_API_ERROR";
135
- streamID: number;
135
+ streamId: string;
136
136
  apiCall: string;
137
137
  }>, z.ZodObject<{
138
138
  type: z.ZodLiteral<"PortChanged">;
@@ -155,19 +155,19 @@ export declare const csEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
155
155
  } | {
156
156
  type: "StreamState";
157
157
  enabled: boolean;
158
+ streamId: string;
158
159
  active: boolean;
159
- streamID: number;
160
160
  isStreaming: boolean;
161
161
  } | {
162
162
  message: string;
163
163
  type: "CS_API_SUCCESS";
164
- streamID: number;
164
+ streamId: string;
165
165
  apiCall: string;
166
166
  } | {
167
167
  code: string;
168
168
  message: string;
169
169
  type: "CS_API_ERROR";
170
- streamID: number;
170
+ streamId: string;
171
171
  apiCall: string;
172
172
  } | {
173
173
  value: boolean;
@@ -182,19 +182,19 @@ export declare const csEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
182
182
  } | {
183
183
  type: "StreamState";
184
184
  enabled: boolean;
185
+ streamId: string;
185
186
  active: boolean;
186
- streamID: number;
187
187
  isStreaming: boolean;
188
188
  } | {
189
189
  message: string;
190
190
  type: "CS_API_SUCCESS";
191
- streamID: number;
191
+ streamId: string;
192
192
  apiCall: string;
193
193
  } | {
194
194
  code: string;
195
195
  message: string;
196
196
  type: "CS_API_ERROR";
197
- streamID: number;
197
+ streamId: string;
198
198
  apiCall: string;
199
199
  } | {
200
200
  value: boolean;
@@ -212,54 +212,54 @@ export declare const csEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
212
212
  state: string;
213
213
  }>, z.ZodObject<{
214
214
  type: z.ZodLiteral<"StreamState">;
215
- streamID: z.ZodNumber;
215
+ streamId: z.ZodString;
216
216
  isStreaming: z.ZodBoolean;
217
217
  active: z.ZodBoolean;
218
218
  enabled: z.ZodBoolean;
219
219
  }, "strip", z.ZodTypeAny, {
220
220
  type: "StreamState";
221
221
  enabled: boolean;
222
+ streamId: string;
222
223
  active: boolean;
223
- streamID: number;
224
224
  isStreaming: boolean;
225
225
  }, {
226
226
  type: "StreamState";
227
227
  enabled: boolean;
228
+ streamId: string;
228
229
  active: boolean;
229
- streamID: number;
230
230
  isStreaming: boolean;
231
231
  }>, z.ZodObject<{
232
232
  type: z.ZodLiteral<"CS_API_SUCCESS">;
233
233
  apiCall: z.ZodString;
234
234
  message: z.ZodString;
235
- streamID: z.ZodNumber;
235
+ streamId: z.ZodString;
236
236
  }, "strip", z.ZodTypeAny, {
237
237
  message: string;
238
238
  type: "CS_API_SUCCESS";
239
- streamID: number;
239
+ streamId: string;
240
240
  apiCall: string;
241
241
  }, {
242
242
  message: string;
243
243
  type: "CS_API_SUCCESS";
244
- streamID: number;
244
+ streamId: string;
245
245
  apiCall: string;
246
246
  }>, z.ZodObject<{
247
247
  type: z.ZodLiteral<"CS_API_ERROR">;
248
248
  apiCall: z.ZodString;
249
249
  message: z.ZodString;
250
- streamID: z.ZodNumber;
250
+ streamId: z.ZodString;
251
251
  code: z.ZodString;
252
252
  }, "strip", z.ZodTypeAny, {
253
253
  code: string;
254
254
  message: string;
255
255
  type: "CS_API_ERROR";
256
- streamID: number;
256
+ streamId: string;
257
257
  apiCall: string;
258
258
  }, {
259
259
  code: string;
260
260
  message: string;
261
261
  type: "CS_API_ERROR";
262
- streamID: number;
262
+ streamId: string;
263
263
  apiCall: string;
264
264
  }>, z.ZodObject<{
265
265
  type: z.ZodLiteral<"PortChanged">;
@@ -6,7 +6,7 @@ const csEventsDataSchema = zod_1.z.discriminatedUnion('type', [
6
6
  zod_1.z.object({ type: zod_1.z.literal('authorization'), state: zod_1.z.string() }),
7
7
  zod_1.z.object({
8
8
  type: zod_1.z.literal('StreamState'),
9
- streamID: zod_1.z.number(),
9
+ streamId: zod_1.z.string(),
10
10
  isStreaming: zod_1.z.boolean(),
11
11
  active: zod_1.z.boolean(),
12
12
  enabled: zod_1.z.boolean(),
@@ -15,13 +15,13 @@ const csEventsDataSchema = zod_1.z.discriminatedUnion('type', [
15
15
  type: zod_1.z.literal('CS_API_SUCCESS'),
16
16
  apiCall: zod_1.z.string(),
17
17
  message: zod_1.z.string(),
18
- streamID: zod_1.z.number(),
18
+ streamId: zod_1.z.string(),
19
19
  }),
20
20
  zod_1.z.object({
21
21
  type: zod_1.z.literal('CS_API_ERROR'),
22
22
  apiCall: zod_1.z.string(),
23
23
  message: zod_1.z.string(),
24
- streamID: zod_1.z.number(),
24
+ streamId: zod_1.z.string(),
25
25
  code: zod_1.z.string(),
26
26
  }),
27
27
  zod_1.z.object({
@@ -46,8 +46,8 @@ export class CamStreamerAPI {
46
46
  const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
47
47
  const oldStreamListRecord = z.record(z.string(), oldStringStreamSchema).safeParse(res.data);
48
48
  if (oldStreamListRecord.success) {
49
- const data = Object.entries(oldStreamListRecord.data).map(([id, streamData]) => ({
50
- id: parseInt(id),
49
+ const data = Object.entries(oldStreamListRecord.data).map(([streamId, streamData]) => ({
50
+ streamId,
51
51
  ...parseCameraStreamResponse(streamData),
52
52
  }));
53
53
  throw new MigrationError([], data);
@@ -64,7 +64,7 @@ export class CamStreamerAPI {
64
64
  const oldStreamParse = oldStringStreamSchemaWithId.safeParse(streamData);
65
65
  if (oldStreamParse.success) {
66
66
  oldStreamData.push({
67
- id: parseInt(oldStreamParse.data.id),
67
+ streamId: oldStreamParse.data.streamId,
68
68
  ...parseCameraStreamResponse(oldStreamParse.data),
69
69
  });
70
70
  continue;
@@ -88,7 +88,7 @@ export class CamStreamerAPI {
88
88
  return newStream.data;
89
89
  }
90
90
  const oldStream = oldStringStreamSchema.passthrough().parse(res.data);
91
- throw new MigrationError([], [{ id: streamId, ...parseCameraStreamResponse(oldStream) }]);
91
+ throw new MigrationError([], [{ streamId, ...parseCameraStreamResponse(oldStream) }]);
92
92
  }
93
93
  async setStream(streamId, streamData, options) {
94
94
  await this._postJsonEncoded(`${BASE_PATH}/stream_list.cgi`, JSON.stringify(streamData), {
@@ -1,26 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { facebookSchema } from './facebookSchema';
3
- import { mpegDvbSchema } from './mpegDvbSchema';
4
- import { rtmpSchema } from './rtmpSchema';
5
- import { sdCardSchema } from './sdCardSchema';
6
3
  import { windySchema } from './windySchema';
7
4
  import { youtubeSchema } from './youtubeSchema';
8
- import { vimeoSchema } from './vimeoSchema';
9
- import { twitchSchema } from './twitchSchema';
10
- import { churchSchema } from './churchSchema';
11
- import { srtSchema } from './srtSchema';
12
- import { daCastSchema } from './daCastSchema';
13
- import { hlsPullSchema } from './hlsPullSchema';
14
- import { hlsPushSchema } from './hlsPushSchema';
15
- import { wowzaSchema } from './wowzaSchema';
16
- import { dailymotionSchema } from './dailymotionSchema';
17
- import { ibmSchema } from './ibmSchema';
18
- import { microsoftAzureSchema } from './microsoftAzureSchema';
19
- import { microsoftStreamSchema } from './microsoftStreamSchema';
20
- import { gameChangerSchema } from './gameChangerSchema';
5
+ import { churchSchema, daCastSchema, dailymotionSchema, gameChangerSchema, hlsPullSchema, hlsPushSchema, ibmSchema, microsoftAzureSchema, microsoftStreamSchema, mpegDvbSchema, rtmpSchema, sdCardSchema, srtSchema, twitchSchema, vimeoSchema, wowzaSchema, youtubeRtmpSchema, } from './streamsSchema';
21
6
  import { fileSchema } from '../common';
22
- import { youtubeRtmpSchema } from './youtubeRtmpSchema';
23
- export const streamSchema = z.discriminatedUnion('type', [
7
+ export const streamSchema = z.discriminatedUnion('platform', [
24
8
  facebookSchema,
25
9
  mpegDvbSchema,
26
10
  rtmpSchema,
@@ -44,64 +28,64 @@ export const streamSchema = z.discriminatedUnion('type', [
44
28
  ]);
45
29
  export const streamListSchema = z.object({ streamList: z.array(streamSchema) });
46
30
  export const isFacebookStream = (stream) => {
47
- return stream.type === 'facebook';
31
+ return stream.platform === 'facebook';
48
32
  };
49
33
  export const isMpegDvbStream = (stream) => {
50
- return stream.type === 'mpeg_dvb';
34
+ return stream.platform === 'mpeg_dvb';
51
35
  };
52
36
  export const isRtmpStream = (stream) => {
53
- return stream.type === 'rtmp';
37
+ return stream.platform === 'rtmp';
54
38
  };
55
39
  export const isSdCardStream = (stream) => {
56
- return stream.type === 'sd_card';
40
+ return stream.platform === 'sd_card';
57
41
  };
58
42
  export const isWindyStream = (stream) => {
59
- return stream.type === 'windy';
43
+ return stream.platform === 'windy';
60
44
  };
61
45
  export const isYouTubeStream = (stream) => {
62
- return stream.type === 'youtube';
46
+ return stream.platform === 'youtube';
63
47
  };
64
48
  export const isVimeoStream = (stream) => {
65
- return stream.type === 'vimeo';
49
+ return stream.platform === 'vimeo';
66
50
  };
67
51
  export const isTwitchStream = (stream) => {
68
- return stream.type === 'twitch';
52
+ return stream.platform === 'twitch';
69
53
  };
70
54
  export const isChurchStream = (stream) => {
71
- return stream.type === 'church';
55
+ return stream.platform === 'church';
72
56
  };
73
57
  export const isSrtStream = (stream) => {
74
- return stream.type === 'srt';
58
+ return stream.platform === 'srt';
75
59
  };
76
60
  export const isDaCastStream = (stream) => {
77
- return stream.type === 'da_cast';
61
+ return stream.platform === 'da_cast';
78
62
  };
79
63
  export const isHlsPullStream = (stream) => {
80
- return stream.type === 'hls_pull';
64
+ return stream.platform === 'hls_pull';
81
65
  };
82
66
  export const isHlsPushStream = (stream) => {
83
- return stream.type === 'hls_push';
67
+ return stream.platform === 'hls_push';
84
68
  };
85
69
  export const isWowzaStream = (stream) => {
86
- return stream.type === 'wowza';
70
+ return stream.platform === 'wowza';
87
71
  };
88
72
  export const isDailymotionStream = (stream) => {
89
- return stream.type === 'dailymotion';
73
+ return stream.platform === 'dailymotion';
90
74
  };
91
75
  export const isIbmStream = (stream) => {
92
- return stream.type === 'ibm';
76
+ return stream.platform === 'ibm';
93
77
  };
94
78
  export const isMicrosoftAzureStream = (stream) => {
95
- return stream.type === 'microsoft_azure';
79
+ return stream.platform === 'microsoft_azure';
96
80
  };
97
81
  export const isMicrosoftStream = (stream) => {
98
- return stream.type === 'microsoft_stream';
82
+ return stream.platform === 'microsoft_stream';
99
83
  };
100
84
  export const isGameChangerStream = (stream) => {
101
- return stream.type === 'game_changer';
85
+ return stream.platform === 'game_changer';
102
86
  };
103
87
  export const isYoutubeRtmpStream = (stream) => {
104
- return stream.type === 'youtube_rtmp';
88
+ return stream.platform === 'youtube_rtmp';
105
89
  };
106
90
  export var AudioType;
107
91
  (function (AudioType) {
@@ -1,21 +1,17 @@
1
1
  import z from 'zod';
2
2
  import { streamCommonSchema } from './streamCommonTypes';
3
- export const facebookStreamPrivacySchema = z.union([z.literal('public'), z.literal('friends'), z.literal('only_me')]);
4
- const timelinePost = z.object({
3
+ const timelinePostSchema = z.object({
5
4
  postLocation: z.literal('timeline'),
6
- streamPrivacy: facebookStreamPrivacySchema,
5
+ streamPrivacy: z.union([z.literal('public'), z.literal('friends'), z.literal('only_me')]),
7
6
  });
8
- const pagePost = z.object({
7
+ const pagePostSchema = z.object({
9
8
  postLocation: z.literal('page'),
10
9
  page: z.string(),
11
10
  });
12
11
  export const facebookSchema = streamCommonSchema.extend({
13
- type: z.literal('facebook'),
12
+ platform: z.literal('facebook'),
14
13
  description: z.string().optional(),
15
14
  deleteAfterEnd: z.boolean(),
16
- saveToSdCard: z.boolean(),
17
- statusCameraLed: z.boolean(),
18
- statusCameraOutput: z.string().nullable(),
19
15
  countdown: z.boolean(),
20
- post: z.discriminatedUnion('postLocation', [timelinePost, pagePost]),
16
+ post: z.discriminatedUnion('postLocation', [timelinePostSchema, pagePostSchema]),
21
17
  });
@@ -1,10 +1,6 @@
1
1
  export * from './CamStreamerAPI';
2
2
  export * from './streamCommonTypes';
3
3
  export * from './facebookSchema';
4
- export * from './mpegDvbSchema';
5
- export * from './rtmpSchema';
6
- export * from './gameChangerSchema';
7
- export * from './sdCardSchema';
8
4
  export * from './windySchema';
9
5
  export * from './youtubeSchema';
10
- export * from './youtubeRtmpSchema';
6
+ export * from './streamsSchema';
@@ -23,7 +23,7 @@ export const oldStringStreamSchema = z.object({
23
23
  stopTime: z.string(),
24
24
  });
25
25
  export const oldStringStreamSchemaWithId = oldStringStreamSchema.extend({
26
- id: z.string(),
26
+ streamId: z.string(),
27
27
  });
28
28
  export const oldStreamSchema = z.object({
29
29
  enabled: z.union([z.literal(0), z.literal(1)]),
@@ -1,46 +1,94 @@
1
1
  import { z } from 'zod';
2
2
  import { bitrateVapixParamsSchema, booleanSchema, h264ProfileSchema } from '../common';
3
- const scheduleSchema = z.object({
4
- start: z.object({
5
- day: z.number().int().min(0).max(6),
6
- timeS: z.number().int().min(0).max(86400),
7
- }),
8
- stop: z.object({
9
- day: z.number().int().min(0).max(6),
10
- timeS: z.number().int().min(0).max(86400),
11
- }),
12
- isActive: z.boolean(),
13
- });
14
- export const streamTriggerSchema = z.discriminatedUnion('type', [
15
- z.object({
16
- type: z.literal('manual'),
17
- ioPort: z.string().nullable(),
18
- }),
19
- z.object({
20
- type: z.literal('onetime'),
21
- startTime: z.number(),
22
- stopTime: z.number(),
23
- ioPort: z.string().nullable(),
3
+ export const streamCommonSchema = z.object({
4
+ streamId: z.string(),
5
+ enabled: z.boolean(),
6
+ active: z.boolean(),
7
+ title: z.string(),
8
+ trigger: z.discriminatedUnion('type', [
9
+ z.object({
10
+ type: z.literal('manual'),
11
+ ioPort: z.number().nullable(),
12
+ }),
13
+ z.object({
14
+ type: z.literal('onetime'),
15
+ startTime: z.number(),
16
+ stopTime: z.number(),
17
+ }),
18
+ z.object({
19
+ type: z.literal('recurrent'),
20
+ schedule: z.array(z.object({
21
+ start: z.object({
22
+ day: z.number().int().min(0).max(6),
23
+ timeS: z.number().int().min(0).max(86400),
24
+ }),
25
+ stop: z.object({
26
+ day: z.number().int().min(0).max(6),
27
+ timeS: z.number().int().min(0).max(86400),
28
+ }),
29
+ isActive: z.boolean(),
30
+ })),
31
+ }),
32
+ ]),
33
+ video: z.object({
34
+ output: z.discriminatedUnion('callApi', [
35
+ z.object({
36
+ type: z.union([z.literal('video'), z.literal('images')]),
37
+ callApi: z.literal(false),
38
+ url: z.string(),
39
+ }),
40
+ z.object({
41
+ type: z.literal('video'),
42
+ callApi: z.literal(true),
43
+ prepareAheadS: z.number(),
44
+ }),
45
+ ]),
46
+ outputParameters: z.string(),
47
+ input: z.discriminatedUnion('type', [
48
+ z.object({
49
+ type: z.literal('RTSP_URL'),
50
+ url: z.string(),
51
+ }),
52
+ z.object({
53
+ type: z.union([z.literal('CSw'), z.literal('CRS')]),
54
+ }),
55
+ ]),
56
+ streamingProtocol: z.union([z.literal('RTMP'), z.literal('RTMPS'), z.literal('HLS_PUSH')]),
57
+ internalVapixParameters: z.string(),
58
+ userVapixParameters: z.string(),
59
+ streamDelay: z
60
+ .object({
61
+ value: z.number().int(),
62
+ unit: z.union([z.literal('seconds'), z.literal('minutes'), z.literal('hours')]),
63
+ })
64
+ .optional(),
24
65
  }),
25
- z.object({
26
- type: z.literal('recurrent'),
27
- schedule: z.array(scheduleSchema),
66
+ audio: z
67
+ .discriminatedUnion('source', [
68
+ z.object({
69
+ source: z.literal('microphone'),
70
+ audioChannelNbr: z.union([z.literal(1), z.literal(2)]),
71
+ forceStereo: booleanSchema,
72
+ }),
73
+ z.object({
74
+ source: z.literal('file'),
75
+ fileName: z.string(),
76
+ filePath: z.string(),
77
+ forceStereo: booleanSchema,
78
+ }),
79
+ z.object({
80
+ source: z.literal('url'),
81
+ fileName: z.string(),
82
+ fileUrl: z.string(),
83
+ avSyncMsec: z.number().int().nonnegative(),
84
+ forceStereo: booleanSchema,
85
+ }),
86
+ ])
87
+ .nullable(),
88
+ status: z.object({
89
+ led: z.boolean(),
90
+ port: z.number().nullable(),
28
91
  }),
29
- ]);
30
- export const streamInputTypeSchema = z.union([z.literal('CSw'), z.literal('CRS'), z.literal('RTSP_URL')]);
31
- export const streamingProtocolTypeSchema = z.union([z.literal('RTMP'), z.literal('RTMPS'), z.literal('HLS_PUSH')]);
32
- export const videoCodecSchema = z.union([z.literal('h264'), z.literal('h265'), z.literal('av1')]);
33
- export const overlaysSchema = z.union([
34
- z.literal('all'),
35
- z.literal('text'),
36
- z.literal('image'),
37
- z.literal('application'),
38
- z.literal(''),
39
- z.literal('off'),
40
- ]);
41
- export const streamDelaySchema = z.object({
42
- value: z.number().int(),
43
- unit: z.union([z.literal('seconds'), z.literal('minutes'), z.literal('hours')]),
44
92
  });
45
93
  export const internalVapixParametersSchema = bitrateVapixParamsSchema.extend({
46
94
  camera: z.string(),
@@ -48,7 +96,7 @@ export const internalVapixParametersSchema = bitrateVapixParamsSchema.extend({
48
96
  fps: z.number().int(),
49
97
  compression: z.number().int(),
50
98
  govLength: z.number().int(),
51
- videoCodec: videoCodecSchema,
99
+ videoCodec: z.union([z.literal('h264'), z.literal('h265'), z.literal('av1')]),
52
100
  h264Profile: h264ProfileSchema.optional(),
53
101
  audio: booleanSchema,
54
102
  nbrOfChannels: z.union([z.literal(1), z.literal(2)]).optional(),
@@ -63,37 +111,3 @@ export const internalVapixParametersSchema = bitrateVapixParamsSchema.extend({
63
111
  ])
64
112
  .optional(),
65
113
  });
66
- export const streamVideoSchema = z.object({
67
- inputType: streamInputTypeSchema,
68
- sourceUrl: z.string().optional(),
69
- internalVapixParameters: z.string(),
70
- userVapixParameters: z.string(),
71
- streamingProtocol: streamingProtocolTypeSchema,
72
- streamDelay: streamDelaySchema.optional(),
73
- });
74
- export const streamAudioSchema = z.discriminatedUnion('source', [
75
- z.object({
76
- source: z.literal('none'),
77
- }),
78
- z.object({ source: z.literal('microphone'), audioChannelNbr: z.union([z.literal(1), z.literal(2)]) }),
79
- z.object({
80
- source: z.literal('file'),
81
- fileName: z.string(),
82
- filePath: z.string(),
83
- }),
84
- z.object({
85
- source: z.literal('url'),
86
- fileName: z.string(),
87
- fileUrl: z.string(),
88
- avSyncMsec: z.number().int().nonnegative(),
89
- }),
90
- ]);
91
- export const streamCommonSchema = z.object({
92
- id: z.number(),
93
- enabled: z.boolean(),
94
- active: z.boolean(),
95
- title: z.string(),
96
- trigger: streamTriggerSchema,
97
- video: streamVideoSchema,
98
- audio: streamAudioSchema,
99
- });