camstreamerlib 4.0.0-beta.119 → 4.0.0-beta.120
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 +83 -91
- package/cjs/CamOverlayAPI.js +10 -62
- package/cjs/CamScripterAPI.d.ts +4 -8
- package/cjs/CamScripterAPI.js +4 -29
- package/cjs/CamStreamerAPI.d.ts +1427 -1596
- package/cjs/CamStreamerAPI.js +7 -76
- package/cjs/CamSwitcherAPI.d.ts +18 -21
- package/cjs/CamSwitcherAPI.js +5 -26
- package/cjs/PlaneTrackerAPI.d.ts +9 -15
- package/cjs/PlaneTrackerAPI.js +6 -69
- package/cjs/internal/BasicAPI.d.ts +15 -0
- package/cjs/internal/BasicAPI.js +97 -0
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +296 -296
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +6 -6
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +26 -26
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -8
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +6 -6
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +6 -6
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +6 -6
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +11 -11
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +6 -6
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +12 -12
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +6 -6
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +7796 -9156
- package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +146 -174
- package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +22 -22
- package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +140 -168
- package/cjs/types/CamStreamerAPI/streamCommonTypes.js +22 -32
- package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +2513 -3017
- package/cjs/types/CamStreamerAPI/windySchema.d.ts +138 -166
- package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +148 -176
- package/cjs/types/CamSwitcherAPI.d.ts +66 -66
- package/cjs/types/PlaneTrackerAPI.d.ts +12 -12
- package/cjs/types/ws/CamStreamerEvents.d.ts +8 -8
- package/cjs/types/ws/CamSwitcherEvents.d.ts +8 -8
- package/esm/CamOverlayAPI.js +11 -63
- package/esm/CamScripterAPI.js +4 -29
- package/esm/CamStreamerAPI.js +8 -77
- package/esm/CamSwitcherAPI.js +6 -27
- package/esm/PlaneTrackerAPI.js +7 -70
- package/esm/internal/BasicAPI.js +93 -0
- package/esm/types/CamStreamerAPI/streamCommonTypes.js +22 -32
- package/package.json +1 -1
- package/types/CamOverlayAPI.d.ts +83 -91
- package/types/CamScripterAPI.d.ts +4 -8
- package/types/CamStreamerAPI.d.ts +1427 -1596
- package/types/CamSwitcherAPI.d.ts +18 -21
- package/types/PlaneTrackerAPI.d.ts +9 -15
- package/types/internal/BasicAPI.d.ts +15 -0
- package/types/internal/versionCompare.d.ts +2 -2
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +296 -296
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +6 -6
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +26 -26
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +8 -8
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +6 -6
- package/types/types/CamOverlayAPI/pipSchema.d.ts +6 -6
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +6 -6
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +11 -11
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +6 -6
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +12 -12
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +6 -6
- package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +7796 -9156
- package/types/types/CamStreamerAPI/facebookSchema.d.ts +146 -174
- package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +22 -22
- package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +140 -168
- package/types/types/CamStreamerAPI/streamsSchema.d.ts +2513 -3017
- package/types/types/CamStreamerAPI/windySchema.d.ts +138 -166
- package/types/types/CamStreamerAPI/youtubeSchema.d.ts +148 -176
- package/types/types/CamSwitcherAPI.d.ts +66 -66
- package/types/types/PlaneTrackerAPI.d.ts +12 -12
- package/types/types/ws/CamStreamerEvents.d.ts +8 -8
- package/types/types/ws/CamSwitcherEvents.d.ts +8 -8
package/cjs/CamOverlayAPI.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { IClient,
|
|
2
|
-
import { THttpRequestOptions
|
|
3
|
-
import { ProxyClient } from './internal/ProxyClient';
|
|
1
|
+
import { IClient, TResponse } from './internal/types';
|
|
2
|
+
import { THttpRequestOptions } from './types/common';
|
|
4
3
|
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService, TFileList, TStorageDataList } from './types/CamOverlayAPI';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(client: Client);
|
|
4
|
+
import { BasicAPI } from './internal/BasicAPI';
|
|
5
|
+
export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> extends BasicAPI<Client> {
|
|
8
6
|
static getBasePath: () => string;
|
|
9
7
|
static getProxyPath: () => string;
|
|
10
8
|
static getFilePreviewPath: (path: string) => string;
|
|
11
|
-
getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
|
|
12
9
|
checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
|
|
13
10
|
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
14
11
|
getNetworkCameraList(options?: THttpRequestOptions): Promise<{
|
|
@@ -16,25 +13,25 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
16
13
|
ip: string;
|
|
17
14
|
}[]>;
|
|
18
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
19
|
-
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<
|
|
16
|
+
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
20
17
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
21
18
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
22
19
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
|
23
20
|
getFileStorage<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TStorageDataList<T>>;
|
|
24
|
-
getFilePreviewFromCamera(path: string, options?: THttpRequestOptions): Promise<
|
|
21
|
+
getFilePreviewFromCamera(path: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
25
22
|
updateInfoticker(serviceId: number, text: string, options?: THttpRequestOptions): Promise<void>;
|
|
26
23
|
setEnabled(serviceId: number, enabled: boolean, options?: THttpRequestOptions): Promise<void>;
|
|
27
24
|
isEnabled(serviceId: number, options?: THttpRequestOptions): Promise<boolean>;
|
|
28
25
|
getSingleService(serviceId: number, options?: THttpRequestOptions): Promise<{
|
|
29
26
|
name: "infoticker";
|
|
30
27
|
enabled: 0 | 1;
|
|
31
|
-
id: number;
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
28
|
source: string;
|
|
29
|
+
id: number;
|
|
35
30
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
36
31
|
cameraList: number[];
|
|
37
32
|
customName: string;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
38
35
|
pos_y: number;
|
|
39
36
|
coordSystem: "top" | "bottom";
|
|
40
37
|
showClock: 0 | 1;
|
|
@@ -59,13 +56,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
59
56
|
} | {
|
|
60
57
|
name: "accuweather";
|
|
61
58
|
enabled: 0 | 1;
|
|
62
|
-
id: number;
|
|
63
|
-
width: number;
|
|
64
|
-
height: number;
|
|
65
59
|
title: string;
|
|
60
|
+
id: number;
|
|
66
61
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
67
62
|
cameraList: number[];
|
|
68
63
|
customName: string;
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
69
66
|
pos_x: number;
|
|
70
67
|
pos_y: number;
|
|
71
68
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -87,13 +84,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
87
84
|
type: "map" | "image" | "compass";
|
|
88
85
|
name: "ptzCompass";
|
|
89
86
|
enabled: 0 | 1;
|
|
90
|
-
id: number;
|
|
91
|
-
width: number;
|
|
92
|
-
height: number;
|
|
93
87
|
image: string;
|
|
88
|
+
id: number;
|
|
94
89
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
95
90
|
cameraList: number[];
|
|
96
91
|
customName: string;
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
97
94
|
pos_x: number;
|
|
98
95
|
pos_y: number;
|
|
99
96
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -118,19 +115,19 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
118
115
|
name: "images";
|
|
119
116
|
enabled: 0 | 1;
|
|
120
117
|
id: number;
|
|
121
|
-
width: number;
|
|
122
|
-
height: number;
|
|
123
118
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
124
119
|
cameraList: number[];
|
|
125
120
|
customName: string;
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
126
123
|
overlayList: {
|
|
127
|
-
duration: number;
|
|
128
124
|
active: boolean;
|
|
129
125
|
pos_x: number;
|
|
130
126
|
pos_y: number;
|
|
131
127
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
132
128
|
imgPath: string;
|
|
133
129
|
imgName: string;
|
|
130
|
+
duration: number;
|
|
134
131
|
scale: number;
|
|
135
132
|
fps?: number | undefined;
|
|
136
133
|
}[];
|
|
@@ -142,19 +139,19 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
142
139
|
name: "ptz";
|
|
143
140
|
enabled: 0 | 1;
|
|
144
141
|
id: number;
|
|
145
|
-
width: number;
|
|
146
|
-
height: number;
|
|
147
142
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
148
143
|
cameraList: number[];
|
|
149
144
|
customName: string;
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
150
147
|
ptz_positions: Record<string, {
|
|
151
148
|
overlayList: {
|
|
152
|
-
duration: number;
|
|
153
149
|
pos_x: number;
|
|
154
150
|
pos_y: number;
|
|
155
151
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
156
152
|
imgPath: string;
|
|
157
153
|
imgName: string;
|
|
154
|
+
duration: number;
|
|
158
155
|
scale: number;
|
|
159
156
|
}[];
|
|
160
157
|
loop: boolean;
|
|
@@ -167,13 +164,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
167
164
|
name: "pip";
|
|
168
165
|
compression: number;
|
|
169
166
|
enabled: 0 | 1;
|
|
170
|
-
id: number;
|
|
171
|
-
width: number;
|
|
172
|
-
height: number;
|
|
173
167
|
fps: number;
|
|
168
|
+
id: number;
|
|
174
169
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
175
170
|
cameraList: number[];
|
|
176
171
|
customName: string;
|
|
172
|
+
width: number;
|
|
173
|
+
height: number;
|
|
177
174
|
pos_x: number;
|
|
178
175
|
pos_y: number;
|
|
179
176
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -204,13 +201,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
204
201
|
} | {
|
|
205
202
|
name: "customGraphics";
|
|
206
203
|
enabled: 0 | 1;
|
|
207
|
-
id: number;
|
|
208
|
-
width: number;
|
|
209
|
-
height: number;
|
|
210
204
|
image: string;
|
|
205
|
+
id: number;
|
|
211
206
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
212
207
|
cameraList: number[];
|
|
213
208
|
customName: string;
|
|
209
|
+
width: number;
|
|
210
|
+
height: number;
|
|
214
211
|
pos_x: number;
|
|
215
212
|
pos_y: number;
|
|
216
213
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -235,8 +232,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
235
232
|
textAlign: "A_LEFT" | "A_CENTER" | "A_RIGHT";
|
|
236
233
|
textVerticalAlign: "VA_TOP" | "VA_CENTER" | "VA_BOTTOM";
|
|
237
234
|
text?: {
|
|
238
|
-
source: string;
|
|
239
235
|
active: boolean;
|
|
236
|
+
source: string;
|
|
240
237
|
}[] | undefined;
|
|
241
238
|
} | {
|
|
242
239
|
type: "countdown";
|
|
@@ -273,8 +270,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
273
270
|
waitingPeriod: number;
|
|
274
271
|
};
|
|
275
272
|
text?: {
|
|
276
|
-
source: string;
|
|
277
273
|
active: boolean;
|
|
274
|
+
source: string;
|
|
278
275
|
}[] | undefined;
|
|
279
276
|
})[];
|
|
280
277
|
camera?: number | undefined;
|
|
@@ -284,13 +281,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
284
281
|
} | {
|
|
285
282
|
name: "screenSharing";
|
|
286
283
|
enabled: 0 | 1;
|
|
287
|
-
id: number;
|
|
288
|
-
width: number;
|
|
289
|
-
height: number;
|
|
290
284
|
fps: number;
|
|
285
|
+
id: number;
|
|
291
286
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
292
287
|
cameraList: number[];
|
|
293
288
|
customName: string;
|
|
289
|
+
width: number;
|
|
290
|
+
height: number;
|
|
294
291
|
pos_x: number;
|
|
295
292
|
pos_y: number;
|
|
296
293
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -302,13 +299,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
302
299
|
} | {
|
|
303
300
|
name: "web_camera";
|
|
304
301
|
enabled: 0 | 1;
|
|
305
|
-
id: number;
|
|
306
|
-
width: number;
|
|
307
|
-
height: number;
|
|
308
302
|
fps: number;
|
|
303
|
+
id: number;
|
|
309
304
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
310
305
|
cameraList: number[];
|
|
311
306
|
customName: string;
|
|
307
|
+
width: number;
|
|
308
|
+
height: number;
|
|
312
309
|
pos_x: number;
|
|
313
310
|
pos_y: number;
|
|
314
311
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -321,10 +318,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
321
318
|
name: "scoreBoard";
|
|
322
319
|
enabled: 0 | 1;
|
|
323
320
|
id: number;
|
|
324
|
-
width: number;
|
|
325
|
-
height: number;
|
|
326
321
|
cameraList: number[];
|
|
327
322
|
zIndex: number;
|
|
323
|
+
width: number;
|
|
324
|
+
height: number;
|
|
328
325
|
pos_x: number;
|
|
329
326
|
pos_y: number;
|
|
330
327
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -351,10 +348,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
351
348
|
name: "baseballScoreBoard";
|
|
352
349
|
enabled: 0 | 1;
|
|
353
350
|
id: number;
|
|
354
|
-
width: number;
|
|
355
|
-
height: number;
|
|
356
351
|
cameraList: number[];
|
|
357
352
|
zIndex: number;
|
|
353
|
+
width: number;
|
|
354
|
+
height: number;
|
|
358
355
|
pos_x: number;
|
|
359
356
|
pos_y: number;
|
|
360
357
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -387,10 +384,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
387
384
|
name: "myBallBaseballWidgets";
|
|
388
385
|
enabled: 0 | 1;
|
|
389
386
|
id: number;
|
|
390
|
-
width: number;
|
|
391
|
-
height: number;
|
|
392
387
|
cameraList: number[];
|
|
393
388
|
zIndex: number;
|
|
389
|
+
width: number;
|
|
390
|
+
height: number;
|
|
394
391
|
scale: number;
|
|
395
392
|
font: string;
|
|
396
393
|
teamHomeBackgroundColor: string;
|
|
@@ -411,12 +408,12 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
411
408
|
} | {
|
|
412
409
|
name: "scoreOverview";
|
|
413
410
|
enabled: 0 | 1;
|
|
414
|
-
id: number;
|
|
415
|
-
width: number;
|
|
416
|
-
height: number;
|
|
417
411
|
description: string;
|
|
412
|
+
id: number;
|
|
418
413
|
cameraList: number[];
|
|
419
414
|
zIndex: number;
|
|
415
|
+
width: number;
|
|
416
|
+
height: number;
|
|
420
417
|
pos_x: number;
|
|
421
418
|
pos_y: number;
|
|
422
419
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -438,13 +435,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
438
435
|
getServices(options?: THttpRequestOptions): Promise<({
|
|
439
436
|
name: "infoticker";
|
|
440
437
|
enabled: 0 | 1;
|
|
441
|
-
id: number;
|
|
442
|
-
width: number;
|
|
443
|
-
height: number;
|
|
444
438
|
source: string;
|
|
439
|
+
id: number;
|
|
445
440
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
446
441
|
cameraList: number[];
|
|
447
442
|
customName: string;
|
|
443
|
+
width: number;
|
|
444
|
+
height: number;
|
|
448
445
|
pos_y: number;
|
|
449
446
|
coordSystem: "top" | "bottom";
|
|
450
447
|
showClock: 0 | 1;
|
|
@@ -469,13 +466,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
469
466
|
} | {
|
|
470
467
|
name: "accuweather";
|
|
471
468
|
enabled: 0 | 1;
|
|
472
|
-
id: number;
|
|
473
|
-
width: number;
|
|
474
|
-
height: number;
|
|
475
469
|
title: string;
|
|
470
|
+
id: number;
|
|
476
471
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
477
472
|
cameraList: number[];
|
|
478
473
|
customName: string;
|
|
474
|
+
width: number;
|
|
475
|
+
height: number;
|
|
479
476
|
pos_x: number;
|
|
480
477
|
pos_y: number;
|
|
481
478
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -497,13 +494,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
497
494
|
type: "map" | "image" | "compass";
|
|
498
495
|
name: "ptzCompass";
|
|
499
496
|
enabled: 0 | 1;
|
|
500
|
-
id: number;
|
|
501
|
-
width: number;
|
|
502
|
-
height: number;
|
|
503
497
|
image: string;
|
|
498
|
+
id: number;
|
|
504
499
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
505
500
|
cameraList: number[];
|
|
506
501
|
customName: string;
|
|
502
|
+
width: number;
|
|
503
|
+
height: number;
|
|
507
504
|
pos_x: number;
|
|
508
505
|
pos_y: number;
|
|
509
506
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -528,19 +525,19 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
528
525
|
name: "images";
|
|
529
526
|
enabled: 0 | 1;
|
|
530
527
|
id: number;
|
|
531
|
-
width: number;
|
|
532
|
-
height: number;
|
|
533
528
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
534
529
|
cameraList: number[];
|
|
535
530
|
customName: string;
|
|
531
|
+
width: number;
|
|
532
|
+
height: number;
|
|
536
533
|
overlayList: {
|
|
537
|
-
duration: number;
|
|
538
534
|
active: boolean;
|
|
539
535
|
pos_x: number;
|
|
540
536
|
pos_y: number;
|
|
541
537
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
542
538
|
imgPath: string;
|
|
543
539
|
imgName: string;
|
|
540
|
+
duration: number;
|
|
544
541
|
scale: number;
|
|
545
542
|
fps?: number | undefined;
|
|
546
543
|
}[];
|
|
@@ -552,19 +549,19 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
552
549
|
name: "ptz";
|
|
553
550
|
enabled: 0 | 1;
|
|
554
551
|
id: number;
|
|
555
|
-
width: number;
|
|
556
|
-
height: number;
|
|
557
552
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
558
553
|
cameraList: number[];
|
|
559
554
|
customName: string;
|
|
555
|
+
width: number;
|
|
556
|
+
height: number;
|
|
560
557
|
ptz_positions: Record<string, {
|
|
561
558
|
overlayList: {
|
|
562
|
-
duration: number;
|
|
563
559
|
pos_x: number;
|
|
564
560
|
pos_y: number;
|
|
565
561
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
566
562
|
imgPath: string;
|
|
567
563
|
imgName: string;
|
|
564
|
+
duration: number;
|
|
568
565
|
scale: number;
|
|
569
566
|
}[];
|
|
570
567
|
loop: boolean;
|
|
@@ -577,13 +574,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
577
574
|
name: "pip";
|
|
578
575
|
compression: number;
|
|
579
576
|
enabled: 0 | 1;
|
|
580
|
-
id: number;
|
|
581
|
-
width: number;
|
|
582
|
-
height: number;
|
|
583
577
|
fps: number;
|
|
578
|
+
id: number;
|
|
584
579
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
585
580
|
cameraList: number[];
|
|
586
581
|
customName: string;
|
|
582
|
+
width: number;
|
|
583
|
+
height: number;
|
|
587
584
|
pos_x: number;
|
|
588
585
|
pos_y: number;
|
|
589
586
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -614,13 +611,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
614
611
|
} | {
|
|
615
612
|
name: "customGraphics";
|
|
616
613
|
enabled: 0 | 1;
|
|
617
|
-
id: number;
|
|
618
|
-
width: number;
|
|
619
|
-
height: number;
|
|
620
614
|
image: string;
|
|
615
|
+
id: number;
|
|
621
616
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
622
617
|
cameraList: number[];
|
|
623
618
|
customName: string;
|
|
619
|
+
width: number;
|
|
620
|
+
height: number;
|
|
624
621
|
pos_x: number;
|
|
625
622
|
pos_y: number;
|
|
626
623
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -645,8 +642,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
645
642
|
textAlign: "A_LEFT" | "A_CENTER" | "A_RIGHT";
|
|
646
643
|
textVerticalAlign: "VA_TOP" | "VA_CENTER" | "VA_BOTTOM";
|
|
647
644
|
text?: {
|
|
648
|
-
source: string;
|
|
649
645
|
active: boolean;
|
|
646
|
+
source: string;
|
|
650
647
|
}[] | undefined;
|
|
651
648
|
} | {
|
|
652
649
|
type: "countdown";
|
|
@@ -683,8 +680,8 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
683
680
|
waitingPeriod: number;
|
|
684
681
|
};
|
|
685
682
|
text?: {
|
|
686
|
-
source: string;
|
|
687
683
|
active: boolean;
|
|
684
|
+
source: string;
|
|
688
685
|
}[] | undefined;
|
|
689
686
|
})[];
|
|
690
687
|
camera?: number | undefined;
|
|
@@ -694,13 +691,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
694
691
|
} | {
|
|
695
692
|
name: "screenSharing";
|
|
696
693
|
enabled: 0 | 1;
|
|
697
|
-
id: number;
|
|
698
|
-
width: number;
|
|
699
|
-
height: number;
|
|
700
694
|
fps: number;
|
|
695
|
+
id: number;
|
|
701
696
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
702
697
|
cameraList: number[];
|
|
703
698
|
customName: string;
|
|
699
|
+
width: number;
|
|
700
|
+
height: number;
|
|
704
701
|
pos_x: number;
|
|
705
702
|
pos_y: number;
|
|
706
703
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -712,13 +709,13 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
712
709
|
} | {
|
|
713
710
|
name: "web_camera";
|
|
714
711
|
enabled: 0 | 1;
|
|
715
|
-
id: number;
|
|
716
|
-
width: number;
|
|
717
|
-
height: number;
|
|
718
712
|
fps: number;
|
|
713
|
+
id: number;
|
|
719
714
|
automationType: "manual" | "schedule" | "time" | `input${number}`;
|
|
720
715
|
cameraList: number[];
|
|
721
716
|
customName: string;
|
|
717
|
+
width: number;
|
|
718
|
+
height: number;
|
|
722
719
|
pos_x: number;
|
|
723
720
|
pos_y: number;
|
|
724
721
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -731,10 +728,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
731
728
|
name: "scoreBoard";
|
|
732
729
|
enabled: 0 | 1;
|
|
733
730
|
id: number;
|
|
734
|
-
width: number;
|
|
735
|
-
height: number;
|
|
736
731
|
cameraList: number[];
|
|
737
732
|
zIndex: number;
|
|
733
|
+
width: number;
|
|
734
|
+
height: number;
|
|
738
735
|
pos_x: number;
|
|
739
736
|
pos_y: number;
|
|
740
737
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -761,10 +758,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
761
758
|
name: "baseballScoreBoard";
|
|
762
759
|
enabled: 0 | 1;
|
|
763
760
|
id: number;
|
|
764
|
-
width: number;
|
|
765
|
-
height: number;
|
|
766
761
|
cameraList: number[];
|
|
767
762
|
zIndex: number;
|
|
763
|
+
width: number;
|
|
764
|
+
height: number;
|
|
768
765
|
pos_x: number;
|
|
769
766
|
pos_y: number;
|
|
770
767
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -797,10 +794,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
797
794
|
name: "myBallBaseballWidgets";
|
|
798
795
|
enabled: 0 | 1;
|
|
799
796
|
id: number;
|
|
800
|
-
width: number;
|
|
801
|
-
height: number;
|
|
802
797
|
cameraList: number[];
|
|
803
798
|
zIndex: number;
|
|
799
|
+
width: number;
|
|
800
|
+
height: number;
|
|
804
801
|
scale: number;
|
|
805
802
|
font: string;
|
|
806
803
|
teamHomeBackgroundColor: string;
|
|
@@ -821,12 +818,12 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
821
818
|
} | {
|
|
822
819
|
name: "scoreOverview";
|
|
823
820
|
enabled: 0 | 1;
|
|
824
|
-
id: number;
|
|
825
|
-
width: number;
|
|
826
|
-
height: number;
|
|
827
821
|
description: string;
|
|
822
|
+
id: number;
|
|
828
823
|
cameraList: number[];
|
|
829
824
|
zIndex: number;
|
|
825
|
+
width: number;
|
|
826
|
+
height: number;
|
|
830
827
|
pos_x: number;
|
|
831
828
|
pos_y: number;
|
|
832
829
|
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
@@ -851,11 +848,6 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
851
848
|
updateCGImagePos(serviceId: number, coordinates?: TCoordinates, x?: number, y?: number, options?: THttpRequestOptions): Promise<void>;
|
|
852
849
|
updateCGImage(serviceId: number, path: string, coordinates?: TCoordinates, x?: number, y?: number, options?: THttpRequestOptions): Promise<void>;
|
|
853
850
|
updateCGImageFromData(serviceId: number, imageType: ImageType, imageData: Parameters<Client['post']>[0]['data'], coordinates?: TCoordinates, x?: number, y?: number, options?: THttpRequestOptions): Promise<void>;
|
|
851
|
+
downloadReport(options?: THttpRequestOptions): Promise<string>;
|
|
854
852
|
private promiseCGUpdate;
|
|
855
|
-
private _getJson;
|
|
856
|
-
private _post;
|
|
857
|
-
private _getBlob;
|
|
858
|
-
private parseBlobResponse;
|
|
859
|
-
private _postUrlEncoded;
|
|
860
|
-
private _postJsonEncoded;
|
|
861
853
|
}
|
package/cjs/CamOverlayAPI.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CamOverlayAPI = void 0;
|
|
4
|
-
const utils_1 = require("./internal/utils");
|
|
5
4
|
const errors_1 = require("./errors/errors");
|
|
6
5
|
const common_1 = require("./types/common");
|
|
7
6
|
const zod_1 = require("zod");
|
|
8
|
-
const ProxyClient_1 = require("./internal/ProxyClient");
|
|
9
7
|
const CamOverlayAPI_1 = require("./types/CamOverlayAPI");
|
|
8
|
+
const BasicAPI_1 = require("./internal/BasicAPI");
|
|
10
9
|
const BASE_PATH = '/local/camoverlay/api';
|
|
11
|
-
class CamOverlayAPI {
|
|
12
|
-
client;
|
|
13
|
-
constructor(client) {
|
|
14
|
-
this.client = client;
|
|
15
|
-
}
|
|
10
|
+
class CamOverlayAPI extends BasicAPI_1.BasicAPI {
|
|
16
11
|
static getBasePath = () => BASE_PATH;
|
|
17
12
|
static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
|
|
18
13
|
static getFilePreviewPath = (path) => `${BASE_PATH}/image.cgi?path=${encodeURIComponent(path)}`;
|
|
19
|
-
getClient(proxyParams) {
|
|
20
|
-
return proxyParams ? new ProxyClient_1.ProxyClient(this.client, proxyParams) : this.client;
|
|
21
|
-
}
|
|
22
14
|
async checkAPIAvailable(options) {
|
|
23
15
|
await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
|
|
24
16
|
}
|
|
@@ -51,7 +43,7 @@ class CamOverlayAPI {
|
|
|
51
43
|
await this._postUrlEncoded(`${BASE_PATH}/upload_${fileType}.cgi`, {
|
|
52
44
|
action: 'remove',
|
|
53
45
|
...fileParams,
|
|
54
|
-
}, options
|
|
46
|
+
}, options);
|
|
55
47
|
}
|
|
56
48
|
async getFileStorage(fileType, options) {
|
|
57
49
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'get_storage' }, options);
|
|
@@ -102,15 +94,15 @@ class CamOverlayAPI {
|
|
|
102
94
|
return services;
|
|
103
95
|
}
|
|
104
96
|
async updateSingleService(service, options) {
|
|
105
|
-
await this._postJsonEncoded(`${BASE_PATH}/services.cgi`,
|
|
97
|
+
await this._postJsonEncoded(`${BASE_PATH}/services.cgi`, service, {
|
|
106
98
|
action: 'set',
|
|
107
99
|
service_id: service.id,
|
|
108
|
-
}, options
|
|
100
|
+
}, options);
|
|
109
101
|
}
|
|
110
102
|
async updateServices(services, options) {
|
|
111
|
-
await this._postJsonEncoded(`${BASE_PATH}/services.cgi`,
|
|
103
|
+
await this._postJsonEncoded(`${BASE_PATH}/services.cgi`, { services: services }, {
|
|
112
104
|
action: 'set',
|
|
113
|
-
}, options
|
|
105
|
+
}, options);
|
|
114
106
|
}
|
|
115
107
|
updateCGText(serviceId, fields, options) {
|
|
116
108
|
const params = {};
|
|
@@ -149,6 +141,9 @@ class CamOverlayAPI {
|
|
|
149
141
|
};
|
|
150
142
|
return this.promiseCGUpdate(serviceId, 'update_image', params, contentType, imageData, options);
|
|
151
143
|
}
|
|
144
|
+
downloadReport(options) {
|
|
145
|
+
return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
|
|
146
|
+
}
|
|
152
147
|
async promiseCGUpdate(serviceId, action, params = {}, contentType, data, options) {
|
|
153
148
|
const path = `${BASE_PATH}/customGraphics.cgi`;
|
|
154
149
|
let headers = {};
|
|
@@ -171,52 +166,5 @@ class CamOverlayAPI {
|
|
|
171
166
|
throw new errors_1.ErrorWithResponse(res);
|
|
172
167
|
}
|
|
173
168
|
}
|
|
174
|
-
async _getJson(path, parameters, options) {
|
|
175
|
-
const agent = this.getClient(options?.proxyParams);
|
|
176
|
-
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
177
|
-
if (res.ok) {
|
|
178
|
-
return await res.json();
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
async _post(path, data, parameters, options, headers) {
|
|
185
|
-
const agent = this.getClient(options?.proxyParams);
|
|
186
|
-
const res = await agent.post({ path, data, parameters, headers, timeout: options?.timeout });
|
|
187
|
-
if (res.ok) {
|
|
188
|
-
return await res.json();
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
async _getBlob(path, parameters, options) {
|
|
195
|
-
const agent = this.getClient(options?.proxyParams);
|
|
196
|
-
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
197
|
-
if (res.ok) {
|
|
198
|
-
return await this.parseBlobResponse(res);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
throw new errors_1.ErrorWithResponse(res);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
async parseBlobResponse(response) {
|
|
205
|
-
try {
|
|
206
|
-
return (await response.blob());
|
|
207
|
-
}
|
|
208
|
-
catch (err) {
|
|
209
|
-
throw new errors_1.ParsingBlobError(err);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async _postUrlEncoded(path, parameters, options, headers) {
|
|
213
|
-
const data = (0, utils_1.paramToUrl)(parameters);
|
|
214
|
-
const baseHeaders = { 'Content-Type': 'application/x-www-form-urlencoded' };
|
|
215
|
-
return this._post(path, data, undefined, options, { ...baseHeaders, ...headers });
|
|
216
|
-
}
|
|
217
|
-
async _postJsonEncoded(path, data, parameters, options, headers) {
|
|
218
|
-
const baseHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
|
|
219
|
-
return this._post(path, data, parameters, options, { ...baseHeaders, ...headers });
|
|
220
|
-
}
|
|
221
169
|
}
|
|
222
170
|
exports.CamOverlayAPI = CamOverlayAPI;
|
package/cjs/CamScripterAPI.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BasicAPI } from './internal/BasicAPI';
|
|
2
2
|
import { IClient, TResponse } from './internal/types';
|
|
3
|
-
import { THttpRequestOptions,
|
|
4
|
-
export declare class CamScripterAPI<Client extends IClient<TResponse, any>> {
|
|
5
|
-
private client;
|
|
6
|
-
constructor(client: Client);
|
|
3
|
+
import { THttpRequestOptions, TStorageType } from './types/common';
|
|
4
|
+
export declare class CamScripterAPI<Client extends IClient<TResponse, any>> extends BasicAPI<Client> {
|
|
7
5
|
static getProxyPath: () => string;
|
|
8
|
-
getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
|
|
9
6
|
checkAPIAvailable(options?: THttpRequestOptions): Promise<void>;
|
|
10
7
|
checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
|
|
11
8
|
getNetworkCameraList(options?: THttpRequestOptions): Promise<{
|
|
@@ -42,6 +39,5 @@ export declare class CamScripterAPI<Client extends IClient<TResponse, any>> {
|
|
|
42
39
|
node_state: "OK" | "NOT_INSTALLED" | "NOT_FOUND";
|
|
43
40
|
}>;
|
|
44
41
|
installNodejs(storage: TStorageType, options?: THttpRequestOptions): Promise<void>;
|
|
45
|
-
|
|
46
|
-
private _post;
|
|
42
|
+
downloadReport(options?: THttpRequestOptions): Promise<string>;
|
|
47
43
|
}
|