camstreamerlib 4.0.34 → 4.0.35-38dd1fb
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 +2 -1
- package/cjs/CamSwitcherAPI.js +2 -0
- package/cjs/PlaneTrackerAPI.d.ts +43 -10
- package/cjs/PlaneTrackerAPI.js +2 -1
- package/cjs/VapixAPI.js +4 -2
- package/cjs/errors/errors.js +4 -4
- package/cjs/types/CamSwitcherAPI.d.ts +7 -4
- package/cjs/types/CamSwitcherAPI.js +1 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +205 -39
- package/cjs/types/PlaneTrackerAPI.js +61 -22
- package/cjs/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/cjs/types/PlaneTrackerAPI.test.js +90 -0
- package/cjs/types/common.d.ts +13 -0
- package/cjs/types/common.js +6 -1
- package/esm/CamOverlayAPI.js +17 -1
- package/esm/CamSwitcherAPI.js +2 -0
- package/esm/PlaneTrackerAPI.js +2 -1
- package/esm/VapixAPI.js +4 -2
- package/esm/errors/errors.js +4 -4
- package/esm/types/CamSwitcherAPI.js +1 -0
- package/esm/types/PlaneTrackerAPI.js +60 -21
- package/esm/types/PlaneTrackerAPI.test.js +88 -0
- package/esm/types/common.js +5 -0
- package/package.json +107 -110
- package/types/CamOverlayAPI.d.ts +6 -0
- package/types/CamSwitcherAPI.d.ts +2 -1
- package/types/PlaneTrackerAPI.d.ts +43 -10
- package/types/types/CamSwitcherAPI.d.ts +7 -4
- package/types/types/PlaneTrackerAPI.d.ts +205 -39
- package/types/types/PlaneTrackerAPI.test.d.ts +1 -0
- package/types/types/common.d.ts +13 -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;
|
|
@@ -161,6 +161,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse, any>> exte
|
|
|
161
161
|
bitrateVapixParams?: string | null | undefined;
|
|
162
162
|
audioSampleRate?: number | undefined;
|
|
163
163
|
audioChannelCount?: 1 | 2 | undefined;
|
|
164
|
+
audioBitrate?: number | undefined;
|
|
164
165
|
} | undefined>;
|
|
165
166
|
getGlobalAudioSettings(options?: THttpRequestOptions): Promise<{
|
|
166
167
|
type: "source" | "fromSource";
|
package/cjs/CamSwitcherAPI.js
CHANGED
|
@@ -156,6 +156,7 @@ class CamSwitcherAPI extends BasicAPI_1.BasicAPI {
|
|
|
156
156
|
audio: {
|
|
157
157
|
sampleRate: data.audioSampleRate,
|
|
158
158
|
channelCount: data.audioChannelCount,
|
|
159
|
+
bitrate: data.audioBitrate,
|
|
159
160
|
},
|
|
160
161
|
keyboard: data.keyboard,
|
|
161
162
|
};
|
|
@@ -207,6 +208,7 @@ class CamSwitcherAPI extends BasicAPI_1.BasicAPI {
|
|
|
207
208
|
const settings = {
|
|
208
209
|
audioSampleRate: saveData.audio?.sampleRate,
|
|
209
210
|
audioChannelCount: saveData.audio?.channelCount,
|
|
211
|
+
audioBitrate: saveData.audio?.bitrate,
|
|
210
212
|
keyboard: saveData.keyboard,
|
|
211
213
|
fps: saveData.video.fps,
|
|
212
214
|
resolution: saveData.video.resolution,
|
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>;
|
|
@@ -45,8 +45,23 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
45
45
|
focusCalibrationPoints: string;
|
|
46
46
|
};
|
|
47
47
|
cameraConfig: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
aircraft: {
|
|
49
|
+
defaultCaptureSizeMeters: number;
|
|
50
|
+
captureSizeExtensionMeters: number;
|
|
51
|
+
};
|
|
52
|
+
drone: {
|
|
53
|
+
defaultCaptureSizeMeters: number;
|
|
54
|
+
captureSizeExtensionMeters: number;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
aircraft: {
|
|
58
|
+
defaultCaptureSizeMeters: number;
|
|
59
|
+
captureSizeExtensionMeters: number;
|
|
60
|
+
};
|
|
61
|
+
drone: {
|
|
62
|
+
defaultCaptureSizeMeters: number;
|
|
63
|
+
captureSizeExtensionMeters: number;
|
|
64
|
+
};
|
|
50
65
|
};
|
|
51
66
|
stream: {
|
|
52
67
|
width: number;
|
|
@@ -99,11 +114,29 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
99
114
|
priority: number;
|
|
100
115
|
};
|
|
101
116
|
identificationLabel: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
aircraft: {
|
|
118
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
119
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
120
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
121
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
122
|
+
opacity: number;
|
|
123
|
+
};
|
|
124
|
+
drone: {
|
|
125
|
+
firstRow: "blank" | "remote_id";
|
|
126
|
+
opacity: number;
|
|
127
|
+
};
|
|
128
|
+
} | {
|
|
129
|
+
aircraft: {
|
|
130
|
+
firstRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
131
|
+
secondRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
132
|
+
thirdRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
133
|
+
fourthRow: "blank" | "registration" | "call_sign" | "flight_number" | "icao";
|
|
134
|
+
opacity: number;
|
|
135
|
+
};
|
|
136
|
+
drone: {
|
|
137
|
+
firstRow: "blank" | "remote_id";
|
|
138
|
+
opacity: number;
|
|
139
|
+
};
|
|
107
140
|
};
|
|
108
141
|
acs: {
|
|
109
142
|
ip: string;
|
|
@@ -181,11 +214,11 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
181
214
|
importAppSettings(dataType: TImportDataType, formData: Parameters<Client['post']>[0]['data'], options?: THttpRequestOptions): Promise<void>;
|
|
182
215
|
getDomainList(options?: THttpRequestOptions): Promise<Partial<Record<"adsb" | "remoteId", {
|
|
183
216
|
uiName: string;
|
|
184
|
-
icon: "unknown" | "small" | "
|
|
217
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
185
218
|
categoryList: {
|
|
186
219
|
categoryId: string;
|
|
187
220
|
uiName: string;
|
|
188
|
-
icon: "unknown" | "small" | "
|
|
221
|
+
icon: "unknown" | "small" | "drone" | "large" | "heavy" | "helicopter" | "operator" | "vehicle";
|
|
189
222
|
}[];
|
|
190
223
|
}>>>;
|
|
191
224
|
fetchFlightInfo(targetId: string, options?: THttpRequestOptions): Promise<{
|
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);
|
package/cjs/VapixAPI.js
CHANGED
|
@@ -93,7 +93,9 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
93
93
|
};
|
|
94
94
|
await this._postJsonEncoded('/axis-cgi/opticscontrol.cgi', data, undefined, options);
|
|
95
95
|
}
|
|
96
|
-
catch {
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.warn('Failed to perform autofocus: ', error instanceof Error ? error.message : String(error));
|
|
98
|
+
console.warn('Falling back to deprecated optics setup API');
|
|
97
99
|
await this._postUrlEncoded('/axis-cgi/opticssetup.cgi', {
|
|
98
100
|
autofocus: 'perform',
|
|
99
101
|
source: '1',
|
|
@@ -144,7 +146,7 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
144
146
|
return data.data.activeTimeZone;
|
|
145
147
|
}
|
|
146
148
|
catch (error) {
|
|
147
|
-
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message :
|
|
149
|
+
console.warn('Failed to fetch time zone data from time API v2:', error instanceof Error ? error.message : String(error));
|
|
148
150
|
console.warn('Falling back to deprecated time API v1');
|
|
149
151
|
}
|
|
150
152
|
try {
|
package/cjs/errors/errors.js
CHANGED
|
@@ -26,7 +26,7 @@ class ServiceNotFoundError extends Error {
|
|
|
26
26
|
exports.ServiceNotFoundError = ServiceNotFoundError;
|
|
27
27
|
class ParsingBlobError extends Error {
|
|
28
28
|
constructor(err) {
|
|
29
|
-
super('Error parsing response as Blob: ' + err);
|
|
29
|
+
super('Error parsing response as Blob: ' + String(err));
|
|
30
30
|
this.name = 'ParsingBlobError';
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -99,7 +99,7 @@ class NoDeviceInfoError extends Error {
|
|
|
99
99
|
exports.NoDeviceInfoError = NoDeviceInfoError;
|
|
100
100
|
class FetchDeviceInfoError extends Error {
|
|
101
101
|
constructor(err) {
|
|
102
|
-
super('Error fetching remote camera data: ' + err);
|
|
102
|
+
super('Error fetching remote camera data: ' + String(err));
|
|
103
103
|
this.name = 'NoDeviceInfoFromCameraError';
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -127,7 +127,7 @@ class PtzNotSupportedError extends Error {
|
|
|
127
127
|
exports.PtzNotSupportedError = PtzNotSupportedError;
|
|
128
128
|
class StorageDataFetchError extends Error {
|
|
129
129
|
constructor(err) {
|
|
130
|
-
super('Error fetching storage data: ' + err);
|
|
130
|
+
super('Error fetching storage data: ' + String(err));
|
|
131
131
|
this.name = 'StorageDataFetchError';
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -155,7 +155,7 @@ class TimezoneNotSetupError extends Error {
|
|
|
155
155
|
exports.TimezoneNotSetupError = TimezoneNotSetupError;
|
|
156
156
|
class TimezoneFetchError extends Error {
|
|
157
157
|
constructor(err) {
|
|
158
|
-
super('Error fetching time zone information: ' + err);
|
|
158
|
+
super('Error fetching time zone information: ' + String(err));
|
|
159
159
|
this.name = 'TimezoneFetchError';
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -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<{
|
|
@@ -785,6 +785,7 @@ export declare const cameraOptionsSchema: z.ZodObject<{
|
|
|
785
785
|
bitrateVapixParams: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
786
786
|
audioSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
787
787
|
audioChannelCount: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
788
|
+
audioBitrate: z.ZodOptional<z.ZodNumber>;
|
|
788
789
|
keyboard: z.ZodOptional<z.ZodObject<{
|
|
789
790
|
fromSource: z.ZodNullable<z.ZodString>;
|
|
790
791
|
none: z.ZodNullable<z.ZodString>;
|
|
@@ -812,6 +813,7 @@ export declare const cameraOptionsSchema: z.ZodObject<{
|
|
|
812
813
|
bitrateVapixParams?: string | null | undefined;
|
|
813
814
|
audioSampleRate?: number | undefined;
|
|
814
815
|
audioChannelCount?: 1 | 2 | undefined;
|
|
816
|
+
audioBitrate?: number | undefined;
|
|
815
817
|
}, {
|
|
816
818
|
resolution?: string | undefined;
|
|
817
819
|
compression?: number | undefined;
|
|
@@ -829,6 +831,7 @@ export declare const cameraOptionsSchema: z.ZodObject<{
|
|
|
829
831
|
bitrateVapixParams?: string | null | undefined;
|
|
830
832
|
audioSampleRate?: number | undefined;
|
|
831
833
|
audioChannelCount?: 1 | 2 | undefined;
|
|
834
|
+
audioBitrate?: number | undefined;
|
|
832
835
|
}>;
|
|
833
836
|
export type TCameraOptions = z.infer<typeof cameraOptionsSchema>;
|
|
834
837
|
export declare const globalAudioSettingsTypeSchema: z.ZodUnion<[z.ZodLiteral<"fromSource">, z.ZodLiteral<"source">]>;
|
|
@@ -145,6 +145,7 @@ exports.cameraOptionsSchema = common_1.bitrateVapixParamsSchema
|
|
|
145
145
|
bitrateVapixParams: zod_1.z.string().nullable(),
|
|
146
146
|
audioSampleRate: zod_1.z.number(),
|
|
147
147
|
audioChannelCount: common_1.audioChannelCountSchema,
|
|
148
|
+
audioBitrate: zod_1.z.number().int().nonnegative(),
|
|
148
149
|
keyboard: zod_1.z.object({
|
|
149
150
|
fromSource: common_1.keyboardShortcutSchema,
|
|
150
151
|
none: common_1.keyboardShortcutSchema,
|