camstreamerlib 4.0.0-beta.3 → 4.0.0-beta.30
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 +8 -2
- package/cjs/CamOverlayAPI.d.ts +47 -26
- package/cjs/CamOverlayAPI.js +171 -88
- package/cjs/CamOverlayDrawingAPI.d.ts +2 -47
- package/cjs/CamOverlayDrawingAPI.js +6 -3
- package/cjs/CamOverlayPainter/Frame.d.ts +8 -37
- package/cjs/CamOverlayPainter/Frame.js +33 -0
- package/cjs/CamOverlayPainter/Painter.d.ts +16 -10
- package/cjs/CamOverlayPainter/Painter.js +6 -5
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +3 -2
- package/cjs/CamOverlayPainter/ResourceManager.js +8 -11
- package/cjs/CamScripterAPI.d.ts +33 -16
- package/cjs/CamScripterAPI.js +50 -41
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +1 -1
- package/cjs/CamScripterAPICameraEventsGenerator.js +6 -3
- package/cjs/CamStreamerAPI.d.ts +16 -14
- package/cjs/CamStreamerAPI.js +32 -32
- package/cjs/CamSwitcherAPI.d.ts +42 -37
- package/cjs/CamSwitcherAPI.js +123 -114
- package/cjs/CamSwitcherEvents.d.ts +1 -1
- package/cjs/PlaneTrackerAPI.d.ts +42 -0
- package/cjs/PlaneTrackerAPI.js +211 -0
- package/cjs/VapixAPI.d.ts +56 -43
- package/cjs/VapixAPI.js +305 -216
- package/cjs/VapixEvents.d.ts +1 -1
- package/cjs/VapixEvents.js +3 -3
- package/cjs/errors/errors.d.ts +3 -0
- package/cjs/errors/errors.js +8 -1
- package/cjs/events/AxisCameraStationEvents.d.ts +5 -4
- package/cjs/events/AxisCameraStationEvents.js +23 -18
- package/cjs/events/GenetecAgent.d.ts +6 -3
- package/cjs/events/GenetecAgent.js +30 -19
- package/cjs/index.d.ts +14 -1
- package/cjs/index.js +23 -2
- package/cjs/internal/Digest.js +6 -6
- package/cjs/internal/ProxyClient.d.ts +8 -9
- package/cjs/internal/ProxyClient.js +25 -29
- package/cjs/internal/types.d.ts +42 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.d.ts +4 -1
- package/cjs/internal/utils.js +22 -3
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/node/DefaultClient.d.ts +5 -6
- package/cjs/node/DefaultClient.js +12 -14
- package/cjs/node/HttpRequestSender.d.ts +1 -0
- package/cjs/node/HttpRequestSender.js +13 -3
- package/cjs/node/HttpServer.js +1 -1
- package/cjs/node/WsClient.d.ts +2 -1
- package/cjs/node/WsEventClient.d.ts +1 -1
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +18 -1
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +3073 -0
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +127 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +114 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +50 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +783 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +75 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +122 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/index.d.ts +9 -0
- package/cjs/types/CamOverlayAPI/index.js +25 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +130 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +29 -0
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +166 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +42 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +126 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +28 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +146 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +15 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +79 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +11 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +79 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +11 -0
- package/cjs/types/CamOverlayDrawingAPI.d.ts +58 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.d.ts +74 -0
- package/cjs/types/CamOverlayPainter.js +2 -0
- package/cjs/types/CamScripterAPI.d.ts +82 -17
- package/cjs/types/CamScripterAPI.js +22 -7
- package/cjs/types/CamStreamerAPI.d.ts +16 -5
- package/cjs/types/CamStreamerAPI.js +5 -1
- package/cjs/types/CamSwitcherAPI.d.ts +5 -5
- package/cjs/types/CamSwitcherEvents.d.ts +77 -0
- package/cjs/types/CamSwitcherEvents.js +8 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +8 -0
- package/cjs/types/PlaneTrackerAPI.js +2 -0
- package/cjs/types/VapixAPI.d.ts +636 -519
- package/cjs/types/VapixAPI.js +62 -24
- package/cjs/types/common.d.ts +14 -5
- package/cjs/web/DefaultClient.d.ts +5 -5
- package/cjs/web/DefaultClient.js +22 -10
- package/cjs/web/WsClient.js +2 -2
- package/esm/CamOverlayAPI.d.ts +47 -26
- package/esm/CamOverlayAPI.js +169 -86
- package/esm/CamOverlayDrawingAPI.d.ts +2 -47
- package/esm/CamOverlayDrawingAPI.js +6 -3
- package/esm/CamOverlayPainter/Frame.d.ts +8 -37
- package/esm/CamOverlayPainter/Frame.js +33 -0
- package/esm/CamOverlayPainter/Painter.d.ts +16 -10
- package/esm/CamOverlayPainter/Painter.js +5 -3
- package/esm/CamOverlayPainter/ResourceManager.d.ts +3 -2
- package/esm/CamOverlayPainter/ResourceManager.js +7 -11
- package/esm/CamScripterAPI.d.ts +33 -16
- package/esm/CamScripterAPI.js +46 -37
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +1 -1
- package/esm/CamScripterAPICameraEventsGenerator.js +6 -3
- package/esm/CamStreamerAPI.d.ts +16 -14
- package/esm/CamStreamerAPI.js +32 -32
- package/esm/CamSwitcherAPI.d.ts +42 -37
- package/esm/CamSwitcherAPI.js +116 -107
- package/esm/CamSwitcherEvents.d.ts +1 -1
- package/esm/PlaneTrackerAPI.d.ts +42 -0
- package/esm/PlaneTrackerAPI.js +207 -0
- package/esm/VapixAPI.d.ts +56 -43
- package/esm/VapixAPI.js +297 -208
- package/esm/VapixEvents.d.ts +1 -1
- package/esm/VapixEvents.js +3 -3
- package/esm/errors/errors.d.ts +3 -0
- package/esm/errors/errors.js +6 -0
- package/esm/events/AxisCameraStationEvents.d.ts +5 -4
- package/esm/events/AxisCameraStationEvents.js +18 -13
- package/esm/events/GenetecAgent.d.ts +6 -3
- package/esm/events/GenetecAgent.js +20 -9
- package/esm/index.d.ts +14 -1
- package/esm/index.js +14 -1
- package/esm/internal/Digest.js +6 -6
- package/esm/internal/ProxyClient.d.ts +8 -9
- package/esm/internal/ProxyClient.js +25 -29
- package/esm/internal/types.d.ts +42 -0
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.d.ts +4 -1
- package/esm/internal/utils.js +17 -1
- package/esm/internal/versionCompare.d.ts +2 -2
- package/esm/node/DefaultClient.d.ts +5 -6
- package/esm/node/DefaultClient.js +12 -14
- package/esm/node/HttpRequestSender.d.ts +1 -0
- package/esm/node/HttpRequestSender.js +13 -3
- package/esm/node/HttpServer.js +1 -1
- package/esm/node/WsClient.d.ts +2 -1
- package/esm/node/WsEventClient.d.ts +1 -1
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +3073 -0
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +124 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +114 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +46 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +783 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +71 -0
- package/esm/types/CamOverlayAPI/imagesSchema.d.ts +122 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +8 -0
- package/esm/types/CamOverlayAPI/index.d.ts +9 -0
- package/esm/types/CamOverlayAPI/index.js +9 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +130 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +25 -0
- package/esm/types/CamOverlayAPI/pipSchema.d.ts +166 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +38 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +126 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +24 -0
- package/esm/types/CamOverlayAPI/ptzSchema.d.ts +146 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +11 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +79 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +7 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +79 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +7 -0
- package/esm/types/CamOverlayDrawingAPI.d.ts +58 -0
- package/esm/types/CamOverlayDrawingAPI.js +1 -0
- package/esm/types/CamOverlayPainter.d.ts +74 -0
- package/esm/types/CamOverlayPainter.js +1 -0
- package/esm/types/CamScripterAPI.d.ts +82 -17
- package/esm/types/CamScripterAPI.js +21 -6
- package/esm/types/CamStreamerAPI.d.ts +16 -5
- package/esm/types/CamStreamerAPI.js +4 -0
- package/esm/types/CamSwitcherAPI.d.ts +5 -5
- package/esm/types/CamSwitcherEvents.d.ts +77 -0
- package/esm/types/CamSwitcherEvents.js +8 -0
- package/esm/types/PlaneTrackerAPI.d.ts +8 -0
- package/esm/types/PlaneTrackerAPI.js +1 -0
- package/esm/types/VapixAPI.d.ts +636 -519
- package/esm/types/VapixAPI.js +61 -23
- package/esm/types/common.d.ts +14 -5
- package/esm/web/DefaultClient.d.ts +5 -5
- package/esm/web/DefaultClient.js +22 -10
- package/esm/web/WsClient.js +2 -2
- package/package.json +9 -8
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- package/cjs/types/CamOverlayAPI.d.ts +0 -188
- package/cjs/types/CamOverlayAPI.js +0 -47
- package/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
package/cjs/CamSwitcherAPI.d.ts
CHANGED
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
import { IClient } from './internal/
|
|
1
|
+
import { IClient, TResponse } from './internal/types';
|
|
2
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
|
|
3
|
+
import { TAudioChannel, THttpRequestOptions, TNetworkCamera, TStorageType } from './types/common';
|
|
4
|
+
export declare class CamSwitcherAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
|
|
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;
|
|
11
|
-
generateSilence(sampleRate: number, channels: TAudioChannel): Promise<void>;
|
|
12
|
-
checkCameraTime(): Promise<boolean>;
|
|
13
|
-
|
|
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>;
|
|
15
|
+
generateSilence(sampleRate: number, channels: TAudioChannel, options?: THttpRequestOptions): Promise<void>;
|
|
16
|
+
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
17
|
+
getNetworkCameraList(options?: THttpRequestOptions): Promise<TNetworkCamera[]>;
|
|
18
|
+
getMaxFps(source: number, options?: THttpRequestOptions): Promise<number>;
|
|
19
|
+
getStorageInfo(options?: THttpRequestOptions): Promise<TStorageInfo[]>;
|
|
20
|
+
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
21
|
+
getOutputInfo(options?: THttpRequestOptions): Promise<TOutputInfo>;
|
|
22
|
+
getAudioPushInfo(options?: THttpRequestOptions): Promise<TAudioPushInfo>;
|
|
23
|
+
getStreamSaveList(options?: THttpRequestOptions): Promise<TStreamSaveLoadList>;
|
|
24
|
+
getClipSaveList(options?: THttpRequestOptions): Promise<TClipSaveLoadList>;
|
|
25
|
+
getPlaylistSaveList(options?: THttpRequestOptions): Promise<TPlaylistSaveLoadList>;
|
|
26
|
+
getTrackerSaveList(options?: THttpRequestOptions): Promise<TrackerSaveLoadList>;
|
|
27
|
+
setStreamSaveList(data: TStreamSaveList, options?: THttpRequestOptions): Promise<boolean>;
|
|
28
|
+
setClipSaveList(data: TClipSaveList, options?: THttpRequestOptions): Promise<boolean>;
|
|
29
|
+
setPlaylistSaveList(data: TPlaylistSaveList, options?: THttpRequestOptions): Promise<boolean>;
|
|
30
|
+
setTrackerSaveList(data: TTrackerSaveList, options?: THttpRequestOptions): Promise<boolean>;
|
|
31
|
+
playlistSwitch(playlistName: string, options?: THttpRequestOptions): Promise<void>;
|
|
32
|
+
playlistQueuePush(playlistName: string, options?: THttpRequestOptions): Promise<void>;
|
|
33
|
+
playlistQueueClear(options?: THttpRequestOptions): Promise<void>;
|
|
34
|
+
playlistQueueList(options?: THttpRequestOptions): Promise<string[]>;
|
|
35
|
+
playlistQueuePlayNext(options?: THttpRequestOptions): Promise<void>;
|
|
36
|
+
addNewClip(file: any, clipType: 'video' | 'audio', storage: TStorageType, id: string, fileName?: string, options?: THttpRequestOptions): Promise<void>;
|
|
37
|
+
removeClip(id: string, storage: TStorageType, options?: THttpRequestOptions): Promise<any>;
|
|
38
|
+
getClipList(options?: THttpRequestOptions): Promise<TClipList>;
|
|
39
|
+
setCamSwitchOptions(data: TCameraOptions, cameraFWVersion: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
40
|
+
setGlobalAudioSettings(settings: TGlobalAudioSettings, options?: THttpRequestOptions): Promise<boolean>;
|
|
41
|
+
setSecondaryAudioSettings(settings: TSecondaryAudioSettings, options?: THttpRequestOptions): Promise<boolean>;
|
|
42
|
+
setDefaultPlaylist(id: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
43
|
+
setPermanentRtspUrlToken(token: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
44
|
+
getCamSwitchOptions(options?: THttpRequestOptions): Promise<Partial<TCameraOptions>>;
|
|
45
|
+
getGlobalAudioSettings(options?: THttpRequestOptions): Promise<TGlobalAudioSettings>;
|
|
46
|
+
getSecondaryAudioSettings(options?: THttpRequestOptions): Promise<TSecondaryAudioSettings>;
|
|
47
|
+
getPermanentRtspUrlToken(options?: THttpRequestOptions): Promise<string>;
|
|
44
48
|
private get;
|
|
45
49
|
private set;
|
|
46
50
|
private setParamFromCameraJSON;
|
|
47
51
|
private getParamFromCameraAndJSONParse;
|
|
52
|
+
private getAgent;
|
|
48
53
|
}
|
package/cjs/CamSwitcherAPI.js
CHANGED
|
@@ -3,124 +3,132 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CamSwitcherAPI = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const errors_1 = require("./errors/errors");
|
|
6
|
-
const
|
|
6
|
+
const utils_1 = require("./internal/utils");
|
|
7
7
|
const CamSwitcherAPI_1 = require("./types/CamSwitcherAPI");
|
|
8
|
-
const
|
|
8
|
+
const common_1 = require("./types/common");
|
|
9
9
|
const VapixAPI_1 = require("./VapixAPI");
|
|
10
10
|
const versionCompare_1 = require("./internal/versionCompare");
|
|
11
|
-
const utils_1 = require("./internal/utils");
|
|
12
11
|
const constants_1 = require("./internal/constants");
|
|
13
|
-
const
|
|
12
|
+
const ProxyClient_1 = require("./internal/ProxyClient");
|
|
13
|
+
const BASE_PATH = '/local/camswitcher/api';
|
|
14
14
|
class CamSwitcherAPI {
|
|
15
15
|
client;
|
|
16
|
+
CustomFormData;
|
|
16
17
|
vapixAgent;
|
|
17
|
-
constructor(client) {
|
|
18
|
+
constructor(client, CustomFormData = FormData) {
|
|
18
19
|
this.client = client;
|
|
19
|
-
this.
|
|
20
|
+
this.CustomFormData = CustomFormData;
|
|
21
|
+
this.vapixAgent = new VapixAPI_1.VapixAPI(client);
|
|
20
22
|
}
|
|
21
|
-
static getProxyUrlPath = () => `${
|
|
23
|
+
static getProxyUrlPath = () => `${BASE_PATH}/proxy.cgi`;
|
|
22
24
|
static getWsEventsUrlPath = () => `/local/camswitcher/events`;
|
|
23
|
-
static getClipPreviewUrlPath = (id, storage) => `${
|
|
24
|
-
async generateSilence(sampleRate, channels) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
static getClipPreviewUrlPath = (id, storage) => `${BASE_PATH}/clip_preview.cgi?clip_name=${id}&storage=${storage}`;
|
|
26
|
+
async generateSilence(sampleRate, channels, options) {
|
|
27
|
+
const agent = this.getAgent(options?.proxyParams);
|
|
28
|
+
await agent.get({
|
|
29
|
+
path: `${BASE_PATH}/generate_silence.cgi`,
|
|
30
|
+
parameters: {
|
|
31
|
+
sample_rate: sampleRate.toString(),
|
|
32
|
+
channels,
|
|
33
|
+
},
|
|
34
|
+
timeout: options?.timeout,
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
|
-
async checkCameraTime() {
|
|
31
|
-
const data = await this.get(`${
|
|
37
|
+
async checkCameraTime(options) {
|
|
38
|
+
const data = await this.get(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
32
39
|
return zod_1.z.boolean().parse(data);
|
|
33
40
|
}
|
|
34
|
-
async
|
|
35
|
-
const data = await this.get(`${
|
|
36
|
-
return
|
|
41
|
+
async getNetworkCameraList(options) {
|
|
42
|
+
const data = await this.get(`${BASE_PATH}/network_camera_list.cgi`, undefined, options);
|
|
43
|
+
return common_1.networkCameraListSchema.parse(data);
|
|
37
44
|
}
|
|
38
|
-
async getMaxFps(source) {
|
|
39
|
-
const data = await this.get(`${
|
|
45
|
+
async getMaxFps(source, options) {
|
|
46
|
+
const data = await this.get(`${BASE_PATH}/get_max_framerate.cgi`, {
|
|
40
47
|
video_source: source.toString(),
|
|
41
|
-
});
|
|
48
|
+
}, options);
|
|
42
49
|
return zod_1.z.number().parse(data);
|
|
43
50
|
}
|
|
44
|
-
async getStorageInfo() {
|
|
45
|
-
const data = await this.get(`${
|
|
51
|
+
async getStorageInfo(options) {
|
|
52
|
+
const data = await this.get(`${BASE_PATH}/get_storage.cgi`, undefined, options);
|
|
46
53
|
return CamSwitcherAPI_1.storageInfoListSchema.parse(data);
|
|
47
54
|
}
|
|
48
|
-
async wsAuthorization() {
|
|
49
|
-
const data = await this.get(`${
|
|
55
|
+
async wsAuthorization(options) {
|
|
56
|
+
const data = await this.get(`${BASE_PATH}/ws_authorization.cgi`, undefined, options);
|
|
50
57
|
return zod_1.z.string().parse(data);
|
|
51
58
|
}
|
|
52
|
-
async getOutputInfo() {
|
|
53
|
-
const data = await this.get(`${
|
|
59
|
+
async getOutputInfo(options) {
|
|
60
|
+
const data = await this.get(`${BASE_PATH}/output_info.cgi`, undefined, options);
|
|
54
61
|
return CamSwitcherAPI_1.outputInfoSchema.parse(data);
|
|
55
62
|
}
|
|
56
|
-
async getAudioPushInfo() {
|
|
57
|
-
const data = await this.get(`${
|
|
63
|
+
async getAudioPushInfo(options) {
|
|
64
|
+
const data = await this.get(`${BASE_PATH}/audio_push_info.cgi`, undefined, options);
|
|
58
65
|
return CamSwitcherAPI_1.audioPushInfoSchema.parse(data);
|
|
59
66
|
}
|
|
60
|
-
async getStreamSaveList() {
|
|
61
|
-
const data = await this.get(`${
|
|
67
|
+
async getStreamSaveList(options) {
|
|
68
|
+
const data = await this.get(`${BASE_PATH}/streams.cgi`, { action: 'get' }, options);
|
|
62
69
|
return CamSwitcherAPI_1.streamSaveLoadSchema.parse(data);
|
|
63
70
|
}
|
|
64
|
-
async getClipSaveList() {
|
|
65
|
-
const data = await this.get(`${
|
|
71
|
+
async getClipSaveList(options) {
|
|
72
|
+
const data = await this.get(`${BASE_PATH}/clips.cgi`, { action: 'get' }, options);
|
|
66
73
|
return CamSwitcherAPI_1.clipSaveLoadSchema.parse(data);
|
|
67
74
|
}
|
|
68
|
-
async getPlaylistSaveList() {
|
|
69
|
-
const data = await this.get(`${
|
|
75
|
+
async getPlaylistSaveList(options) {
|
|
76
|
+
const data = await this.get(`${BASE_PATH}/playlists.cgi`, { action: 'get' }, options);
|
|
70
77
|
return CamSwitcherAPI_1.playlistSaveLoadSchema.parse(data);
|
|
71
78
|
}
|
|
72
|
-
async getTrackerSaveList() {
|
|
73
|
-
const data = await this.get(`${
|
|
79
|
+
async getTrackerSaveList(options) {
|
|
80
|
+
const data = await this.get(`${BASE_PATH}/trackers.cgi`, { action: 'get' }, options);
|
|
74
81
|
return CamSwitcherAPI_1.trackerSaveLoadSchema.parse(data);
|
|
75
82
|
}
|
|
76
|
-
async setStreamSaveList(data) {
|
|
77
|
-
return await this.set(`${
|
|
83
|
+
async setStreamSaveList(data, options) {
|
|
84
|
+
return await this.set(`${BASE_PATH}/streams.cgi`, data, { action: 'set' }, options);
|
|
78
85
|
}
|
|
79
|
-
async setClipSaveList(data) {
|
|
80
|
-
return await this.set(`${
|
|
86
|
+
async setClipSaveList(data, options) {
|
|
87
|
+
return await this.set(`${BASE_PATH}/clips.cgi`, data, { action: 'set' }, options);
|
|
81
88
|
}
|
|
82
|
-
async setPlaylistSaveList(data) {
|
|
83
|
-
return await this.set(`${
|
|
89
|
+
async setPlaylistSaveList(data, options) {
|
|
90
|
+
return await this.set(`${BASE_PATH}/playlists.cgi`, data, { action: 'set' }, options);
|
|
84
91
|
}
|
|
85
|
-
async setTrackerSaveList(data) {
|
|
86
|
-
return await this.set(`${
|
|
92
|
+
async setTrackerSaveList(data, options) {
|
|
93
|
+
return await this.set(`${BASE_PATH}/trackers.cgi`, data, { action: 'set' }, options);
|
|
87
94
|
}
|
|
88
|
-
async playlistSwitch(playlistName) {
|
|
89
|
-
await this.get(`${
|
|
95
|
+
async playlistSwitch(playlistName, options) {
|
|
96
|
+
await this.get(`${BASE_PATH}/playlist_switch.cgi`, { playlist_name: playlistName }, options);
|
|
90
97
|
}
|
|
91
|
-
async playlistQueuePush(playlistName) {
|
|
92
|
-
await this.get(`${
|
|
98
|
+
async playlistQueuePush(playlistName, options) {
|
|
99
|
+
await this.get(`${BASE_PATH}/playlist_queue_push.cgi`, { playlist_name: playlistName }, options);
|
|
93
100
|
}
|
|
94
|
-
async playlistQueueClear() {
|
|
95
|
-
await this.get(`${
|
|
101
|
+
async playlistQueueClear(options) {
|
|
102
|
+
await this.get(`${BASE_PATH}/playlist_queue_clear.cgi`, undefined, options);
|
|
96
103
|
}
|
|
97
|
-
async playlistQueueList() {
|
|
98
|
-
const data = await this.get(`${
|
|
104
|
+
async playlistQueueList(options) {
|
|
105
|
+
const data = await this.get(`${BASE_PATH}/playlist_queue_list.cgi`, undefined, options);
|
|
99
106
|
return CamSwitcherAPI_1.playlistQueueSchema.parse(data).playlistQueueList;
|
|
100
107
|
}
|
|
101
|
-
async playlistQueuePlayNext() {
|
|
102
|
-
await this.get(`${
|
|
108
|
+
async playlistQueuePlayNext(options) {
|
|
109
|
+
await this.get(`${BASE_PATH}/playlist_queue_play_next.cgi`, undefined, options);
|
|
103
110
|
}
|
|
104
|
-
async addNewClip(file, clipType, storage, id, fileName) {
|
|
105
|
-
const
|
|
111
|
+
async addNewClip(file, clipType, storage, id, fileName, options) {
|
|
112
|
+
const path = `${BASE_PATH}/clip_upload.cgi?storage=${storage}`;
|
|
113
|
+
const formData = new this.CustomFormData();
|
|
106
114
|
formData.append('clip_name', id);
|
|
107
115
|
formData.append('clip_type', clipType);
|
|
108
116
|
formData.append('file', file, fileName);
|
|
109
|
-
const
|
|
110
|
-
const res = await
|
|
117
|
+
const agent = this.getAgent(options?.proxyParams);
|
|
118
|
+
const res = await agent.post({ path, data: formData, timeout: options?.timeout });
|
|
111
119
|
const output = (await res.json());
|
|
112
120
|
if (output.status !== 200) {
|
|
113
121
|
throw new errors_1.AddNewClipError(output.message);
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
|
-
removeClip(id, storage) {
|
|
117
|
-
return this.get(`${
|
|
124
|
+
removeClip(id, storage, options) {
|
|
125
|
+
return this.get(`${BASE_PATH}/clip_remove.cgi`, { clip_name: id, storage }, options);
|
|
118
126
|
}
|
|
119
|
-
async getClipList() {
|
|
120
|
-
const data = await this.get(`${
|
|
127
|
+
async getClipList(options) {
|
|
128
|
+
const data = await this.get(`${BASE_PATH}/clip_list.cgi`, undefined, options);
|
|
121
129
|
return CamSwitcherAPI_1.clipListSchema.parse(data).clip_list;
|
|
122
130
|
}
|
|
123
|
-
setCamSwitchOptions(data, cameraFWVersion) {
|
|
131
|
+
setCamSwitchOptions(data, cameraFWVersion, options) {
|
|
124
132
|
const bitrateVapixParams = parseBitrateOptionsToBitrateVapixParams(cameraFWVersion, data.bitrateMode, data);
|
|
125
133
|
const saveData = {
|
|
126
134
|
video: {
|
|
@@ -138,9 +146,9 @@ class CamSwitcherAPI {
|
|
|
138
146
|
},
|
|
139
147
|
keyboard: data.keyboard,
|
|
140
148
|
};
|
|
141
|
-
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.SETTINGS, saveData);
|
|
149
|
+
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.SETTINGS, saveData, options);
|
|
142
150
|
}
|
|
143
|
-
setGlobalAudioSettings(settings) {
|
|
151
|
+
setGlobalAudioSettings(settings, options) {
|
|
144
152
|
let acceptedType = 'NONE';
|
|
145
153
|
if (settings.type === 'source' && settings.source) {
|
|
146
154
|
if ((0, utils_1.isClip)(settings.source)) {
|
|
@@ -156,9 +164,9 @@ class CamSwitcherAPI {
|
|
|
156
164
|
clip_name: settings.source,
|
|
157
165
|
storage: settings.storage,
|
|
158
166
|
};
|
|
159
|
-
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.MASTER_AUDIO, data);
|
|
167
|
+
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.MASTER_AUDIO, data, options);
|
|
160
168
|
}
|
|
161
|
-
setSecondaryAudioSettings(settings) {
|
|
169
|
+
setSecondaryAudioSettings(settings, options) {
|
|
162
170
|
const data = {
|
|
163
171
|
type: settings.type,
|
|
164
172
|
stream_name: settings.streamName ?? '',
|
|
@@ -167,34 +175,34 @@ class CamSwitcherAPI {
|
|
|
167
175
|
secondary_audio_level: settings.secondaryAudioLevel,
|
|
168
176
|
master_audio_level: settings.masterAudioLevel,
|
|
169
177
|
};
|
|
170
|
-
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.SECONDARY_AUDIO, data);
|
|
178
|
+
return this.setParamFromCameraJSON(CSW_PARAM_NAMES.SECONDARY_AUDIO, data, options);
|
|
171
179
|
}
|
|
172
|
-
setDefaultPlaylist(id) {
|
|
180
|
+
setDefaultPlaylist(id, options) {
|
|
173
181
|
const value = JSON.stringify({ default_playlist_id: id });
|
|
174
182
|
return this.vapixAgent.setParameter({
|
|
175
183
|
[CSW_PARAM_NAMES.DEFAULT_PLAYLIST]: value,
|
|
176
|
-
},
|
|
184
|
+
}, options);
|
|
177
185
|
}
|
|
178
|
-
setPermanentRtspUrlToken(token) {
|
|
179
|
-
return this.vapixAgent.setParameter({ [CSW_PARAM_NAMES.RTSP_TOKEN]: token },
|
|
186
|
+
setPermanentRtspUrlToken(token, options) {
|
|
187
|
+
return this.vapixAgent.setParameter({ [CSW_PARAM_NAMES.RTSP_TOKEN]: token }, options);
|
|
180
188
|
}
|
|
181
|
-
async getCamSwitchOptions() {
|
|
182
|
-
const saveData = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.SETTINGS);
|
|
183
|
-
if ((0,
|
|
189
|
+
async getCamSwitchOptions(options) {
|
|
190
|
+
const saveData = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.SETTINGS, options);
|
|
191
|
+
if ((0, utils_1.isNullish)(saveData.video)) {
|
|
184
192
|
return saveData;
|
|
185
193
|
}
|
|
186
|
-
if (!(0,
|
|
194
|
+
if (!(0, utils_1.isNullish)(saveData.video?.bitrateVapixParams)) {
|
|
187
195
|
const bitrateOptions = parseVapixParamsToBitrateOptions(saveData.video.bitrateVapixParams);
|
|
188
196
|
saveData.video.bitrateMode = bitrateOptions.bitrateMode;
|
|
189
197
|
saveData.video.maximumBitRate = bitrateOptions.maximumBitRate;
|
|
190
198
|
saveData.video.retentionTime = bitrateOptions.retentionTime;
|
|
191
199
|
saveData.video.bitRateLimit = bitrateOptions.bitRateLimit;
|
|
192
200
|
}
|
|
193
|
-
if (!(0,
|
|
201
|
+
if (!(0, utils_1.isNullish)(saveData.video?.bitrateLimit)) {
|
|
194
202
|
saveData.video.maximumBitRate = saveData.video.bitrateLimit;
|
|
195
203
|
saveData.video.bitrateMode = 'MBR';
|
|
196
204
|
}
|
|
197
|
-
if (!(0,
|
|
205
|
+
if (!(0, utils_1.isNullish)(saveData.video?.videoClipQuality)) {
|
|
198
206
|
saveData.video.maximumBitRate = saveData.video.videoClipQuality;
|
|
199
207
|
}
|
|
200
208
|
return {
|
|
@@ -204,12 +212,12 @@ class CamSwitcherAPI {
|
|
|
204
212
|
keyboard: saveData.keyboard,
|
|
205
213
|
};
|
|
206
214
|
}
|
|
207
|
-
async getGlobalAudioSettings() {
|
|
215
|
+
async getGlobalAudioSettings(options) {
|
|
208
216
|
const settings = {
|
|
209
217
|
type: 'fromSource',
|
|
210
218
|
source: 'fromSource',
|
|
211
219
|
};
|
|
212
|
-
const res = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.MASTER_AUDIO);
|
|
220
|
+
const res = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.MASTER_AUDIO, options);
|
|
213
221
|
if (res.type === 'STREAM') {
|
|
214
222
|
settings.type = 'source';
|
|
215
223
|
settings.source = res.stream_name;
|
|
@@ -221,8 +229,8 @@ class CamSwitcherAPI {
|
|
|
221
229
|
}
|
|
222
230
|
return settings;
|
|
223
231
|
}
|
|
224
|
-
async getSecondaryAudioSettings() {
|
|
225
|
-
const res = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.SECONDARY_AUDIO);
|
|
232
|
+
async getSecondaryAudioSettings(options) {
|
|
233
|
+
const res = await this.getParamFromCameraAndJSONParse(CSW_PARAM_NAMES.SECONDARY_AUDIO, options);
|
|
226
234
|
const settings = {
|
|
227
235
|
type: res.type ?? 'NONE',
|
|
228
236
|
streamName: res.stream_name,
|
|
@@ -233,38 +241,40 @@ class CamSwitcherAPI {
|
|
|
233
241
|
};
|
|
234
242
|
return settings;
|
|
235
243
|
}
|
|
236
|
-
async getPermanentRtspUrlToken() {
|
|
244
|
+
async getPermanentRtspUrlToken(options) {
|
|
237
245
|
const paramName = CSW_PARAM_NAMES.RTSP_TOKEN;
|
|
238
|
-
const res = await this.vapixAgent.getParameter([paramName],
|
|
246
|
+
const res = await this.vapixAgent.getParameter([paramName], options);
|
|
239
247
|
return res[paramName] ?? '';
|
|
240
248
|
}
|
|
241
|
-
async get(path, parameters
|
|
242
|
-
const
|
|
249
|
+
async get(path, parameters, options) {
|
|
250
|
+
const agent = this.getAgent(options?.proxyParams);
|
|
251
|
+
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
243
252
|
if (res.ok) {
|
|
244
253
|
const d = (await res.json());
|
|
245
254
|
return d.data;
|
|
246
255
|
}
|
|
247
256
|
else {
|
|
248
|
-
throw new Error(await (0,
|
|
257
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
249
258
|
}
|
|
250
259
|
}
|
|
251
|
-
async set(path, data, parameters
|
|
252
|
-
const
|
|
260
|
+
async set(path, data, parameters, options) {
|
|
261
|
+
const agent = this.getAgent(options?.proxyParams);
|
|
262
|
+
const res = await agent.post({ path, data: JSON.stringify(data), parameters, timeout: options?.timeout });
|
|
253
263
|
if (res.ok) {
|
|
254
264
|
const parsed = await res.json();
|
|
255
265
|
return parsed.message === 'OK';
|
|
256
266
|
}
|
|
257
267
|
else {
|
|
258
|
-
throw new Error(await (0,
|
|
268
|
+
throw new Error(await (0, utils_1.responseStringify)(res));
|
|
259
269
|
}
|
|
260
270
|
}
|
|
261
|
-
setParamFromCameraJSON(paramName, data) {
|
|
271
|
+
setParamFromCameraJSON(paramName, data, options) {
|
|
262
272
|
const params = {};
|
|
263
273
|
params[paramName] = JSON.stringify(data);
|
|
264
|
-
return this.vapixAgent.setParameter(params,
|
|
274
|
+
return this.vapixAgent.setParameter(params, options);
|
|
265
275
|
}
|
|
266
|
-
async getParamFromCameraAndJSONParse(paramName) {
|
|
267
|
-
const data = await this.vapixAgent.getParameter([paramName],
|
|
276
|
+
async getParamFromCameraAndJSONParse(paramName, options) {
|
|
277
|
+
const data = await this.vapixAgent.getParameter([paramName], options);
|
|
268
278
|
if (data[paramName] !== undefined) {
|
|
269
279
|
try {
|
|
270
280
|
if (data[paramName] === '') {
|
|
@@ -280,6 +290,9 @@ class CamSwitcherAPI {
|
|
|
280
290
|
}
|
|
281
291
|
throw new Error("Error: no parametr '" + paramName + "' was found");
|
|
282
292
|
}
|
|
293
|
+
getAgent(proxyParams) {
|
|
294
|
+
return proxyParams ? new ProxyClient_1.ProxyClient(this.client, proxyParams) : this.client;
|
|
295
|
+
}
|
|
283
296
|
}
|
|
284
297
|
exports.CamSwitcherAPI = CamSwitcherAPI;
|
|
285
298
|
const CSW_PARAM_NAMES = {
|
|
@@ -296,16 +309,12 @@ const parseBitrateOptionsToBitrateVapixParams = (firmWareVersion, bitrateMode, c
|
|
|
296
309
|
if (bitrateMode === null) {
|
|
297
310
|
return '';
|
|
298
311
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if (bitrateMode === 'ABR') {
|
|
306
|
-
return `videobitratemode=abr&videoabrtargetbitrate=${cameraOptions.maximumBitRate}&videoabrretentiontime=${cameraOptions.retentionTime}&videoabrmaxbitrate=${cameraOptions.bitRateLimit}`;
|
|
307
|
-
}
|
|
308
|
-
throw new Error('Unknown bitrateMode param in getVapixParams method.');
|
|
312
|
+
const data = {
|
|
313
|
+
VBR: 'videobitratemode=vbr',
|
|
314
|
+
MBR: `videobitratemode=mbr&videomaxbitrate=${cameraOptions.maximumBitRate}`,
|
|
315
|
+
ABR: `videobitratemode=abr&videoabrtargetbitrate=${cameraOptions.maximumBitRate}&videoabrretentiontime=${cameraOptions.retentionTime}&videoabrmaxbitrate=${cameraOptions.bitRateLimit}`,
|
|
316
|
+
};
|
|
317
|
+
return data[bitrateMode];
|
|
309
318
|
};
|
|
310
319
|
const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
|
|
311
320
|
const params = {};
|
|
@@ -316,7 +325,7 @@ const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
|
|
|
316
325
|
const bitrateMode = params['videobitratemode'] !== undefined ? params['videobitratemode'].toUpperCase() : undefined;
|
|
317
326
|
const hasLowerFw = bitrateMode === undefined && params['videomaxbitrate'] !== undefined;
|
|
318
327
|
if (hasLowerFw) {
|
|
319
|
-
const maximumBitRate = parseInt(params['videomaxbitrate'], 10);
|
|
328
|
+
const maximumBitRate = parseInt(params['videomaxbitrate'] ?? '0', 10);
|
|
320
329
|
return {
|
|
321
330
|
bitrateMode: 'MBR',
|
|
322
331
|
maximumBitRate: maximumBitRate,
|
|
@@ -325,19 +334,19 @@ const parseVapixParamsToBitrateOptions = (bitrateVapixParams) => {
|
|
|
325
334
|
};
|
|
326
335
|
}
|
|
327
336
|
if (bitrateMode === 'ABR') {
|
|
328
|
-
const maximumBitRate = parseInt(params['videoabrtargetbitrate'], 10);
|
|
329
|
-
const retentionTime = parseInt(params['videoabrretentiontime'], 10);
|
|
330
|
-
const
|
|
337
|
+
const maximumBitRate = parseInt(params['videoabrtargetbitrate'] ?? '0', 10);
|
|
338
|
+
const retentionTime = parseInt(params['videoabrretentiontime'] ?? '0', 10);
|
|
339
|
+
const bitRateLimit = parseInt(params['videoabrmaxbitrate'] ?? '0', 10);
|
|
331
340
|
return {
|
|
332
|
-
bitrateMode
|
|
333
|
-
maximumBitRate
|
|
334
|
-
retentionTime
|
|
335
|
-
bitRateLimit
|
|
341
|
+
bitrateMode,
|
|
342
|
+
maximumBitRate,
|
|
343
|
+
retentionTime,
|
|
344
|
+
bitRateLimit,
|
|
336
345
|
};
|
|
337
346
|
}
|
|
338
347
|
else if (bitrateMode === 'MBR') {
|
|
339
|
-
const maximumBitRate = parseInt(params['videomaxbitrate'], 10);
|
|
340
|
-
const oldMaximumBitrateParamValue = parseInt(params['videombrmaxbitrate'], 10);
|
|
348
|
+
const maximumBitRate = params['videomaxbitrate'] !== undefined ? parseInt(params['videomaxbitrate'], 10) : null;
|
|
349
|
+
const oldMaximumBitrateParamValue = parseInt(params['videombrmaxbitrate'] ?? '0', 10);
|
|
341
350
|
return {
|
|
342
351
|
bitrateMode: bitrateMode,
|
|
343
352
|
maximumBitRate: maximumBitRate ?? oldMaximumBitrateParamValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IWebsocket } from './internal/
|
|
1
|
+
import { IWebsocket } from './internal/types';
|
|
2
2
|
import { TCamSwitcherEventOfType, TCamSwitcherEventType } from './types/CamSwitcherEvents';
|
|
3
3
|
type TListenerFunction<T extends TCamSwitcherEventType> = (data: TCamSwitcherEventOfType<T>, isInit: boolean) => void;
|
|
4
4
|
export declare class CamSwitcherEvents<Event extends {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IClient, TBlobResponse, TParameters, TResponse } from './internal/types';
|
|
2
|
+
import { ICAO, TApiUser, TExportDataType, TImportDataType } from './types/PlaneTrackerAPI';
|
|
3
|
+
import { THttpRequestOptions } from './types/common';
|
|
4
|
+
export declare class PlaneTrackerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
|
|
5
|
+
private client;
|
|
6
|
+
private apiUser;
|
|
7
|
+
constructor(client: Client, apiUser: TApiUser);
|
|
8
|
+
static getProxyUrlPath: () => string;
|
|
9
|
+
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
10
|
+
resetPtzCalibration: (options?: THttpRequestOptions) => Promise<TResponse>;
|
|
11
|
+
resetFocusCalibration: (options?: THttpRequestOptions) => Promise<TResponse>;
|
|
12
|
+
serverRunCheck: (options?: THttpRequestOptions) => Promise<TResponse>;
|
|
13
|
+
getLiveViewAlias: (rtspUrl: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
14
|
+
fetchCameraSettings: (options?: THttpRequestOptions) => Promise<any>;
|
|
15
|
+
setCameraSettings: (settingsJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
16
|
+
fetchServerSettings: (options?: THttpRequestOptions) => Promise<any>;
|
|
17
|
+
exportAppSettings: (dataType: TExportDataType, options?: THttpRequestOptions) => Promise<TBlobResponse<Client>>;
|
|
18
|
+
importAppSettings: (dataType: TImportDataType, formData: FormData, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
19
|
+
fetchFlightInfo: (icao: ICAO, options?: THttpRequestOptions) => Promise<any>;
|
|
20
|
+
getTrackingMode: (options?: THttpRequestOptions) => Promise<any>;
|
|
21
|
+
setTrackingMode: (modeJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
22
|
+
startTrackingPlane: (icao: ICAO, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
23
|
+
stopTrackingPlane: (options?: THttpRequestOptions) => Promise<TResponse>;
|
|
24
|
+
getPriorityList: (options?: THttpRequestOptions) => Promise<any>;
|
|
25
|
+
setPriorityList: (priorityListJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
26
|
+
getWhiteList: (options?: THttpRequestOptions) => Promise<any>;
|
|
27
|
+
setWhiteList: (whiteListJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
28
|
+
getBlackList: (options?: THttpRequestOptions) => Promise<any>;
|
|
29
|
+
setBlackList: (blackListJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
30
|
+
fetchMapInfo: (options?: THttpRequestOptions) => Promise<any>;
|
|
31
|
+
getZones: (options?: THttpRequestOptions) => Promise<any>;
|
|
32
|
+
setZones: (zonesJsonString: string, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
33
|
+
goToCoordinates: (lat: number, lon: number, alt?: number, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
34
|
+
checkGenetecConnection: (params: TParameters, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
35
|
+
getGenetecCameraList: (params: TParameters, options?: THttpRequestOptions) => Promise<any>;
|
|
36
|
+
private _getJson;
|
|
37
|
+
private _getBlob;
|
|
38
|
+
private parseBlobResponse;
|
|
39
|
+
private _postJsonEncoded;
|
|
40
|
+
private _postUrlEncoded;
|
|
41
|
+
private getAgent;
|
|
42
|
+
}
|