camstreamerlib 4.0.0-beta.154 → 4.0.0-beta.155
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/CamScripterAPI.js +5 -1
- package/cjs/CamStreamerAPI.d.ts +1 -0
- package/cjs/CamStreamerAPI.js +4 -0
- package/cjs/PlaneTrackerAPI.d.ts +0 -1
- package/cjs/types/CamScripterAPI.d.ts +0 -11
- package/cjs/types/CamScripterAPI.js +1 -5
- package/cjs/types/PlaneTrackerAPI.d.ts +0 -3
- package/cjs/types/PlaneTrackerAPI.js +0 -1
- package/esm/CamScripterAPI.js +3 -2
- package/esm/CamStreamerAPI.js +4 -0
- package/esm/types/CamScripterAPI.js +0 -4
- package/esm/types/PlaneTrackerAPI.js +0 -1
- package/package.json +1 -1
- package/types/CamStreamerAPI.d.ts +1 -0
- package/types/PlaneTrackerAPI.d.ts +0 -1
- package/types/types/CamScripterAPI.d.ts +0 -11
- package/types/types/PlaneTrackerAPI.d.ts +0 -3
package/cjs/CamScripterAPI.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.CamScripterAPI = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
4
8
|
const BasicAPI_1 = require("./internal/BasicAPI");
|
|
5
9
|
const CamScripterAPI_1 = require("./types/CamScripterAPI");
|
|
6
10
|
const common_1 = require("./types/common");
|
|
@@ -12,7 +16,7 @@ class CamScripterAPI extends BasicAPI_1.BasicAPI {
|
|
|
12
16
|
}
|
|
13
17
|
async checkCameraTime(options) {
|
|
14
18
|
const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
15
|
-
return
|
|
19
|
+
return zod_1.default.boolean().parse(res.state);
|
|
16
20
|
}
|
|
17
21
|
async getNetworkCameraList(options) {
|
|
18
22
|
const res = await this._getJson(`${BASE_PATH}/network_camera_list.cgi`, undefined, options);
|
package/cjs/CamStreamerAPI.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
7
7
|
static getProxyPath: () => string;
|
|
8
8
|
static getWsEventsPath: () => string;
|
|
9
9
|
checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
|
|
10
|
+
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
10
11
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
11
12
|
getUtcTime(options?: THttpRequestOptions): Promise<number>;
|
|
12
13
|
getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
|
package/cjs/CamStreamerAPI.js
CHANGED
|
@@ -14,6 +14,10 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
14
14
|
async checkAPIAvailable(options) {
|
|
15
15
|
await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
|
|
16
16
|
}
|
|
17
|
+
async checkCameraTime(options) {
|
|
18
|
+
const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
19
|
+
return zod_1.z.boolean().parse(res.data?.state);
|
|
20
|
+
}
|
|
17
21
|
async wsAuthorization(options) {
|
|
18
22
|
const res = await this._getJson(`${BASE_PATH}/ws_authorization.cgi`, undefined, options);
|
|
19
23
|
if (res.status !== 200) {
|
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -117,14 +117,3 @@ export declare const camscripterApiResponseSchema: z.ZodObject<{
|
|
|
117
117
|
message: string;
|
|
118
118
|
}>;
|
|
119
119
|
export type TCamscripterApiResponse = z.infer<typeof camscripterApiResponseSchema>;
|
|
120
|
-
export declare const cameraTimeResponseSchema: z.ZodObject<{
|
|
121
|
-
state: z.ZodBoolean;
|
|
122
|
-
code: z.ZodNumber;
|
|
123
|
-
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
code: number;
|
|
125
|
-
state: boolean;
|
|
126
|
-
}, {
|
|
127
|
-
code: number;
|
|
128
|
-
state: boolean;
|
|
129
|
-
}>;
|
|
130
|
-
export type TCameraTimeResponse = z.infer<typeof cameraTimeResponseSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.camscripterApiResponseSchema = exports.cameraStorageSchema = exports.packageConfigSchema = exports.packageInfoListSchema = exports.nodeStateSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const common_1 = require("./common");
|
|
6
6
|
exports.nodeStateSchema = zod_1.z.object({
|
|
@@ -30,7 +30,3 @@ exports.camscripterApiResponseSchema = zod_1.z.object({
|
|
|
30
30
|
status: zod_1.z.number(),
|
|
31
31
|
message: zod_1.z.string(),
|
|
32
32
|
});
|
|
33
|
-
exports.cameraTimeResponseSchema = zod_1.z.object({
|
|
34
|
-
state: zod_1.z.boolean(),
|
|
35
|
-
code: zod_1.z.number(),
|
|
36
|
-
});
|
|
@@ -60,7 +60,6 @@ export declare const widgetSchema: z.ZodObject<{
|
|
|
60
60
|
declare const labelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"registration">, z.ZodLiteral<"call_sign">, z.ZodLiteral<"flight_number">, z.ZodLiteral<"icao">]>;
|
|
61
61
|
export type TLabelOption = z.infer<typeof labelOptionsSchema>;
|
|
62
62
|
export declare const cameraSettingsSchema: z.ZodObject<{
|
|
63
|
-
trackingDomain: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"adsb">, z.ZodLiteral<"dronetag">]>>;
|
|
64
63
|
units: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">]>>;
|
|
65
64
|
adsbSource: z.ZodDefault<z.ZodObject<{
|
|
66
65
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
@@ -405,7 +404,6 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
405
404
|
protocol: "https" | "http" | "https_insecure";
|
|
406
405
|
};
|
|
407
406
|
units: "metric" | "imperial";
|
|
408
|
-
trackingDomain: "adsb" | "dronetag";
|
|
409
407
|
adsbSource: {
|
|
410
408
|
ip: string;
|
|
411
409
|
port: number;
|
|
@@ -530,7 +528,6 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
530
528
|
protocol: "https" | "http" | "https_insecure";
|
|
531
529
|
} | undefined;
|
|
532
530
|
units?: "metric" | "imperial" | undefined;
|
|
533
|
-
trackingDomain?: "adsb" | "dronetag" | undefined;
|
|
534
531
|
adsbSource?: {
|
|
535
532
|
ip: string;
|
|
536
533
|
port: number;
|
|
@@ -41,7 +41,6 @@ const identificationLabelSchema = zod_1.z.object({
|
|
|
41
41
|
opacity: zod_1.z.number().positive(),
|
|
42
42
|
});
|
|
43
43
|
exports.cameraSettingsSchema = zod_1.z.object({
|
|
44
|
-
trackingDomain: zod_1.z.union([zod_1.z.literal('adsb'), zod_1.z.literal('dronetag')]).default('adsb'),
|
|
45
44
|
units: zod_1.z.union([zod_1.z.literal('metric'), zod_1.z.literal('imperial')]).default('imperial'),
|
|
46
45
|
adsbSource: zod_1.z
|
|
47
46
|
.object({
|
package/esm/CamScripterAPI.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import z from 'zod';
|
|
1
2
|
import { BasicAPI } from './internal/BasicAPI';
|
|
2
|
-
import {
|
|
3
|
+
import { nodeStateSchema, packageInfoListSchema, cameraStorageSchema } from './types/CamScripterAPI';
|
|
3
4
|
import { networkCameraListSchema } from './types/common';
|
|
4
5
|
const BASE_PATH = '/local/camscripter';
|
|
5
6
|
export class CamScripterAPI extends BasicAPI {
|
|
@@ -9,7 +10,7 @@ export class CamScripterAPI extends BasicAPI {
|
|
|
9
10
|
}
|
|
10
11
|
async checkCameraTime(options) {
|
|
11
12
|
const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
12
|
-
return
|
|
13
|
+
return z.boolean().parse(res.state);
|
|
13
14
|
}
|
|
14
15
|
async getNetworkCameraList(options) {
|
|
15
16
|
const res = await this._getJson(`${BASE_PATH}/network_camera_list.cgi`, undefined, options);
|
package/esm/CamStreamerAPI.js
CHANGED
|
@@ -11,6 +11,10 @@ export class CamStreamerAPI extends BasicAPI {
|
|
|
11
11
|
async checkAPIAvailable(options) {
|
|
12
12
|
await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
|
|
13
13
|
}
|
|
14
|
+
async checkCameraTime(options) {
|
|
15
|
+
const res = await this._getJson(`${BASE_PATH}/camera_time.cgi`, undefined, options);
|
|
16
|
+
return z.boolean().parse(res.data?.state);
|
|
17
|
+
}
|
|
14
18
|
async wsAuthorization(options) {
|
|
15
19
|
const res = await this._getJson(`${BASE_PATH}/ws_authorization.cgi`, undefined, options);
|
|
16
20
|
if (res.status !== 200) {
|
|
@@ -38,7 +38,6 @@ const identificationLabelSchema = z.object({
|
|
|
38
38
|
opacity: z.number().positive(),
|
|
39
39
|
});
|
|
40
40
|
export const cameraSettingsSchema = z.object({
|
|
41
|
-
trackingDomain: z.union([z.literal('adsb'), z.literal('dronetag')]).default('adsb'),
|
|
42
41
|
units: z.union([z.literal('metric'), z.literal('imperial')]).default('imperial'),
|
|
43
42
|
adsbSource: z
|
|
44
43
|
.object({
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
7
7
|
static getProxyPath: () => string;
|
|
8
8
|
static getWsEventsPath: () => string;
|
|
9
9
|
checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
|
|
10
|
+
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
10
11
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
11
12
|
getUtcTime(options?: THttpRequestOptions): Promise<number>;
|
|
12
13
|
getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
|
|
@@ -117,14 +117,3 @@ export declare const camscripterApiResponseSchema: z.ZodObject<{
|
|
|
117
117
|
message: string;
|
|
118
118
|
}>;
|
|
119
119
|
export type TCamscripterApiResponse = z.infer<typeof camscripterApiResponseSchema>;
|
|
120
|
-
export declare const cameraTimeResponseSchema: z.ZodObject<{
|
|
121
|
-
state: z.ZodBoolean;
|
|
122
|
-
code: z.ZodNumber;
|
|
123
|
-
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
code: number;
|
|
125
|
-
state: boolean;
|
|
126
|
-
}, {
|
|
127
|
-
code: number;
|
|
128
|
-
state: boolean;
|
|
129
|
-
}>;
|
|
130
|
-
export type TCameraTimeResponse = z.infer<typeof cameraTimeResponseSchema>;
|
|
@@ -60,7 +60,6 @@ export declare const widgetSchema: z.ZodObject<{
|
|
|
60
60
|
declare const labelOptionsSchema: z.ZodUnion<[z.ZodLiteral<"blank">, z.ZodLiteral<"registration">, z.ZodLiteral<"call_sign">, z.ZodLiteral<"flight_number">, z.ZodLiteral<"icao">]>;
|
|
61
61
|
export type TLabelOption = z.infer<typeof labelOptionsSchema>;
|
|
62
62
|
export declare const cameraSettingsSchema: z.ZodObject<{
|
|
63
|
-
trackingDomain: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"adsb">, z.ZodLiteral<"dronetag">]>>;
|
|
64
63
|
units: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"metric">, z.ZodLiteral<"imperial">]>>;
|
|
65
64
|
adsbSource: z.ZodDefault<z.ZodObject<{
|
|
66
65
|
ip: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
@@ -405,7 +404,6 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
405
404
|
protocol: "https" | "http" | "https_insecure";
|
|
406
405
|
};
|
|
407
406
|
units: "metric" | "imperial";
|
|
408
|
-
trackingDomain: "adsb" | "dronetag";
|
|
409
407
|
adsbSource: {
|
|
410
408
|
ip: string;
|
|
411
409
|
port: number;
|
|
@@ -530,7 +528,6 @@ export declare const cameraSettingsSchema: z.ZodObject<{
|
|
|
530
528
|
protocol: "https" | "http" | "https_insecure";
|
|
531
529
|
} | undefined;
|
|
532
530
|
units?: "metric" | "imperial" | undefined;
|
|
533
|
-
trackingDomain?: "adsb" | "dronetag" | undefined;
|
|
534
531
|
adsbSource?: {
|
|
535
532
|
ip: string;
|
|
536
533
|
port: number;
|