camstreamerlib 4.0.0-beta.5 → 4.0.0-beta.7
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/CamSwitcherAPI.d.ts +5 -1
- package/cjs/CamSwitcherAPI.js +4 -2
- package/cjs/VapixAPI.js +2 -2
- package/cjs/types/CamSwitcherEvents.d.ts +77 -0
- package/cjs/types/CamSwitcherEvents.js +8 -0
- package/cjs/types/VapixAPI.d.ts +394 -302
- package/cjs/types/VapixAPI.js +5 -2
- package/esm/CamSwitcherAPI.d.ts +5 -1
- package/esm/CamSwitcherAPI.js +4 -2
- package/esm/VapixAPI.js +2 -2
- package/esm/types/CamSwitcherEvents.d.ts +77 -0
- package/esm/types/CamSwitcherEvents.js +8 -0
- package/esm/types/VapixAPI.d.ts +394 -302
- package/esm/types/VapixAPI.js +5 -2
- package/package.json +1 -1
package/cjs/types/VapixAPI.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.APP_IDS = [
|
|
|
22
22
|
'CamScripter',
|
|
23
23
|
'PlaneTracker',
|
|
24
24
|
'Ndihxplugin',
|
|
25
|
+
'SportTracker',
|
|
25
26
|
];
|
|
26
27
|
exports.applicationListSchema = zod_1.z.object({
|
|
27
28
|
reply: zod_1.z.object({
|
|
@@ -70,7 +71,7 @@ exports.audioDeviceSignalingChannelTypeSchema = zod_1.z.object({
|
|
|
70
71
|
});
|
|
71
72
|
exports.audioDeviceSignalingTypeSchema = zod_1.z.object({
|
|
72
73
|
id: zod_1.z.string(),
|
|
73
|
-
powerType: zod_1.z.string(),
|
|
74
|
+
powerType: zod_1.z.string().optional(),
|
|
74
75
|
channels: zod_1.z.array(exports.audioDeviceSignalingChannelTypeSchema),
|
|
75
76
|
});
|
|
76
77
|
exports.audioDeviceConnectionTypeSchema = zod_1.z.object({
|
|
@@ -97,7 +98,9 @@ const audioDeviceFromRequestSchema = zod_1.z.object({
|
|
|
97
98
|
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
98
99
|
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
99
100
|
});
|
|
100
|
-
exports.audioDeviceRequestSchema = zod_1.z.object({
|
|
101
|
+
exports.audioDeviceRequestSchema = zod_1.z.object({
|
|
102
|
+
data: zod_1.z.object({ devices: zod_1.z.array(audioDeviceFromRequestSchema) }),
|
|
103
|
+
});
|
|
101
104
|
exports.maxFpsResponseSchema = zod_1.z.object({
|
|
102
105
|
data: zod_1.z
|
|
103
106
|
.array(zod_1.z.object({
|
package/esm/CamSwitcherAPI.d.ts
CHANGED
|
@@ -3,8 +3,12 @@ import { TAudioPushInfo, TOutputInfo, TStorageInfo, TStreamSaveList, TClipList,
|
|
|
3
3
|
import { TAudioChannel, TNetworkCamera, TStorageType } from './types/common';
|
|
4
4
|
export declare class CamSwitcherAPI<Client extends IClient = IClient> {
|
|
5
5
|
client: Client;
|
|
6
|
+
private CustomFormData;
|
|
6
7
|
private vapixAgent;
|
|
7
|
-
constructor(client: Client
|
|
8
|
+
constructor(client: Client, CustomFormData?: {
|
|
9
|
+
new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
|
|
10
|
+
prototype: FormData;
|
|
11
|
+
});
|
|
8
12
|
static getProxyUrlPath: () => string;
|
|
9
13
|
static getWsEventsUrlPath: () => string;
|
|
10
14
|
static getClipPreviewUrlPath: (id: string, storage: TStorageType) => string;
|
package/esm/CamSwitcherAPI.js
CHANGED
|
@@ -10,9 +10,11 @@ import { FIRMWARE_WITH_BITRATE_MODES_SUPPORT } from './internal/constants';
|
|
|
10
10
|
const baseUrl = '/local/camswitcher/api';
|
|
11
11
|
export class CamSwitcherAPI {
|
|
12
12
|
client;
|
|
13
|
+
CustomFormData;
|
|
13
14
|
vapixAgent;
|
|
14
|
-
constructor(client) {
|
|
15
|
+
constructor(client, CustomFormData = FormData) {
|
|
15
16
|
this.client = client;
|
|
17
|
+
this.CustomFormData = CustomFormData;
|
|
16
18
|
this.vapixAgent = new VapixAPI(client, () => '');
|
|
17
19
|
}
|
|
18
20
|
static getProxyUrlPath = () => `${baseUrl}/proxy.cgi`;
|
|
@@ -99,7 +101,7 @@ export class CamSwitcherAPI {
|
|
|
99
101
|
await this.get(`${baseUrl}/playlist_queue_play_next.cgi`);
|
|
100
102
|
}
|
|
101
103
|
async addNewClip(file, clipType, storage, id, fileName) {
|
|
102
|
-
const formData = new
|
|
104
|
+
const formData = new this.CustomFormData();
|
|
103
105
|
formData.append('clip_name', id);
|
|
104
106
|
formData.append('clip_type', clipType);
|
|
105
107
|
formData.append('file', file, fileName);
|
package/esm/VapixAPI.js
CHANGED
|
@@ -177,7 +177,7 @@ export class VapixAPI {
|
|
|
177
177
|
const data = { apiVersion: '1.0', method: 'getDevicesSettings' };
|
|
178
178
|
const res = await this.postJson(proxy, '/axis-cgi/audiodevicecontrol.cgi', data);
|
|
179
179
|
const result = audioDeviceRequestSchema.parse(await res.json());
|
|
180
|
-
return result.devices.map((device) => ({
|
|
180
|
+
return result.data.devices.map((device) => ({
|
|
181
181
|
...device,
|
|
182
182
|
inputs: (device.inputs || []).sort((a, b) => a.id.localeCompare(b.id)),
|
|
183
183
|
outputs: (device.outputs || []).sort((a, b) => a.id.localeCompare(b.id)),
|
|
@@ -399,7 +399,7 @@ const parseParameters = (response) => {
|
|
|
399
399
|
}
|
|
400
400
|
const delimiterPos = line.indexOf('=');
|
|
401
401
|
if (delimiterPos !== -1) {
|
|
402
|
-
const paramName = line.substring(0, delimiterPos);
|
|
402
|
+
const paramName = line.substring(0, delimiterPos).replace('root.', '');
|
|
403
403
|
const paramValue = line.substring(delimiterPos + 1);
|
|
404
404
|
params[paramName] = paramValue;
|
|
405
405
|
}
|
|
@@ -44,6 +44,27 @@ declare const cswEventsDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
|
|
|
44
44
|
master_audio: boolean;
|
|
45
45
|
stream_name?: string | undefined;
|
|
46
46
|
clip_name?: string | undefined;
|
|
47
|
+
}>, z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"StreamSwitchVideoError">;
|
|
49
|
+
playlist_name: z.ZodString;
|
|
50
|
+
playlist_active_stream: z.ZodNumber;
|
|
51
|
+
stream_name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
clip_name: z.ZodOptional<z.ZodString>;
|
|
53
|
+
info: z.ZodString;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
type: "StreamSwitchVideoError";
|
|
56
|
+
playlist_name: string;
|
|
57
|
+
playlist_active_stream: number;
|
|
58
|
+
info: string;
|
|
59
|
+
stream_name?: string | undefined;
|
|
60
|
+
clip_name?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
type: "StreamSwitchVideoError";
|
|
63
|
+
playlist_name: string;
|
|
64
|
+
playlist_active_stream: number;
|
|
65
|
+
info: string;
|
|
66
|
+
stream_name?: string | undefined;
|
|
67
|
+
clip_name?: string | undefined;
|
|
47
68
|
}>, z.ZodObject<{
|
|
48
69
|
type: z.ZodLiteral<"StreamSwitchAudioError">;
|
|
49
70
|
stream_name: z.ZodOptional<z.ZodString>;
|
|
@@ -176,6 +197,27 @@ export declare const cswEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
176
197
|
master_audio: boolean;
|
|
177
198
|
stream_name?: string | undefined;
|
|
178
199
|
clip_name?: string | undefined;
|
|
200
|
+
}>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"StreamSwitchVideoError">;
|
|
202
|
+
playlist_name: z.ZodString;
|
|
203
|
+
playlist_active_stream: z.ZodNumber;
|
|
204
|
+
stream_name: z.ZodOptional<z.ZodString>;
|
|
205
|
+
clip_name: z.ZodOptional<z.ZodString>;
|
|
206
|
+
info: z.ZodString;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
type: "StreamSwitchVideoError";
|
|
209
|
+
playlist_name: string;
|
|
210
|
+
playlist_active_stream: number;
|
|
211
|
+
info: string;
|
|
212
|
+
stream_name?: string | undefined;
|
|
213
|
+
clip_name?: string | undefined;
|
|
214
|
+
}, {
|
|
215
|
+
type: "StreamSwitchVideoError";
|
|
216
|
+
playlist_name: string;
|
|
217
|
+
playlist_active_stream: number;
|
|
218
|
+
info: string;
|
|
219
|
+
stream_name?: string | undefined;
|
|
220
|
+
clip_name?: string | undefined;
|
|
179
221
|
}>, z.ZodObject<{
|
|
180
222
|
type: z.ZodLiteral<"StreamSwitchAudioError">;
|
|
181
223
|
stream_name: z.ZodOptional<z.ZodString>;
|
|
@@ -278,6 +320,13 @@ export declare const cswEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
278
320
|
master_audio: boolean;
|
|
279
321
|
stream_name?: string | undefined;
|
|
280
322
|
clip_name?: string | undefined;
|
|
323
|
+
} | {
|
|
324
|
+
type: "StreamSwitchVideoError";
|
|
325
|
+
playlist_name: string;
|
|
326
|
+
playlist_active_stream: number;
|
|
327
|
+
info: string;
|
|
328
|
+
stream_name?: string | undefined;
|
|
329
|
+
clip_name?: string | undefined;
|
|
281
330
|
} | {
|
|
282
331
|
type: "StreamSwitchAudioError";
|
|
283
332
|
master_audio: boolean;
|
|
@@ -324,6 +373,13 @@ export declare const cswEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
324
373
|
master_audio: boolean;
|
|
325
374
|
stream_name?: string | undefined;
|
|
326
375
|
clip_name?: string | undefined;
|
|
376
|
+
} | {
|
|
377
|
+
type: "StreamSwitchVideoError";
|
|
378
|
+
playlist_name: string;
|
|
379
|
+
playlist_active_stream: number;
|
|
380
|
+
info: string;
|
|
381
|
+
stream_name?: string | undefined;
|
|
382
|
+
clip_name?: string | undefined;
|
|
327
383
|
} | {
|
|
328
384
|
type: "StreamSwitchAudioError";
|
|
329
385
|
master_audio: boolean;
|
|
@@ -398,6 +454,27 @@ export declare const cswEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
398
454
|
master_audio: boolean;
|
|
399
455
|
stream_name?: string | undefined;
|
|
400
456
|
clip_name?: string | undefined;
|
|
457
|
+
}>, z.ZodObject<{
|
|
458
|
+
type: z.ZodLiteral<"StreamSwitchVideoError">;
|
|
459
|
+
playlist_name: z.ZodString;
|
|
460
|
+
playlist_active_stream: z.ZodNumber;
|
|
461
|
+
stream_name: z.ZodOptional<z.ZodString>;
|
|
462
|
+
clip_name: z.ZodOptional<z.ZodString>;
|
|
463
|
+
info: z.ZodString;
|
|
464
|
+
}, "strip", z.ZodTypeAny, {
|
|
465
|
+
type: "StreamSwitchVideoError";
|
|
466
|
+
playlist_name: string;
|
|
467
|
+
playlist_active_stream: number;
|
|
468
|
+
info: string;
|
|
469
|
+
stream_name?: string | undefined;
|
|
470
|
+
clip_name?: string | undefined;
|
|
471
|
+
}, {
|
|
472
|
+
type: "StreamSwitchVideoError";
|
|
473
|
+
playlist_name: string;
|
|
474
|
+
playlist_active_stream: number;
|
|
475
|
+
info: string;
|
|
476
|
+
stream_name?: string | undefined;
|
|
477
|
+
clip_name?: string | undefined;
|
|
401
478
|
}>, z.ZodObject<{
|
|
402
479
|
type: z.ZodLiteral<"StreamSwitchAudioError">;
|
|
403
480
|
stream_name: z.ZodOptional<z.ZodString>;
|
|
@@ -16,6 +16,14 @@ const cswEventsDataSchema = z.discriminatedUnion('type', [
|
|
|
16
16
|
clip_name: z.string().optional(),
|
|
17
17
|
master_audio: z.boolean(),
|
|
18
18
|
}),
|
|
19
|
+
z.object({
|
|
20
|
+
type: z.literal('StreamSwitchVideoError'),
|
|
21
|
+
playlist_name: z.string(),
|
|
22
|
+
playlist_active_stream: z.number(),
|
|
23
|
+
stream_name: z.string().optional(),
|
|
24
|
+
clip_name: z.string().optional(),
|
|
25
|
+
info: z.string(),
|
|
26
|
+
}),
|
|
19
27
|
z.object({
|
|
20
28
|
type: z.literal('StreamSwitchAudioError'),
|
|
21
29
|
stream_name: z.string().optional(),
|