opcua-webapi-ts 1.1.11 → 1.1.12

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,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UaError = void 0;
4
+ const _1 = require(".");
4
5
  class UaError extends Error {
5
6
  constructor(statusCode) {
6
7
  super();
@@ -11,5 +12,8 @@ class UaError extends Error {
11
12
  get statusCode() {
12
13
  return this._statusCode;
13
14
  }
15
+ static from(code) {
16
+ return new UaError(new _1.UaStatusCode(code));
17
+ }
14
18
  }
15
19
  exports.UaError = UaError;
@@ -31,14 +31,6 @@ class UaStatusCode {
31
31
  get hasOverflowBit() {
32
32
  return this.checkBit(exports.extraStatusCodeBits.Overflow);
33
33
  }
34
- /** returns true if the semanticChange bit is set */
35
- get hasSemanticChangedBit() {
36
- return this.checkBit(exports.extraStatusCodeBits.SemanticChanged);
37
- }
38
- /** returns true if the structureChange bit is set */
39
- get hasStructureChangedBit() {
40
- return this.checkBit(exports.extraStatusCodeBits.StructureChanged);
41
- }
42
34
  equals(other) {
43
35
  return this.value === other.value;
44
36
  }
@@ -54,6 +46,9 @@ class UaStatusCode {
54
46
  isUncertain() {
55
47
  return (this.value < 0x80000000 && this.value >= 0x10000000);
56
48
  }
49
+ static from(code) {
50
+ return new UaStatusCode(code);
51
+ }
57
52
  }
58
53
  exports.UaStatusCode = UaStatusCode;
59
54
  UaStatusCode._codesDictionary = null;
@@ -72,5 +67,5 @@ exports.extraStatusCodeBits = {
72
67
  HistorianMultiValue: 0x1 << 4
73
68
  };
74
69
  function makeUaStatusCode(code) {
75
- return new UaStatusCode(code);
70
+ return UaStatusCode.from(code);
76
71
  }
@@ -3,4 +3,5 @@ export declare class UaError extends Error {
3
3
  private readonly _statusCode;
4
4
  constructor(statusCode: UaStatusCode);
5
5
  get statusCode(): UaStatusCode;
6
+ static from(code: number): UaError;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UaError = void 0;
4
+ const _1 = require(".");
4
5
  class UaError extends Error {
5
6
  constructor(statusCode) {
6
7
  super();
@@ -11,5 +12,8 @@ class UaError extends Error {
11
12
  get statusCode() {
12
13
  return this._statusCode;
13
14
  }
15
+ static from(code) {
16
+ return new UaError(new _1.UaStatusCode(code));
17
+ }
14
18
  }
15
19
  exports.UaError = UaError;
@@ -8,15 +8,12 @@ export declare class UaStatusCode {
8
8
  checkBit(mask: number): boolean;
9
9
  /** returns true if the overflow bit is set */
10
10
  get hasOverflowBit(): boolean;
11
- /** returns true if the semanticChange bit is set */
12
- get hasSemanticChangedBit(): boolean;
13
- /** returns true if the structureChange bit is set */
14
- get hasStructureChangedBit(): boolean;
15
11
  equals(other: UaStatusCode): boolean;
16
12
  isGood(): boolean;
17
13
  isNotGood(): boolean;
18
14
  isBad(): boolean;
19
15
  isUncertain(): boolean;
16
+ static from(code: number): UaStatusCode;
20
17
  }
21
18
  export declare const extraStatusCodeBits: {
22
19
  [key: string]: number;
@@ -31,14 +31,6 @@ class UaStatusCode {
31
31
  get hasOverflowBit() {
32
32
  return this.checkBit(exports.extraStatusCodeBits.Overflow);
33
33
  }
34
- /** returns true if the semanticChange bit is set */
35
- get hasSemanticChangedBit() {
36
- return this.checkBit(exports.extraStatusCodeBits.SemanticChanged);
37
- }
38
- /** returns true if the structureChange bit is set */
39
- get hasStructureChangedBit() {
40
- return this.checkBit(exports.extraStatusCodeBits.StructureChanged);
41
- }
42
34
  equals(other) {
43
35
  return this.value === other.value;
44
36
  }
@@ -54,6 +46,9 @@ class UaStatusCode {
54
46
  isUncertain() {
55
47
  return (this.value < 0x80000000 && this.value >= 0x10000000);
56
48
  }
49
+ static from(code) {
50
+ return new UaStatusCode(code);
51
+ }
57
52
  }
58
53
  exports.UaStatusCode = UaStatusCode;
59
54
  UaStatusCode._codesDictionary = null;
@@ -72,5 +67,5 @@ exports.extraStatusCodeBits = {
72
67
  HistorianMultiValue: 0x1 << 4
73
68
  };
74
69
  function makeUaStatusCode(code) {
75
- return new UaStatusCode(code);
70
+ return UaStatusCode.from(code);
76
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opcua-webapi-ts",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Provides OPC UA WebAPI wrapper and client based on opcua-webapi-typescript",
5
5
  "author": "DingYan",
6
6
  "license": "MIT",