camstreamerlib 4.0.0-beta.7 → 4.0.0-beta.71
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 +143 -38
- package/cjs/CamOverlayAPI.d.ts +863 -27
- package/cjs/CamOverlayAPI.js +135 -92
- package/cjs/CamScripterAPI.d.ts +44 -17
- package/cjs/CamScripterAPI.js +52 -42
- package/cjs/CamStreamerAPI.d.ts +62 -14
- package/cjs/CamStreamerAPI.js +82 -39
- package/cjs/CamSwitcherAPI.d.ts +158 -43
- package/cjs/CamSwitcherAPI.js +138 -122
- package/cjs/PlaneTrackerAPI.d.ts +233 -0
- package/cjs/PlaneTrackerAPI.js +247 -0
- package/cjs/VapixAPI.d.ts +94 -42
- package/cjs/VapixAPI.js +323 -233
- package/cjs/{CreatePackage.js → bin/CreatePackage.js} +44 -18
- package/cjs/errors/errors.d.ts +61 -4
- package/cjs/errors/errors.js +134 -7
- package/cjs/index.d.ts +20 -4
- package/cjs/index.js +28 -5
- package/cjs/internal/ProxyClient.d.ts +8 -9
- package/cjs/internal/ProxyClient.js +28 -32
- package/cjs/internal/WsEvents.d.ts +37 -0
- package/cjs/{CamSwitcherEvents.js → internal/WsEvents.js} +28 -22
- package/cjs/internal/types.d.ts +47 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.d.ts +3 -1
- package/cjs/internal/utils.js +15 -3
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +28 -20
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.d.ts +8 -37
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.d.ts +5 -21
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
- package/cjs/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
- package/cjs/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +13 -13
- package/cjs/node/DefaultClient.d.ts +6 -5
- package/cjs/node/DefaultClient.js +10 -12
- package/cjs/{internal → node}/Digest.js +24 -1
- package/cjs/node/Digest.test.js +13 -0
- package/cjs/node/HttpRequestSender.d.ts +1 -0
- package/cjs/node/HttpRequestSender.js +14 -4
- package/cjs/node/HttpServer.d.ts +1 -1
- package/cjs/node/HttpServer.js +29 -6
- package/cjs/node/TimeZoneDaemon.d.ts +6 -0
- package/cjs/node/TimeZoneDaemon.js +29 -0
- package/cjs/node/VapixEvents.d.ts +16 -0
- package/cjs/{VapixEvents.js → node/VapixEvents.js} +10 -10
- package/cjs/node/WsClient.d.ts +9 -18
- package/cjs/node/WsClient.js +27 -20
- package/cjs/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/cjs/node/events/AxisCameraStationEvents.js +53 -0
- package/cjs/node/events/GenetecAgent.d.ts +16 -0
- package/cjs/node/events/GenetecAgent.js +124 -0
- package/cjs/node/index.d.ts +18 -2
- package/cjs/node/index.js +39 -5
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +4330 -0
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
- package/cjs/types/CamOverlayAPI/index.d.ts +11 -0
- package/cjs/types/CamOverlayAPI/index.js +27 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +96 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
- package/cjs/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.d.ts +76 -0
- package/cjs/types/CamOverlayPainter.js +14 -0
- package/cjs/types/CamScripterAPI.d.ts +86 -23
- package/cjs/types/CamScripterAPI.js +24 -8
- package/cjs/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
- package/cjs/types/CamStreamerAPI.d.ts +180 -47
- package/cjs/types/CamStreamerAPI.js +34 -3
- package/cjs/types/CamSwitcherAPI.d.ts +145 -66
- package/cjs/types/CamSwitcherAPI.js +38 -1
- package/cjs/{events → types}/GenetecAgent.d.ts +47 -47
- package/cjs/types/GenetecAgent.js +31 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +952 -0
- package/cjs/types/PlaneTrackerAPI.js +320 -0
- package/cjs/types/VapixAPI.d.ts +254 -164
- package/cjs/types/VapixAPI.js +66 -11
- package/cjs/types/VapixEvents.d.ts +15 -0
- package/cjs/types/VapixEvents.js +2 -0
- package/cjs/types/common.d.ts +17 -5
- package/cjs/types/common.js +4 -2
- package/cjs/types/ws/CamOverlayEvents.d.ts +88 -0
- package/cjs/types/ws/CamOverlayEvents.js +19 -0
- package/cjs/types/ws/CamStreamerEvents.d.ts +249 -0
- package/cjs/types/ws/CamStreamerEvents.js +32 -0
- package/cjs/types/ws/PlaneTrackerEvents.d.ts +1637 -0
- package/cjs/types/ws/PlaneTrackerEvents.js +196 -0
- package/cjs/web/DefaultClient.d.ts +7 -5
- package/cjs/web/DefaultClient.js +26 -10
- package/cjs/web/WsClient.d.ts +9 -5
- package/cjs/web/WsClient.js +16 -18
- package/cjs/ws/CamOverlayEvents.d.ts +8 -0
- package/cjs/ws/CamOverlayEvents.js +24 -0
- package/cjs/ws/CamStreamerEvents.d.ts +8 -0
- package/cjs/ws/CamStreamerEvents.js +24 -0
- package/cjs/ws/CamSwitcherEvents.d.ts +8 -0
- package/cjs/ws/CamSwitcherEvents.js +24 -0
- package/cjs/ws/PlaneTrackerEvents.d.ts +9 -0
- package/cjs/ws/PlaneTrackerEvents.js +30 -0
- package/esm/CamOverlayAPI.js +135 -92
- package/esm/CamScripterAPI.js +50 -40
- package/esm/CamStreamerAPI.js +81 -39
- package/esm/CamSwitcherAPI.js +136 -120
- package/esm/PlaneTrackerAPI.js +243 -0
- package/esm/VapixAPI.js +323 -233
- package/esm/{CreatePackage.js → bin/CreatePackage.js} +16 -16
- package/esm/errors/errors.js +116 -6
- package/esm/index.js +20 -4
- package/esm/internal/ProxyClient.js +28 -32
- package/esm/{CamSwitcherEvents.js → internal/WsEvents.js} +26 -20
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.js +11 -1
- package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +26 -18
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
- package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +11 -11
- package/esm/node/DefaultClient.js +10 -12
- package/esm/node/Digest.test.js +11 -0
- package/esm/node/HttpRequestSender.js +14 -4
- package/esm/node/HttpServer.js +1 -1
- package/esm/node/TimeZoneDaemon.js +25 -0
- package/esm/{VapixEvents.js → node/VapixEvents.js} +10 -10
- package/esm/node/WsClient.js +22 -15
- package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
- package/esm/node/events/GenetecAgent.js +120 -0
- package/esm/node/index.js +18 -2
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
- package/esm/types/CamOverlayAPI/index.js +11 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +23 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
- package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
- package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
- package/esm/types/CamOverlayDrawingAPI.js +1 -0
- package/esm/types/CamOverlayPainter.js +11 -0
- package/esm/types/CamScripterAPI.js +23 -7
- package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
- package/esm/types/CamStreamerAPI.js +33 -2
- package/esm/types/CamSwitcherAPI.js +38 -1
- package/esm/types/GenetecAgent.js +28 -0
- package/esm/types/PlaneTrackerAPI.js +317 -0
- package/esm/types/VapixAPI.js +65 -10
- package/esm/types/VapixEvents.js +1 -0
- package/esm/types/common.js +3 -1
- package/esm/types/ws/CamOverlayEvents.js +16 -0
- package/esm/types/ws/CamStreamerEvents.js +29 -0
- package/esm/types/ws/PlaneTrackerEvents.js +193 -0
- package/esm/web/DefaultClient.js +26 -10
- package/esm/web/WsClient.js +16 -18
- package/esm/ws/CamOverlayEvents.js +20 -0
- package/esm/ws/CamStreamerEvents.js +20 -0
- package/esm/ws/CamSwitcherEvents.js +20 -0
- package/esm/ws/PlaneTrackerEvents.js +26 -0
- package/package.json +44 -11
- package/types/CamOverlayAPI.d.ts +867 -0
- package/types/CamScripterAPI.d.ts +46 -0
- package/types/CamStreamerAPI.d.ts +64 -0
- package/types/CamSwitcherAPI.d.ts +167 -0
- package/types/PlaneTrackerAPI.d.ts +233 -0
- package/types/VapixAPI.d.ts +118 -0
- package/types/bin/CreatePackage.d.ts +1 -0
- package/types/errors/errors.d.ts +91 -0
- package/types/index.d.ts +27 -0
- package/types/internal/ProxyClient.d.ts +10 -0
- package/types/internal/WsEvents.d.ts +37 -0
- package/types/internal/types.d.ts +47 -0
- package/{esm → types}/internal/utils.d.ts +3 -1
- package/{esm → types}/internal/versionCompare.d.ts +2 -2
- package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
- package/{esm → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
- package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/types/node/DefaultClient.d.ts +16 -0
- package/types/node/Digest.test.d.ts +1 -0
- package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
- package/{esm → types}/node/HttpServer.d.ts +1 -1
- package/types/node/TimeZoneDaemon.d.ts +6 -0
- package/types/node/VapixEvents.d.ts +16 -0
- package/types/node/WsClient.d.ts +30 -0
- package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/types/node/events/GenetecAgent.d.ts +16 -0
- package/types/node/index.d.ts +18 -0
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4330 -0
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/types/types/CamOverlayAPI/index.d.ts +11 -0
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/types/types/CamOverlayPainter.d.ts +76 -0
- package/types/types/CamScripterAPI.d.ts +130 -0
- package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/types/types/CamStreamerAPI.d.ts +272 -0
- package/{esm → types}/types/CamSwitcherAPI.d.ts +145 -66
- package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
- package/types/types/PlaneTrackerAPI.d.ts +952 -0
- package/{esm → types}/types/VapixAPI.d.ts +254 -164
- package/types/types/VapixEvents.d.ts +15 -0
- package/{esm → types}/types/common.d.ts +17 -5
- package/types/types/ws/CamOverlayEvents.d.ts +88 -0
- package/types/types/ws/CamStreamerEvents.d.ts +249 -0
- package/types/types/ws/PlaneTrackerEvents.d.ts +1637 -0
- package/types/web/DefaultClient.d.ts +8 -0
- package/types/web/WsClient.d.ts +17 -0
- package/types/ws/CamOverlayEvents.d.ts +8 -0
- package/types/ws/CamStreamerEvents.d.ts +8 -0
- package/types/ws/CamSwitcherEvents.d.ts +8 -0
- package/types/ws/PlaneTrackerEvents.d.ts +9 -0
- package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/cjs/CamSwitcherEvents.d.ts +0 -18
- package/cjs/VapixEvents.d.ts +0 -43
- package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
- package/cjs/events/AxisCameraStationEvents.js +0 -48
- package/cjs/events/GenetecAgent.js +0 -123
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- package/cjs/node/WsEventClient.d.ts +0 -13
- package/cjs/node/WsEventClient.js +0 -22
- package/cjs/types/CamOverlayAPI.d.ts +0 -188
- package/cjs/types/CamOverlayAPI.js +0 -47
- package/esm/CamOverlayAPI.d.ts +0 -31
- package/esm/CamOverlayDrawingAPI.d.ts +0 -86
- package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/esm/CamScripterAPI.d.ts +0 -19
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/esm/CamStreamerAPI.d.ts +0 -16
- package/esm/CamSwitcherAPI.d.ts +0 -52
- package/esm/CamSwitcherEvents.d.ts +0 -18
- package/esm/VapixAPI.d.ts +0 -66
- package/esm/VapixEvents.d.ts +0 -43
- package/esm/errors/errors.d.ts +0 -34
- package/esm/events/AxisCameraStationEvents.d.ts +0 -9
- package/esm/events/GenetecAgent.js +0 -119
- package/esm/index.d.ts +0 -11
- package/esm/internal/ProxyClient.d.ts +0 -11
- package/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/node/DefaultClient.d.ts +0 -15
- package/esm/node/WsClient.d.ts +0 -39
- package/esm/node/WsEventClient.d.ts +0 -13
- package/esm/node/WsEventClient.js +0 -18
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
- package/esm/types/CamScripterAPI.d.ts +0 -67
- package/esm/types/CamStreamerAPI.d.ts +0 -139
- package/esm/web/DefaultClient.d.ts +0 -6
- package/esm/web/WsClient.d.ts +0 -13
- package/esm/web/index.d.ts +0 -2
- /package/cjs/{CreatePackage.d.ts → bin/CreatePackage.d.ts} +0 -0
- /package/cjs/{internal → node}/Digest.d.ts +0 -0
- /package/{esm/CreatePackage.d.ts → cjs/node/Digest.test.d.ts} +0 -0
- /package/cjs/types/{CamSwitcherEvents.d.ts → ws/CamSwitcherEvents.d.ts} +0 -0
- /package/cjs/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
- /package/esm/{internal → node}/Digest.js +0 -0
- /package/esm/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
- /package/{esm → types}/internal/constants.d.ts +0 -0
- /package/{esm → types}/internal/transformers.d.ts +0 -0
- /package/{esm/internal → types/node}/Digest.d.ts +0 -0
- /package/{esm/types → types/types/ws}/CamSwitcherEvents.d.ts +0 -0
- /package/{esm/node → types/web}/index.d.ts +0 -0
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const fs = require("fs");
|
|
29
|
+
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
30
|
+
const path = __importStar(require("path"));
|
|
31
|
+
const fs = __importStar(require("fs"));
|
|
6
32
|
const child_process_1 = require("child_process");
|
|
7
33
|
const productionModulesFolder = 'production_modules';
|
|
8
|
-
function isDirectory(
|
|
9
|
-
const stat = fs.statSync(
|
|
34
|
+
function isDirectory(filePath) {
|
|
35
|
+
const stat = fs.statSync(filePath);
|
|
10
36
|
return stat.isDirectory();
|
|
11
37
|
}
|
|
12
38
|
function getPackageInfo(folder) {
|
|
13
39
|
try {
|
|
14
|
-
const manifest = fs.readFileSync(
|
|
40
|
+
const manifest = fs.readFileSync(path.join(folder, 'manifest.json'));
|
|
15
41
|
const manifestParsed = JSON.parse(manifest.toString());
|
|
16
42
|
return {
|
|
17
43
|
packageName: manifestParsed.package_name,
|
|
@@ -23,11 +49,11 @@ function getPackageInfo(folder) {
|
|
|
23
49
|
}
|
|
24
50
|
}
|
|
25
51
|
function createZipArchive(zip, folder, options) {
|
|
26
|
-
const zipFileRegex = new RegExp(`${
|
|
52
|
+
const zipFileRegex = new RegExp(`${path.basename(folder)}(_[0-9]){3}\\.zip`);
|
|
27
53
|
const files = fs.readdirSync(folder);
|
|
28
54
|
for (const file of files) {
|
|
29
|
-
const
|
|
30
|
-
const isDir = isDirectory(
|
|
55
|
+
const filePath = path.join(folder, file);
|
|
56
|
+
const isDir = isDirectory(filePath);
|
|
31
57
|
if (file[0] === '.' ||
|
|
32
58
|
zipFileRegex.test(file) ||
|
|
33
59
|
file === 'node_modules' ||
|
|
@@ -36,16 +62,16 @@ function createZipArchive(zip, folder, options) {
|
|
|
36
62
|
continue;
|
|
37
63
|
}
|
|
38
64
|
else if (file === 'dist' && options.typeScriptPackage) {
|
|
39
|
-
zip.addLocalFolder(
|
|
65
|
+
zip.addLocalFolder(filePath);
|
|
40
66
|
}
|
|
41
67
|
else if (file === productionModulesFolder && options.includeNodeModules) {
|
|
42
|
-
zip.addLocalFolder(
|
|
68
|
+
zip.addLocalFolder(path.join(productionModulesFolder, 'node_modules'), 'node_modules');
|
|
43
69
|
}
|
|
44
70
|
else if (isDir) {
|
|
45
|
-
zip.addLocalFolder(
|
|
71
|
+
zip.addLocalFolder(filePath, file);
|
|
46
72
|
}
|
|
47
73
|
else {
|
|
48
|
-
zip.addLocalFile(
|
|
74
|
+
zip.addLocalFile(filePath);
|
|
49
75
|
}
|
|
50
76
|
}
|
|
51
77
|
}
|
|
@@ -53,10 +79,10 @@ function installDependencies() {
|
|
|
53
79
|
if (!fs.existsSync(productionModulesFolder)) {
|
|
54
80
|
fs.mkdirSync(productionModulesFolder, {});
|
|
55
81
|
}
|
|
56
|
-
fs.cpSync('package.json',
|
|
57
|
-
fs.cpSync('package-lock.json',
|
|
82
|
+
fs.cpSync('package.json', path.join(productionModulesFolder, 'package.json'));
|
|
83
|
+
fs.cpSync('package-lock.json', path.join(productionModulesFolder, 'package-lock.json'));
|
|
58
84
|
(0, child_process_1.execSync)(`npm ci --omit=dev`, {
|
|
59
|
-
cwd:
|
|
85
|
+
cwd: path.join(process.cwd(), productionModulesFolder),
|
|
60
86
|
});
|
|
61
87
|
}
|
|
62
88
|
function main(args) {
|
|
@@ -83,7 +109,7 @@ function main(args) {
|
|
|
83
109
|
if (fs.existsSync('dist')) {
|
|
84
110
|
options.typeScriptPackage = true;
|
|
85
111
|
}
|
|
86
|
-
const folder =
|
|
112
|
+
const folder = path.resolve('.');
|
|
87
113
|
const packageInfo = getPackageInfo(folder);
|
|
88
114
|
if (packageInfo === undefined) {
|
|
89
115
|
console.error('Package info not found');
|
|
@@ -99,7 +125,7 @@ function main(args) {
|
|
|
99
125
|
process.exit(1);
|
|
100
126
|
}
|
|
101
127
|
}
|
|
102
|
-
const zip = new
|
|
128
|
+
const zip = new adm_zip_1.default();
|
|
103
129
|
createZipArchive(zip, folder, options);
|
|
104
130
|
zip.writeZip(zipFile);
|
|
105
131
|
}
|
package/cjs/errors/errors.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { TResponse } from '../internal/types';
|
|
2
|
+
export declare class ErrorWithResponse<T extends TResponse> extends Error {
|
|
3
|
+
res: T;
|
|
4
|
+
constructor(res: T);
|
|
5
|
+
}
|
|
1
6
|
export declare class ServiceUnavailableError extends Error {
|
|
2
7
|
constructor();
|
|
3
8
|
}
|
|
@@ -7,16 +12,27 @@ export declare class ServiceNotFoundError extends Error {
|
|
|
7
12
|
export declare class ParsingBlobError extends Error {
|
|
8
13
|
constructor(err: unknown);
|
|
9
14
|
}
|
|
10
|
-
|
|
15
|
+
export declare class JsonParseError extends Error {
|
|
16
|
+
constructor(paramName: string, data: unknown);
|
|
17
|
+
}
|
|
18
|
+
export declare class ParameterNotFoundError extends Error {
|
|
19
|
+
constructor(paramName: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class SettingParameterError extends Error {
|
|
22
|
+
constructor(message: string);
|
|
23
|
+
}
|
|
24
|
+
type TApplicationAPIAction = 'START' | 'RESTART' | 'STOP' | 'INSTALL';
|
|
11
25
|
export declare class ApplicationAPIError extends Error {
|
|
12
|
-
|
|
26
|
+
action: TApplicationAPIAction;
|
|
27
|
+
constructor(action: TApplicationAPIAction, reason: string);
|
|
13
28
|
}
|
|
14
29
|
type TSDCardAction = 'MOUNT' | 'UNMOUNT';
|
|
15
30
|
export declare class SDCardActionError extends Error {
|
|
16
|
-
|
|
31
|
+
action: TSDCardAction;
|
|
32
|
+
constructor(action: TSDCardAction, reason: string);
|
|
17
33
|
}
|
|
18
34
|
export declare class SDCardJobError extends Error {
|
|
19
|
-
constructor();
|
|
35
|
+
constructor(reason: string);
|
|
20
36
|
}
|
|
21
37
|
type TMaxFPSErrorType = 'MALFORMED_REPLY' | 'CHANNEL_NOT_FOUND' | 'CAPTURE_MODE_NOT_FOUND' | 'FPS_NOT_SPECIFIED';
|
|
22
38
|
export declare class MaxFPSError extends Error {
|
|
@@ -31,4 +47,45 @@ export declare class FetchDeviceInfoError extends Error {
|
|
|
31
47
|
export declare class AddNewClipError extends Error {
|
|
32
48
|
constructor(message: string);
|
|
33
49
|
}
|
|
50
|
+
export declare class PtzNotSupportedError extends Error {
|
|
51
|
+
constructor();
|
|
52
|
+
}
|
|
53
|
+
export declare class StorageDataFetchError extends Error {
|
|
54
|
+
constructor(err: unknown);
|
|
55
|
+
}
|
|
56
|
+
export declare class WsAuthorizationError extends Error {
|
|
57
|
+
constructor(message: string);
|
|
58
|
+
}
|
|
59
|
+
export declare class UtcTimeFetchError extends Error {
|
|
60
|
+
constructor(message: string);
|
|
61
|
+
}
|
|
62
|
+
export declare class TimezoneNotSetupError extends Error {
|
|
63
|
+
constructor();
|
|
64
|
+
}
|
|
65
|
+
export declare class TimezoneFetchError extends Error {
|
|
66
|
+
constructor(err: unknown);
|
|
67
|
+
}
|
|
68
|
+
type TCalibrationType = 'PTZ' | 'FOCUS';
|
|
69
|
+
export declare class ResetCalibrationError<T extends TResponse> extends ErrorWithResponse<T> {
|
|
70
|
+
type: TCalibrationType;
|
|
71
|
+
constructor(type: TCalibrationType, res: T);
|
|
72
|
+
}
|
|
73
|
+
export declare class ImportSettingsError<T extends TResponse> extends ErrorWithResponse<T> {
|
|
74
|
+
constructor(res: T);
|
|
75
|
+
}
|
|
76
|
+
export declare class CannotSetCoordsInAutoModeError extends Error {
|
|
77
|
+
constructor();
|
|
78
|
+
}
|
|
79
|
+
export declare class InvalidLatLngError extends Error {
|
|
80
|
+
constructor();
|
|
81
|
+
}
|
|
82
|
+
export declare class InvalidAltitudeError extends Error {
|
|
83
|
+
constructor();
|
|
84
|
+
}
|
|
85
|
+
export declare class ServerError extends Error {
|
|
86
|
+
constructor();
|
|
87
|
+
}
|
|
88
|
+
export declare class BadRequestError<T extends TResponse> extends ErrorWithResponse<T> {
|
|
89
|
+
constructor(res: T);
|
|
90
|
+
}
|
|
34
91
|
export {};
|
package/cjs/errors/errors.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddNewClipError = exports.FetchDeviceInfoError = exports.NoDeviceInfoError = exports.MaxFPSError = exports.SDCardJobError = exports.SDCardActionError = exports.ApplicationAPIError = exports.ParsingBlobError = exports.ServiceNotFoundError = exports.ServiceUnavailableError = void 0;
|
|
3
|
+
exports.BadRequestError = exports.ServerError = exports.InvalidAltitudeError = exports.InvalidLatLngError = exports.CannotSetCoordsInAutoModeError = exports.ImportSettingsError = exports.ResetCalibrationError = exports.TimezoneFetchError = exports.TimezoneNotSetupError = exports.UtcTimeFetchError = exports.WsAuthorizationError = exports.StorageDataFetchError = exports.PtzNotSupportedError = exports.AddNewClipError = exports.FetchDeviceInfoError = exports.NoDeviceInfoError = exports.MaxFPSError = exports.SDCardJobError = exports.SDCardActionError = exports.ApplicationAPIError = exports.SettingParameterError = exports.ParameterNotFoundError = exports.JsonParseError = exports.ParsingBlobError = exports.ServiceNotFoundError = exports.ServiceUnavailableError = exports.ErrorWithResponse = void 0;
|
|
4
|
+
class ErrorWithResponse extends Error {
|
|
5
|
+
res;
|
|
6
|
+
constructor(res) {
|
|
7
|
+
super(res.statusText);
|
|
8
|
+
this.res = res;
|
|
9
|
+
this.name = 'ErrorWithResponse';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.ErrorWithResponse = ErrorWithResponse;
|
|
4
13
|
class ServiceUnavailableError extends Error {
|
|
5
14
|
constructor() {
|
|
6
15
|
super('Service is unavailable.');
|
|
@@ -22,23 +31,48 @@ class ParsingBlobError extends Error {
|
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
33
|
exports.ParsingBlobError = ParsingBlobError;
|
|
34
|
+
class JsonParseError extends Error {
|
|
35
|
+
constructor(paramName, data) {
|
|
36
|
+
super(`Error: in JSON parsing of ${paramName}. Cannot parse: ${data}`);
|
|
37
|
+
this.name = 'JsonParseError';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.JsonParseError = JsonParseError;
|
|
41
|
+
class ParameterNotFoundError extends Error {
|
|
42
|
+
constructor(paramName) {
|
|
43
|
+
super(`Error: no parameter '${paramName}' was found`);
|
|
44
|
+
this.name = 'ParameterNotFoundError';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ParameterNotFoundError = ParameterNotFoundError;
|
|
48
|
+
class SettingParameterError extends Error {
|
|
49
|
+
constructor(message) {
|
|
50
|
+
super(`Error setting parameter to camera: ${message}`);
|
|
51
|
+
this.name = 'SettingParameterError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SettingParameterError = SettingParameterError;
|
|
25
55
|
class ApplicationAPIError extends Error {
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
action;
|
|
57
|
+
constructor(action, reason) {
|
|
58
|
+
super(`Error performing application action '${action}': ${reason}`);
|
|
59
|
+
this.action = action;
|
|
28
60
|
this.name = 'ApplicationAPIError';
|
|
29
61
|
}
|
|
30
62
|
}
|
|
31
63
|
exports.ApplicationAPIError = ApplicationAPIError;
|
|
32
64
|
class SDCardActionError extends Error {
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
action;
|
|
66
|
+
constructor(action, reason) {
|
|
67
|
+
super(`Error performing SD card action '${action}': ${reason}`);
|
|
68
|
+
this.action = action;
|
|
35
69
|
this.name = 'SDCardActionError';
|
|
36
70
|
}
|
|
37
71
|
}
|
|
38
72
|
exports.SDCardActionError = SDCardActionError;
|
|
39
73
|
class SDCardJobError extends Error {
|
|
40
|
-
constructor() {
|
|
41
|
-
super(
|
|
74
|
+
constructor(reason) {
|
|
75
|
+
super(`Error while fetching SD card job progress: ${reason}`);
|
|
42
76
|
this.name = 'SDCardJobError';
|
|
43
77
|
}
|
|
44
78
|
}
|
|
@@ -77,3 +111,96 @@ class AddNewClipError extends Error {
|
|
|
77
111
|
}
|
|
78
112
|
}
|
|
79
113
|
exports.AddNewClipError = AddNewClipError;
|
|
114
|
+
class PtzNotSupportedError extends Error {
|
|
115
|
+
constructor() {
|
|
116
|
+
super('Ptz not supported.');
|
|
117
|
+
this.name = 'PtzNotSupportedError';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.PtzNotSupportedError = PtzNotSupportedError;
|
|
121
|
+
class StorageDataFetchError extends Error {
|
|
122
|
+
constructor(err) {
|
|
123
|
+
super('Error fetching storage data: ' + err);
|
|
124
|
+
this.name = 'StorageDataFetchError';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.StorageDataFetchError = StorageDataFetchError;
|
|
128
|
+
class WsAuthorizationError extends Error {
|
|
129
|
+
constructor(message) {
|
|
130
|
+
super('Server error on ws authorization: ' + message);
|
|
131
|
+
this.name = 'WsAuthorizationError';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.WsAuthorizationError = WsAuthorizationError;
|
|
135
|
+
class UtcTimeFetchError extends Error {
|
|
136
|
+
constructor(message) {
|
|
137
|
+
super('Server error on get UTC time: ' + message);
|
|
138
|
+
this.name = 'UtcTimeFetchError';
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.UtcTimeFetchError = UtcTimeFetchError;
|
|
142
|
+
class TimezoneNotSetupError extends Error {
|
|
143
|
+
constructor() {
|
|
144
|
+
super('Time zone not setup on the device');
|
|
145
|
+
this.name = 'TimezoneNotSetupError';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.TimezoneNotSetupError = TimezoneNotSetupError;
|
|
149
|
+
class TimezoneFetchError extends Error {
|
|
150
|
+
constructor(err) {
|
|
151
|
+
super('Error fetching time zone information: ' + err);
|
|
152
|
+
this.name = 'TimezoneFetchError';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.TimezoneFetchError = TimezoneFetchError;
|
|
156
|
+
class ResetCalibrationError extends ErrorWithResponse {
|
|
157
|
+
type;
|
|
158
|
+
constructor(type, res) {
|
|
159
|
+
super(res);
|
|
160
|
+
this.type = type;
|
|
161
|
+
this.name = 'ResetCalibrationError';
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.ResetCalibrationError = ResetCalibrationError;
|
|
165
|
+
class ImportSettingsError extends ErrorWithResponse {
|
|
166
|
+
constructor(res) {
|
|
167
|
+
super(res);
|
|
168
|
+
this.name = 'ImportSettingsError';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.ImportSettingsError = ImportSettingsError;
|
|
172
|
+
class CannotSetCoordsInAutoModeError extends Error {
|
|
173
|
+
constructor() {
|
|
174
|
+
super("The automatic mode doesn't allow control of the camera.");
|
|
175
|
+
this.name = 'CannotSetCoordsInAutoModeError';
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.CannotSetCoordsInAutoModeError = CannotSetCoordsInAutoModeError;
|
|
179
|
+
class InvalidLatLngError extends Error {
|
|
180
|
+
constructor() {
|
|
181
|
+
super('The provided latitude or longitude parameters are invalid.');
|
|
182
|
+
this.name = 'InvalidLatLngError';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.InvalidLatLngError = InvalidLatLngError;
|
|
186
|
+
class InvalidAltitudeError extends Error {
|
|
187
|
+
constructor() {
|
|
188
|
+
super('The provided altitude parameter is invalid.');
|
|
189
|
+
this.name = 'InvalidAltitudeError';
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.InvalidAltitudeError = InvalidAltitudeError;
|
|
193
|
+
class ServerError extends Error {
|
|
194
|
+
constructor() {
|
|
195
|
+
super('An internal server error occurred.');
|
|
196
|
+
this.name = 'ServerError';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.ServerError = ServerError;
|
|
200
|
+
class BadRequestError extends ErrorWithResponse {
|
|
201
|
+
constructor(res) {
|
|
202
|
+
super(res);
|
|
203
|
+
this.name = 'BadRequestError';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
exports.BadRequestError = BadRequestError;
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './errors/errors';
|
|
2
|
+
export * from './internal/types';
|
|
2
3
|
export * from './internal/constants';
|
|
3
4
|
export * from './internal/utils';
|
|
4
5
|
export * from './internal/versionCompare';
|
|
6
|
+
export * from './internal/ProxyClient';
|
|
5
7
|
export * from './types/common';
|
|
8
|
+
export { CamStreamerAPI } from './CamStreamerAPI';
|
|
9
|
+
export * from './types/CamStreamerAPI';
|
|
10
|
+
export { CamStreamerEvents } from './ws/CamStreamerEvents';
|
|
11
|
+
export * from './types/ws/CamStreamerEvents';
|
|
12
|
+
export { CamOverlayAPI } from './CamOverlayAPI';
|
|
13
|
+
export * from './types/CamOverlayAPI';
|
|
14
|
+
export { CamOverlayEvents } from './ws/CamOverlayEvents';
|
|
15
|
+
export * from './types/ws/CamOverlayEvents';
|
|
6
16
|
export { CamSwitcherAPI } from './CamSwitcherAPI';
|
|
7
|
-
export { CamSwitcherEvents } from './CamSwitcherEvents';
|
|
8
|
-
export { VapixAPI } from './VapixAPI';
|
|
9
|
-
export * from './types/CamSwitcherEvents';
|
|
10
17
|
export * from './types/CamSwitcherAPI';
|
|
18
|
+
export { CamSwitcherEvents } from './ws/CamSwitcherEvents';
|
|
19
|
+
export * from './types/ws/CamSwitcherEvents';
|
|
20
|
+
export { PlaneTrackerAPI } from './PlaneTrackerAPI';
|
|
21
|
+
export * from './types/PlaneTrackerAPI';
|
|
22
|
+
export { PlaneTrackerEvents } from './ws/PlaneTrackerEvents';
|
|
23
|
+
export * from './types/ws/PlaneTrackerEvents';
|
|
24
|
+
export { CamScripterAPI } from './CamScripterAPI';
|
|
25
|
+
export * from './types/CamScripterAPI';
|
|
26
|
+
export { VapixAPI } from './VapixAPI';
|
|
11
27
|
export * from './types/VapixAPI';
|
package/cjs/index.js
CHANGED
|
@@ -14,18 +14,41 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.VapixAPI = exports.CamSwitcherEvents = exports.CamSwitcherAPI = void 0;
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
exports.VapixAPI = exports.CamScripterAPI = exports.PlaneTrackerEvents = exports.PlaneTrackerAPI = exports.CamSwitcherEvents = exports.CamSwitcherAPI = exports.CamOverlayEvents = exports.CamOverlayAPI = exports.CamStreamerEvents = exports.CamStreamerAPI = void 0;
|
|
18
|
+
__exportStar(require("./errors/errors"), exports);
|
|
19
|
+
__exportStar(require("./internal/types"), exports);
|
|
19
20
|
__exportStar(require("./internal/constants"), exports);
|
|
20
21
|
__exportStar(require("./internal/utils"), exports);
|
|
21
22
|
__exportStar(require("./internal/versionCompare"), exports);
|
|
23
|
+
__exportStar(require("./internal/ProxyClient"), exports);
|
|
22
24
|
__exportStar(require("./types/common"), exports);
|
|
25
|
+
var CamStreamerAPI_1 = require("./CamStreamerAPI");
|
|
26
|
+
Object.defineProperty(exports, "CamStreamerAPI", { enumerable: true, get: function () { return CamStreamerAPI_1.CamStreamerAPI; } });
|
|
27
|
+
__exportStar(require("./types/CamStreamerAPI"), exports);
|
|
28
|
+
var CamStreamerEvents_1 = require("./ws/CamStreamerEvents");
|
|
29
|
+
Object.defineProperty(exports, "CamStreamerEvents", { enumerable: true, get: function () { return CamStreamerEvents_1.CamStreamerEvents; } });
|
|
30
|
+
__exportStar(require("./types/ws/CamStreamerEvents"), exports);
|
|
31
|
+
var CamOverlayAPI_1 = require("./CamOverlayAPI");
|
|
32
|
+
Object.defineProperty(exports, "CamOverlayAPI", { enumerable: true, get: function () { return CamOverlayAPI_1.CamOverlayAPI; } });
|
|
33
|
+
__exportStar(require("./types/CamOverlayAPI"), exports);
|
|
34
|
+
var CamOverlayEvents_1 = require("./ws/CamOverlayEvents");
|
|
35
|
+
Object.defineProperty(exports, "CamOverlayEvents", { enumerable: true, get: function () { return CamOverlayEvents_1.CamOverlayEvents; } });
|
|
36
|
+
__exportStar(require("./types/ws/CamOverlayEvents"), exports);
|
|
23
37
|
var CamSwitcherAPI_1 = require("./CamSwitcherAPI");
|
|
24
38
|
Object.defineProperty(exports, "CamSwitcherAPI", { enumerable: true, get: function () { return CamSwitcherAPI_1.CamSwitcherAPI; } });
|
|
25
|
-
|
|
39
|
+
__exportStar(require("./types/CamSwitcherAPI"), exports);
|
|
40
|
+
var CamSwitcherEvents_1 = require("./ws/CamSwitcherEvents");
|
|
26
41
|
Object.defineProperty(exports, "CamSwitcherEvents", { enumerable: true, get: function () { return CamSwitcherEvents_1.CamSwitcherEvents; } });
|
|
42
|
+
__exportStar(require("./types/ws/CamSwitcherEvents"), exports);
|
|
43
|
+
var PlaneTrackerAPI_1 = require("./PlaneTrackerAPI");
|
|
44
|
+
Object.defineProperty(exports, "PlaneTrackerAPI", { enumerable: true, get: function () { return PlaneTrackerAPI_1.PlaneTrackerAPI; } });
|
|
45
|
+
__exportStar(require("./types/PlaneTrackerAPI"), exports);
|
|
46
|
+
var PlaneTrackerEvents_1 = require("./ws/PlaneTrackerEvents");
|
|
47
|
+
Object.defineProperty(exports, "PlaneTrackerEvents", { enumerable: true, get: function () { return PlaneTrackerEvents_1.PlaneTrackerEvents; } });
|
|
48
|
+
__exportStar(require("./types/ws/PlaneTrackerEvents"), exports);
|
|
49
|
+
var CamScripterAPI_1 = require("./CamScripterAPI");
|
|
50
|
+
Object.defineProperty(exports, "CamScripterAPI", { enumerable: true, get: function () { return CamScripterAPI_1.CamScripterAPI; } });
|
|
51
|
+
__exportStar(require("./types/CamScripterAPI"), exports);
|
|
27
52
|
var VapixAPI_1 = require("./VapixAPI");
|
|
28
53
|
Object.defineProperty(exports, "VapixAPI", { enumerable: true, get: function () { return VapixAPI_1.VapixAPI; } });
|
|
29
|
-
__exportStar(require("./types/CamSwitcherEvents"), exports);
|
|
30
|
-
__exportStar(require("./types/CamSwitcherAPI"), exports);
|
|
31
54
|
__exportStar(require("./types/VapixAPI"), exports);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
post: (proxy: TProxyParam, path: string, data: string | Buffer | FormData, parameters?: TParameters, headers?: Record<string, string>) => Promise<import("./common").TResponse>;
|
|
1
|
+
import { IClient, TGetParams, TResponse } from './types';
|
|
2
|
+
import { TProxyParams } from '../types/common';
|
|
3
|
+
export declare class ProxyClient<Client extends IClient<TResponse, any>> {
|
|
4
|
+
private client;
|
|
5
|
+
private proxyParams;
|
|
6
|
+
constructor(client: Client, proxyParams: TProxyParams);
|
|
7
|
+
get(params: TGetParams): ReturnType<Client["get"]>;
|
|
8
|
+
post(params: Parameters<Client['post']>[0]): ReturnType<Client["post"]>;
|
|
10
9
|
private getReal;
|
|
11
10
|
}
|
|
@@ -4,41 +4,37 @@ exports.ProxyClient = void 0;
|
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
class ProxyClient {
|
|
6
6
|
client;
|
|
7
|
-
|
|
8
|
-
constructor(client,
|
|
7
|
+
proxyParams;
|
|
8
|
+
constructor(client, proxyParams) {
|
|
9
9
|
this.client = client;
|
|
10
|
-
this.
|
|
10
|
+
this.proxyParams = proxyParams;
|
|
11
11
|
}
|
|
12
|
-
get
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
realUrl: this.getProxyUrl(),
|
|
26
|
-
realHeaders: {
|
|
27
|
-
...(headers ?? {}),
|
|
28
|
-
'x-target-camera-protocol': proxy.port === 443 ? 'https' : 'http',
|
|
29
|
-
'x-target-camera-path': url,
|
|
30
|
-
'x-target-camera-ip': proxy.ip,
|
|
31
|
-
'x-target-camera-mdns': proxy.mdnsName,
|
|
32
|
-
'x-target-camera-port': String(proxy.port),
|
|
33
|
-
'x-target-camera-pass': encodeURIComponent(proxy.pass),
|
|
34
|
-
'x-target-camera-user': encodeURIComponent(proxy.user),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
12
|
+
get(params) {
|
|
13
|
+
const { path, parameters, headers, timeout } = params;
|
|
14
|
+
const targetPath = (0, utils_1.addParametersToPath)(path, parameters);
|
|
15
|
+
const { realPath, realHeaders } = this.getReal(targetPath, headers);
|
|
16
|
+
return this.client.get({ path: realPath, headers: realHeaders, timeout });
|
|
17
|
+
}
|
|
18
|
+
post(params) {
|
|
19
|
+
const { path, data, parameters, headers, timeout } = params;
|
|
20
|
+
const targetPath = (0, utils_1.addParametersToPath)(path, parameters);
|
|
21
|
+
const { realPath, realHeaders } = this.getReal(targetPath, headers);
|
|
22
|
+
return this.client.post({ path: realPath, data, headers: realHeaders, timeout });
|
|
23
|
+
}
|
|
24
|
+
getReal(targetPath, headers) {
|
|
38
25
|
return {
|
|
39
|
-
|
|
40
|
-
realHeaders:
|
|
26
|
+
realPath: this.proxyParams.path,
|
|
27
|
+
realHeaders: {
|
|
28
|
+
...(headers ?? {}),
|
|
29
|
+
'x-target-camera-protocol': this.proxyParams.target.port === 443 ? 'https' : 'http',
|
|
30
|
+
'x-target-camera-path': targetPath,
|
|
31
|
+
'x-target-camera-ip': this.proxyParams.target.ip,
|
|
32
|
+
'x-target-camera-mdns': this.proxyParams.target.mdnsName,
|
|
33
|
+
'x-target-camera-port': String(this.proxyParams.target.port),
|
|
34
|
+
'x-target-camera-pass': this.proxyParams.target.pass,
|
|
35
|
+
'x-target-camera-user': this.proxyParams.target.user,
|
|
36
|
+
},
|
|
41
37
|
};
|
|
42
|
-
}
|
|
38
|
+
}
|
|
43
39
|
}
|
|
44
40
|
exports.ProxyClient = ProxyClient;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IWsClient } from './types';
|
|
2
|
+
type TEventType<T extends {
|
|
3
|
+
type: string;
|
|
4
|
+
}> = T extends {
|
|
5
|
+
type: infer Type;
|
|
6
|
+
} ? Type : never;
|
|
7
|
+
type TEvent<T extends {
|
|
8
|
+
type: string;
|
|
9
|
+
}, Type extends TEventType<T>> = T extends {
|
|
10
|
+
type: Type;
|
|
11
|
+
} ? T : never;
|
|
12
|
+
type TValidate<T extends {
|
|
13
|
+
type: string;
|
|
14
|
+
}> = (data: string) => {
|
|
15
|
+
type: 'init';
|
|
16
|
+
data: TEvent<T, TEventType<T>>;
|
|
17
|
+
} | TEvent<T, TEventType<T>>;
|
|
18
|
+
type TListenerFunction<T extends {
|
|
19
|
+
type: string;
|
|
20
|
+
}, Type extends TEventType<T>> = (data: TEvent<T, Type>, isInit: boolean) => void;
|
|
21
|
+
export declare class WsEvents<T extends {
|
|
22
|
+
type: string;
|
|
23
|
+
}> {
|
|
24
|
+
private validate;
|
|
25
|
+
ws: IWsClient;
|
|
26
|
+
private _isDestroyed;
|
|
27
|
+
private listeners;
|
|
28
|
+
constructor(validate: TValidate<T>, ws: IWsClient);
|
|
29
|
+
get isDestroyed(): boolean;
|
|
30
|
+
resendInitData(): void;
|
|
31
|
+
addListener<Type extends TEventType<T>>(type: Type, listener: TListenerFunction<T, Type>, id: string): void;
|
|
32
|
+
removeListener<Type extends TEventType<T>>(type: Type, id: string): void;
|
|
33
|
+
private onMessage;
|
|
34
|
+
private processMessage;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|