camstreamerlib 4.0.33-4b63673 → 4.0.33-71913af
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/CamOverlayAPI.d.ts +6 -0
- package/cjs/CamOverlayAPI.js +16 -0
- package/cjs/CamSwitcherAPI.d.ts +1 -1
- package/cjs/PlaneTrackerAPI.d.ts +1 -1
- package/cjs/PlaneTrackerAPI.js +2 -1
- package/cjs/types/CamSwitcherAPI.d.ts +4 -4
- package/cjs/types/PlaneTrackerAPI.d.ts +0 -13
- package/cjs/types/PlaneTrackerAPI.js +1 -6
- package/cjs/types/common.d.ts +13 -0
- package/cjs/types/common.js +6 -1
- package/cjs/types/ws/PlaneTrackerEvents.d.ts +11 -0
- package/cjs/types/ws/PlaneTrackerEvents.js +1 -0
- package/esm/CamOverlayAPI.js +17 -1
- package/esm/PlaneTrackerAPI.js +2 -1
- package/esm/types/PlaneTrackerAPI.js +0 -5
- package/esm/types/common.js +5 -0
- package/esm/types/ws/PlaneTrackerEvents.js +1 -0
- package/package.json +1 -1
- package/types/CamOverlayAPI.d.ts +6 -0
- package/types/CamSwitcherAPI.d.ts +1 -1
- package/types/PlaneTrackerAPI.d.ts +1 -1
- package/types/types/CamSwitcherAPI.d.ts +4 -4
- package/types/types/PlaneTrackerAPI.d.ts +0 -13
- package/types/types/common.d.ts +13 -0
- package/types/types/ws/PlaneTrackerEvents.d.ts +11 -0
package/cjs/CamOverlayAPI.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> exten
|
|
|
14
14
|
}[]>;
|
|
15
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
16
16
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
17
|
+
isViewerPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
18
|
+
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
19
|
+
alias: string;
|
|
20
|
+
ws: string;
|
|
21
|
+
ws_initial_message: string;
|
|
22
|
+
}>;
|
|
17
23
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
18
24
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
19
25
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
package/cjs/CamOverlayAPI.js
CHANGED
|
@@ -29,6 +29,22 @@ class CamOverlayAPI extends BasicAPI_1.BasicAPI {
|
|
|
29
29
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
30
30
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
31
31
|
}
|
|
32
|
+
async isViewerPassValid(pass, options) {
|
|
33
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
34
|
+
if (res.status !== 200) {
|
|
35
|
+
throw new Error(res.message);
|
|
36
|
+
}
|
|
37
|
+
return res.data === '1';
|
|
38
|
+
}
|
|
39
|
+
async getLiveViewAlias(rtspUrl, options) {
|
|
40
|
+
const agent = this.getClient(options?.proxyParams);
|
|
41
|
+
const res = await agent.get({
|
|
42
|
+
path: `${BASE_PATH}/getLiveViewAlias.cgi`,
|
|
43
|
+
parameters: { rtsp_url: rtspUrl },
|
|
44
|
+
timeout: options?.timeout,
|
|
45
|
+
});
|
|
46
|
+
return common_1.wsAliasResponseSchema.parse(await res.json());
|
|
47
|
+
}
|
|
32
48
|
async listFiles(fileType, options) {
|
|
33
49
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
34
50
|
return (0, CamOverlayAPI_1.getFileListSchema)(fileType).parse(res.list);
|
package/cjs/CamSwitcherAPI.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> exte
|
|
|
28
28
|
}[]>;
|
|
29
29
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
30
30
|
getOutputInfo(options?: THttpRequestOptions): Promise<{
|
|
31
|
-
rtspUrl: string;
|
|
32
31
|
ws: string;
|
|
33
32
|
wsInitialMessage: string;
|
|
33
|
+
rtspUrl: string;
|
|
34
34
|
}>;
|
|
35
35
|
getAudioPushInfo(options?: THttpRequestOptions): Promise<{
|
|
36
36
|
ws: string;
|
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
12
12
|
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
13
13
|
serverRunCheck(options?: THttpRequestOptions): Promise<boolean>;
|
|
14
14
|
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
15
|
+
alias: string;
|
|
15
16
|
ws: string;
|
|
16
17
|
ws_initial_message: string;
|
|
17
|
-
alias: string;
|
|
18
18
|
}>;
|
|
19
19
|
resetPtzCalibration(options?: THttpRequestOptions): Promise<void>;
|
|
20
20
|
resetFocusCalibration(options?: THttpRequestOptions): Promise<void>;
|
package/cjs/PlaneTrackerAPI.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.PlaneTrackerAPI = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const PlaneTrackerAPI_1 = require("./types/PlaneTrackerAPI");
|
|
6
6
|
const errors_1 = require("./errors/errors");
|
|
7
|
+
const common_1 = require("./types/common");
|
|
7
8
|
const BasicAPI_1 = require("./internal/BasicAPI");
|
|
8
9
|
const PlaneTrackerEvents_1 = require("./types/ws/PlaneTrackerEvents");
|
|
9
10
|
const BASE_PATH = '/local/planetracker';
|
|
@@ -37,7 +38,7 @@ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
|
|
|
37
38
|
parameters: { rtsp_url: rtspUrl },
|
|
38
39
|
timeout: options?.timeout,
|
|
39
40
|
});
|
|
40
|
-
return
|
|
41
|
+
return common_1.wsAliasResponseSchema.parse(await res.json());
|
|
41
42
|
}
|
|
42
43
|
async resetPtzCalibration(options) {
|
|
43
44
|
const agent = this.getClient(options?.proxyParams);
|
|
@@ -25,21 +25,21 @@ export declare const outputInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
|
25
25
|
ws: z.ZodString;
|
|
26
26
|
ws_initial_message: z.ZodString;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
rtsp_url: string;
|
|
29
28
|
ws: string;
|
|
30
29
|
ws_initial_message: string;
|
|
31
|
-
}, {
|
|
32
30
|
rtsp_url: string;
|
|
31
|
+
}, {
|
|
33
32
|
ws: string;
|
|
34
33
|
ws_initial_message: string;
|
|
34
|
+
rtsp_url: string;
|
|
35
35
|
}>, {
|
|
36
|
-
rtspUrl: string;
|
|
37
36
|
ws: string;
|
|
38
37
|
wsInitialMessage: string;
|
|
38
|
+
rtspUrl: string;
|
|
39
39
|
}, {
|
|
40
|
-
rtsp_url: string;
|
|
41
40
|
ws: string;
|
|
42
41
|
ws_initial_message: string;
|
|
42
|
+
rtsp_url: string;
|
|
43
43
|
}>;
|
|
44
44
|
export type TOutputInfo = z.infer<typeof outputInfoSchema>;
|
|
45
45
|
export declare const audioPushInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export type TImportDataType = 'MAP_DATA' | 'SERVER_DATA' | 'ALL';
|
|
3
3
|
export type TExportDataType = 'NIGHT_SKY_CALIBRATION_DATA' | 'ALL';
|
|
4
|
-
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
5
|
-
alias: z.ZodString;
|
|
6
|
-
ws: z.ZodString;
|
|
7
|
-
ws_initial_message: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
ws: string;
|
|
10
|
-
ws_initial_message: string;
|
|
11
|
-
alias: string;
|
|
12
|
-
}, {
|
|
13
|
-
ws: string;
|
|
14
|
-
ws_initial_message: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
}>;
|
|
17
4
|
export declare const connectionSchema: z.ZodObject<{
|
|
18
5
|
protocol: z.ZodUnion<[z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodLiteral<"https_insecure">]>;
|
|
19
6
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainListSchema = exports.zonesSchema = exports.zonePerimeterSchema = exports.domainIdSchema = exports.mapInfoSchema = exports.mapTypeSchema = exports.friendlyListSchema = exports.priorityListSchema = exports.blackListSchema = exports.whiteListSchema = exports.priorityListEntrySchema = exports.listEntrySchema = exports.listEntryIdTypeSchema = exports.listEntryDomainSchema = exports.flightInfoSchema = exports.trackingModeSchema = exports.getIcaoSchema = exports.serverSettingsSchema = exports.cameraSettingsSchema = exports.widgetSchema = exports.milestoneCameraListSchema = exports.connectionSchema =
|
|
3
|
+
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainListSchema = exports.zonesSchema = exports.zonePerimeterSchema = exports.domainIdSchema = exports.mapInfoSchema = exports.mapTypeSchema = exports.friendlyListSchema = exports.priorityListSchema = exports.blackListSchema = exports.whiteListSchema = exports.priorityListEntrySchema = exports.listEntrySchema = exports.listEntryIdTypeSchema = exports.listEntryDomainSchema = exports.flightInfoSchema = exports.trackingModeSchema = exports.getIcaoSchema = exports.serverSettingsSchema = exports.cameraSettingsSchema = exports.widgetSchema = exports.milestoneCameraListSchema = exports.connectionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.wsAliasResponseSchema = zod_1.z.object({
|
|
6
|
-
alias: zod_1.z.string(),
|
|
7
|
-
ws: zod_1.z.string(),
|
|
8
|
-
ws_initial_message: zod_1.z.string(),
|
|
9
|
-
});
|
|
10
5
|
exports.connectionSchema = zod_1.z.object({
|
|
11
6
|
protocol: zod_1.z.union([zod_1.z.literal('http'), zod_1.z.literal('https'), zod_1.z.literal('https_insecure')]),
|
|
12
7
|
ip: zod_1.z.union([zod_1.z.string().ip(), zod_1.z.literal('')]),
|
package/cjs/types/common.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export declare const keyboardShortcutSchema: z.ZodNullable<z.ZodString>;
|
|
|
26
26
|
export declare const keyboardShortcutsSchema: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
27
27
|
export type TKeyboardShortcut = z.infer<typeof keyboardShortcutSchema>;
|
|
28
28
|
export type TKeyboardShortcuts = z.infer<typeof keyboardShortcutsSchema>;
|
|
29
|
+
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
30
|
+
alias: z.ZodString;
|
|
31
|
+
ws: z.ZodString;
|
|
32
|
+
ws_initial_message: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
alias: string;
|
|
35
|
+
ws: string;
|
|
36
|
+
ws_initial_message: string;
|
|
37
|
+
}, {
|
|
38
|
+
alias: string;
|
|
39
|
+
ws: string;
|
|
40
|
+
ws_initial_message: string;
|
|
41
|
+
}>;
|
|
29
42
|
export type TProxyTarget = {
|
|
30
43
|
ip: string;
|
|
31
44
|
mdnsName: string;
|
package/cjs/types/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fileSchema = exports.bitrateVapixParamsSchema = exports.bitrateModeSchema = exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.sdCardStorageTypeSchema = exports.flashStorageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = exports.booleanSchema = void 0;
|
|
3
|
+
exports.fileSchema = exports.bitrateVapixParamsSchema = exports.bitrateModeSchema = exports.wsAliasResponseSchema = exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.sdCardStorageTypeSchema = exports.flashStorageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = exports.booleanSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.booleanSchema = zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]);
|
|
6
6
|
exports.audioChannelSchema = zod_1.z.union([zod_1.z.literal('mono'), zod_1.z.literal('stereo')]);
|
|
@@ -15,6 +15,11 @@ exports.networkCameraListSchema = zod_1.z.array(zod_1.z.object({
|
|
|
15
15
|
}));
|
|
16
16
|
exports.keyboardShortcutSchema = zod_1.z.string().nullable();
|
|
17
17
|
exports.keyboardShortcutsSchema = zod_1.z.record(exports.keyboardShortcutSchema);
|
|
18
|
+
exports.wsAliasResponseSchema = zod_1.z.object({
|
|
19
|
+
alias: zod_1.z.string(),
|
|
20
|
+
ws: zod_1.z.string(),
|
|
21
|
+
ws_initial_message: zod_1.z.string(),
|
|
22
|
+
});
|
|
18
23
|
exports.bitrateModeSchema = zod_1.z.union([zod_1.z.literal('VBR'), zod_1.z.literal('MBR'), zod_1.z.literal('ABR')]);
|
|
19
24
|
exports.bitrateVapixParamsSchema = zod_1.z.object({
|
|
20
25
|
bitrateMode: exports.bitrateModeSchema,
|
|
@@ -181,6 +181,7 @@ declare const eventsDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
181
181
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
182
182
|
icao: z.ZodString;
|
|
183
183
|
targetId: z.ZodString;
|
|
184
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
184
185
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
185
186
|
categoryId: z.ZodString;
|
|
186
187
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -189,12 +190,14 @@ declare const eventsDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
189
190
|
targetId: string;
|
|
190
191
|
domain: "adsb" | "remoteId";
|
|
191
192
|
categoryId: string;
|
|
193
|
+
callsign?: string | undefined;
|
|
192
194
|
}, {
|
|
193
195
|
type: "TRACKING_START";
|
|
194
196
|
icao: string;
|
|
195
197
|
targetId: string;
|
|
196
198
|
domain: "adsb" | "remoteId";
|
|
197
199
|
categoryId: string;
|
|
200
|
+
callsign?: string | undefined;
|
|
198
201
|
}>, z.ZodObject<{
|
|
199
202
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
200
203
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1342,6 +1345,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1342
1345
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
1343
1346
|
icao: z.ZodString;
|
|
1344
1347
|
targetId: z.ZodString;
|
|
1348
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
1345
1349
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
1346
1350
|
categoryId: z.ZodString;
|
|
1347
1351
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1350,12 +1354,14 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1350
1354
|
targetId: string;
|
|
1351
1355
|
domain: "adsb" | "remoteId";
|
|
1352
1356
|
categoryId: string;
|
|
1357
|
+
callsign?: string | undefined;
|
|
1353
1358
|
}, {
|
|
1354
1359
|
type: "TRACKING_START";
|
|
1355
1360
|
icao: string;
|
|
1356
1361
|
targetId: string;
|
|
1357
1362
|
domain: "adsb" | "remoteId";
|
|
1358
1363
|
categoryId: string;
|
|
1364
|
+
callsign?: string | undefined;
|
|
1359
1365
|
}>, z.ZodObject<{
|
|
1360
1366
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
1361
1367
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2488,6 +2494,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2488
2494
|
targetId: string;
|
|
2489
2495
|
domain: "adsb" | "remoteId";
|
|
2490
2496
|
categoryId: string;
|
|
2497
|
+
callsign?: string | undefined;
|
|
2491
2498
|
} | {
|
|
2492
2499
|
type: "TRACKING_STOP";
|
|
2493
2500
|
} | {
|
|
@@ -2752,6 +2759,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2752
2759
|
targetId: string;
|
|
2753
2760
|
domain: "adsb" | "remoteId";
|
|
2754
2761
|
categoryId: string;
|
|
2762
|
+
callsign?: string | undefined;
|
|
2755
2763
|
} | {
|
|
2756
2764
|
type: "TRACKING_STOP";
|
|
2757
2765
|
} | {
|
|
@@ -3029,6 +3037,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3029
3037
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
3030
3038
|
icao: z.ZodString;
|
|
3031
3039
|
targetId: z.ZodString;
|
|
3040
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
3032
3041
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
3033
3042
|
categoryId: z.ZodString;
|
|
3034
3043
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3037,12 +3046,14 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3037
3046
|
targetId: string;
|
|
3038
3047
|
domain: "adsb" | "remoteId";
|
|
3039
3048
|
categoryId: string;
|
|
3049
|
+
callsign?: string | undefined;
|
|
3040
3050
|
}, {
|
|
3041
3051
|
type: "TRACKING_START";
|
|
3042
3052
|
icao: string;
|
|
3043
3053
|
targetId: string;
|
|
3044
3054
|
domain: "adsb" | "remoteId";
|
|
3045
3055
|
categoryId: string;
|
|
3056
|
+
callsign?: string | undefined;
|
|
3046
3057
|
}>, z.ZodObject<{
|
|
3047
3058
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
3048
3059
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -83,6 +83,7 @@ const eventsDataSchema = zod_1.z.union([
|
|
|
83
83
|
type: zod_1.z.literal('TRACKING_START'),
|
|
84
84
|
icao: zod_1.z.string(),
|
|
85
85
|
targetId: zod_1.z.string(),
|
|
86
|
+
callsign: zod_1.z.string().optional(),
|
|
86
87
|
domain: PlaneTrackerAPI_1.domainIdSchema,
|
|
87
88
|
categoryId: zod_1.z.string(),
|
|
88
89
|
}),
|
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorWithResponse, ServiceNotFoundError, StorageDataFetchError } from './errors/errors';
|
|
2
|
-
import { networkCameraListSchema } from './types/common';
|
|
2
|
+
import { networkCameraListSchema, wsAliasResponseSchema } from './types/common';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { ImageType, serviceListSchema, servicesSchema, wsResponseSchema, getStorageDataListSchema, getFileListSchema, } from './types/CamOverlayAPI';
|
|
5
5
|
import { BasicAPI } from './internal/BasicAPI';
|
|
@@ -26,6 +26,22 @@ export class CamOverlayAPI extends BasicAPI {
|
|
|
26
26
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
27
27
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
28
28
|
}
|
|
29
|
+
async isViewerPassValid(pass, options) {
|
|
30
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
31
|
+
if (res.status !== 200) {
|
|
32
|
+
throw new Error(res.message);
|
|
33
|
+
}
|
|
34
|
+
return res.data === '1';
|
|
35
|
+
}
|
|
36
|
+
async getLiveViewAlias(rtspUrl, options) {
|
|
37
|
+
const agent = this.getClient(options?.proxyParams);
|
|
38
|
+
const res = await agent.get({
|
|
39
|
+
path: `${BASE_PATH}/getLiveViewAlias.cgi`,
|
|
40
|
+
parameters: { rtsp_url: rtspUrl },
|
|
41
|
+
timeout: options?.timeout,
|
|
42
|
+
});
|
|
43
|
+
return wsAliasResponseSchema.parse(await res.json());
|
|
44
|
+
}
|
|
29
45
|
async listFiles(fileType, options) {
|
|
30
46
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
31
47
|
return getFileListSchema(fileType).parse(res.list);
|
package/esm/PlaneTrackerAPI.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { blackListSchema, cameraSettingsSchema, domainListSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, milestoneCameraListSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, whiteListSchema,
|
|
2
|
+
import { blackListSchema, cameraSettingsSchema, domainListSchema, flightInfoSchema, getIcaoSchema, mapInfoSchema, milestoneCameraListSchema, priorityListSchema, serverSettingsSchema, trackingModeSchema, whiteListSchema, zonesSchema, } from './types/PlaneTrackerAPI';
|
|
3
3
|
import { CannotSetCoordsInAutoModeError, ImportSettingsError, InvalidAltitudeError, InvalidLatLngError, ResetCalibrationError, ServerError, BadRequestError, } from './errors/errors';
|
|
4
|
+
import { wsAliasResponseSchema } from './types/common';
|
|
4
5
|
import { BasicAPI } from './internal/BasicAPI';
|
|
5
6
|
import { apiUserInputSchema } from './types/ws/PlaneTrackerEvents';
|
|
6
7
|
const BASE_PATH = '/local/planetracker';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const wsAliasResponseSchema = z.object({
|
|
3
|
-
alias: z.string(),
|
|
4
|
-
ws: z.string(),
|
|
5
|
-
ws_initial_message: z.string(),
|
|
6
|
-
});
|
|
7
2
|
export const connectionSchema = z.object({
|
|
8
3
|
protocol: z.union([z.literal('http'), z.literal('https'), z.literal('https_insecure')]),
|
|
9
4
|
ip: z.union([z.string().ip(), z.literal('')]),
|
package/esm/types/common.js
CHANGED
|
@@ -12,6 +12,11 @@ export const networkCameraListSchema = z.array(z.object({
|
|
|
12
12
|
}));
|
|
13
13
|
export const keyboardShortcutSchema = z.string().nullable();
|
|
14
14
|
export const keyboardShortcutsSchema = z.record(keyboardShortcutSchema);
|
|
15
|
+
export const wsAliasResponseSchema = z.object({
|
|
16
|
+
alias: z.string(),
|
|
17
|
+
ws: z.string(),
|
|
18
|
+
ws_initial_message: z.string(),
|
|
19
|
+
});
|
|
15
20
|
export const bitrateModeSchema = z.union([z.literal('VBR'), z.literal('MBR'), z.literal('ABR')]);
|
|
16
21
|
export const bitrateVapixParamsSchema = z.object({
|
|
17
22
|
bitrateMode: bitrateModeSchema,
|
package/package.json
CHANGED
package/types/CamOverlayAPI.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> exten
|
|
|
14
14
|
}[]>;
|
|
15
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
16
16
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
17
|
+
isViewerPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
18
|
+
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
19
|
+
alias: string;
|
|
20
|
+
ws: string;
|
|
21
|
+
ws_initial_message: string;
|
|
22
|
+
}>;
|
|
17
23
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
18
24
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
19
25
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
|
@@ -28,9 +28,9 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> exte
|
|
|
28
28
|
}[]>;
|
|
29
29
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
30
30
|
getOutputInfo(options?: THttpRequestOptions): Promise<{
|
|
31
|
-
rtspUrl: string;
|
|
32
31
|
ws: string;
|
|
33
32
|
wsInitialMessage: string;
|
|
33
|
+
rtspUrl: string;
|
|
34
34
|
}>;
|
|
35
35
|
getAudioPushInfo(options?: THttpRequestOptions): Promise<{
|
|
36
36
|
ws: string;
|
|
@@ -12,9 +12,9 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
12
12
|
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
13
13
|
serverRunCheck(options?: THttpRequestOptions): Promise<boolean>;
|
|
14
14
|
getLiveViewAlias(rtspUrl: string, options?: THttpRequestOptions): Promise<{
|
|
15
|
+
alias: string;
|
|
15
16
|
ws: string;
|
|
16
17
|
ws_initial_message: string;
|
|
17
|
-
alias: string;
|
|
18
18
|
}>;
|
|
19
19
|
resetPtzCalibration(options?: THttpRequestOptions): Promise<void>;
|
|
20
20
|
resetFocusCalibration(options?: THttpRequestOptions): Promise<void>;
|
|
@@ -25,21 +25,21 @@ export declare const outputInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
|
25
25
|
ws: z.ZodString;
|
|
26
26
|
ws_initial_message: z.ZodString;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
rtsp_url: string;
|
|
29
28
|
ws: string;
|
|
30
29
|
ws_initial_message: string;
|
|
31
|
-
}, {
|
|
32
30
|
rtsp_url: string;
|
|
31
|
+
}, {
|
|
33
32
|
ws: string;
|
|
34
33
|
ws_initial_message: string;
|
|
34
|
+
rtsp_url: string;
|
|
35
35
|
}>, {
|
|
36
|
-
rtspUrl: string;
|
|
37
36
|
ws: string;
|
|
38
37
|
wsInitialMessage: string;
|
|
38
|
+
rtspUrl: string;
|
|
39
39
|
}, {
|
|
40
|
-
rtsp_url: string;
|
|
41
40
|
ws: string;
|
|
42
41
|
ws_initial_message: string;
|
|
42
|
+
rtsp_url: string;
|
|
43
43
|
}>;
|
|
44
44
|
export type TOutputInfo = z.infer<typeof outputInfoSchema>;
|
|
45
45
|
export declare const audioPushInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export type TImportDataType = 'MAP_DATA' | 'SERVER_DATA' | 'ALL';
|
|
3
3
|
export type TExportDataType = 'NIGHT_SKY_CALIBRATION_DATA' | 'ALL';
|
|
4
|
-
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
5
|
-
alias: z.ZodString;
|
|
6
|
-
ws: z.ZodString;
|
|
7
|
-
ws_initial_message: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
ws: string;
|
|
10
|
-
ws_initial_message: string;
|
|
11
|
-
alias: string;
|
|
12
|
-
}, {
|
|
13
|
-
ws: string;
|
|
14
|
-
ws_initial_message: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
}>;
|
|
17
4
|
export declare const connectionSchema: z.ZodObject<{
|
|
18
5
|
protocol: z.ZodUnion<[z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodLiteral<"https_insecure">]>;
|
|
19
6
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
package/types/types/common.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export declare const keyboardShortcutSchema: z.ZodNullable<z.ZodString>;
|
|
|
26
26
|
export declare const keyboardShortcutsSchema: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
27
27
|
export type TKeyboardShortcut = z.infer<typeof keyboardShortcutSchema>;
|
|
28
28
|
export type TKeyboardShortcuts = z.infer<typeof keyboardShortcutsSchema>;
|
|
29
|
+
export declare const wsAliasResponseSchema: z.ZodObject<{
|
|
30
|
+
alias: z.ZodString;
|
|
31
|
+
ws: z.ZodString;
|
|
32
|
+
ws_initial_message: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
alias: string;
|
|
35
|
+
ws: string;
|
|
36
|
+
ws_initial_message: string;
|
|
37
|
+
}, {
|
|
38
|
+
alias: string;
|
|
39
|
+
ws: string;
|
|
40
|
+
ws_initial_message: string;
|
|
41
|
+
}>;
|
|
29
42
|
export type TProxyTarget = {
|
|
30
43
|
ip: string;
|
|
31
44
|
mdnsName: string;
|
|
@@ -181,6 +181,7 @@ declare const eventsDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
181
181
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
182
182
|
icao: z.ZodString;
|
|
183
183
|
targetId: z.ZodString;
|
|
184
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
184
185
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
185
186
|
categoryId: z.ZodString;
|
|
186
187
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -189,12 +190,14 @@ declare const eventsDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
189
190
|
targetId: string;
|
|
190
191
|
domain: "adsb" | "remoteId";
|
|
191
192
|
categoryId: string;
|
|
193
|
+
callsign?: string | undefined;
|
|
192
194
|
}, {
|
|
193
195
|
type: "TRACKING_START";
|
|
194
196
|
icao: string;
|
|
195
197
|
targetId: string;
|
|
196
198
|
domain: "adsb" | "remoteId";
|
|
197
199
|
categoryId: string;
|
|
200
|
+
callsign?: string | undefined;
|
|
198
201
|
}>, z.ZodObject<{
|
|
199
202
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
200
203
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1342,6 +1345,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1342
1345
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
1343
1346
|
icao: z.ZodString;
|
|
1344
1347
|
targetId: z.ZodString;
|
|
1348
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
1345
1349
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
1346
1350
|
categoryId: z.ZodString;
|
|
1347
1351
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1350,12 +1354,14 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1350
1354
|
targetId: string;
|
|
1351
1355
|
domain: "adsb" | "remoteId";
|
|
1352
1356
|
categoryId: string;
|
|
1357
|
+
callsign?: string | undefined;
|
|
1353
1358
|
}, {
|
|
1354
1359
|
type: "TRACKING_START";
|
|
1355
1360
|
icao: string;
|
|
1356
1361
|
targetId: string;
|
|
1357
1362
|
domain: "adsb" | "remoteId";
|
|
1358
1363
|
categoryId: string;
|
|
1364
|
+
callsign?: string | undefined;
|
|
1359
1365
|
}>, z.ZodObject<{
|
|
1360
1366
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
1361
1367
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2488,6 +2494,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2488
2494
|
targetId: string;
|
|
2489
2495
|
domain: "adsb" | "remoteId";
|
|
2490
2496
|
categoryId: string;
|
|
2497
|
+
callsign?: string | undefined;
|
|
2491
2498
|
} | {
|
|
2492
2499
|
type: "TRACKING_STOP";
|
|
2493
2500
|
} | {
|
|
@@ -2752,6 +2759,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2752
2759
|
targetId: string;
|
|
2753
2760
|
domain: "adsb" | "remoteId";
|
|
2754
2761
|
categoryId: string;
|
|
2762
|
+
callsign?: string | undefined;
|
|
2755
2763
|
} | {
|
|
2756
2764
|
type: "TRACKING_STOP";
|
|
2757
2765
|
} | {
|
|
@@ -3029,6 +3037,7 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3029
3037
|
type: z.ZodLiteral<"TRACKING_START">;
|
|
3030
3038
|
icao: z.ZodString;
|
|
3031
3039
|
targetId: z.ZodString;
|
|
3040
|
+
callsign: z.ZodOptional<z.ZodString>;
|
|
3032
3041
|
domain: z.ZodEnum<["adsb", "remoteId"]>;
|
|
3033
3042
|
categoryId: z.ZodString;
|
|
3034
3043
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3037,12 +3046,14 @@ export declare const ptrEventsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3037
3046
|
targetId: string;
|
|
3038
3047
|
domain: "adsb" | "remoteId";
|
|
3039
3048
|
categoryId: string;
|
|
3049
|
+
callsign?: string | undefined;
|
|
3040
3050
|
}, {
|
|
3041
3051
|
type: "TRACKING_START";
|
|
3042
3052
|
icao: string;
|
|
3043
3053
|
targetId: string;
|
|
3044
3054
|
domain: "adsb" | "remoteId";
|
|
3045
3055
|
categoryId: string;
|
|
3056
|
+
callsign?: string | undefined;
|
|
3046
3057
|
}>, z.ZodObject<{
|
|
3047
3058
|
type: z.ZodLiteral<"TRACKING_STOP">;
|
|
3048
3059
|
}, "strip", z.ZodTypeAny, {
|