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.
- package/dist/cjs/common/types/UaError.js +4 -0
- package/dist/cjs/common/types/UaStatusCode.js +4 -9
- package/dist/common/types/UaError.d.ts +1 -0
- package/dist/common/types/UaError.js +4 -0
- package/dist/common/types/UaStatusCode.d.ts +1 -4
- package/dist/common/types/UaStatusCode.js +4 -9
- package/package.json +1 -1
|
@@ -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
|
|
70
|
+
return UaStatusCode.from(code);
|
|
76
71
|
}
|
|
@@ -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
|
|
70
|
+
return UaStatusCode.from(code);
|
|
76
71
|
}
|