camstreamerlib 4.0.0-beta.105 → 4.0.0-beta.107
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 +5 -12
- package/cjs/CamOverlayAPI.js +2 -2
- package/cjs/CamStreamerAPI.d.ts +22 -4
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +293 -12
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +50 -11
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +105 -20
- package/cjs/types/CamStreamerAPI/gameChangerSchema.d.ts +19 -0
- package/cjs/types/CamStreamerAPI/gameChangerSchema.js +2 -2
- package/cjs/types/CamStreamerAPI/index.d.ts +1 -0
- package/cjs/types/CamStreamerAPI/index.js +1 -0
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +3 -3
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +1 -1
- package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +313 -1
- package/cjs/types/CamStreamerAPI/rtmpSchema.js +8 -3
- package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +3 -3
- package/cjs/types/CamStreamerAPI/youtubeSchema.js +1 -1
- package/esm/CamOverlayAPI.js +3 -3
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +44 -10
- package/esm/types/CamStreamerAPI/gameChangerSchema.js +2 -2
- package/esm/types/CamStreamerAPI/index.js +1 -0
- package/esm/types/CamStreamerAPI/mpegDvbSchema.js +1 -1
- package/esm/types/CamStreamerAPI/rtmpSchema.js +7 -2
- package/esm/types/CamStreamerAPI/youtubeSchema.js +1 -1
- package/package.json +1 -1
- package/types/CamOverlayAPI.d.ts +5 -12
- package/types/CamStreamerAPI.d.ts +22 -4
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +293 -12
- package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +105 -20
- package/types/types/CamStreamerAPI/gameChangerSchema.d.ts +19 -0
- package/types/types/CamStreamerAPI/index.d.ts +1 -0
- package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +3 -3
- package/types/types/CamStreamerAPI/rtmpSchema.d.ts +313 -1
- package/types/types/CamStreamerAPI/youtubeSchema.d.ts +3 -3
|
@@ -1,4 +1,306 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
export declare const commonRtmpSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodNumber;
|
|
4
|
+
enabled: z.ZodBoolean;
|
|
5
|
+
active: z.ZodBoolean;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"manual">;
|
|
9
|
+
ioPort: z.ZodNullable<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
type: "manual";
|
|
12
|
+
ioPort: string | null;
|
|
13
|
+
}, {
|
|
14
|
+
type: "manual";
|
|
15
|
+
ioPort: string | null;
|
|
16
|
+
}>, z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"onetime">;
|
|
18
|
+
startTime: z.ZodNumber;
|
|
19
|
+
stopTime: z.ZodNumber;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
type: "onetime";
|
|
22
|
+
startTime: number;
|
|
23
|
+
stopTime: number;
|
|
24
|
+
}, {
|
|
25
|
+
type: "onetime";
|
|
26
|
+
startTime: number;
|
|
27
|
+
stopTime: number;
|
|
28
|
+
}>, z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"recurrent">;
|
|
30
|
+
schedule: z.ZodArray<z.ZodObject<{
|
|
31
|
+
start: z.ZodObject<{
|
|
32
|
+
day: z.ZodNumber;
|
|
33
|
+
timeS: z.ZodNumber;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
day: number;
|
|
36
|
+
timeS: number;
|
|
37
|
+
}, {
|
|
38
|
+
day: number;
|
|
39
|
+
timeS: number;
|
|
40
|
+
}>;
|
|
41
|
+
stop: z.ZodObject<{
|
|
42
|
+
day: z.ZodNumber;
|
|
43
|
+
timeS: z.ZodNumber;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
day: number;
|
|
46
|
+
timeS: number;
|
|
47
|
+
}, {
|
|
48
|
+
day: number;
|
|
49
|
+
timeS: number;
|
|
50
|
+
}>;
|
|
51
|
+
isActive: z.ZodBoolean;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
start: {
|
|
54
|
+
day: number;
|
|
55
|
+
timeS: number;
|
|
56
|
+
};
|
|
57
|
+
stop: {
|
|
58
|
+
day: number;
|
|
59
|
+
timeS: number;
|
|
60
|
+
};
|
|
61
|
+
isActive: boolean;
|
|
62
|
+
}, {
|
|
63
|
+
start: {
|
|
64
|
+
day: number;
|
|
65
|
+
timeS: number;
|
|
66
|
+
};
|
|
67
|
+
stop: {
|
|
68
|
+
day: number;
|
|
69
|
+
timeS: number;
|
|
70
|
+
};
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
}>, "many">;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
type: "recurrent";
|
|
75
|
+
schedule: {
|
|
76
|
+
start: {
|
|
77
|
+
day: number;
|
|
78
|
+
timeS: number;
|
|
79
|
+
};
|
|
80
|
+
stop: {
|
|
81
|
+
day: number;
|
|
82
|
+
timeS: number;
|
|
83
|
+
};
|
|
84
|
+
isActive: boolean;
|
|
85
|
+
}[];
|
|
86
|
+
}, {
|
|
87
|
+
type: "recurrent";
|
|
88
|
+
schedule: {
|
|
89
|
+
start: {
|
|
90
|
+
day: number;
|
|
91
|
+
timeS: number;
|
|
92
|
+
};
|
|
93
|
+
stop: {
|
|
94
|
+
day: number;
|
|
95
|
+
timeS: number;
|
|
96
|
+
};
|
|
97
|
+
isActive: boolean;
|
|
98
|
+
}[];
|
|
99
|
+
}>]>;
|
|
100
|
+
video: z.ZodObject<{
|
|
101
|
+
inputType: z.ZodUnion<[z.ZodLiteral<"CSw">, z.ZodLiteral<"CRS">, z.ZodLiteral<"RTSP_URL">]>;
|
|
102
|
+
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
103
|
+
internalVapixParameters: z.ZodString;
|
|
104
|
+
userVapixParameters: z.ZodString;
|
|
105
|
+
streamingProtocol: z.ZodUnion<[z.ZodLiteral<"RTMP">, z.ZodLiteral<"RTMPS">, z.ZodLiteral<"HLS_PUSH">]>;
|
|
106
|
+
streamDelay: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
value: z.ZodNumber;
|
|
108
|
+
unit: z.ZodUnion<[z.ZodLiteral<"seconds">, z.ZodLiteral<"minutes">, z.ZodLiteral<"hours">]>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
value: number;
|
|
111
|
+
unit: "seconds" | "minutes" | "hours";
|
|
112
|
+
}, {
|
|
113
|
+
value: number;
|
|
114
|
+
unit: "seconds" | "minutes" | "hours";
|
|
115
|
+
}>>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
inputType: "RTSP_URL" | "CSw" | "CRS";
|
|
118
|
+
internalVapixParameters: string;
|
|
119
|
+
userVapixParameters: string;
|
|
120
|
+
streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
|
|
121
|
+
sourceUrl?: string | undefined;
|
|
122
|
+
streamDelay?: {
|
|
123
|
+
value: number;
|
|
124
|
+
unit: "seconds" | "minutes" | "hours";
|
|
125
|
+
} | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
inputType: "RTSP_URL" | "CSw" | "CRS";
|
|
128
|
+
internalVapixParameters: string;
|
|
129
|
+
userVapixParameters: string;
|
|
130
|
+
streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
|
|
131
|
+
sourceUrl?: string | undefined;
|
|
132
|
+
streamDelay?: {
|
|
133
|
+
value: number;
|
|
134
|
+
unit: "seconds" | "minutes" | "hours";
|
|
135
|
+
} | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
audio: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
138
|
+
source: z.ZodLiteral<"none">;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
source: "none";
|
|
141
|
+
}, {
|
|
142
|
+
source: "none";
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
source: z.ZodLiteral<"microphone">;
|
|
145
|
+
audioChannelNbr: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
source: "microphone";
|
|
148
|
+
audioChannelNbr: 1 | 2;
|
|
149
|
+
}, {
|
|
150
|
+
source: "microphone";
|
|
151
|
+
audioChannelNbr: 1 | 2;
|
|
152
|
+
}>, z.ZodObject<{
|
|
153
|
+
source: z.ZodLiteral<"file">;
|
|
154
|
+
fileName: z.ZodString;
|
|
155
|
+
filePath: z.ZodString;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
source: "file";
|
|
158
|
+
fileName: string;
|
|
159
|
+
filePath: string;
|
|
160
|
+
}, {
|
|
161
|
+
source: "file";
|
|
162
|
+
fileName: string;
|
|
163
|
+
filePath: string;
|
|
164
|
+
}>, z.ZodObject<{
|
|
165
|
+
source: z.ZodLiteral<"url">;
|
|
166
|
+
fileName: z.ZodString;
|
|
167
|
+
fileUrl: z.ZodString;
|
|
168
|
+
avSyncMsec: z.ZodNumber;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
source: "url";
|
|
171
|
+
fileName: string;
|
|
172
|
+
fileUrl: string;
|
|
173
|
+
avSyncMsec: number;
|
|
174
|
+
}, {
|
|
175
|
+
source: "url";
|
|
176
|
+
fileName: string;
|
|
177
|
+
fileUrl: string;
|
|
178
|
+
avSyncMsec: number;
|
|
179
|
+
}>]>;
|
|
180
|
+
} & {
|
|
181
|
+
outputUrl: z.ZodString;
|
|
182
|
+
streamKey: z.ZodString;
|
|
183
|
+
streamIdentifier: z.ZodOptional<z.ZodString>;
|
|
184
|
+
saveToSdCard: z.ZodBoolean;
|
|
185
|
+
statusCameraLed: z.ZodBoolean;
|
|
186
|
+
statusCameraOutput: z.ZodNullable<z.ZodString>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
audio: {
|
|
189
|
+
source: "none";
|
|
190
|
+
} | {
|
|
191
|
+
source: "microphone";
|
|
192
|
+
audioChannelNbr: 1 | 2;
|
|
193
|
+
} | {
|
|
194
|
+
source: "file";
|
|
195
|
+
fileName: string;
|
|
196
|
+
filePath: string;
|
|
197
|
+
} | {
|
|
198
|
+
source: "url";
|
|
199
|
+
fileName: string;
|
|
200
|
+
fileUrl: string;
|
|
201
|
+
avSyncMsec: number;
|
|
202
|
+
};
|
|
203
|
+
video: {
|
|
204
|
+
inputType: "RTSP_URL" | "CSw" | "CRS";
|
|
205
|
+
internalVapixParameters: string;
|
|
206
|
+
userVapixParameters: string;
|
|
207
|
+
streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
|
|
208
|
+
sourceUrl?: string | undefined;
|
|
209
|
+
streamDelay?: {
|
|
210
|
+
value: number;
|
|
211
|
+
unit: "seconds" | "minutes" | "hours";
|
|
212
|
+
} | undefined;
|
|
213
|
+
};
|
|
214
|
+
enabled: boolean;
|
|
215
|
+
id: number;
|
|
216
|
+
active: boolean;
|
|
217
|
+
title: string;
|
|
218
|
+
trigger: {
|
|
219
|
+
type: "manual";
|
|
220
|
+
ioPort: string | null;
|
|
221
|
+
} | {
|
|
222
|
+
type: "onetime";
|
|
223
|
+
startTime: number;
|
|
224
|
+
stopTime: number;
|
|
225
|
+
} | {
|
|
226
|
+
type: "recurrent";
|
|
227
|
+
schedule: {
|
|
228
|
+
start: {
|
|
229
|
+
day: number;
|
|
230
|
+
timeS: number;
|
|
231
|
+
};
|
|
232
|
+
stop: {
|
|
233
|
+
day: number;
|
|
234
|
+
timeS: number;
|
|
235
|
+
};
|
|
236
|
+
isActive: boolean;
|
|
237
|
+
}[];
|
|
238
|
+
};
|
|
239
|
+
statusCameraLed: boolean;
|
|
240
|
+
statusCameraOutput: string | null;
|
|
241
|
+
saveToSdCard: boolean;
|
|
242
|
+
outputUrl: string;
|
|
243
|
+
streamKey: string;
|
|
244
|
+
streamIdentifier?: string | undefined;
|
|
245
|
+
}, {
|
|
246
|
+
audio: {
|
|
247
|
+
source: "none";
|
|
248
|
+
} | {
|
|
249
|
+
source: "microphone";
|
|
250
|
+
audioChannelNbr: 1 | 2;
|
|
251
|
+
} | {
|
|
252
|
+
source: "file";
|
|
253
|
+
fileName: string;
|
|
254
|
+
filePath: string;
|
|
255
|
+
} | {
|
|
256
|
+
source: "url";
|
|
257
|
+
fileName: string;
|
|
258
|
+
fileUrl: string;
|
|
259
|
+
avSyncMsec: number;
|
|
260
|
+
};
|
|
261
|
+
video: {
|
|
262
|
+
inputType: "RTSP_URL" | "CSw" | "CRS";
|
|
263
|
+
internalVapixParameters: string;
|
|
264
|
+
userVapixParameters: string;
|
|
265
|
+
streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
|
|
266
|
+
sourceUrl?: string | undefined;
|
|
267
|
+
streamDelay?: {
|
|
268
|
+
value: number;
|
|
269
|
+
unit: "seconds" | "minutes" | "hours";
|
|
270
|
+
} | undefined;
|
|
271
|
+
};
|
|
272
|
+
enabled: boolean;
|
|
273
|
+
id: number;
|
|
274
|
+
active: boolean;
|
|
275
|
+
title: string;
|
|
276
|
+
trigger: {
|
|
277
|
+
type: "manual";
|
|
278
|
+
ioPort: string | null;
|
|
279
|
+
} | {
|
|
280
|
+
type: "onetime";
|
|
281
|
+
startTime: number;
|
|
282
|
+
stopTime: number;
|
|
283
|
+
} | {
|
|
284
|
+
type: "recurrent";
|
|
285
|
+
schedule: {
|
|
286
|
+
start: {
|
|
287
|
+
day: number;
|
|
288
|
+
timeS: number;
|
|
289
|
+
};
|
|
290
|
+
stop: {
|
|
291
|
+
day: number;
|
|
292
|
+
timeS: number;
|
|
293
|
+
};
|
|
294
|
+
isActive: boolean;
|
|
295
|
+
}[];
|
|
296
|
+
};
|
|
297
|
+
statusCameraLed: boolean;
|
|
298
|
+
statusCameraOutput: string | null;
|
|
299
|
+
saveToSdCard: boolean;
|
|
300
|
+
outputUrl: string;
|
|
301
|
+
streamKey: string;
|
|
302
|
+
streamIdentifier?: string | undefined;
|
|
303
|
+
}>;
|
|
2
304
|
export declare const rtmpSchema: z.ZodObject<{
|
|
3
305
|
id: z.ZodNumber;
|
|
4
306
|
enabled: z.ZodBoolean;
|
|
@@ -178,10 +480,14 @@ export declare const rtmpSchema: z.ZodObject<{
|
|
|
178
480
|
avSyncMsec: number;
|
|
179
481
|
}>]>;
|
|
180
482
|
} & {
|
|
181
|
-
type: z.ZodLiteral<"rtmp">;
|
|
182
483
|
outputUrl: z.ZodString;
|
|
183
484
|
streamKey: z.ZodString;
|
|
184
485
|
streamIdentifier: z.ZodOptional<z.ZodString>;
|
|
486
|
+
saveToSdCard: z.ZodBoolean;
|
|
487
|
+
statusCameraLed: z.ZodBoolean;
|
|
488
|
+
statusCameraOutput: z.ZodNullable<z.ZodString>;
|
|
489
|
+
} & {
|
|
490
|
+
type: z.ZodLiteral<"rtmp">;
|
|
185
491
|
}, "strip", z.ZodTypeAny, {
|
|
186
492
|
type: "rtmp";
|
|
187
493
|
audio: {
|
|
@@ -235,6 +541,9 @@ export declare const rtmpSchema: z.ZodObject<{
|
|
|
235
541
|
isActive: boolean;
|
|
236
542
|
}[];
|
|
237
543
|
};
|
|
544
|
+
statusCameraLed: boolean;
|
|
545
|
+
statusCameraOutput: string | null;
|
|
546
|
+
saveToSdCard: boolean;
|
|
238
547
|
outputUrl: string;
|
|
239
548
|
streamKey: string;
|
|
240
549
|
streamIdentifier?: string | undefined;
|
|
@@ -291,6 +600,9 @@ export declare const rtmpSchema: z.ZodObject<{
|
|
|
291
600
|
isActive: boolean;
|
|
292
601
|
}[];
|
|
293
602
|
};
|
|
603
|
+
statusCameraLed: boolean;
|
|
604
|
+
statusCameraOutput: string | null;
|
|
605
|
+
saveToSdCard: boolean;
|
|
294
606
|
outputUrl: string;
|
|
295
607
|
streamKey: string;
|
|
296
608
|
streamIdentifier?: string | undefined;
|
|
@@ -3,12 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.rtmpSchema = void 0;
|
|
6
|
+
exports.rtmpSchema = exports.commonRtmpSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const streamCommonTypes_1 = require("./streamCommonTypes");
|
|
9
|
-
exports.
|
|
10
|
-
type: zod_1.default.literal('rtmp'),
|
|
9
|
+
exports.commonRtmpSchema = streamCommonTypes_1.streamCommonSchema.extend({
|
|
11
10
|
outputUrl: zod_1.default.string(),
|
|
12
11
|
streamKey: zod_1.default.string(),
|
|
13
12
|
streamIdentifier: zod_1.default.string().optional(),
|
|
13
|
+
saveToSdCard: zod_1.default.boolean(),
|
|
14
|
+
statusCameraLed: zod_1.default.boolean(),
|
|
15
|
+
statusCameraOutput: zod_1.default.string().nullable(),
|
|
16
|
+
});
|
|
17
|
+
exports.rtmpSchema = exports.commonRtmpSchema.extend({
|
|
18
|
+
type: zod_1.default.literal('rtmp'),
|
|
14
19
|
});
|
|
@@ -189,7 +189,7 @@ export declare const youtubeSchema: z.ZodObject<{
|
|
|
189
189
|
dvr: z.ZodBoolean;
|
|
190
190
|
saveToSdCard: z.ZodBoolean;
|
|
191
191
|
statusCameraLed: z.ZodBoolean;
|
|
192
|
-
statusCameraOutput: z.ZodString
|
|
192
|
+
statusCameraOutput: z.ZodNullable<z.ZodString>;
|
|
193
193
|
hasWatchdogs: z.ZodBoolean;
|
|
194
194
|
countdown: z.ZodBoolean;
|
|
195
195
|
enableManualControl: z.ZodBoolean;
|
|
@@ -247,7 +247,7 @@ export declare const youtubeSchema: z.ZodObject<{
|
|
|
247
247
|
}[];
|
|
248
248
|
};
|
|
249
249
|
statusCameraLed: boolean;
|
|
250
|
-
statusCameraOutput: string;
|
|
250
|
+
statusCameraOutput: string | null;
|
|
251
251
|
saveToSdCard: boolean;
|
|
252
252
|
tags: string[];
|
|
253
253
|
streamPrivacy: "public" | "unlisted" | "private";
|
|
@@ -314,7 +314,7 @@ export declare const youtubeSchema: z.ZodObject<{
|
|
|
314
314
|
}[];
|
|
315
315
|
};
|
|
316
316
|
statusCameraLed: boolean;
|
|
317
|
-
statusCameraOutput: string;
|
|
317
|
+
statusCameraOutput: string | null;
|
|
318
318
|
saveToSdCard: boolean;
|
|
319
319
|
tags: string[];
|
|
320
320
|
streamPrivacy: "public" | "unlisted" | "private";
|
|
@@ -18,7 +18,7 @@ exports.youtubeSchema = streamCommonTypes_1.streamCommonSchema.extend({
|
|
|
18
18
|
dvr: zod_1.default.boolean(),
|
|
19
19
|
saveToSdCard: zod_1.default.boolean(),
|
|
20
20
|
statusCameraLed: zod_1.default.boolean(),
|
|
21
|
-
statusCameraOutput: zod_1.default.string(),
|
|
21
|
+
statusCameraOutput: zod_1.default.string().nullable(),
|
|
22
22
|
hasWatchdogs: zod_1.default.boolean(),
|
|
23
23
|
countdown: zod_1.default.boolean(),
|
|
24
24
|
enableManualControl: zod_1.default.boolean(),
|
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ParsingBlobError, ErrorWithResponse, ServiceNotFoundError, StorageDataF
|
|
|
3
3
|
import { networkCameraListSchema } from './types/common';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ProxyClient } from './internal/ProxyClient';
|
|
6
|
-
import {
|
|
6
|
+
import { ImageType, serviceListSchema, servicesSchema, wsResponseSchema, getStorageDataListSchema, getFileListSchema, } from './types/CamOverlayAPI';
|
|
7
7
|
const BASE_PATH = '/local/camoverlay/api';
|
|
8
8
|
export class CamOverlayAPI {
|
|
9
9
|
client;
|
|
@@ -33,7 +33,7 @@ export class CamOverlayAPI {
|
|
|
33
33
|
}
|
|
34
34
|
async listFiles(fileType, options) {
|
|
35
35
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
36
|
-
return
|
|
36
|
+
return getFileListSchema(fileType).parse(res.list);
|
|
37
37
|
}
|
|
38
38
|
async uploadFile(fileType, formData, storage, options) {
|
|
39
39
|
await this._post(`${BASE_PATH}/upload_${fileType}.cgi`, formData, {
|
|
@@ -52,7 +52,7 @@ export class CamOverlayAPI {
|
|
|
52
52
|
if (res.code !== 200) {
|
|
53
53
|
throw new StorageDataFetchError(res);
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return getStorageDataListSchema(fileType).parse(res.list);
|
|
56
56
|
}
|
|
57
57
|
async getFilePreviewFromCamera(path, options) {
|
|
58
58
|
return await this._getBlob(CamOverlayAPI.getFilePreviewPath(path), undefined, options);
|
|
@@ -49,28 +49,62 @@ export var ImageType;
|
|
|
49
49
|
ImageType[ImageType["PNG"] = 0] = "PNG";
|
|
50
50
|
ImageType[ImageType["JPEG"] = 1] = "JPEG";
|
|
51
51
|
})(ImageType || (ImageType = {}));
|
|
52
|
-
export const
|
|
52
|
+
export const imageFileStorageTypeSchema = z.union([
|
|
53
53
|
z.literal('flash'),
|
|
54
54
|
z.literal('SD0'),
|
|
55
55
|
z.literal('ftp'),
|
|
56
56
|
z.literal('samba'),
|
|
57
57
|
z.literal('url'),
|
|
58
58
|
]);
|
|
59
|
-
export const
|
|
60
|
-
|
|
59
|
+
export const fontFileStorageTypeSchema = z.union([z.literal('flash'), z.literal('SD0')]);
|
|
60
|
+
export const imageFilestorageDataListSchema = z.array(z.object({
|
|
61
|
+
type: imageFileStorageTypeSchema,
|
|
61
62
|
state: z.string(),
|
|
62
63
|
}));
|
|
63
|
-
export const
|
|
64
|
+
export const fontStorageDataListSchema = z.array(z.object({
|
|
65
|
+
type: fontFileStorageTypeSchema,
|
|
66
|
+
state: z.string(),
|
|
67
|
+
}));
|
|
68
|
+
export const getStorageDataListSchema = (fileType) => {
|
|
69
|
+
return fileType === 'image' ? imageFilestorageDataListSchema : fontStorageDataListSchema;
|
|
70
|
+
};
|
|
71
|
+
export const imageStorageResponseSchema = z.object({
|
|
64
72
|
code: z.number(),
|
|
65
|
-
list:
|
|
73
|
+
list: imageFilestorageDataListSchema,
|
|
66
74
|
});
|
|
67
|
-
export const
|
|
75
|
+
export const fontStorageResponseSchema = z.object({
|
|
76
|
+
code: z.number(),
|
|
77
|
+
list: fontStorageDataListSchema,
|
|
78
|
+
});
|
|
79
|
+
export const getStorageResponseSchema = (fileType) => {
|
|
80
|
+
return fileType === 'image' ? imageStorageResponseSchema : fontStorageResponseSchema;
|
|
81
|
+
};
|
|
82
|
+
export const imageFileSchema = z.object({
|
|
68
83
|
name: z.string(),
|
|
69
84
|
path: z.string().url(),
|
|
70
|
-
storage:
|
|
85
|
+
storage: imageFileStorageTypeSchema,
|
|
86
|
+
});
|
|
87
|
+
export const fontFileSchema = z.object({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
path: z.string().url(),
|
|
90
|
+
storage: fontFileStorageTypeSchema,
|
|
91
|
+
});
|
|
92
|
+
export const getFileSchema = (fileType) => {
|
|
93
|
+
return fileType === 'image' ? imageFileSchema : fontFileSchema;
|
|
94
|
+
};
|
|
95
|
+
export const imageFileListSchema = z.array(imageFileSchema);
|
|
96
|
+
export const fontFileListSchema = z.array(fontFileSchema);
|
|
97
|
+
export const getFileListSchema = (fileType) => {
|
|
98
|
+
return fileType === 'image' ? imageFileListSchema : fontFileListSchema;
|
|
99
|
+
};
|
|
100
|
+
export const imageFileDataSchema = z.object({
|
|
101
|
+
code: z.number(),
|
|
102
|
+
list: imageFileListSchema,
|
|
71
103
|
});
|
|
72
|
-
export const
|
|
73
|
-
export const fileDataSchema = z.object({
|
|
104
|
+
export const fontFileDataSchema = z.object({
|
|
74
105
|
code: z.number(),
|
|
75
|
-
list:
|
|
106
|
+
list: fontFileListSchema,
|
|
76
107
|
});
|
|
108
|
+
export const getFileDataSchema = (fileType) => {
|
|
109
|
+
return fileType === 'image' ? imageFileDataSchema : fontFileDataSchema;
|
|
110
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export const gameChangerSchema =
|
|
2
|
+
import { commonRtmpSchema } from './rtmpSchema';
|
|
3
|
+
export const gameChangerSchema = commonRtmpSchema.extend({
|
|
4
4
|
type: z.literal('game_changer'),
|
|
5
5
|
});
|
|
@@ -3,6 +3,7 @@ export * from './streamCommonTypes';
|
|
|
3
3
|
export * from './facebookSchema';
|
|
4
4
|
export * from './mpegDvbSchema';
|
|
5
5
|
export * from './rtmpSchema';
|
|
6
|
+
export * from './gameChangerSchema';
|
|
6
7
|
export * from './sdCardSchema';
|
|
7
8
|
export * from './windySchema';
|
|
8
9
|
export * from './youtubeSchema';
|
|
@@ -16,6 +16,6 @@ export const mpegDvbSchema = streamCommonSchema.extend({
|
|
|
16
16
|
providerName: z.string(),
|
|
17
17
|
serviceName: z.string(),
|
|
18
18
|
statusCameraLed: z.boolean(),
|
|
19
|
-
statusCameraOutput: z.string(),
|
|
19
|
+
statusCameraOutput: z.string().nullable(),
|
|
20
20
|
saveToSdCard: z.boolean(),
|
|
21
21
|
});
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import { streamCommonSchema } from './streamCommonTypes';
|
|
3
|
-
export const
|
|
4
|
-
type: z.literal('rtmp'),
|
|
3
|
+
export const commonRtmpSchema = streamCommonSchema.extend({
|
|
5
4
|
outputUrl: z.string(),
|
|
6
5
|
streamKey: z.string(),
|
|
7
6
|
streamIdentifier: z.string().optional(),
|
|
7
|
+
saveToSdCard: z.boolean(),
|
|
8
|
+
statusCameraLed: z.boolean(),
|
|
9
|
+
statusCameraOutput: z.string().nullable(),
|
|
10
|
+
});
|
|
11
|
+
export const rtmpSchema = commonRtmpSchema.extend({
|
|
12
|
+
type: z.literal('rtmp'),
|
|
8
13
|
});
|
|
@@ -12,7 +12,7 @@ export const youtubeSchema = streamCommonSchema.extend({
|
|
|
12
12
|
dvr: z.boolean(),
|
|
13
13
|
saveToSdCard: z.boolean(),
|
|
14
14
|
statusCameraLed: z.boolean(),
|
|
15
|
-
statusCameraOutput: z.string(),
|
|
15
|
+
statusCameraOutput: z.string().nullable(),
|
|
16
16
|
hasWatchdogs: z.boolean(),
|
|
17
17
|
countdown: z.boolean(),
|
|
18
18
|
enableManualControl: z.boolean(),
|
package/package.json
CHANGED
package/types/CamOverlayAPI.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IClient, TBlobResponse, TResponse } from './internal/types';
|
|
2
2
|
import { THttpRequestOptions, TProxyParams } from './types/common';
|
|
3
3
|
import { ProxyClient } from './internal/ProxyClient';
|
|
4
|
-
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService } from './types/CamOverlayAPI';
|
|
4
|
+
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService, TFileList, TStorageDataList } from './types/CamOverlayAPI';
|
|
5
5
|
export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -16,17 +16,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
16
16
|
}[]>;
|
|
17
17
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
18
18
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
19
|
-
listFiles(fileType:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}[]>;
|
|
24
|
-
uploadFile(fileType: TFileType, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType, options?: THttpRequestOptions): Promise<void>;
|
|
25
|
-
removeFile(fileType: TFileType, fileParams: TFile, options?: THttpRequestOptions): Promise<void>;
|
|
26
|
-
getFileStorage(fileType: TFileType, options?: THttpRequestOptions): Promise<{
|
|
27
|
-
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
28
|
-
state: string;
|
|
29
|
-
}[]>;
|
|
19
|
+
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
20
|
+
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
21
|
+
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
|
22
|
+
getFileStorage<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TStorageDataList<T>>;
|
|
30
23
|
getFilePreviewFromCamera(path: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
31
24
|
updateInfoticker(serviceId: number, text: string, options?: THttpRequestOptions): Promise<void>;
|
|
32
25
|
setEnabled(serviceId: number, enabled: boolean, options?: THttpRequestOptions): Promise<void>;
|
|
@@ -132,7 +132,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
132
132
|
providerName: string;
|
|
133
133
|
serviceName: string;
|
|
134
134
|
statusCameraLed: boolean;
|
|
135
|
-
statusCameraOutput: string;
|
|
135
|
+
statusCameraOutput: string | null;
|
|
136
136
|
saveToSdCard: boolean;
|
|
137
137
|
} | {
|
|
138
138
|
type: "rtmp";
|
|
@@ -187,6 +187,9 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
187
187
|
isActive: boolean;
|
|
188
188
|
}[];
|
|
189
189
|
};
|
|
190
|
+
statusCameraLed: boolean;
|
|
191
|
+
statusCameraOutput: string | null;
|
|
192
|
+
saveToSdCard: boolean;
|
|
190
193
|
outputUrl: string;
|
|
191
194
|
streamKey: string;
|
|
192
195
|
streamIdentifier?: string | undefined;
|
|
@@ -350,7 +353,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
350
353
|
}[];
|
|
351
354
|
};
|
|
352
355
|
statusCameraLed: boolean;
|
|
353
|
-
statusCameraOutput: string;
|
|
356
|
+
statusCameraOutput: string | null;
|
|
354
357
|
saveToSdCard: boolean;
|
|
355
358
|
tags: string[];
|
|
356
359
|
streamPrivacy: "public" | "unlisted" | "private";
|
|
@@ -1052,6 +1055,12 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
1052
1055
|
isActive: boolean;
|
|
1053
1056
|
}[];
|
|
1054
1057
|
};
|
|
1058
|
+
statusCameraLed: boolean;
|
|
1059
|
+
statusCameraOutput: string | null;
|
|
1060
|
+
saveToSdCard: boolean;
|
|
1061
|
+
outputUrl: string;
|
|
1062
|
+
streamKey: string;
|
|
1063
|
+
streamIdentifier?: string | undefined;
|
|
1055
1064
|
})[]>;
|
|
1056
1065
|
setStreamList(streamList: TStreamList['streamList'], options?: THttpRequestOptions): Promise<void>;
|
|
1057
1066
|
getStream(streamId: number, options?: THttpRequestOptions): Promise<{
|
|
@@ -1174,7 +1183,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
1174
1183
|
providerName: string;
|
|
1175
1184
|
serviceName: string;
|
|
1176
1185
|
statusCameraLed: boolean;
|
|
1177
|
-
statusCameraOutput: string;
|
|
1186
|
+
statusCameraOutput: string | null;
|
|
1178
1187
|
saveToSdCard: boolean;
|
|
1179
1188
|
} | {
|
|
1180
1189
|
type: "rtmp";
|
|
@@ -1229,6 +1238,9 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
1229
1238
|
isActive: boolean;
|
|
1230
1239
|
}[];
|
|
1231
1240
|
};
|
|
1241
|
+
statusCameraLed: boolean;
|
|
1242
|
+
statusCameraOutput: string | null;
|
|
1243
|
+
saveToSdCard: boolean;
|
|
1232
1244
|
outputUrl: string;
|
|
1233
1245
|
streamKey: string;
|
|
1234
1246
|
streamIdentifier?: string | undefined;
|
|
@@ -1392,7 +1404,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
1392
1404
|
}[];
|
|
1393
1405
|
};
|
|
1394
1406
|
statusCameraLed: boolean;
|
|
1395
|
-
statusCameraOutput: string;
|
|
1407
|
+
statusCameraOutput: string | null;
|
|
1396
1408
|
saveToSdCard: boolean;
|
|
1397
1409
|
tags: string[];
|
|
1398
1410
|
streamPrivacy: "public" | "unlisted" | "private";
|
|
@@ -2094,6 +2106,12 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
2094
2106
|
isActive: boolean;
|
|
2095
2107
|
}[];
|
|
2096
2108
|
};
|
|
2109
|
+
statusCameraLed: boolean;
|
|
2110
|
+
statusCameraOutput: string | null;
|
|
2111
|
+
saveToSdCard: boolean;
|
|
2112
|
+
outputUrl: string;
|
|
2113
|
+
streamKey: string;
|
|
2114
|
+
streamIdentifier?: string | undefined;
|
|
2097
2115
|
}>;
|
|
2098
2116
|
setStream(streamId: number, streamData: TStream, options?: THttpRequestOptions): Promise<void>;
|
|
2099
2117
|
isStreaming(streamId: number, options?: THttpRequestOptions): Promise<boolean>;
|