camstreamerlib 4.0.0-beta.110 → 4.0.0-beta.112

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.
@@ -13,6 +13,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
13
13
  wsAuthorization(options?: THttpRequestOptions): Promise<string>;
14
14
  getUtcTime(options?: THttpRequestOptions): Promise<number>;
15
15
  getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
16
+ isCSPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
16
17
  getStreamList(options?: THttpRequestOptions): Promise<({
17
18
  post: {
18
19
  postLocation: "timeline";
@@ -1075,6 +1076,65 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
1075
1076
  outputUrl: string;
1076
1077
  streamKey: string;
1077
1078
  streamIdentifier?: string | undefined;
1079
+ } | {
1080
+ type: "youtube_rtmp";
1081
+ audio: {
1082
+ source: "none";
1083
+ } | {
1084
+ source: "microphone";
1085
+ audioChannelNbr: 1 | 2;
1086
+ } | {
1087
+ source: "file";
1088
+ fileName: string;
1089
+ filePath: string;
1090
+ } | {
1091
+ source: "url";
1092
+ fileName: string;
1093
+ fileUrl: string;
1094
+ avSyncMsec: number;
1095
+ };
1096
+ video: {
1097
+ inputType: "RTSP_URL" | "CSw" | "CRS";
1098
+ internalVapixParameters: string;
1099
+ userVapixParameters: string;
1100
+ streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
1101
+ sourceUrl?: string | undefined;
1102
+ streamDelay?: {
1103
+ value: number;
1104
+ unit: "seconds" | "minutes" | "hours";
1105
+ } | undefined;
1106
+ };
1107
+ enabled: boolean;
1108
+ id: number;
1109
+ active: boolean;
1110
+ title: string;
1111
+ trigger: {
1112
+ type: "manual";
1113
+ ioPort: string | null;
1114
+ } | {
1115
+ type: "onetime";
1116
+ startTime: number;
1117
+ stopTime: number;
1118
+ } | {
1119
+ type: "recurrent";
1120
+ schedule: {
1121
+ start: {
1122
+ day: number;
1123
+ timeS: number;
1124
+ };
1125
+ stop: {
1126
+ day: number;
1127
+ timeS: number;
1128
+ };
1129
+ isActive: boolean;
1130
+ }[];
1131
+ };
1132
+ saveToSdCard: boolean;
1133
+ statusCameraLed: boolean;
1134
+ statusCameraOutput: string | null;
1135
+ outputUrl: string;
1136
+ streamKey: string;
1137
+ streamIdentifier?: string | undefined;
1078
1138
  })[]>;
1079
1139
  setStreamList(streamList: TStreamList['streamList'], options?: THttpRequestOptions): Promise<void>;
1080
1140
  getStream(streamId: number, options?: THttpRequestOptions): Promise<{
@@ -2139,6 +2199,65 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
2139
2199
  outputUrl: string;
2140
2200
  streamKey: string;
2141
2201
  streamIdentifier?: string | undefined;
2202
+ } | {
2203
+ type: "youtube_rtmp";
2204
+ audio: {
2205
+ source: "none";
2206
+ } | {
2207
+ source: "microphone";
2208
+ audioChannelNbr: 1 | 2;
2209
+ } | {
2210
+ source: "file";
2211
+ fileName: string;
2212
+ filePath: string;
2213
+ } | {
2214
+ source: "url";
2215
+ fileName: string;
2216
+ fileUrl: string;
2217
+ avSyncMsec: number;
2218
+ };
2219
+ video: {
2220
+ inputType: "RTSP_URL" | "CSw" | "CRS";
2221
+ internalVapixParameters: string;
2222
+ userVapixParameters: string;
2223
+ streamingProtocol: "RTMP" | "RTMPS" | "HLS_PUSH";
2224
+ sourceUrl?: string | undefined;
2225
+ streamDelay?: {
2226
+ value: number;
2227
+ unit: "seconds" | "minutes" | "hours";
2228
+ } | undefined;
2229
+ };
2230
+ enabled: boolean;
2231
+ id: number;
2232
+ active: boolean;
2233
+ title: string;
2234
+ trigger: {
2235
+ type: "manual";
2236
+ ioPort: string | null;
2237
+ } | {
2238
+ type: "onetime";
2239
+ startTime: number;
2240
+ stopTime: number;
2241
+ } | {
2242
+ type: "recurrent";
2243
+ schedule: {
2244
+ start: {
2245
+ day: number;
2246
+ timeS: number;
2247
+ };
2248
+ stop: {
2249
+ day: number;
2250
+ timeS: number;
2251
+ };
2252
+ isActive: boolean;
2253
+ }[];
2254
+ };
2255
+ saveToSdCard: boolean;
2256
+ statusCameraLed: boolean;
2257
+ statusCameraOutput: string | null;
2258
+ outputUrl: string;
2259
+ streamKey: string;
2260
+ streamIdentifier?: string | undefined;
2142
2261
  }>;
2143
2262
  setStream(streamId: number, streamData: TStream, options?: THttpRequestOptions): Promise<void>;
2144
2263
  isStreaming(streamId: number, options?: THttpRequestOptions): Promise<boolean>;
@@ -38,6 +38,10 @@ class CamStreamerAPI {
38
38
  async getMaxFps(source = 0, options) {
39
39
  return await this._getJson(`${BASE_PATH}/get_max_framerate.cgi`, { video_source: source.toString() }, options);
40
40
  }
41
+ async isCSPassValid(pass, options) {
42
+ const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
43
+ return res.data === '1';
44
+ }
41
45
  async getStreamList(options) {
42
46
  const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
43
47
  const oldStreamListRecord = zod_1.z.record(zod_1.z.string(), oldStreamSchema_1.oldStringStreamSchema).safeParse(res.data);
@@ -67,7 +71,7 @@ class CamStreamerAPI {
67
71
  }
68
72
  invalidStreamData.push(streamData);
69
73
  }
70
- if (oldStreamData.length > 0) {
74
+ if (oldStreamData.length > 0 || invalidStreamData.length > 0) {
71
75
  throw new errors_1.MigrationError(newStreamData, oldStreamData, invalidStreamData);
72
76
  }
73
77
  return newStreamData;
@@ -23,9 +23,9 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
23
23
  camera: {
24
24
  ip: string;
25
25
  port: number;
26
- protocol: "https" | "http" | "https_insecure";
27
- user: string;
28
26
  pass: string;
27
+ user: string;
28
+ protocol: "https" | "http" | "https_insecure";
29
29
  };
30
30
  units: "metric" | "imperial";
31
31
  adsbSource: {
@@ -100,9 +100,9 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
100
100
  ip: string;
101
101
  port: number;
102
102
  enabled: boolean;
103
- protocol: "https" | "http" | "https_insecure";
104
- user: string;
105
103
  pass: string;
104
+ user: string;
105
+ protocol: "https" | "http" | "https_insecure";
106
106
  sourceKey: string;
107
107
  };
108
108
  genetec: {
@@ -110,10 +110,10 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
110
110
  port: number;
111
111
  enabled: boolean;
112
112
  cameraList: string[];
113
+ pass: string;
113
114
  appId: string;
114
- protocol: "https" | "http" | "https_insecure";
115
115
  user: string;
116
- pass: string;
116
+ protocol: "https" | "http" | "https_insecure";
117
117
  baseUri: string;
118
118
  };
119
119
  camstreamerIntegration: {
package/cjs/VapixAPI.d.ts CHANGED
@@ -95,6 +95,9 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> {
95
95
  }[]>;
96
96
  setPorts(ports: TPortSetSchema[], options?: THttpRequestOptions): Promise<void>;
97
97
  setPortStateSequence(port: number, sequence: TPortSequenceStateSchema[], options?: THttpRequestOptions): Promise<void>;
98
+ addCameraUser(username: string, pass: string, sgrp: string, comment?: string, options?: THttpRequestOptions): Promise<TResponse>;
99
+ getCameraUsers(options?: THttpRequestOptions): Promise<string>;
100
+ editCameraUser(username: string, pass: string, options?: THttpRequestOptions): Promise<TResponse>;
98
101
  getApplicationList(options?: THttpRequestOptions): Promise<{
99
102
  Name: string;
100
103
  NiceName: string;
package/cjs/VapixAPI.js CHANGED
@@ -395,6 +395,29 @@ class VapixAPI {
395
395
  params: { port, sequence },
396
396
  }, undefined, options);
397
397
  }
398
+ async addCameraUser(username, pass, sgrp, comment, options) {
399
+ return await this.postUrlEncoded('/axis-cgi/pwdgrp.cgi', {
400
+ action: 'add',
401
+ user: username,
402
+ pwd: pass,
403
+ grp: 'users',
404
+ sgrp,
405
+ comment,
406
+ }, undefined, options);
407
+ }
408
+ async getCameraUsers(options) {
409
+ const res = await this.postUrlEncoded('/axis-cgi/pwdgrp.cgi', {
410
+ action: 'get',
411
+ }, undefined, options);
412
+ return await res.text();
413
+ }
414
+ async editCameraUser(username, pass, options) {
415
+ return await this.postUrlEncoded('/axis-cgi/pwdgrp.cgi', {
416
+ action: 'update',
417
+ user: username,
418
+ pwd: pass,
419
+ }, undefined, options);
420
+ }
398
421
  async getApplicationList(options) {
399
422
  const agent = this.getClient(options?.proxyParams);
400
423
  const res = await agent.get({ path: '/axis-cgi/applications/list.cgi', timeout: options?.timeout });