camstreamerlib 4.0.0-beta.136 → 4.0.0-beta.137

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.
@@ -56,6 +56,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
56
56
  type: "video";
57
57
  url: string | null;
58
58
  parameters: string;
59
+ saveToSdCard: boolean;
59
60
  } | {
60
61
  type: "images";
61
62
  url: string | null;
@@ -134,6 +135,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
134
135
  type: "video";
135
136
  url: string | null;
136
137
  parameters: string;
138
+ saveToSdCard: boolean;
137
139
  } | {
138
140
  type: "images";
139
141
  url: string | null;
@@ -209,6 +211,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
209
211
  type: "video";
210
212
  url: string | null;
211
213
  parameters: string;
214
+ saveToSdCard: boolean;
212
215
  } | {
213
216
  type: "images";
214
217
  url: string | null;
@@ -296,6 +299,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
296
299
  type: "video";
297
300
  url: string | null;
298
301
  parameters: string;
302
+ saveToSdCard: boolean;
299
303
  } | {
300
304
  type: "images";
301
305
  url: string | null;
@@ -371,6 +375,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
371
375
  type: "video";
372
376
  url: string | null;
373
377
  parameters: string;
378
+ saveToSdCard: boolean;
374
379
  } | {
375
380
  type: "images";
376
381
  url: string | null;
@@ -446,6 +451,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
446
451
  type: "video";
447
452
  url: string | null;
448
453
  parameters: string;
454
+ saveToSdCard: boolean;
449
455
  } | {
450
456
  type: "images";
451
457
  url: string | null;
@@ -521,6 +527,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
521
527
  type: "video";
522
528
  url: string | null;
523
529
  parameters: string;
530
+ saveToSdCard: boolean;
524
531
  } | {
525
532
  type: "images";
526
533
  url: string | null;
@@ -596,6 +603,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
596
603
  type: "video";
597
604
  url: string | null;
598
605
  parameters: string;
606
+ saveToSdCard: boolean;
599
607
  } | {
600
608
  type: "images";
601
609
  url: string | null;
@@ -671,6 +679,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
671
679
  type: "video";
672
680
  url: string | null;
673
681
  parameters: string;
682
+ saveToSdCard: boolean;
674
683
  } | {
675
684
  type: "images";
676
685
  url: string | null;
@@ -746,6 +755,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
746
755
  type: "video";
747
756
  url: string | null;
748
757
  parameters: string;
758
+ saveToSdCard: boolean;
749
759
  } | {
750
760
  type: "images";
751
761
  url: string | null;
@@ -821,6 +831,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
821
831
  type: "video";
822
832
  url: string | null;
823
833
  parameters: string;
834
+ saveToSdCard: boolean;
824
835
  } | {
825
836
  type: "images";
826
837
  url: string | null;
@@ -896,6 +907,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
896
907
  type: "video";
897
908
  url: string | null;
898
909
  parameters: string;
910
+ saveToSdCard: boolean;
899
911
  } | {
900
912
  type: "images";
901
913
  url: string | null;
@@ -971,6 +983,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
971
983
  type: "video";
972
984
  url: string | null;
973
985
  parameters: string;
986
+ saveToSdCard: boolean;
974
987
  } | {
975
988
  type: "images";
976
989
  url: string | null;
@@ -1046,6 +1059,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1046
1059
  type: "video";
1047
1060
  url: string | null;
1048
1061
  parameters: string;
1062
+ saveToSdCard: boolean;
1049
1063
  } | {
1050
1064
  type: "images";
1051
1065
  url: string | null;
@@ -1121,6 +1135,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1121
1135
  type: "video";
1122
1136
  url: string | null;
1123
1137
  parameters: string;
1138
+ saveToSdCard: boolean;
1124
1139
  } | {
1125
1140
  type: "images";
1126
1141
  url: string | null;
@@ -1196,6 +1211,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1196
1211
  type: "video";
1197
1212
  url: string | null;
1198
1213
  parameters: string;
1214
+ saveToSdCard: boolean;
1199
1215
  } | {
1200
1216
  type: "images";
1201
1217
  url: string | null;
@@ -1271,6 +1287,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1271
1287
  type: "video";
1272
1288
  url: string | null;
1273
1289
  parameters: string;
1290
+ saveToSdCard: boolean;
1274
1291
  } | {
1275
1292
  type: "images";
1276
1293
  url: string | null;
@@ -1346,6 +1363,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1346
1363
  type: "video";
1347
1364
  url: string | null;
1348
1365
  parameters: string;
1366
+ saveToSdCard: boolean;
1349
1367
  } | {
1350
1368
  type: "images";
1351
1369
  url: string | null;
@@ -1421,6 +1439,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1421
1439
  type: "video";
1422
1440
  url: string | null;
1423
1441
  parameters: string;
1442
+ saveToSdCard: boolean;
1424
1443
  } | {
1425
1444
  type: "images";
1426
1445
  url: string | null;
@@ -1496,6 +1515,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1496
1515
  type: "video";
1497
1516
  url: string | null;
1498
1517
  parameters: string;
1518
+ saveToSdCard: boolean;
1499
1519
  } | {
1500
1520
  type: "images";
1501
1521
  url: string | null;
@@ -1580,6 +1600,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1580
1600
  type: "video";
1581
1601
  url: string | null;
1582
1602
  parameters: string;
1603
+ saveToSdCard: boolean;
1583
1604
  } | {
1584
1605
  type: "images";
1585
1606
  url: string | null;
@@ -1658,6 +1679,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1658
1679
  type: "video";
1659
1680
  url: string | null;
1660
1681
  parameters: string;
1682
+ saveToSdCard: boolean;
1661
1683
  } | {
1662
1684
  type: "images";
1663
1685
  url: string | null;
@@ -1733,6 +1755,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1733
1755
  type: "video";
1734
1756
  url: string | null;
1735
1757
  parameters: string;
1758
+ saveToSdCard: boolean;
1736
1759
  } | {
1737
1760
  type: "images";
1738
1761
  url: string | null;
@@ -1820,6 +1843,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1820
1843
  type: "video";
1821
1844
  url: string | null;
1822
1845
  parameters: string;
1846
+ saveToSdCard: boolean;
1823
1847
  } | {
1824
1848
  type: "images";
1825
1849
  url: string | null;
@@ -1895,6 +1919,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1895
1919
  type: "video";
1896
1920
  url: string | null;
1897
1921
  parameters: string;
1922
+ saveToSdCard: boolean;
1898
1923
  } | {
1899
1924
  type: "images";
1900
1925
  url: string | null;
@@ -1970,6 +1995,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
1970
1995
  type: "video";
1971
1996
  url: string | null;
1972
1997
  parameters: string;
1998
+ saveToSdCard: boolean;
1973
1999
  } | {
1974
2000
  type: "images";
1975
2001
  url: string | null;
@@ -2045,6 +2071,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2045
2071
  type: "video";
2046
2072
  url: string | null;
2047
2073
  parameters: string;
2074
+ saveToSdCard: boolean;
2048
2075
  } | {
2049
2076
  type: "images";
2050
2077
  url: string | null;
@@ -2120,6 +2147,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2120
2147
  type: "video";
2121
2148
  url: string | null;
2122
2149
  parameters: string;
2150
+ saveToSdCard: boolean;
2123
2151
  } | {
2124
2152
  type: "images";
2125
2153
  url: string | null;
@@ -2195,6 +2223,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2195
2223
  type: "video";
2196
2224
  url: string | null;
2197
2225
  parameters: string;
2226
+ saveToSdCard: boolean;
2198
2227
  } | {
2199
2228
  type: "images";
2200
2229
  url: string | null;
@@ -2270,6 +2299,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2270
2299
  type: "video";
2271
2300
  url: string | null;
2272
2301
  parameters: string;
2302
+ saveToSdCard: boolean;
2273
2303
  } | {
2274
2304
  type: "images";
2275
2305
  url: string | null;
@@ -2345,6 +2375,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2345
2375
  type: "video";
2346
2376
  url: string | null;
2347
2377
  parameters: string;
2378
+ saveToSdCard: boolean;
2348
2379
  } | {
2349
2380
  type: "images";
2350
2381
  url: string | null;
@@ -2420,6 +2451,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2420
2451
  type: "video";
2421
2452
  url: string | null;
2422
2453
  parameters: string;
2454
+ saveToSdCard: boolean;
2423
2455
  } | {
2424
2456
  type: "images";
2425
2457
  url: string | null;
@@ -2495,6 +2527,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2495
2527
  type: "video";
2496
2528
  url: string | null;
2497
2529
  parameters: string;
2530
+ saveToSdCard: boolean;
2498
2531
  } | {
2499
2532
  type: "images";
2500
2533
  url: string | null;
@@ -2570,6 +2603,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2570
2603
  type: "video";
2571
2604
  url: string | null;
2572
2605
  parameters: string;
2606
+ saveToSdCard: boolean;
2573
2607
  } | {
2574
2608
  type: "images";
2575
2609
  url: string | null;
@@ -2645,6 +2679,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2645
2679
  type: "video";
2646
2680
  url: string | null;
2647
2681
  parameters: string;
2682
+ saveToSdCard: boolean;
2648
2683
  } | {
2649
2684
  type: "images";
2650
2685
  url: string | null;
@@ -2720,6 +2755,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2720
2755
  type: "video";
2721
2756
  url: string | null;
2722
2757
  parameters: string;
2758
+ saveToSdCard: boolean;
2723
2759
  } | {
2724
2760
  type: "images";
2725
2761
  url: string | null;
@@ -2795,6 +2831,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2795
2831
  type: "video";
2796
2832
  url: string | null;
2797
2833
  parameters: string;
2834
+ saveToSdCard: boolean;
2798
2835
  } | {
2799
2836
  type: "images";
2800
2837
  url: string | null;
@@ -2870,6 +2907,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2870
2907
  type: "video";
2871
2908
  url: string | null;
2872
2909
  parameters: string;
2910
+ saveToSdCard: boolean;
2873
2911
  } | {
2874
2912
  type: "images";
2875
2913
  url: string | null;
@@ -2945,6 +2983,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
2945
2983
  type: "video";
2946
2984
  url: string | null;
2947
2985
  parameters: string;
2986
+ saveToSdCard: boolean;
2948
2987
  } | {
2949
2988
  type: "images";
2950
2989
  url: string | null;
@@ -3020,6 +3059,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> exte
3020
3059
  type: "video";
3021
3060
  url: string | null;
3022
3061
  parameters: string;
3062
+ saveToSdCard: boolean;
3023
3063
  } | {
3024
3064
  type: "images";
3025
3065
  url: string | null;
@@ -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: (path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions) => Promise<TResponse>;
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
- postJson = async (path, data, headers, options) => {
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;