camstreamerlib 4.0.14 → 4.0.15
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/CamStreamerAPI.js +9 -0
- package/cjs/PlaneTrackerAPI.d.ts +1 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +5 -0
- package/cjs/types/PlaneTrackerAPI.js +1 -0
- package/esm/CamStreamerAPI.js +9 -0
- package/esm/types/PlaneTrackerAPI.js +1 -0
- package/package.json +1 -1
- package/types/PlaneTrackerAPI.d.ts +1 -0
- package/types/types/PlaneTrackerAPI.d.ts +5 -0
package/cjs/CamStreamerAPI.js
CHANGED
|
@@ -37,6 +37,9 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
37
37
|
}
|
|
38
38
|
async isCSPassValid(pass, options) {
|
|
39
39
|
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
40
|
+
if (res.status !== 200) {
|
|
41
|
+
throw new Error(res.message);
|
|
42
|
+
}
|
|
40
43
|
return res.data === '1';
|
|
41
44
|
}
|
|
42
45
|
async getCamStreamerAppLog(options) {
|
|
@@ -44,6 +47,9 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
44
47
|
}
|
|
45
48
|
async getStreamList(options) {
|
|
46
49
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
|
|
50
|
+
if (res.status !== 200) {
|
|
51
|
+
throw new Error(res.message);
|
|
52
|
+
}
|
|
47
53
|
const oldStreamListRecord = zod_1.z.record(zod_1.z.string(), oldStreamSchema_1.oldStringStreamSchema).safeParse(res.data);
|
|
48
54
|
if (oldStreamListRecord.success) {
|
|
49
55
|
const data = Object.entries(oldStreamListRecord.data).map(([streamId, streamData]) => ({
|
|
@@ -88,6 +94,9 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
88
94
|
}
|
|
89
95
|
async getStream(streamId, options) {
|
|
90
96
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get', stream_id: streamId }, options);
|
|
97
|
+
if (res.status !== 200) {
|
|
98
|
+
throw new Error(res.message);
|
|
99
|
+
}
|
|
91
100
|
const newStream = CamStreamerAPI_1.streamSchema.safeParse(res.data);
|
|
92
101
|
if (newStream.success) {
|
|
93
102
|
return newStream.data;
|
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
117
117
|
displayIcao?: boolean | undefined;
|
|
118
118
|
displayRegistration?: boolean | undefined;
|
|
119
119
|
displayFlightNumber?: boolean | undefined;
|
|
120
|
+
displayCallsign?: boolean | undefined;
|
|
120
121
|
displayAltitude?: boolean | undefined;
|
|
121
122
|
displayVelocity?: boolean | undefined;
|
|
122
123
|
displayDistance?: boolean | undefined;
|
|
@@ -177,6 +177,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
177
177
|
displayIcao: z.ZodOptional<z.ZodBoolean>;
|
|
178
178
|
displayRegistration: z.ZodOptional<z.ZodBoolean>;
|
|
179
179
|
displayFlightNumber: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
displayCallsign: z.ZodOptional<z.ZodBoolean>;
|
|
180
181
|
displayAltitude: z.ZodOptional<z.ZodBoolean>;
|
|
181
182
|
displayVelocity: z.ZodOptional<z.ZodBoolean>;
|
|
182
183
|
displayDistance: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -199,6 +200,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
199
200
|
displayIcao?: boolean | undefined;
|
|
200
201
|
displayRegistration?: boolean | undefined;
|
|
201
202
|
displayFlightNumber?: boolean | undefined;
|
|
203
|
+
displayCallsign?: boolean | undefined;
|
|
202
204
|
displayAltitude?: boolean | undefined;
|
|
203
205
|
displayVelocity?: boolean | undefined;
|
|
204
206
|
displayDistance?: boolean | undefined;
|
|
@@ -221,6 +223,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
221
223
|
displayIcao?: boolean | undefined;
|
|
222
224
|
displayRegistration?: boolean | undefined;
|
|
223
225
|
displayFlightNumber?: boolean | undefined;
|
|
226
|
+
displayCallsign?: boolean | undefined;
|
|
224
227
|
displayAltitude?: boolean | undefined;
|
|
225
228
|
displayVelocity?: boolean | undefined;
|
|
226
229
|
displayDistance?: boolean | undefined;
|
|
@@ -470,6 +473,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
470
473
|
displayIcao?: boolean | undefined;
|
|
471
474
|
displayRegistration?: boolean | undefined;
|
|
472
475
|
displayFlightNumber?: boolean | undefined;
|
|
476
|
+
displayCallsign?: boolean | undefined;
|
|
473
477
|
displayAltitude?: boolean | undefined;
|
|
474
478
|
displayVelocity?: boolean | undefined;
|
|
475
479
|
displayDistance?: boolean | undefined;
|
|
@@ -540,6 +544,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
540
544
|
displayIcao?: boolean | undefined;
|
|
541
545
|
displayRegistration?: boolean | undefined;
|
|
542
546
|
displayFlightNumber?: boolean | undefined;
|
|
547
|
+
displayCallsign?: boolean | undefined;
|
|
543
548
|
displayAltitude?: boolean | undefined;
|
|
544
549
|
displayVelocity?: boolean | undefined;
|
|
545
550
|
displayDistance?: boolean | undefined;
|
|
@@ -120,6 +120,7 @@ exports.cameraSettingsSchema = zod_1.z.object({
|
|
|
120
120
|
displayIcao: zod_1.z.boolean().optional(),
|
|
121
121
|
displayRegistration: zod_1.z.boolean().optional(),
|
|
122
122
|
displayFlightNumber: zod_1.z.boolean().optional(),
|
|
123
|
+
displayCallsign: zod_1.z.boolean().optional(),
|
|
123
124
|
displayAltitude: zod_1.z.boolean().optional(),
|
|
124
125
|
displayVelocity: zod_1.z.boolean().optional(),
|
|
125
126
|
displayDistance: zod_1.z.boolean().optional(),
|
package/esm/CamStreamerAPI.js
CHANGED
|
@@ -34,6 +34,9 @@ export class CamStreamerAPI extends BasicAPI {
|
|
|
34
34
|
}
|
|
35
35
|
async isCSPassValid(pass, options) {
|
|
36
36
|
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
37
|
+
if (res.status !== 200) {
|
|
38
|
+
throw new Error(res.message);
|
|
39
|
+
}
|
|
37
40
|
return res.data === '1';
|
|
38
41
|
}
|
|
39
42
|
async getCamStreamerAppLog(options) {
|
|
@@ -41,6 +44,9 @@ export class CamStreamerAPI extends BasicAPI {
|
|
|
41
44
|
}
|
|
42
45
|
async getStreamList(options) {
|
|
43
46
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
|
|
47
|
+
if (res.status !== 200) {
|
|
48
|
+
throw new Error(res.message);
|
|
49
|
+
}
|
|
44
50
|
const oldStreamListRecord = z.record(z.string(), oldStringStreamSchema).safeParse(res.data);
|
|
45
51
|
if (oldStreamListRecord.success) {
|
|
46
52
|
const data = Object.entries(oldStreamListRecord.data).map(([streamId, streamData]) => ({
|
|
@@ -85,6 +91,9 @@ export class CamStreamerAPI extends BasicAPI {
|
|
|
85
91
|
}
|
|
86
92
|
async getStream(streamId, options) {
|
|
87
93
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get', stream_id: streamId }, options);
|
|
94
|
+
if (res.status !== 200) {
|
|
95
|
+
throw new Error(res.message);
|
|
96
|
+
}
|
|
88
97
|
const newStream = streamSchema.safeParse(res.data);
|
|
89
98
|
if (newStream.success) {
|
|
90
99
|
return newStream.data;
|
|
@@ -117,6 +117,7 @@ export const cameraSettingsSchema = z.object({
|
|
|
117
117
|
displayIcao: z.boolean().optional(),
|
|
118
118
|
displayRegistration: z.boolean().optional(),
|
|
119
119
|
displayFlightNumber: z.boolean().optional(),
|
|
120
|
+
displayCallsign: z.boolean().optional(),
|
|
120
121
|
displayAltitude: z.boolean().optional(),
|
|
121
122
|
displayVelocity: z.boolean().optional(),
|
|
122
123
|
displayDistance: z.boolean().optional(),
|
package/package.json
CHANGED
|
@@ -117,6 +117,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
117
117
|
displayIcao?: boolean | undefined;
|
|
118
118
|
displayRegistration?: boolean | undefined;
|
|
119
119
|
displayFlightNumber?: boolean | undefined;
|
|
120
|
+
displayCallsign?: boolean | undefined;
|
|
120
121
|
displayAltitude?: boolean | undefined;
|
|
121
122
|
displayVelocity?: boolean | undefined;
|
|
122
123
|
displayDistance?: boolean | undefined;
|
|
@@ -177,6 +177,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
177
177
|
displayIcao: z.ZodOptional<z.ZodBoolean>;
|
|
178
178
|
displayRegistration: z.ZodOptional<z.ZodBoolean>;
|
|
179
179
|
displayFlightNumber: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
displayCallsign: z.ZodOptional<z.ZodBoolean>;
|
|
180
181
|
displayAltitude: z.ZodOptional<z.ZodBoolean>;
|
|
181
182
|
displayVelocity: z.ZodOptional<z.ZodBoolean>;
|
|
182
183
|
displayDistance: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -199,6 +200,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
199
200
|
displayIcao?: boolean | undefined;
|
|
200
201
|
displayRegistration?: boolean | undefined;
|
|
201
202
|
displayFlightNumber?: boolean | undefined;
|
|
203
|
+
displayCallsign?: boolean | undefined;
|
|
202
204
|
displayAltitude?: boolean | undefined;
|
|
203
205
|
displayVelocity?: boolean | undefined;
|
|
204
206
|
displayDistance?: boolean | undefined;
|
|
@@ -221,6 +223,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
221
223
|
displayIcao?: boolean | undefined;
|
|
222
224
|
displayRegistration?: boolean | undefined;
|
|
223
225
|
displayFlightNumber?: boolean | undefined;
|
|
226
|
+
displayCallsign?: boolean | undefined;
|
|
224
227
|
displayAltitude?: boolean | undefined;
|
|
225
228
|
displayVelocity?: boolean | undefined;
|
|
226
229
|
displayDistance?: boolean | undefined;
|
|
@@ -470,6 +473,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
470
473
|
displayIcao?: boolean | undefined;
|
|
471
474
|
displayRegistration?: boolean | undefined;
|
|
472
475
|
displayFlightNumber?: boolean | undefined;
|
|
476
|
+
displayCallsign?: boolean | undefined;
|
|
473
477
|
displayAltitude?: boolean | undefined;
|
|
474
478
|
displayVelocity?: boolean | undefined;
|
|
475
479
|
displayDistance?: boolean | undefined;
|
|
@@ -540,6 +544,7 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
540
544
|
displayIcao?: boolean | undefined;
|
|
541
545
|
displayRegistration?: boolean | undefined;
|
|
542
546
|
displayFlightNumber?: boolean | undefined;
|
|
547
|
+
displayCallsign?: boolean | undefined;
|
|
543
548
|
displayAltitude?: boolean | undefined;
|
|
544
549
|
displayVelocity?: boolean | undefined;
|
|
545
550
|
displayDistance?: boolean | undefined;
|