camstreamerlib 1.9.0 → 1.9.1

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.
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as EventEmitter from 'events';
4
- export declare type CamOverlayOptions = {
4
+ export type CamOverlayOptions = {
5
5
  protocol?: string;
6
6
  tls?: boolean;
7
7
  tlsInsecure?: boolean;
@@ -12,33 +12,33 @@ export declare type CamOverlayOptions = {
12
12
  serviceID?: number;
13
13
  camera?: number | number[];
14
14
  };
15
- export declare type Field = {
15
+ export type Field = {
16
16
  field_name: string;
17
17
  text: string;
18
18
  color?: string;
19
19
  };
20
- export declare type Message = {
20
+ export type Message = {
21
21
  command: string;
22
22
  params: any[];
23
23
  };
24
- export declare type CairoResponse = {
24
+ export type CairoResponse = {
25
25
  message: string;
26
26
  call_id: number;
27
27
  };
28
- export declare type CairoCreateResponse = {
28
+ export type CairoCreateResponse = {
29
29
  var: string;
30
30
  call_id: number;
31
31
  };
32
- export declare type UploadImageResponse = {
32
+ export type UploadImageResponse = {
33
33
  var: string;
34
34
  width: number;
35
35
  height: number;
36
36
  call_id: number;
37
37
  };
38
- export declare type Align = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
39
- export declare type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
40
- export declare type WriteTextParams = [string, string, number, number, number, number, Align, TextFit?];
41
- export declare type Service = {
38
+ export type Align = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
39
+ export type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
40
+ export type WriteTextParams = [string, string, number, number, number, number, Align, TextFit?];
41
+ export type Service = {
42
42
  id: number;
43
43
  enabled: number;
44
44
  schedule: string;
@@ -46,7 +46,7 @@ export declare type Service = {
46
46
  identifier: string;
47
47
  cameraList: number[];
48
48
  };
49
- export declare type ServiceList = {
49
+ export type ServiceList = {
50
50
  services: Service[];
51
51
  };
52
52
  export declare enum ImageType {
@@ -1,13 +1,13 @@
1
1
  /// <reference types="node" />
2
2
  import * as EventEmitter from 'events';
3
- export declare type CamScripterOptions = {
3
+ export type CamScripterOptions = {
4
4
  tls?: boolean;
5
5
  tlsInsecure?: boolean;
6
6
  ip?: string;
7
7
  port?: number;
8
8
  auth?: string;
9
9
  };
10
- export declare type Declaration = {
10
+ export type Declaration = {
11
11
  type?: '' | 'SOURCE' | 'DATA';
12
12
  namespace: string;
13
13
  key: string;
@@ -16,25 +16,25 @@ export declare type Declaration = {
16
16
  key_nice_name?: string;
17
17
  value_nice_name?: string;
18
18
  };
19
- export declare type EventDeclaration = {
19
+ export type EventDeclaration = {
20
20
  declaration_id: string;
21
21
  stateless: boolean;
22
22
  declaration: Declaration[];
23
23
  };
24
- export declare type EventUndeclaration = {
24
+ export type EventUndeclaration = {
25
25
  declaration_id: string;
26
26
  };
27
- export declare type EventData = {
27
+ export type EventData = {
28
28
  namespace: string;
29
29
  key: string;
30
30
  value: string | boolean | number;
31
31
  value_type: 'STRING' | 'INT' | 'BOOL' | 'DOUBLE';
32
32
  };
33
- export declare type Event = {
33
+ export type Event = {
34
34
  declaration_id: string;
35
35
  event_data: EventData[];
36
36
  };
37
- export declare type Response = {
37
+ export type Response = {
38
38
  call_id: number;
39
39
  message: string;
40
40
  };
@@ -1,4 +1,4 @@
1
- export declare type CamStreamerAPIOptions = {
1
+ export type CamStreamerAPIOptions = {
2
2
  protocol?: string;
3
3
  tls?: boolean;
4
4
  tlsInsecure?: boolean;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import * as EventEmitter from 'events';
3
- export declare type CamSwitcherAPIOptions = {
3
+ export type CamSwitcherAPIOptions = {
4
4
  tls?: boolean;
5
5
  tlsInsecure?: boolean;
6
6
  ip?: string;
package/CameraVapix.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  import * as http from 'http';
4
4
  import { EventEmitter2 as EventEmitter } from 'eventemitter2';
5
- export declare type CameraVapixOptions = {
5
+ export type CameraVapixOptions = {
6
6
  protocol?: string;
7
7
  tls?: boolean;
8
8
  tlsInsecure?: boolean;
@@ -10,7 +10,7 @@ export declare type CameraVapixOptions = {
10
10
  port?: number;
11
11
  auth?: string;
12
12
  };
13
- export declare type ApplicationList = {
13
+ export type ApplicationList = {
14
14
  reply: {
15
15
  $: {
16
16
  result: string;
@@ -20,7 +20,7 @@ export declare type ApplicationList = {
20
20
  }[];
21
21
  };
22
22
  };
23
- export declare type Application = {
23
+ export type Application = {
24
24
  Name: string;
25
25
  NiceName: string;
26
26
  Vendor: string;
@@ -32,7 +32,7 @@ export declare type Application = {
32
32
  VendorHomePage?: string;
33
33
  LicenseName?: string;
34
34
  };
35
- export declare type GuardTour = {
35
+ export type GuardTour = {
36
36
  id: string;
37
37
  camNbr: any;
38
38
  name: string;
package/CameraVapix.js CHANGED
@@ -233,9 +233,12 @@ class CameraVapix extends eventemitter2_1.EventEmitter2 {
233
233
  }
234
234
  websocketConnect(digestHeader) {
235
235
  var _a;
236
- const address = `ws://${this.ip}:${this.port}/vapix/ws-data-stream?sources=events`;
236
+ const protocol = this.tls ? 'wss' : 'ws';
237
+ const address = `${protocol}://${this.ip}:${this.port}/vapix/ws-data-stream?sources=events`;
237
238
  const options = {
238
239
  auth: this.auth,
240
+ rejectUnauthorized: !this.tlsInsecure,
241
+ headers: {},
239
242
  };
240
243
  if (digestHeader != undefined) {
241
244
  const userPass = this.auth.split(':');
package/HTTPRequest.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as http from 'http';
4
- export declare type HttpRequestOptions = {
4
+ export type HttpRequestOptions = {
5
5
  method?: string;
6
6
  protocol?: string;
7
7
  host: string;
package/HttpServer.d.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  /// <reference types="node" />
3
3
  import * as http from 'http';
4
4
  import * as EventEmitter from 'events';
5
- export declare type HttpServerOptions = {
5
+ export type HttpServerOptions = {
6
6
  port?: number;
7
7
  };
8
- declare type OnRequestCallback = (req: http.IncomingMessage, res: http.ServerResponse) => void;
8
+ type OnRequestCallback = (req: http.IncomingMessage, res: http.ServerResponse) => void;
9
9
  export declare class HttpServer extends EventEmitter {
10
10
  private port;
11
11
  private registeredPaths;
package/RtspClient.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as EventEmitter from 'events';
4
- export declare type RtspClientOptions = {
4
+ export type RtspClientOptions = {
5
5
  ip?: string;
6
6
  port?: number;
7
7
  auth?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "dependencies": {