camstreamerlib 4.0.0-beta.136 → 4.0.0-beta.138
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.d.ts +48 -4
- package/cjs/CamStreamerAPI.js +6 -5
- package/cjs/PlaneTrackerAPI.d.ts +1 -1
- package/cjs/VapixAPI.d.ts +6 -1
- package/cjs/VapixAPI.js +30 -2
- package/cjs/errors/errors.d.ts +6 -1
- package/cjs/errors/errors.js +3 -1
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +340 -0
- package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +7 -0
- package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +7 -0
- package/cjs/types/CamStreamerAPI/streamCommonTypes.js +1 -0
- package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +119 -0
- package/cjs/types/CamStreamerAPI/windySchema.d.ts +7 -0
- package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +7 -0
- package/cjs/types/GenetecAgent.d.ts +2 -2
- package/esm/CamStreamerAPI.js +6 -5
- package/esm/VapixAPI.js +30 -2
- package/esm/errors/errors.js +3 -1
- package/esm/types/CamStreamerAPI/streamCommonTypes.js +1 -0
- package/package.json +1 -1
- package/types/CamStreamerAPI.d.ts +48 -4
- package/types/PlaneTrackerAPI.d.ts +1 -1
- package/types/VapixAPI.d.ts +6 -1
- package/types/errors/errors.d.ts +6 -1
- package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +340 -0
- package/types/types/CamStreamerAPI/facebookSchema.d.ts +7 -0
- package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +7 -0
- package/types/types/CamStreamerAPI/streamsSchema.d.ts +119 -0
- package/types/types/CamStreamerAPI/windySchema.d.ts +7 -0
- package/types/types/CamStreamerAPI/youtubeSchema.d.ts +7 -0
- package/types/types/GenetecAgent.d.ts +2 -2
package/cjs/CamStreamerAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IClient, TResponse } from './internal/types';
|
|
2
|
-
import { TAudioFile, TAudioFileStorageType, TDiagnosticsParams, TStream
|
|
2
|
+
import { TAudioFile, TAudioFileStorageType, TDiagnosticsParams, TStream } from './types/CamStreamerAPI/CamStreamerAPI';
|
|
3
3
|
import { THttpRequestOptions } from './types/common';
|
|
4
4
|
import { TOldStream, TOldStringStream } from './types/CamStreamerAPI/oldStreamSchema';
|
|
5
5
|
import { BasicAPI } from './internal/BasicAPI';
|
|
@@ -12,7 +12,9 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
12
12
|
getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
|
|
13
13
|
isCSPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
14
14
|
getCamStreamerAppLog(options?: THttpRequestOptions): Promise<string>;
|
|
15
|
-
getStreamList
|
|
15
|
+
getStreamList<TUnknownStream extends {
|
|
16
|
+
platform: string;
|
|
17
|
+
}>(options?: THttpRequestOptions): Promise<({
|
|
16
18
|
post: {
|
|
17
19
|
postLocation: "timeline";
|
|
18
20
|
streamPrivacy: "public" | "friends" | "only_me";
|
|
@@ -56,6 +58,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
56
58
|
type: "video";
|
|
57
59
|
url: string | null;
|
|
58
60
|
parameters: string;
|
|
61
|
+
saveToSdCard: boolean;
|
|
59
62
|
} | {
|
|
60
63
|
type: "images";
|
|
61
64
|
url: string | null;
|
|
@@ -134,6 +137,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
134
137
|
type: "video";
|
|
135
138
|
url: string | null;
|
|
136
139
|
parameters: string;
|
|
140
|
+
saveToSdCard: boolean;
|
|
137
141
|
} | {
|
|
138
142
|
type: "images";
|
|
139
143
|
url: string | null;
|
|
@@ -209,6 +213,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
209
213
|
type: "video";
|
|
210
214
|
url: string | null;
|
|
211
215
|
parameters: string;
|
|
216
|
+
saveToSdCard: boolean;
|
|
212
217
|
} | {
|
|
213
218
|
type: "images";
|
|
214
219
|
url: string | null;
|
|
@@ -296,6 +301,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
296
301
|
type: "video";
|
|
297
302
|
url: string | null;
|
|
298
303
|
parameters: string;
|
|
304
|
+
saveToSdCard: boolean;
|
|
299
305
|
} | {
|
|
300
306
|
type: "images";
|
|
301
307
|
url: string | null;
|
|
@@ -371,6 +377,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
371
377
|
type: "video";
|
|
372
378
|
url: string | null;
|
|
373
379
|
parameters: string;
|
|
380
|
+
saveToSdCard: boolean;
|
|
374
381
|
} | {
|
|
375
382
|
type: "images";
|
|
376
383
|
url: string | null;
|
|
@@ -446,6 +453,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
446
453
|
type: "video";
|
|
447
454
|
url: string | null;
|
|
448
455
|
parameters: string;
|
|
456
|
+
saveToSdCard: boolean;
|
|
449
457
|
} | {
|
|
450
458
|
type: "images";
|
|
451
459
|
url: string | null;
|
|
@@ -521,6 +529,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
521
529
|
type: "video";
|
|
522
530
|
url: string | null;
|
|
523
531
|
parameters: string;
|
|
532
|
+
saveToSdCard: boolean;
|
|
524
533
|
} | {
|
|
525
534
|
type: "images";
|
|
526
535
|
url: string | null;
|
|
@@ -596,6 +605,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
596
605
|
type: "video";
|
|
597
606
|
url: string | null;
|
|
598
607
|
parameters: string;
|
|
608
|
+
saveToSdCard: boolean;
|
|
599
609
|
} | {
|
|
600
610
|
type: "images";
|
|
601
611
|
url: string | null;
|
|
@@ -671,6 +681,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
671
681
|
type: "video";
|
|
672
682
|
url: string | null;
|
|
673
683
|
parameters: string;
|
|
684
|
+
saveToSdCard: boolean;
|
|
674
685
|
} | {
|
|
675
686
|
type: "images";
|
|
676
687
|
url: string | null;
|
|
@@ -746,6 +757,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
746
757
|
type: "video";
|
|
747
758
|
url: string | null;
|
|
748
759
|
parameters: string;
|
|
760
|
+
saveToSdCard: boolean;
|
|
749
761
|
} | {
|
|
750
762
|
type: "images";
|
|
751
763
|
url: string | null;
|
|
@@ -821,6 +833,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
821
833
|
type: "video";
|
|
822
834
|
url: string | null;
|
|
823
835
|
parameters: string;
|
|
836
|
+
saveToSdCard: boolean;
|
|
824
837
|
} | {
|
|
825
838
|
type: "images";
|
|
826
839
|
url: string | null;
|
|
@@ -896,6 +909,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
896
909
|
type: "video";
|
|
897
910
|
url: string | null;
|
|
898
911
|
parameters: string;
|
|
912
|
+
saveToSdCard: boolean;
|
|
899
913
|
} | {
|
|
900
914
|
type: "images";
|
|
901
915
|
url: string | null;
|
|
@@ -971,6 +985,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
971
985
|
type: "video";
|
|
972
986
|
url: string | null;
|
|
973
987
|
parameters: string;
|
|
988
|
+
saveToSdCard: boolean;
|
|
974
989
|
} | {
|
|
975
990
|
type: "images";
|
|
976
991
|
url: string | null;
|
|
@@ -1046,6 +1061,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1046
1061
|
type: "video";
|
|
1047
1062
|
url: string | null;
|
|
1048
1063
|
parameters: string;
|
|
1064
|
+
saveToSdCard: boolean;
|
|
1049
1065
|
} | {
|
|
1050
1066
|
type: "images";
|
|
1051
1067
|
url: string | null;
|
|
@@ -1121,6 +1137,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1121
1137
|
type: "video";
|
|
1122
1138
|
url: string | null;
|
|
1123
1139
|
parameters: string;
|
|
1140
|
+
saveToSdCard: boolean;
|
|
1124
1141
|
} | {
|
|
1125
1142
|
type: "images";
|
|
1126
1143
|
url: string | null;
|
|
@@ -1196,6 +1213,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1196
1213
|
type: "video";
|
|
1197
1214
|
url: string | null;
|
|
1198
1215
|
parameters: string;
|
|
1216
|
+
saveToSdCard: boolean;
|
|
1199
1217
|
} | {
|
|
1200
1218
|
type: "images";
|
|
1201
1219
|
url: string | null;
|
|
@@ -1271,6 +1289,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1271
1289
|
type: "video";
|
|
1272
1290
|
url: string | null;
|
|
1273
1291
|
parameters: string;
|
|
1292
|
+
saveToSdCard: boolean;
|
|
1274
1293
|
} | {
|
|
1275
1294
|
type: "images";
|
|
1276
1295
|
url: string | null;
|
|
@@ -1346,6 +1365,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1346
1365
|
type: "video";
|
|
1347
1366
|
url: string | null;
|
|
1348
1367
|
parameters: string;
|
|
1368
|
+
saveToSdCard: boolean;
|
|
1349
1369
|
} | {
|
|
1350
1370
|
type: "images";
|
|
1351
1371
|
url: string | null;
|
|
@@ -1421,6 +1441,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1421
1441
|
type: "video";
|
|
1422
1442
|
url: string | null;
|
|
1423
1443
|
parameters: string;
|
|
1444
|
+
saveToSdCard: boolean;
|
|
1424
1445
|
} | {
|
|
1425
1446
|
type: "images";
|
|
1426
1447
|
url: string | null;
|
|
@@ -1496,6 +1517,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1496
1517
|
type: "video";
|
|
1497
1518
|
url: string | null;
|
|
1498
1519
|
parameters: string;
|
|
1520
|
+
saveToSdCard: boolean;
|
|
1499
1521
|
} | {
|
|
1500
1522
|
type: "images";
|
|
1501
1523
|
url: string | null;
|
|
@@ -1534,8 +1556,10 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1534
1556
|
avSyncMsec: number;
|
|
1535
1557
|
};
|
|
1536
1558
|
platform: "youtube_rtmp";
|
|
1537
|
-
})[]>;
|
|
1538
|
-
setStreamList
|
|
1559
|
+
} | TUnknownStream)[]>;
|
|
1560
|
+
setStreamList<TUnknownStream extends {
|
|
1561
|
+
platform: string;
|
|
1562
|
+
}>(streamList: (TStream | TUnknownStream)[], options?: THttpRequestOptions): Promise<void>;
|
|
1539
1563
|
getStream(streamId: string, options?: THttpRequestOptions): Promise<{
|
|
1540
1564
|
post: {
|
|
1541
1565
|
postLocation: "timeline";
|
|
@@ -1580,6 +1604,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1580
1604
|
type: "video";
|
|
1581
1605
|
url: string | null;
|
|
1582
1606
|
parameters: string;
|
|
1607
|
+
saveToSdCard: boolean;
|
|
1583
1608
|
} | {
|
|
1584
1609
|
type: "images";
|
|
1585
1610
|
url: string | null;
|
|
@@ -1658,6 +1683,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1658
1683
|
type: "video";
|
|
1659
1684
|
url: string | null;
|
|
1660
1685
|
parameters: string;
|
|
1686
|
+
saveToSdCard: boolean;
|
|
1661
1687
|
} | {
|
|
1662
1688
|
type: "images";
|
|
1663
1689
|
url: string | null;
|
|
@@ -1733,6 +1759,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1733
1759
|
type: "video";
|
|
1734
1760
|
url: string | null;
|
|
1735
1761
|
parameters: string;
|
|
1762
|
+
saveToSdCard: boolean;
|
|
1736
1763
|
} | {
|
|
1737
1764
|
type: "images";
|
|
1738
1765
|
url: string | null;
|
|
@@ -1820,6 +1847,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1820
1847
|
type: "video";
|
|
1821
1848
|
url: string | null;
|
|
1822
1849
|
parameters: string;
|
|
1850
|
+
saveToSdCard: boolean;
|
|
1823
1851
|
} | {
|
|
1824
1852
|
type: "images";
|
|
1825
1853
|
url: string | null;
|
|
@@ -1895,6 +1923,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1895
1923
|
type: "video";
|
|
1896
1924
|
url: string | null;
|
|
1897
1925
|
parameters: string;
|
|
1926
|
+
saveToSdCard: boolean;
|
|
1898
1927
|
} | {
|
|
1899
1928
|
type: "images";
|
|
1900
1929
|
url: string | null;
|
|
@@ -1970,6 +1999,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
1970
1999
|
type: "video";
|
|
1971
2000
|
url: string | null;
|
|
1972
2001
|
parameters: string;
|
|
2002
|
+
saveToSdCard: boolean;
|
|
1973
2003
|
} | {
|
|
1974
2004
|
type: "images";
|
|
1975
2005
|
url: string | null;
|
|
@@ -2045,6 +2075,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2045
2075
|
type: "video";
|
|
2046
2076
|
url: string | null;
|
|
2047
2077
|
parameters: string;
|
|
2078
|
+
saveToSdCard: boolean;
|
|
2048
2079
|
} | {
|
|
2049
2080
|
type: "images";
|
|
2050
2081
|
url: string | null;
|
|
@@ -2120,6 +2151,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2120
2151
|
type: "video";
|
|
2121
2152
|
url: string | null;
|
|
2122
2153
|
parameters: string;
|
|
2154
|
+
saveToSdCard: boolean;
|
|
2123
2155
|
} | {
|
|
2124
2156
|
type: "images";
|
|
2125
2157
|
url: string | null;
|
|
@@ -2195,6 +2227,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2195
2227
|
type: "video";
|
|
2196
2228
|
url: string | null;
|
|
2197
2229
|
parameters: string;
|
|
2230
|
+
saveToSdCard: boolean;
|
|
2198
2231
|
} | {
|
|
2199
2232
|
type: "images";
|
|
2200
2233
|
url: string | null;
|
|
@@ -2270,6 +2303,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2270
2303
|
type: "video";
|
|
2271
2304
|
url: string | null;
|
|
2272
2305
|
parameters: string;
|
|
2306
|
+
saveToSdCard: boolean;
|
|
2273
2307
|
} | {
|
|
2274
2308
|
type: "images";
|
|
2275
2309
|
url: string | null;
|
|
@@ -2345,6 +2379,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2345
2379
|
type: "video";
|
|
2346
2380
|
url: string | null;
|
|
2347
2381
|
parameters: string;
|
|
2382
|
+
saveToSdCard: boolean;
|
|
2348
2383
|
} | {
|
|
2349
2384
|
type: "images";
|
|
2350
2385
|
url: string | null;
|
|
@@ -2420,6 +2455,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2420
2455
|
type: "video";
|
|
2421
2456
|
url: string | null;
|
|
2422
2457
|
parameters: string;
|
|
2458
|
+
saveToSdCard: boolean;
|
|
2423
2459
|
} | {
|
|
2424
2460
|
type: "images";
|
|
2425
2461
|
url: string | null;
|
|
@@ -2495,6 +2531,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2495
2531
|
type: "video";
|
|
2496
2532
|
url: string | null;
|
|
2497
2533
|
parameters: string;
|
|
2534
|
+
saveToSdCard: boolean;
|
|
2498
2535
|
} | {
|
|
2499
2536
|
type: "images";
|
|
2500
2537
|
url: string | null;
|
|
@@ -2570,6 +2607,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2570
2607
|
type: "video";
|
|
2571
2608
|
url: string | null;
|
|
2572
2609
|
parameters: string;
|
|
2610
|
+
saveToSdCard: boolean;
|
|
2573
2611
|
} | {
|
|
2574
2612
|
type: "images";
|
|
2575
2613
|
url: string | null;
|
|
@@ -2645,6 +2683,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2645
2683
|
type: "video";
|
|
2646
2684
|
url: string | null;
|
|
2647
2685
|
parameters: string;
|
|
2686
|
+
saveToSdCard: boolean;
|
|
2648
2687
|
} | {
|
|
2649
2688
|
type: "images";
|
|
2650
2689
|
url: string | null;
|
|
@@ -2720,6 +2759,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2720
2759
|
type: "video";
|
|
2721
2760
|
url: string | null;
|
|
2722
2761
|
parameters: string;
|
|
2762
|
+
saveToSdCard: boolean;
|
|
2723
2763
|
} | {
|
|
2724
2764
|
type: "images";
|
|
2725
2765
|
url: string | null;
|
|
@@ -2795,6 +2835,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2795
2835
|
type: "video";
|
|
2796
2836
|
url: string | null;
|
|
2797
2837
|
parameters: string;
|
|
2838
|
+
saveToSdCard: boolean;
|
|
2798
2839
|
} | {
|
|
2799
2840
|
type: "images";
|
|
2800
2841
|
url: string | null;
|
|
@@ -2870,6 +2911,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2870
2911
|
type: "video";
|
|
2871
2912
|
url: string | null;
|
|
2872
2913
|
parameters: string;
|
|
2914
|
+
saveToSdCard: boolean;
|
|
2873
2915
|
} | {
|
|
2874
2916
|
type: "images";
|
|
2875
2917
|
url: string | null;
|
|
@@ -2945,6 +2987,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
2945
2987
|
type: "video";
|
|
2946
2988
|
url: string | null;
|
|
2947
2989
|
parameters: string;
|
|
2990
|
+
saveToSdCard: boolean;
|
|
2948
2991
|
} | {
|
|
2949
2992
|
type: "images";
|
|
2950
2993
|
url: string | null;
|
|
@@ -3020,6 +3063,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
|
|
|
3020
3063
|
type: "video";
|
|
3021
3064
|
url: string | null;
|
|
3022
3065
|
parameters: string;
|
|
3066
|
+
saveToSdCard: boolean;
|
|
3023
3067
|
} | {
|
|
3024
3068
|
type: "images";
|
|
3025
3069
|
url: string | null;
|
package/cjs/CamStreamerAPI.js
CHANGED
|
@@ -46,14 +46,15 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
46
46
|
streamId,
|
|
47
47
|
...(0, exports.parseCameraStreamResponse)(streamData),
|
|
48
48
|
}));
|
|
49
|
-
throw new errors_1.MigrationError([], data);
|
|
49
|
+
throw new errors_1.MigrationError([], data, [], []);
|
|
50
50
|
}
|
|
51
51
|
const newStreamData = [];
|
|
52
|
+
const unknownStreamData = [];
|
|
52
53
|
const oldStreamData = [];
|
|
53
54
|
const invalidStreamData = [];
|
|
54
55
|
for (const streamData of res.data.streamList) {
|
|
55
56
|
if (streamData.platform !== undefined && !Object.values(CamStreamerAPI_2.streamPlatforms).includes(streamData.platform)) {
|
|
56
|
-
|
|
57
|
+
unknownStreamData.push(streamData);
|
|
57
58
|
continue;
|
|
58
59
|
}
|
|
59
60
|
const newStreamParse = CamStreamerAPI_1.streamSchema.safeParse(streamData);
|
|
@@ -72,9 +73,9 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
72
73
|
invalidStreamData.push(streamData);
|
|
73
74
|
}
|
|
74
75
|
if (oldStreamData.length > 0 || invalidStreamData.length > 0) {
|
|
75
|
-
throw new errors_1.MigrationError(newStreamData, oldStreamData, invalidStreamData);
|
|
76
|
+
throw new errors_1.MigrationError(newStreamData, oldStreamData, invalidStreamData, unknownStreamData);
|
|
76
77
|
}
|
|
77
|
-
return newStreamData;
|
|
78
|
+
return [...newStreamData, ...unknownStreamData];
|
|
78
79
|
}
|
|
79
80
|
async setStreamList(streamList, options) {
|
|
80
81
|
await this._postJsonEncoded(`${BASE_PATH}/stream_list.cgi`, { streamList }, {
|
|
@@ -88,7 +89,7 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
|
|
|
88
89
|
return newStream.data;
|
|
89
90
|
}
|
|
90
91
|
const oldStream = oldStreamSchema_1.oldStringStreamSchema.passthrough().parse(res.data);
|
|
91
|
-
throw new errors_1.MigrationError([], [{ streamId, ...(0, exports.parseCameraStreamResponse)(oldStream) }]);
|
|
92
|
+
throw new errors_1.MigrationError([], [{ streamId, ...(0, exports.parseCameraStreamResponse)(oldStream) }], [], []);
|
|
92
93
|
}
|
|
93
94
|
async setStream(streamId, streamData, options) {
|
|
94
95
|
await this._postJsonEncoded(`${BASE_PATH}/stream_list.cgi`, streamData, {
|
package/cjs/PlaneTrackerAPI.d.ts
CHANGED
|
@@ -230,7 +230,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> ext
|
|
|
230
230
|
checkGenetecConnection(params: TParameters, options?: THttpRequestOptions): Promise<TResponse>;
|
|
231
231
|
getGenetecCameraList(params: TParameters, options?: THttpRequestOptions): Promise<{
|
|
232
232
|
value: string;
|
|
233
|
-
index: number;
|
|
234
233
|
label: string;
|
|
234
|
+
index: number;
|
|
235
235
|
}[]>;
|
|
236
236
|
}
|
package/cjs/VapixAPI.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
|
|
|
9
9
|
prototype: FormData;
|
|
10
10
|
});
|
|
11
11
|
postUrlEncoded(path: string, parameters?: TParameters, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
12
|
-
postJson
|
|
12
|
+
postJson(path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions): Promise<TResponse>;
|
|
13
13
|
getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
|
|
14
14
|
getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
|
|
15
15
|
getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<{
|
|
@@ -96,6 +96,10 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
|
|
|
96
96
|
addCameraUser(username: string, pass: string, sgrp: string, comment?: string, options?: THttpRequestOptions): Promise<TResponse>;
|
|
97
97
|
getCameraUsers(options?: THttpRequestOptions): Promise<string>;
|
|
98
98
|
editCameraUser(username: string, pass: string, options?: THttpRequestOptions): Promise<TResponse>;
|
|
99
|
+
getRecordingRuleList(options?: THttpRequestOptions): Promise<Element | undefined>;
|
|
100
|
+
addRecordingRule(params: Record<string, string>, options?: THttpRequestOptions): Promise<Element | undefined>;
|
|
101
|
+
removeRecordingRule(profileId: string, options?: THttpRequestOptions): Promise<Element | undefined>;
|
|
102
|
+
getDiskInfo(diskId?: string, options?: THttpRequestOptions): Promise<Element | undefined>;
|
|
99
103
|
getApplicationList(options?: THttpRequestOptions): Promise<{
|
|
100
104
|
Name: string;
|
|
101
105
|
NiceName: string;
|
|
@@ -116,4 +120,5 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
|
|
|
116
120
|
private static parseParameters;
|
|
117
121
|
private static parseCameraPtzResponse;
|
|
118
122
|
private static parsePtz;
|
|
123
|
+
private static parseXmlResponse;
|
|
119
124
|
}
|
package/cjs/VapixAPI.js
CHANGED
|
@@ -23,7 +23,7 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
23
23
|
}
|
|
24
24
|
return res;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
async postJson(path, data, headers, options) {
|
|
27
27
|
const agent = this.getClient(options?.proxyParams);
|
|
28
28
|
const jsonData = JSON.stringify(data);
|
|
29
29
|
const res = await agent.post({
|
|
@@ -36,7 +36,7 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
36
36
|
throw new errors_1.ErrorWithResponse(res);
|
|
37
37
|
}
|
|
38
38
|
return res;
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
async getCameraImage(parameters, options) {
|
|
41
41
|
const agent = this.getClient(options?.proxyParams);
|
|
42
42
|
return (await agent.get({
|
|
@@ -418,6 +418,26 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
418
418
|
pwd: pass,
|
|
419
419
|
}, options);
|
|
420
420
|
}
|
|
421
|
+
async getRecordingRuleList(options) {
|
|
422
|
+
const res = await this._getText('/axis-cgi/record/continuous/listconfiguration.cgi', undefined, options);
|
|
423
|
+
return VapixAPI.parseXmlResponse(res, 'continuousrecordingconfigurations');
|
|
424
|
+
}
|
|
425
|
+
async addRecordingRule(params, options) {
|
|
426
|
+
const res = await this._getText('/axis-cgi/record/continuous/addconfiguration.cgi', params, options);
|
|
427
|
+
return VapixAPI.parseXmlResponse(res, 'configure');
|
|
428
|
+
}
|
|
429
|
+
async removeRecordingRule(profileId, options) {
|
|
430
|
+
const res = await this._getText('/axis-cgi/record/continuous/removeconfiguration.cgi', {
|
|
431
|
+
profile: profileId,
|
|
432
|
+
}, options);
|
|
433
|
+
return VapixAPI.parseXmlResponse(res, 'remove');
|
|
434
|
+
}
|
|
435
|
+
async getDiskInfo(diskId = 'all', options) {
|
|
436
|
+
const res = await this._getText('/axis-cgi/disks/list.cgi', {
|
|
437
|
+
diskid: diskId,
|
|
438
|
+
}, options);
|
|
439
|
+
return VapixAPI.parseXmlResponse(res, 'disks');
|
|
440
|
+
}
|
|
421
441
|
async getApplicationList(options) {
|
|
422
442
|
const agent = this.getClient(options?.proxyParams);
|
|
423
443
|
const res = await agent.get({ path: '/axis-cgi/applications/list.cgi', timeout: options?.timeout });
|
|
@@ -571,5 +591,13 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
571
591
|
});
|
|
572
592
|
return res;
|
|
573
593
|
};
|
|
594
|
+
static parseXmlResponse = (xml, nodeName) => {
|
|
595
|
+
const doc = new DOMParser().parseFromString(xml, 'text/xml');
|
|
596
|
+
const node = doc.getElementsByTagName(nodeName);
|
|
597
|
+
if (node.length !== 1) {
|
|
598
|
+
throw new Error('Invalid XML from camera');
|
|
599
|
+
}
|
|
600
|
+
return node[0];
|
|
601
|
+
};
|
|
574
602
|
}
|
|
575
603
|
exports.VapixAPI = VapixAPI;
|
package/cjs/errors/errors.d.ts
CHANGED
|
@@ -96,8 +96,13 @@ export declare class MigrationError extends Error {
|
|
|
96
96
|
streamId: string;
|
|
97
97
|
})[];
|
|
98
98
|
readonly invalid: any[];
|
|
99
|
+
readonly unknown: {
|
|
100
|
+
platform: string;
|
|
101
|
+
}[];
|
|
99
102
|
constructor(valid: TStream[], old: (TOldStream & {
|
|
100
103
|
streamId: string;
|
|
101
|
-
})[], invalid?: any[]
|
|
104
|
+
})[], invalid?: any[], unknown?: {
|
|
105
|
+
platform: string;
|
|
106
|
+
}[]);
|
|
102
107
|
}
|
|
103
108
|
export {};
|
package/cjs/errors/errors.js
CHANGED
|
@@ -208,12 +208,14 @@ class MigrationError extends Error {
|
|
|
208
208
|
valid;
|
|
209
209
|
old;
|
|
210
210
|
invalid;
|
|
211
|
-
|
|
211
|
+
unknown;
|
|
212
|
+
constructor(valid, old, invalid = [], unknown = []) {
|
|
212
213
|
super('Migration to newer version is needed: some stream entries failed to parse.');
|
|
213
214
|
this.name = 'MigrationError';
|
|
214
215
|
this.valid = valid;
|
|
215
216
|
this.old = old;
|
|
216
217
|
this.invalid = invalid;
|
|
218
|
+
this.unknown = unknown;
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
exports.MigrationError = MigrationError;
|