camstreamerlib 4.0.7 → 4.0.8
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/PlaneTrackerAPI.d.ts +12 -1
- package/cjs/PlaneTrackerAPI.js +23 -3
- package/cjs/types/PlaneTrackerAPI.d.ts +84 -9
- package/cjs/types/PlaneTrackerAPI.js +14 -1
- package/cjs/types/ws/PlaneTrackerEvents.d.ts +2205 -589
- package/cjs/types/ws/PlaneTrackerEvents.js +48 -77
- package/cjs/ws/PlaneTrackerEvents.js +1 -9
- package/esm/PlaneTrackerAPI.js +24 -4
- package/esm/types/PlaneTrackerAPI.js +13 -0
- package/esm/types/ws/PlaneTrackerEvents.js +47 -76
- package/esm/ws/PlaneTrackerEvents.js +2 -10
- package/package.json +1 -1
- package/types/PlaneTrackerAPI.d.ts +12 -1
- package/types/types/PlaneTrackerAPI.d.ts +84 -9
- package/types/types/ws/PlaneTrackerEvents.d.ts +2205 -589
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -158,7 +158,16 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
158
158
|
}>;
|
|
159
159
|
exportAppSettings(dataType: TExportDataType, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
160
160
|
importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
|
|
161
|
-
|
|
161
|
+
getDomainList(options?: THttpRequestOptions): Promise<Partial<Record<"adsb" | "remoteId", {
|
|
162
|
+
uiName: string;
|
|
163
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
164
|
+
categoryList: {
|
|
165
|
+
categoryId: string;
|
|
166
|
+
uiName: string;
|
|
167
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
168
|
+
}[];
|
|
169
|
+
}>>>;
|
|
170
|
+
fetchFlightInfo(targetId: string, options?: THttpRequestOptions): Promise<{
|
|
162
171
|
destinationAirport: {
|
|
163
172
|
icao?: string | undefined;
|
|
164
173
|
iata?: string | undefined;
|
|
@@ -185,6 +194,8 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
185
194
|
setTrackingMode(mode: TTrackingMode['mode'], options?: THttpRequestOptions): Promise<void>;
|
|
186
195
|
startTrackingPlane(icao: ICAO, options?: THttpRequestOptions): Promise<void>;
|
|
187
196
|
stopTrackingPlane(options?: THttpRequestOptions): Promise<void>;
|
|
197
|
+
startTrackingTarget(targetId: string, options?: THttpRequestOptions): Promise<void>;
|
|
198
|
+
stopTrackingTarget(options?: THttpRequestOptions): Promise<void>;
|
|
188
199
|
getIcao(by: TGetIcaoByOption, value: string, options?: THttpRequestOptions): Promise<string>;
|
|
189
200
|
getPriorityList(options?: THttpRequestOptions): Promise<{
|
|
190
201
|
list: {
|
package/cjs/PlaneTrackerAPI.js
CHANGED
|
@@ -88,8 +88,12 @@ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
|
|
|
88
88
|
throw new errors_1.ImportSettingsError(res);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
async
|
|
92
|
-
const res = await this._getJson(`${BASE_PATH}/
|
|
91
|
+
async getDomainList(options) {
|
|
92
|
+
const res = await this._getJson(`${BASE_PATH}/getDomainList.cgi`, { action: 'get' }, options);
|
|
93
|
+
return PlaneTrackerAPI_1.domainListSchema.parse(res);
|
|
94
|
+
}
|
|
95
|
+
async fetchFlightInfo(targetId, options) {
|
|
96
|
+
const res = await this._getJson(`${BASE_PATH}/package/flightInfo.cgi`, { targetId }, options);
|
|
93
97
|
return PlaneTrackerAPI_1.flightInfoSchema.parse(res);
|
|
94
98
|
}
|
|
95
99
|
async getTrackingMode(options) {
|
|
@@ -115,9 +119,25 @@ class PlaneTrackerAPI extends BasicAPI_1.BasicAPI {
|
|
|
115
119
|
timeout: options?.timeout,
|
|
116
120
|
});
|
|
117
121
|
}
|
|
122
|
+
async startTrackingTarget(targetId, options) {
|
|
123
|
+
const agent = this.getClient(options?.proxyParams);
|
|
124
|
+
await agent.get({
|
|
125
|
+
path: `${BASE_PATH}/package/trackTarget.cgi`,
|
|
126
|
+
parameters: { targetId, ...this.apiUser },
|
|
127
|
+
timeout: options?.timeout,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async stopTrackingTarget(options) {
|
|
131
|
+
const agent = this.getClient(options?.proxyParams);
|
|
132
|
+
await agent.get({
|
|
133
|
+
path: `${BASE_PATH}/package/resetTarget.cgi`,
|
|
134
|
+
parameters: this.apiUser,
|
|
135
|
+
timeout: options?.timeout,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
118
138
|
async getIcao(by, value, options) {
|
|
119
139
|
const res = await this._getJson(`${BASE_PATH}/package/getIcao.cgi`, { [by]: value }, options);
|
|
120
|
-
return PlaneTrackerAPI_1.getIcaoSchema.parse(res).
|
|
140
|
+
return PlaneTrackerAPI_1.getIcaoSchema.parse(res).targetId;
|
|
121
141
|
}
|
|
122
142
|
async getPriorityList(options) {
|
|
123
143
|
const res = await this._getJson(`${BASE_PATH}/package/getPriorityList.cgi`, undefined, options);
|
|
@@ -701,10 +701,13 @@ export type TServerSettings = z.infer<typeof serverSettingsSchema>;
|
|
|
701
701
|
export type ICAO = string;
|
|
702
702
|
export declare const getIcaoSchema: z.ZodObject<{
|
|
703
703
|
icao: z.ZodString;
|
|
704
|
+
targetId: z.ZodString;
|
|
704
705
|
}, "strip", z.ZodTypeAny, {
|
|
705
706
|
icao: string;
|
|
707
|
+
targetId: string;
|
|
706
708
|
}, {
|
|
707
709
|
icao: string;
|
|
710
|
+
targetId: string;
|
|
708
711
|
}>;
|
|
709
712
|
export type TGetIcaoByOption = 'registration' | 'callsign';
|
|
710
713
|
export declare const trackingModeSchema: z.ZodObject<{
|
|
@@ -1037,18 +1040,90 @@ export declare const zonesSchema: z.ZodObject<{
|
|
|
1037
1040
|
export type TZones = z.infer<typeof zonesSchema>;
|
|
1038
1041
|
export declare const domainIdSchema: z.ZodEnum<["adsb", "remoteId"]>;
|
|
1039
1042
|
export type TDomainId = z.infer<typeof domainIdSchema>;
|
|
1040
|
-
|
|
1041
|
-
export type
|
|
1043
|
+
declare const categoryIconSchema: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1044
|
+
export type TCategoryIcon = z.infer<typeof categoryIconSchema>;
|
|
1045
|
+
declare const categoryDescriptorSchema: z.ZodObject<{
|
|
1046
|
+
categoryId: z.ZodString;
|
|
1047
|
+
uiName: z.ZodString;
|
|
1048
|
+
icon: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1049
|
+
}, "strip", z.ZodTypeAny, {
|
|
1042
1050
|
categoryId: string;
|
|
1043
1051
|
uiName: string;
|
|
1044
|
-
icon:
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1052
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1053
|
+
}, {
|
|
1054
|
+
categoryId: string;
|
|
1047
1055
|
uiName: string;
|
|
1048
|
-
icon:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1056
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1057
|
+
}>;
|
|
1058
|
+
export type TCategoryDescriptor = z.infer<typeof categoryDescriptorSchema>;
|
|
1059
|
+
declare const domainDescriptorSchema: z.ZodObject<{
|
|
1060
|
+
uiName: z.ZodString;
|
|
1061
|
+
icon: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1062
|
+
categoryList: z.ZodArray<z.ZodObject<{
|
|
1063
|
+
categoryId: z.ZodString;
|
|
1064
|
+
uiName: z.ZodString;
|
|
1065
|
+
icon: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1066
|
+
}, "strip", z.ZodTypeAny, {
|
|
1067
|
+
categoryId: string;
|
|
1068
|
+
uiName: string;
|
|
1069
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1070
|
+
}, {
|
|
1071
|
+
categoryId: string;
|
|
1072
|
+
uiName: string;
|
|
1073
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1074
|
+
}>, "many">;
|
|
1075
|
+
}, "strip", z.ZodTypeAny, {
|
|
1076
|
+
uiName: string;
|
|
1077
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1078
|
+
categoryList: {
|
|
1079
|
+
categoryId: string;
|
|
1080
|
+
uiName: string;
|
|
1081
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1082
|
+
}[];
|
|
1083
|
+
}, {
|
|
1084
|
+
uiName: string;
|
|
1085
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1086
|
+
categoryList: {
|
|
1087
|
+
categoryId: string;
|
|
1088
|
+
uiName: string;
|
|
1089
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1090
|
+
}[];
|
|
1091
|
+
}>;
|
|
1092
|
+
export type TDomainDescriptor = z.infer<typeof domainDescriptorSchema>;
|
|
1093
|
+
export declare const domainListSchema: z.ZodRecord<z.ZodEnum<["adsb", "remoteId"]>, z.ZodObject<{
|
|
1094
|
+
uiName: z.ZodString;
|
|
1095
|
+
icon: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1096
|
+
categoryList: z.ZodArray<z.ZodObject<{
|
|
1097
|
+
categoryId: z.ZodString;
|
|
1098
|
+
uiName: z.ZodString;
|
|
1099
|
+
icon: z.ZodEnum<["small", "large", "heavy", "helicopter", "drone", "operator", "unknown"]>;
|
|
1100
|
+
}, "strip", z.ZodTypeAny, {
|
|
1101
|
+
categoryId: string;
|
|
1102
|
+
uiName: string;
|
|
1103
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1104
|
+
}, {
|
|
1105
|
+
categoryId: string;
|
|
1106
|
+
uiName: string;
|
|
1107
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1108
|
+
}>, "many">;
|
|
1109
|
+
}, "strip", z.ZodTypeAny, {
|
|
1110
|
+
uiName: string;
|
|
1111
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1112
|
+
categoryList: {
|
|
1113
|
+
categoryId: string;
|
|
1114
|
+
uiName: string;
|
|
1115
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1116
|
+
}[];
|
|
1117
|
+
}, {
|
|
1118
|
+
uiName: string;
|
|
1119
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1120
|
+
categoryList: {
|
|
1121
|
+
categoryId: string;
|
|
1122
|
+
uiName: string;
|
|
1123
|
+
icon: "unknown" | "small" | "large" | "heavy" | "helicopter" | "drone" | "operator";
|
|
1124
|
+
}[];
|
|
1125
|
+
}>>;
|
|
1126
|
+
export type TDomainList = z.infer<typeof domainListSchema>;
|
|
1052
1127
|
export declare const ADSB_CATEGORY_IDS: {
|
|
1053
1128
|
readonly A_LIGHT: "A_LIGHT";
|
|
1054
1129
|
readonly A_SMALL: "A_SMALL";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainIdSchema = exports.zonesSchema = exports.mapInfoSchema = exports.mapTypeSchema = 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.connectionSchema = exports.wsAliasResponseSchema = void 0;
|
|
3
|
+
exports.REMOTE_ID_CATEGORY_IDS = exports.ADSB_CATEGORY_IDS = exports.domainListSchema = exports.domainIdSchema = exports.zonesSchema = exports.mapInfoSchema = exports.mapTypeSchema = 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.connectionSchema = exports.wsAliasResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.wsAliasResponseSchema = zod_1.z.object({
|
|
6
6
|
alias: zod_1.z.string(),
|
|
@@ -251,6 +251,7 @@ exports.serverSettingsSchema = zod_1.z.object({
|
|
|
251
251
|
});
|
|
252
252
|
exports.getIcaoSchema = zod_1.z.object({
|
|
253
253
|
icao: zod_1.z.string(),
|
|
254
|
+
targetId: zod_1.z.string(),
|
|
254
255
|
});
|
|
255
256
|
exports.trackingModeSchema = zod_1.z.object({
|
|
256
257
|
mode: zod_1.z.union([zod_1.z.literal('MANUAL'), zod_1.z.literal('AUTOMATIC')]).default('AUTOMATIC'),
|
|
@@ -327,6 +328,18 @@ exports.zonesSchema = zod_1.z.object({
|
|
|
327
328
|
.default([]),
|
|
328
329
|
});
|
|
329
330
|
exports.domainIdSchema = zod_1.z.enum(['adsb', 'remoteId']);
|
|
331
|
+
const categoryIconSchema = zod_1.z.enum(['small', 'large', 'heavy', 'helicopter', 'drone', 'operator', 'unknown']);
|
|
332
|
+
const categoryDescriptorSchema = zod_1.z.object({
|
|
333
|
+
categoryId: zod_1.z.string(),
|
|
334
|
+
uiName: zod_1.z.string(),
|
|
335
|
+
icon: categoryIconSchema,
|
|
336
|
+
});
|
|
337
|
+
const domainDescriptorSchema = zod_1.z.object({
|
|
338
|
+
uiName: zod_1.z.string(),
|
|
339
|
+
icon: categoryIconSchema,
|
|
340
|
+
categoryList: zod_1.z.array(categoryDescriptorSchema),
|
|
341
|
+
});
|
|
342
|
+
exports.domainListSchema = zod_1.z.record(exports.domainIdSchema, domainDescriptorSchema);
|
|
330
343
|
exports.ADSB_CATEGORY_IDS = {
|
|
331
344
|
A_LIGHT: 'A_LIGHT',
|
|
332
345
|
A_SMALL: 'A_SMALL',
|