camstreamerlib 4.0.0-beta.2 → 4.0.0-beta.3
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/README.md +3 -1
- package/cjs/CamOverlayAPI.js +176 -0
- package/cjs/CamOverlayDrawingAPI.js +232 -0
- package/cjs/CamOverlayPainter/Frame.js +301 -0
- package/cjs/CamOverlayPainter/Painter.js +168 -0
- package/cjs/CamOverlayPainter/ResourceManager.js +50 -0
- package/cjs/CamScripterAPI.js +70 -0
- package/cjs/CamScripterAPICameraEventsGenerator.js +159 -0
- package/cjs/CamStreamerAPI.js +65 -0
- package/{CamSwitcherAPI.d.ts → cjs/CamSwitcherAPI.d.ts} +3 -3
- package/cjs/CamSwitcherAPI.js +354 -0
- package/{CamSwitcherEvents.d.ts → cjs/CamSwitcherEvents.d.ts} +1 -1
- package/cjs/CamSwitcherEvents.js +67 -0
- package/cjs/CreatePackage.js +106 -0
- package/cjs/VapixAPI.js +458 -0
- package/cjs/VapixEvents.js +88 -0
- package/cjs/errors/errors.js +79 -0
- package/cjs/events/AxisCameraStationEvents.js +48 -0
- package/cjs/events/GenetecAgent.js +123 -0
- package/cjs/index.d.ts +11 -0
- package/cjs/index.js +31 -0
- package/cjs/internal/Digest.js +42 -0
- package/cjs/internal/ProxyClient.js +44 -0
- package/{internal → cjs/internal}/common.d.ts +0 -1
- package/cjs/internal/common.js +27 -0
- package/cjs/internal/constants.js +4 -0
- package/cjs/internal/transformers.js +32 -0
- package/cjs/internal/utils.js +46 -0
- package/cjs/internal/versionCompare.js +53 -0
- package/cjs/node/DefaultClient.js +54 -0
- package/cjs/node/HttpRequestSender.js +89 -0
- package/cjs/node/HttpServer.js +96 -0
- package/cjs/node/WsClient.js +149 -0
- package/cjs/node/WsEventClient.js +22 -0
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +7 -0
- package/cjs/types/CamOverlayAPI.js +47 -0
- package/cjs/types/CamScripterAPI.js +20 -0
- package/cjs/types/CamStreamerAPI.js +28 -0
- package/cjs/types/CamSwitcherAPI.js +137 -0
- package/cjs/types/CamSwitcherEvents.js +62 -0
- package/cjs/types/VapixAPI.js +132 -0
- package/cjs/types/common.js +14 -0
- package/cjs/web/DefaultClient.js +20 -0
- package/cjs/web/WsClient.js +62 -0
- package/cjs/web/index.d.ts +2 -0
- package/cjs/web/index.js +7 -0
- package/esm/CamOverlayAPI.d.ts +31 -0
- package/esm/CamOverlayDrawingAPI.d.ts +86 -0
- package/esm/CamOverlayPainter/Frame.d.ts +96 -0
- package/esm/CamOverlayPainter/Painter.d.ts +37 -0
- package/esm/CamOverlayPainter/ResourceManager.d.ts +14 -0
- package/esm/CamScripterAPI.d.ts +19 -0
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +74 -0
- package/esm/CamStreamerAPI.d.ts +16 -0
- package/esm/CamSwitcherAPI.d.ts +48 -0
- package/{CamSwitcherAPI.js → esm/CamSwitcherAPI.js} +3 -3
- package/esm/CamSwitcherEvents.d.ts +18 -0
- package/{CamSwitcherEvents.js → esm/CamSwitcherEvents.js} +1 -1
- package/esm/CreatePackage.d.ts +1 -0
- package/esm/VapixAPI.d.ts +66 -0
- package/esm/VapixEvents.d.ts +43 -0
- package/esm/errors/errors.d.ts +34 -0
- package/esm/events/AxisCameraStationEvents.d.ts +9 -0
- package/esm/events/GenetecAgent.d.ts +174 -0
- package/esm/index.d.ts +11 -0
- package/esm/index.js +11 -0
- package/esm/internal/Digest.d.ts +4 -0
- package/esm/internal/ProxyClient.d.ts +11 -0
- package/esm/internal/common.d.ts +39 -0
- package/{internal → esm/internal}/common.js +0 -3
- package/esm/internal/constants.d.ts +1 -0
- package/esm/internal/transformers.d.ts +5 -0
- package/esm/internal/utils.d.ts +11 -0
- package/esm/internal/versionCompare.d.ts +6 -0
- package/esm/node/DefaultClient.d.ts +15 -0
- package/esm/node/HttpRequestSender.d.ts +28 -0
- package/esm/node/HttpServer.d.ts +21 -0
- package/esm/node/WsClient.d.ts +39 -0
- package/esm/node/WsEventClient.d.ts +13 -0
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI.d.ts +188 -0
- package/esm/types/CamScripterAPI.d.ts +67 -0
- package/esm/types/CamStreamerAPI.d.ts +139 -0
- package/esm/types/CamSwitcherAPI.d.ts +814 -0
- package/esm/types/CamSwitcherEvents.d.ts +491 -0
- package/esm/types/VapixAPI.d.ts +1704 -0
- package/esm/types/common.d.ts +37 -0
- package/esm/web/DefaultClient.d.ts +6 -0
- package/esm/web/WsClient.d.ts +13 -0
- package/esm/web/index.d.ts +2 -0
- package/esm/web/index.js +2 -0
- package/package.json +4 -4
- /package/{CamOverlayAPI.d.ts → cjs/CamOverlayAPI.d.ts} +0 -0
- /package/{CamOverlayDrawingAPI.d.ts → cjs/CamOverlayDrawingAPI.d.ts} +0 -0
- /package/{CamOverlayPainter → cjs/CamOverlayPainter}/Frame.d.ts +0 -0
- /package/{CamOverlayPainter → cjs/CamOverlayPainter}/Painter.d.ts +0 -0
- /package/{CamOverlayPainter → cjs/CamOverlayPainter}/ResourceManager.d.ts +0 -0
- /package/{CamScripterAPI.d.ts → cjs/CamScripterAPI.d.ts} +0 -0
- /package/{CamScripterAPICameraEventsGenerator.d.ts → cjs/CamScripterAPICameraEventsGenerator.d.ts} +0 -0
- /package/{CamStreamerAPI.d.ts → cjs/CamStreamerAPI.d.ts} +0 -0
- /package/{CreatePackage.d.ts → cjs/CreatePackage.d.ts} +0 -0
- /package/{VapixAPI.d.ts → cjs/VapixAPI.d.ts} +0 -0
- /package/{VapixEvents.d.ts → cjs/VapixEvents.d.ts} +0 -0
- /package/{errors → cjs/errors}/errors.d.ts +0 -0
- /package/{events → cjs/events}/AxisCameraStationEvents.d.ts +0 -0
- /package/{events → cjs/events}/GenetecAgent.d.ts +0 -0
- /package/{internal → cjs/internal}/Digest.d.ts +0 -0
- /package/{internal → cjs/internal}/ProxyClient.d.ts +0 -0
- /package/{internal → cjs/internal}/constants.d.ts +0 -0
- /package/{internal → cjs/internal}/transformers.d.ts +0 -0
- /package/{internal → cjs/internal}/utils.d.ts +0 -0
- /package/{internal → cjs/internal}/versionCompare.d.ts +0 -0
- /package/{node → cjs/node}/DefaultClient.d.ts +0 -0
- /package/{node → cjs/node}/HttpRequestSender.d.ts +0 -0
- /package/{node → cjs/node}/HttpServer.d.ts +0 -0
- /package/{node → cjs/node}/WsClient.d.ts +0 -0
- /package/{node → cjs/node}/WsEventClient.d.ts +0 -0
- /package/{types → cjs/types}/CamOverlayAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamScripterAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamStreamerAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamSwitcherAPI.d.ts +0 -0
- /package/{types/CamswitcherEvents.d.ts → cjs/types/CamSwitcherEvents.d.ts} +0 -0
- /package/{types → cjs/types}/VapixAPI.d.ts +0 -0
- /package/{types → cjs/types}/common.d.ts +0 -0
- /package/{web → cjs/web}/DefaultClient.d.ts +0 -0
- /package/{web → cjs/web}/WsClient.d.ts +0 -0
- /package/{CamOverlayAPI.js → esm/CamOverlayAPI.js} +0 -0
- /package/{CamOverlayDrawingAPI.js → esm/CamOverlayDrawingAPI.js} +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/Frame.js +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/Painter.js +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/ResourceManager.js +0 -0
- /package/{CamScripterAPI.js → esm/CamScripterAPI.js} +0 -0
- /package/{CamScripterAPICameraEventsGenerator.js → esm/CamScripterAPICameraEventsGenerator.js} +0 -0
- /package/{CamStreamerAPI.js → esm/CamStreamerAPI.js} +0 -0
- /package/{CreatePackage.js → esm/CreatePackage.js} +0 -0
- /package/{VapixAPI.js → esm/VapixAPI.js} +0 -0
- /package/{VapixEvents.js → esm/VapixEvents.js} +0 -0
- /package/{errors → esm/errors}/errors.js +0 -0
- /package/{events → esm/events}/AxisCameraStationEvents.js +0 -0
- /package/{events → esm/events}/GenetecAgent.js +0 -0
- /package/{internal → esm/internal}/Digest.js +0 -0
- /package/{internal → esm/internal}/ProxyClient.js +0 -0
- /package/{internal → esm/internal}/constants.js +0 -0
- /package/{internal → esm/internal}/transformers.js +0 -0
- /package/{internal → esm/internal}/utils.js +0 -0
- /package/{internal → esm/internal}/versionCompare.js +0 -0
- /package/{node → esm/node}/DefaultClient.js +0 -0
- /package/{node → esm/node}/HttpRequestSender.js +0 -0
- /package/{node → esm/node}/HttpServer.js +0 -0
- /package/{node → esm/node}/WsClient.js +0 -0
- /package/{node → esm/node}/WsEventClient.js +0 -0
- /package/{types → esm/types}/CamOverlayAPI.js +0 -0
- /package/{types → esm/types}/CamScripterAPI.js +0 -0
- /package/{types → esm/types}/CamStreamerAPI.js +0 -0
- /package/{types → esm/types}/CamSwitcherAPI.js +0 -0
- /package/{types/CamswitcherEvents.js → esm/types/CamSwitcherEvents.js} +0 -0
- /package/{types → esm/types}/VapixAPI.js +0 -0
- /package/{types → esm/types}/common.js +0 -0
- /package/{web → esm/web}/DefaultClient.js +0 -0
- /package/{web → esm/web}/WsClient.js +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.audioSampleRatesResponseSchema = exports.dateTimeinfoSchema = exports.maxFpsResponseSchema = exports.audioDeviceRequestSchema = exports.audioDeviceSchema = exports.audioDeviceInputOutputSchema = exports.audioDeviceConnectionTypeSchema = exports.audioDeviceSignalingTypeSchema = exports.audioDeviceSignalingChannelTypeSchema = exports.cameraPTZItemSchema = exports.cameraPTZItemDataSchema = exports.PtzOverviewSchema = exports.sdCardWatchedStatuses = exports.guardTourSchema = exports.applicationListSchema = exports.APP_IDS = exports.applicationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const transformers_1 = require("../internal/transformers");
|
|
6
|
+
exports.applicationSchema = zod_1.z.object({
|
|
7
|
+
Name: zod_1.z.string(),
|
|
8
|
+
NiceName: zod_1.z.string(),
|
|
9
|
+
Vendor: zod_1.z.string(),
|
|
10
|
+
Version: zod_1.z.string(),
|
|
11
|
+
ApplicationID: zod_1.z.string().optional(),
|
|
12
|
+
License: zod_1.z.string(),
|
|
13
|
+
Status: zod_1.z.string(),
|
|
14
|
+
ConfigurationPage: zod_1.z.string().optional(),
|
|
15
|
+
VendorHomePage: zod_1.z.string().optional(),
|
|
16
|
+
LicenseName: zod_1.z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
exports.APP_IDS = [
|
|
19
|
+
'CamStreamer',
|
|
20
|
+
'CamSwitcher',
|
|
21
|
+
'CamOverlay',
|
|
22
|
+
'CamScripter',
|
|
23
|
+
'PlaneTracker',
|
|
24
|
+
'Ndihxplugin',
|
|
25
|
+
];
|
|
26
|
+
exports.applicationListSchema = zod_1.z.object({
|
|
27
|
+
reply: zod_1.z.object({
|
|
28
|
+
$: zod_1.z.object({ result: zod_1.z.string() }),
|
|
29
|
+
application: zod_1.z.array(zod_1.z.object({
|
|
30
|
+
$: exports.applicationSchema,
|
|
31
|
+
})),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
exports.guardTourSchema = zod_1.z.object({
|
|
35
|
+
id: zod_1.z.string(),
|
|
36
|
+
camNbr: zod_1.z.unknown(),
|
|
37
|
+
name: zod_1.z.string(),
|
|
38
|
+
randomEnabled: zod_1.z.unknown(),
|
|
39
|
+
running: zod_1.z.string(),
|
|
40
|
+
timeBetweenSequences: zod_1.z.unknown(),
|
|
41
|
+
tour: zod_1.z.array(zod_1.z.object({
|
|
42
|
+
moveSpeed: zod_1.z.unknown(),
|
|
43
|
+
position: zod_1.z.unknown(),
|
|
44
|
+
presetNbr: zod_1.z.unknown(),
|
|
45
|
+
waitTime: zod_1.z.unknown(),
|
|
46
|
+
waitTimeViewType: zod_1.z.unknown(),
|
|
47
|
+
})),
|
|
48
|
+
});
|
|
49
|
+
const audioSampleRatesSchema = zod_1.z.object({
|
|
50
|
+
sample_rate: zod_1.z.number(),
|
|
51
|
+
bit_rates: zod_1.z.array(zod_1.z.number()),
|
|
52
|
+
});
|
|
53
|
+
const audioSampleRatesOutSchema = audioSampleRatesSchema.transform(transformers_1.toCamelCaseDeep);
|
|
54
|
+
exports.sdCardWatchedStatuses = ['OK', 'connected', 'disconnected'];
|
|
55
|
+
exports.PtzOverviewSchema = zod_1.z.record(zod_1.z.number(), zod_1.z.array(zod_1.z.object({ id: zod_1.z.number(), name: zod_1.z.string() })));
|
|
56
|
+
exports.cameraPTZItemDataSchema = zod_1.z.object({
|
|
57
|
+
pan: zod_1.z.number().optional(),
|
|
58
|
+
tilt: zod_1.z.number().optional(),
|
|
59
|
+
zoom: zod_1.z.number().optional(),
|
|
60
|
+
});
|
|
61
|
+
exports.cameraPTZItemSchema = zod_1.z.object({
|
|
62
|
+
name: zod_1.z.string(),
|
|
63
|
+
id: zod_1.z.number(),
|
|
64
|
+
data: exports.cameraPTZItemDataSchema,
|
|
65
|
+
});
|
|
66
|
+
exports.audioDeviceSignalingChannelTypeSchema = zod_1.z.object({
|
|
67
|
+
id: zod_1.z.string(),
|
|
68
|
+
gain: zod_1.z.number(),
|
|
69
|
+
mute: zod_1.z.boolean(),
|
|
70
|
+
});
|
|
71
|
+
exports.audioDeviceSignalingTypeSchema = zod_1.z.object({
|
|
72
|
+
id: zod_1.z.string(),
|
|
73
|
+
powerType: zod_1.z.string(),
|
|
74
|
+
channels: zod_1.z.array(exports.audioDeviceSignalingChannelTypeSchema),
|
|
75
|
+
});
|
|
76
|
+
exports.audioDeviceConnectionTypeSchema = zod_1.z.object({
|
|
77
|
+
id: zod_1.z.string(),
|
|
78
|
+
signalingTypeSelected: zod_1.z.string(),
|
|
79
|
+
signalingTypes: zod_1.z.array(exports.audioDeviceSignalingTypeSchema),
|
|
80
|
+
});
|
|
81
|
+
exports.audioDeviceInputOutputSchema = zod_1.z.object({
|
|
82
|
+
id: zod_1.z.string(),
|
|
83
|
+
name: zod_1.z.string(),
|
|
84
|
+
enabled: zod_1.z.boolean(),
|
|
85
|
+
connectionTypes: zod_1.z.array(exports.audioDeviceConnectionTypeSchema),
|
|
86
|
+
connectionTypeSelected: zod_1.z.string(),
|
|
87
|
+
});
|
|
88
|
+
exports.audioDeviceSchema = zod_1.z.object({
|
|
89
|
+
id: zod_1.z.string(),
|
|
90
|
+
name: zod_1.z.string(),
|
|
91
|
+
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema),
|
|
92
|
+
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema),
|
|
93
|
+
});
|
|
94
|
+
const audioDeviceFromRequestSchema = zod_1.z.object({
|
|
95
|
+
id: zod_1.z.string(),
|
|
96
|
+
name: zod_1.z.string(),
|
|
97
|
+
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
98
|
+
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
99
|
+
});
|
|
100
|
+
exports.audioDeviceRequestSchema = zod_1.z.object({ devices: zod_1.z.array(audioDeviceFromRequestSchema) });
|
|
101
|
+
exports.maxFpsResponseSchema = zod_1.z.object({
|
|
102
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
103
|
+
channel: zod_1.z.number(),
|
|
104
|
+
captureMode: zod_1.z.array(zod_1.z.object({
|
|
105
|
+
enabled: zod_1.z.boolean(),
|
|
106
|
+
maxFPS: zod_1.z.number().optional(),
|
|
107
|
+
})),
|
|
108
|
+
})),
|
|
109
|
+
});
|
|
110
|
+
exports.dateTimeinfoSchema = zod_1.z.object({
|
|
111
|
+
data: zod_1.z.object({
|
|
112
|
+
dateTime: zod_1.z.string(),
|
|
113
|
+
dstEnabled: zod_1.z.boolean(),
|
|
114
|
+
localDateTime: zod_1.z.string(),
|
|
115
|
+
posixTimeZone: zod_1.z.string(),
|
|
116
|
+
timeZone: zod_1.z.string(),
|
|
117
|
+
}),
|
|
118
|
+
});
|
|
119
|
+
exports.audioSampleRatesResponseSchema = zod_1.z.object({
|
|
120
|
+
data: zod_1.z.object({
|
|
121
|
+
encoders: zod_1.z.union([
|
|
122
|
+
zod_1.z.object({
|
|
123
|
+
aac: zod_1.z.array(audioSampleRatesSchema),
|
|
124
|
+
AAC: zod_1.z.undefined(),
|
|
125
|
+
}),
|
|
126
|
+
zod_1.z.object({
|
|
127
|
+
AAC: zod_1.z.array(audioSampleRatesSchema),
|
|
128
|
+
aac: zod_1.z.undefined(),
|
|
129
|
+
}),
|
|
130
|
+
]),
|
|
131
|
+
}),
|
|
132
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.audioChannelSchema = zod_1.z.union([zod_1.z.literal('mono'), zod_1.z.literal('stereo')]);
|
|
6
|
+
exports.audioChannelCountSchema = zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2)]);
|
|
7
|
+
exports.h264ProfileSchema = zod_1.z.union([zod_1.z.literal('high'), zod_1.z.literal('main'), zod_1.z.literal('baseline')]);
|
|
8
|
+
exports.storageTypeSchema = zod_1.z.union([zod_1.z.literal('SD_DISK'), zod_1.z.literal('FLASH')]);
|
|
9
|
+
exports.networkCameraListSchema = zod_1.z.array(zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
ip: zod_1.z.string(),
|
|
12
|
+
}));
|
|
13
|
+
exports.keyboardShortcutSchema = zod_1.z.string().nullable();
|
|
14
|
+
exports.keyboardShortcutsSchema = zod_1.z.record(exports.keyboardShortcutSchema);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultClient = void 0;
|
|
4
|
+
const utils_1 = require("../internal/utils");
|
|
5
|
+
class DefaultClient {
|
|
6
|
+
get(url, parameters, headers) {
|
|
7
|
+
return fetch((0, utils_1.addParametersToPath)(url, parameters), {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
headers: headers,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
post(url, data, parameters, headers) {
|
|
13
|
+
return fetch((0, utils_1.addParametersToPath)(url, parameters), {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: data,
|
|
16
|
+
headers: headers,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DefaultClient = DefaultClient;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsClient = void 0;
|
|
4
|
+
const REFRESH_TIMEOUT = 5_000;
|
|
5
|
+
class WsClient {
|
|
6
|
+
getUrl;
|
|
7
|
+
getAuthToken;
|
|
8
|
+
isDestroyed = false;
|
|
9
|
+
ws = null;
|
|
10
|
+
restartTimeout = null;
|
|
11
|
+
constructor(getUrl, getAuthToken) {
|
|
12
|
+
this.getUrl = getUrl;
|
|
13
|
+
this.getAuthToken = getAuthToken;
|
|
14
|
+
}
|
|
15
|
+
init() {
|
|
16
|
+
if (this.isDestroyed) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.destroyWebsocket();
|
|
20
|
+
const ws = new WebSocket(this.getUrl(), 'events');
|
|
21
|
+
ws.onopen = async () => {
|
|
22
|
+
try {
|
|
23
|
+
const token = await this.getAuthToken();
|
|
24
|
+
ws.send(JSON.stringify({ authorization: token }));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error sending auth token:', error);
|
|
28
|
+
ws.close();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
ws.onmessage = (e) => this.onmessage(e);
|
|
32
|
+
ws.onclose = () => {
|
|
33
|
+
this.restartTimeout = setTimeout(() => this.init(), REFRESH_TIMEOUT);
|
|
34
|
+
};
|
|
35
|
+
this.ws = ws;
|
|
36
|
+
}
|
|
37
|
+
send = (msg) => {
|
|
38
|
+
this.ws?.send(msg);
|
|
39
|
+
};
|
|
40
|
+
onmessage = (_) => { };
|
|
41
|
+
destroy = () => {
|
|
42
|
+
this.isDestroyed = true;
|
|
43
|
+
this.destroyWebsocket();
|
|
44
|
+
};
|
|
45
|
+
destroyWebsocket() {
|
|
46
|
+
if (this.restartTimeout) {
|
|
47
|
+
clearTimeout(this.restartTimeout);
|
|
48
|
+
this.restartTimeout = null;
|
|
49
|
+
}
|
|
50
|
+
if (!this.ws) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.ws.onmessage = null;
|
|
54
|
+
this.ws.onopen = null;
|
|
55
|
+
this.ws.onclose = null;
|
|
56
|
+
if (this.ws.readyState === this.ws.OPEN) {
|
|
57
|
+
this.ws.close();
|
|
58
|
+
}
|
|
59
|
+
this.ws = null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.WsClient = WsClient;
|
package/cjs/web/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsClient = exports.DefaultClient = void 0;
|
|
4
|
+
var DefaultClient_1 = require("./DefaultClient");
|
|
5
|
+
Object.defineProperty(exports, "DefaultClient", { enumerable: true, get: function () { return DefaultClient_1.DefaultClient; } });
|
|
6
|
+
var WsClient_1 = require("./WsClient");
|
|
7
|
+
Object.defineProperty(exports, "WsClient", { enumerable: true, get: function () { return WsClient_1.WsClient; } });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IClient } from './internal/common';
|
|
3
|
+
import { CamOverlayOptions, ImageType, TCoordinates, TField, TFile, TFileList, TFileType, TService, TServiceList, TStorage } from './types/CamOverlayAPI';
|
|
4
|
+
import { TNetworkCamera } from './types/common';
|
|
5
|
+
export declare class CamOverlayAPI {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(options?: CamOverlayOptions | IClient);
|
|
8
|
+
checkCameraTime(): Promise<boolean>;
|
|
9
|
+
getNetworkCameraList(): Promise<TNetworkCamera[]>;
|
|
10
|
+
wsAutoratization(): Promise<string>;
|
|
11
|
+
getMjpegStreamImage(mjpegUrl: string): Promise<Blob>;
|
|
12
|
+
listFiles(fileType: TFileType): Promise<TFileList>;
|
|
13
|
+
uploadFile(fileType: TFileType, file: Blob, fileName: string): Promise<void>;
|
|
14
|
+
removeFile(fileType: TFileType, file: TFile): Promise<void>;
|
|
15
|
+
getFileStorage(fileType: TFileType): Promise<TStorage>;
|
|
16
|
+
updateInfoticker(serviceID: number, text: string): Promise<void>;
|
|
17
|
+
setEnabled(serviceID: number, enabled: boolean): Promise<void>;
|
|
18
|
+
isEnabled(serviceID: number): Promise<boolean>;
|
|
19
|
+
getSingleService(serviceId: number): Promise<TService>;
|
|
20
|
+
getServices(): Promise<TService[]>;
|
|
21
|
+
updateSingleService(serviceId: number, serviceJson: TService): Promise<void>;
|
|
22
|
+
updateServices(servicesJson: TServiceList): Promise<void>;
|
|
23
|
+
updateCGText(serviceID: number, fields: TField[]): Promise<void>;
|
|
24
|
+
updateCGImagePos(serviceID: number, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
25
|
+
updateCGImage(serviceID: number, path: string, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
26
|
+
updateCGImageFromData(serviceID: number, imageType: ImageType, imageData: Buffer, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
27
|
+
private promiseCGUpdate;
|
|
28
|
+
private get;
|
|
29
|
+
private post;
|
|
30
|
+
private parseBlobResponse;
|
|
31
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as EventEmitter from 'events';
|
|
4
|
+
import { WsOptions } from './internal/common';
|
|
5
|
+
export type CamOverlayDrawingOptions = WsOptions & {
|
|
6
|
+
camera?: number | number[];
|
|
7
|
+
zIndex?: number;
|
|
8
|
+
};
|
|
9
|
+
export type TCairoResponse = {
|
|
10
|
+
message: string;
|
|
11
|
+
call_id: number;
|
|
12
|
+
};
|
|
13
|
+
export type TCairoCreateResponse = {
|
|
14
|
+
var: string;
|
|
15
|
+
call_id: number;
|
|
16
|
+
};
|
|
17
|
+
export type TUploadImageResponse = {
|
|
18
|
+
var: string;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
call_id: number;
|
|
22
|
+
};
|
|
23
|
+
export type TErrorResponse = {
|
|
24
|
+
error: string;
|
|
25
|
+
call_id?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TService = {
|
|
28
|
+
id: number;
|
|
29
|
+
enabled: number;
|
|
30
|
+
schedule: string;
|
|
31
|
+
name: string;
|
|
32
|
+
identifier: string;
|
|
33
|
+
cameraList: number[];
|
|
34
|
+
};
|
|
35
|
+
export type TServiceList = {
|
|
36
|
+
services: TService[];
|
|
37
|
+
};
|
|
38
|
+
export type TAlign = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
39
|
+
export type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
40
|
+
export type TWriteTextParams = [string, string, number, number, number, number, TAlign, TextFit?];
|
|
41
|
+
export interface CamOverlayDrawingAPI {
|
|
42
|
+
on(event: 'open', listener: () => void): this;
|
|
43
|
+
on(event: 'close', listener: () => void): this;
|
|
44
|
+
on(event: 'error', listener: (err: Error) => void): this;
|
|
45
|
+
on(event: 'message', listener: (msg: string) => void): this;
|
|
46
|
+
emit(event: 'open'): boolean;
|
|
47
|
+
emit(event: 'close'): boolean;
|
|
48
|
+
emit(event: 'error', err: Error): boolean;
|
|
49
|
+
emit(event: 'message', msg: string): boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare class CamOverlayDrawingAPI extends EventEmitter {
|
|
52
|
+
private tls;
|
|
53
|
+
private tlsInsecure;
|
|
54
|
+
private ip;
|
|
55
|
+
private port;
|
|
56
|
+
private user;
|
|
57
|
+
private pass;
|
|
58
|
+
private cameraList;
|
|
59
|
+
private zIndex;
|
|
60
|
+
private callId;
|
|
61
|
+
private sendMessages;
|
|
62
|
+
private timeoutCheckTimer;
|
|
63
|
+
private wsConnected;
|
|
64
|
+
private ws;
|
|
65
|
+
constructor(options?: CamOverlayDrawingOptions);
|
|
66
|
+
connect(): void;
|
|
67
|
+
disconnect(): void;
|
|
68
|
+
isConnected(): boolean;
|
|
69
|
+
cairo(command: string, ...params: unknown[]): Promise<TCairoResponse | TCairoCreateResponse>;
|
|
70
|
+
writeText(...params: TWriteTextParams): Promise<TCairoResponse>;
|
|
71
|
+
uploadImageData(imgBuffer: Buffer): Promise<TUploadImageResponse>;
|
|
72
|
+
uploadFontData(fontBuffer: Buffer): Promise<TCairoCreateResponse>;
|
|
73
|
+
showCairoImage(cairoImage: string, posX: number, posY: number): Promise<TCairoResponse>;
|
|
74
|
+
showCairoImageAbsolute(cairoImage: string, posX: number, posY: number, width: number, height: number): Promise<TCairoResponse>;
|
|
75
|
+
removeImage(): Promise<TCairoResponse>;
|
|
76
|
+
private createWsClient;
|
|
77
|
+
private incomingWsMessageHandler;
|
|
78
|
+
private sendMessage;
|
|
79
|
+
private sendBinaryMessage;
|
|
80
|
+
private startMsgsTimeoutCheck;
|
|
81
|
+
private stopMsgsTimeoutCheck;
|
|
82
|
+
private reconnectWithError;
|
|
83
|
+
private reportMessage;
|
|
84
|
+
private reportError;
|
|
85
|
+
private reportClose;
|
|
86
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { CamOverlayDrawingAPI, TAlign, TCairoCreateResponse, TUploadImageResponse } from '../CamOverlayDrawingAPI';
|
|
4
|
+
import ResourceManager from './ResourceManager';
|
|
5
|
+
export type TRgb = [number, number, number];
|
|
6
|
+
export type TRgba = [number, number, number, number];
|
|
7
|
+
export type TTmf = 'TFM_OVERFLOW' | 'TFM_SCALE' | 'TFM_TRUNCATE';
|
|
8
|
+
export type TObjectFitType = 'fill' | 'fit' | 'none';
|
|
9
|
+
export type TFrameOptions = {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
text?: string;
|
|
16
|
+
fontColor?: TRgb;
|
|
17
|
+
font?: string;
|
|
18
|
+
bgColor?: TRgba;
|
|
19
|
+
bgImage?: string;
|
|
20
|
+
bgType?: TObjectFitType;
|
|
21
|
+
borderRadius?: number;
|
|
22
|
+
borderWidth?: number;
|
|
23
|
+
borderColor?: TRgba;
|
|
24
|
+
customDraw?: TDrawingCallback;
|
|
25
|
+
layer?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TFrameInfo = {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
export type TDrawingCallback = (cod: CamOverlayDrawingAPI, cairo: string, info: TFrameInfo) => Promise<void>;
|
|
32
|
+
export interface Frame {
|
|
33
|
+
on(event: 'open', listener: () => void): this;
|
|
34
|
+
on(event: 'close', listener: () => void): this;
|
|
35
|
+
on(event: 'layoutChanged', listener: () => void): this;
|
|
36
|
+
emit(event: 'open'): boolean;
|
|
37
|
+
emit(event: 'close'): boolean;
|
|
38
|
+
emit(event: 'layoutChanged'): boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare class Frame extends EventEmitter {
|
|
41
|
+
protected enabled: boolean;
|
|
42
|
+
protected posX: number;
|
|
43
|
+
protected posY: number;
|
|
44
|
+
protected width: number;
|
|
45
|
+
protected height: number;
|
|
46
|
+
private text;
|
|
47
|
+
private fontColor;
|
|
48
|
+
private fontName?;
|
|
49
|
+
private font?;
|
|
50
|
+
private align;
|
|
51
|
+
private textType;
|
|
52
|
+
private bgColor?;
|
|
53
|
+
private bgImageName?;
|
|
54
|
+
private bgImage?;
|
|
55
|
+
private bgType?;
|
|
56
|
+
private borderRadius;
|
|
57
|
+
private borderWidth;
|
|
58
|
+
private borderColor;
|
|
59
|
+
private customDraw?;
|
|
60
|
+
private layer;
|
|
61
|
+
protected children: Frame[];
|
|
62
|
+
constructor(opt: TFrameOptions);
|
|
63
|
+
enable(): void;
|
|
64
|
+
disable(): void;
|
|
65
|
+
setFramePosition(x: number, y: number): void;
|
|
66
|
+
setFrameSize(width: number, height: number): void;
|
|
67
|
+
setText(text: string, align: TAlign, textType?: TTmf, fontColor?: TRgb): void;
|
|
68
|
+
setFontColor(fontColor: TRgb): void;
|
|
69
|
+
setFont(fontName: string): void;
|
|
70
|
+
setFontData(fontData: TCairoCreateResponse): void;
|
|
71
|
+
setBgColor(color: TRgba): void;
|
|
72
|
+
setBgImage(imageName: string, type?: TObjectFitType): void;
|
|
73
|
+
setBgImageData(imageData: TUploadImageResponse, type?: TObjectFitType): void;
|
|
74
|
+
setBgType(type: TObjectFitType): void;
|
|
75
|
+
setBorderRadius(radius: number): void;
|
|
76
|
+
setBorderWidth(width: number): void;
|
|
77
|
+
setBorderColor(color: TRgba): void;
|
|
78
|
+
setCustomDraw(customDraw: TDrawingCallback): void;
|
|
79
|
+
resetFont(): void;
|
|
80
|
+
resetBgColor(): void;
|
|
81
|
+
resetBgImage(): void;
|
|
82
|
+
resetCustomDraw(): void;
|
|
83
|
+
clear(): void;
|
|
84
|
+
insert(...frames: Frame[]): void;
|
|
85
|
+
getLayers(): Set<number>;
|
|
86
|
+
protected layoutChanged(): void;
|
|
87
|
+
displayImage(cod: CamOverlayDrawingAPI, resourceManager: ResourceManager, cairo: string, ppX: number, ppY: number, scale: number, layer: number): Promise<void>;
|
|
88
|
+
private prepareResources;
|
|
89
|
+
protected displayOwnImage(cod: CamOverlayDrawingAPI, cairo: string, ppX: number, ppY: number, scale: number): Promise<void>;
|
|
90
|
+
private clipDrawing;
|
|
91
|
+
private drawFrame;
|
|
92
|
+
private drawImage;
|
|
93
|
+
private drawText;
|
|
94
|
+
private drawBorder;
|
|
95
|
+
private drawRectPath;
|
|
96
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CamOverlayDrawingAPI, CamOverlayDrawingOptions } from '../CamOverlayDrawingAPI';
|
|
2
|
+
import ResourceManager from './ResourceManager';
|
|
3
|
+
import { Frame, TFrameOptions } from './Frame';
|
|
4
|
+
export declare const COORD: Record<string, [number, number]>;
|
|
5
|
+
export type TPainterOptions = TFrameOptions & {
|
|
6
|
+
screenWidth: number;
|
|
7
|
+
screenHeight: number;
|
|
8
|
+
coAlignment: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class Painter extends Frame {
|
|
11
|
+
private screenWidth;
|
|
12
|
+
private screenHeight;
|
|
13
|
+
private coAlignment;
|
|
14
|
+
private cod;
|
|
15
|
+
private rm;
|
|
16
|
+
private refreshLayers;
|
|
17
|
+
private layers;
|
|
18
|
+
constructor(opt: TPainterOptions, coopt: CamOverlayDrawingOptions);
|
|
19
|
+
get camOverlayDrawingAPI(): CamOverlayDrawingAPI;
|
|
20
|
+
get resourceManager(): ResourceManager;
|
|
21
|
+
connect(): void;
|
|
22
|
+
disconnect(): void;
|
|
23
|
+
isConnected(): boolean;
|
|
24
|
+
registerImage(moniker: string, fileName: string): void;
|
|
25
|
+
registerFont(moniker: string, fileName: string): void;
|
|
26
|
+
setScreenSize(sw: number, sh: number): void;
|
|
27
|
+
setCoAlignment(coAlignment: string): void;
|
|
28
|
+
protected layoutChanged(): void;
|
|
29
|
+
display(scale?: number): Promise<void>;
|
|
30
|
+
hide(): Promise<void>;
|
|
31
|
+
invalidateLayer(layer: number): Promise<void>;
|
|
32
|
+
private prepareLayers;
|
|
33
|
+
private prepareSurface;
|
|
34
|
+
private cleanupSurface;
|
|
35
|
+
private positionConvertor;
|
|
36
|
+
}
|
|
37
|
+
export { Frame, TFrameOptions as FrameOptions, ResourceManager, CamOverlayDrawingOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CamOverlayDrawingAPI, TUploadImageResponse, TCairoCreateResponse } from '../CamOverlayDrawingAPI';
|
|
2
|
+
export default class ResourceManager {
|
|
3
|
+
private co;
|
|
4
|
+
private imgFileNames;
|
|
5
|
+
private fontFileNames;
|
|
6
|
+
private images;
|
|
7
|
+
private fonts;
|
|
8
|
+
constructor(co: CamOverlayDrawingAPI);
|
|
9
|
+
registerImage(moniker: string, fileName: string): void;
|
|
10
|
+
registerFont(moniker: string, fileName: string): void;
|
|
11
|
+
image(moniker: string): Promise<TUploadImageResponse>;
|
|
12
|
+
font(moniker: string): Promise<TCairoCreateResponse>;
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IClient } from './internal/common';
|
|
2
|
+
import { CamScripterOptions, TNodeState, TPackageInfoList, TStorage, TStorageType } from './types/CamScripterAPI';
|
|
3
|
+
import { TNetworkCamera } from './types/common';
|
|
4
|
+
export declare class CamOverlayAPI {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(options?: CamScripterOptions | IClient);
|
|
7
|
+
checkCameraTime(): Promise<boolean>;
|
|
8
|
+
getStorageInfo(): Promise<TStorage>;
|
|
9
|
+
getNetworkCameraList(): Promise<TNetworkCamera[]>;
|
|
10
|
+
getPackageList(): Promise<TPackageInfoList>;
|
|
11
|
+
installPackages(formData: FormData, storage: TStorageType): Promise<void>;
|
|
12
|
+
uninstallPackage(packageId: string): Promise<void>;
|
|
13
|
+
importSettings(packageId: string, formData: FormData): Promise<void>;
|
|
14
|
+
exportSettings(packageId: string, formData: FormData): Promise<void>;
|
|
15
|
+
getNodejsStatus(): Promise<TNodeState>;
|
|
16
|
+
installNodejs(storage: TStorageType): Promise<void>;
|
|
17
|
+
private get;
|
|
18
|
+
private post;
|
|
19
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as EventEmitter from 'events';
|
|
3
|
+
import { WsOptions } from './internal/common';
|
|
4
|
+
export type CamScripterOptions = WsOptions;
|
|
5
|
+
export type TDeclaration = {
|
|
6
|
+
type?: '' | 'SOURCE' | 'DATA';
|
|
7
|
+
namespace: string;
|
|
8
|
+
key: string;
|
|
9
|
+
value: string | boolean | number;
|
|
10
|
+
value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
|
|
11
|
+
key_nice_name?: string;
|
|
12
|
+
value_nice_name?: string;
|
|
13
|
+
};
|
|
14
|
+
export type TEventDeclaration = {
|
|
15
|
+
declaration_id: string;
|
|
16
|
+
stateless: boolean;
|
|
17
|
+
declaration: TDeclaration[];
|
|
18
|
+
};
|
|
19
|
+
export type TEventUndeclaration = {
|
|
20
|
+
declaration_id: string;
|
|
21
|
+
};
|
|
22
|
+
export type TEventData = {
|
|
23
|
+
namespace: string;
|
|
24
|
+
key: string;
|
|
25
|
+
value: string | boolean | number;
|
|
26
|
+
value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
|
|
27
|
+
};
|
|
28
|
+
export type TEvent = {
|
|
29
|
+
declaration_id: string;
|
|
30
|
+
event_data: TEventData[];
|
|
31
|
+
};
|
|
32
|
+
export type TResponse = {
|
|
33
|
+
call_id: number;
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
export type TErrorResponse = {
|
|
37
|
+
error: string;
|
|
38
|
+
call_id?: number;
|
|
39
|
+
};
|
|
40
|
+
export interface CamScripterAPICameraEventsGenerator {
|
|
41
|
+
on(event: 'open', listener: () => void): this;
|
|
42
|
+
on(event: 'close', listener: () => void): this;
|
|
43
|
+
on(event: 'error', listener: (err: Error) => void): this;
|
|
44
|
+
emit(event: 'open'): boolean;
|
|
45
|
+
emit(event: 'close'): boolean;
|
|
46
|
+
emit(event: 'error', err: Error): boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
|
|
49
|
+
private tls;
|
|
50
|
+
private tlsInsecure;
|
|
51
|
+
private ip;
|
|
52
|
+
private port;
|
|
53
|
+
private user;
|
|
54
|
+
private pass;
|
|
55
|
+
private callId;
|
|
56
|
+
private sendMessages;
|
|
57
|
+
private timeoutCheckTimer;
|
|
58
|
+
private wsConnected;
|
|
59
|
+
private ws;
|
|
60
|
+
constructor(options?: CamScripterOptions);
|
|
61
|
+
connect(): void;
|
|
62
|
+
disconnect(): void;
|
|
63
|
+
declareEvent(eventDeclaration: TEventDeclaration): Promise<TResponse>;
|
|
64
|
+
undeclareEvent(eventUndeclaration: TEventUndeclaration): Promise<TResponse>;
|
|
65
|
+
sendEvent(event: TEvent): Promise<TResponse>;
|
|
66
|
+
private createWsClient;
|
|
67
|
+
private incomingWsMessageHandler;
|
|
68
|
+
private sendMessage;
|
|
69
|
+
private startMsgsTimeoutCheck;
|
|
70
|
+
private stopMsgsTimeoutCheck;
|
|
71
|
+
private reconnectWithError;
|
|
72
|
+
private reportErr;
|
|
73
|
+
private reportClose;
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IClient } from './internal/common';
|
|
2
|
+
import { CamStreamerAPIOptions, TStreamAttributes, TStreamList } from './types/CamStreamerAPI';
|
|
3
|
+
export declare class CamStreamerAPI {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(options?: CamStreamerAPIOptions | IClient);
|
|
6
|
+
getStreamList(): Promise<TStreamList>;
|
|
7
|
+
getStream(streamID: string): Promise<TStreamAttributes>;
|
|
8
|
+
getStreamParameter(streamID: string, paramName: string): Promise<string>;
|
|
9
|
+
setStream(streamID: string, params: Partial<TStreamAttributes>): Promise<void>;
|
|
10
|
+
setStreamParameter(streamID: string, paramName: string, value: string): Promise<void>;
|
|
11
|
+
isStreaming(streamID: string): Promise<boolean>;
|
|
12
|
+
deleteStream(streamID: string): Promise<void>;
|
|
13
|
+
wsAutoratization(): Promise<string>;
|
|
14
|
+
getUtcTime(): Promise<number>;
|
|
15
|
+
private get;
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IClient } from './internal/common';
|
|
2
|
+
import { TAudioPushInfo, TOutputInfo, TStorageInfo, TStreamSaveList, TClipList, TStreamSaveLoadList, TClipSaveLoadList, TPlaylistSaveLoadList, TTrackerSaveList, TrackerSaveLoadList, TClipSaveList, TPlaylistSaveList, TCameraOptions, TGlobalAudioSettings, TSecondaryAudioSettings } from './types/CamSwitcherAPI';
|
|
3
|
+
import { TAudioChannel, TNetworkCamera, TStorageType } from './types/common';
|
|
4
|
+
export declare class CamSwitcherAPI<Client extends IClient = IClient> {
|
|
5
|
+
client: Client;
|
|
6
|
+
private vapixAgent;
|
|
7
|
+
constructor(client: Client);
|
|
8
|
+
static getProxyUrlPath: () => string;
|
|
9
|
+
static getWsEventsUrlPath: () => string;
|
|
10
|
+
static getClipPreviewUrlPath: (id: string, storage: TStorageType) => string;
|
|
11
|
+
generateSilence(sampleRate: number, channels: TAudioChannel): Promise<void>;
|
|
12
|
+
checkCameraTime(): Promise<boolean>;
|
|
13
|
+
getIpListFromNetworkCheck(): Promise<TNetworkCamera[]>;
|
|
14
|
+
getMaxFps(source: number): Promise<number>;
|
|
15
|
+
getStorageInfo(): Promise<TStorageInfo[]>;
|
|
16
|
+
wsAuthorization(): Promise<string>;
|
|
17
|
+
getOutputInfo(): Promise<TOutputInfo>;
|
|
18
|
+
getAudioPushInfo(): Promise<TAudioPushInfo>;
|
|
19
|
+
getStreamSaveList(): Promise<TStreamSaveLoadList>;
|
|
20
|
+
getClipSaveList(): Promise<TClipSaveLoadList>;
|
|
21
|
+
getPlaylistSaveList(): Promise<TPlaylistSaveLoadList>;
|
|
22
|
+
getTrackerSaveList(): Promise<TrackerSaveLoadList>;
|
|
23
|
+
setStreamSaveList(data: TStreamSaveList): Promise<boolean>;
|
|
24
|
+
setClipSaveList(data: TClipSaveList): Promise<boolean>;
|
|
25
|
+
setPlaylistSaveList(data: TPlaylistSaveList): Promise<boolean>;
|
|
26
|
+
setTrackerSaveList(data: TTrackerSaveList): Promise<boolean>;
|
|
27
|
+
playlistSwitch(playlistName: string): Promise<void>;
|
|
28
|
+
playlistQueuePush(playlistName: string): Promise<void>;
|
|
29
|
+
playlistQueueClear(): Promise<void>;
|
|
30
|
+
playlistQueueList(): Promise<string[]>;
|
|
31
|
+
playlistQueuePlayNext(): Promise<void>;
|
|
32
|
+
addNewClip(file: any, clipType: 'video' | 'audio', storage: TStorageType, id: string, fileName?: string): Promise<void>;
|
|
33
|
+
removeClip(id: string, storage: TStorageType): Promise<any>;
|
|
34
|
+
getClipList(): Promise<TClipList>;
|
|
35
|
+
setCamSwitchOptions(data: TCameraOptions, cameraFWVersion: string): Promise<boolean>;
|
|
36
|
+
setGlobalAudioSettings(settings: TGlobalAudioSettings): Promise<boolean>;
|
|
37
|
+
setSecondaryAudioSettings(settings: TSecondaryAudioSettings): Promise<boolean>;
|
|
38
|
+
setDefaultPlaylist(id: string): Promise<boolean>;
|
|
39
|
+
setPermanentRtspUrlToken(token: string): Promise<boolean>;
|
|
40
|
+
getCamSwitchOptions(): Promise<Partial<TCameraOptions>>;
|
|
41
|
+
getGlobalAudioSettings(): Promise<TGlobalAudioSettings>;
|
|
42
|
+
getSecondaryAudioSettings(): Promise<TSecondaryAudioSettings>;
|
|
43
|
+
getPermanentRtspUrlToken(): Promise<string>;
|
|
44
|
+
private get;
|
|
45
|
+
private set;
|
|
46
|
+
private setParamFromCameraJSON;
|
|
47
|
+
private getParamFromCameraAndJSONParse;
|
|
48
|
+
}
|