node-opcua-data-model 2.55.0 → 2.56.0
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/_make_flag.d.ts +1 -1
- package/dist/_make_flag.js.map +1 -1
- package/dist/access_level.js.map +1 -1
- package/dist/access_level_ex.js +2 -2
- package/dist/access_level_ex.js.map +1 -1
- package/dist/access_restrictions.js.map +1 -1
- package/dist/attributeIds.js.map +1 -1
- package/dist/data_encoding.d.ts +1 -1
- package/dist/data_encoding.js +2 -2
- package/dist/data_encoding.js.map +1 -1
- package/dist/diagnostic_info.d.ts +2 -2
- package/dist/diagnostic_info.js.map +1 -1
- package/dist/localized_text.d.ts +3 -3
- package/dist/localized_text.js.map +1 -1
- package/dist/node_class_mask.js.map +1 -1
- package/dist/nodeclass.js.map +1 -1
- package/dist/permission_flag.js.map +1 -1
- package/dist/qualified_name.js +2 -2
- package/dist/qualified_name.js.map +1 -1
- package/dist/result_mask.js.map +1 -1
- package/dist/write_mask.js +1 -1
- package/dist/write_mask.js.map +1 -1
- package/package.json +9 -7
- package/source/BrowseDirection.ts +41 -41
- package/source/_make_flag.ts +2 -3
- package/source/access_level.ts +18 -13
- package/source/access_level_ex.ts +22 -25
- package/source/access_restrictions.ts +1 -3
- package/source/attributeIds.ts +1 -5
- package/source/data_encoding.ts +23 -23
- package/source/diagnostic_info.ts +362 -361
- package/source/localized_text.ts +189 -188
- package/source/node_class_mask.ts +47 -47
- package/source/nodeclass.ts +23 -23
- package/source/permission_flag.ts +8 -8
- package/source/qualified_name.ts +3 -3
- package/source/result_mask.ts +35 -35
- package/source/write_mask.ts +37 -37
package/source/localized_text.ts
CHANGED
|
@@ -1,188 +1,189 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-data-model
|
|
3
|
-
*/
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
5
|
-
import { decodeByte, decodeString, encodeByte, encodeString, LocaleId, UAString } from "node-opcua-basic-types";
|
|
6
|
-
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
7
|
-
import {
|
|
8
|
-
BaseUAObject,
|
|
9
|
-
buildStructuredType,
|
|
10
|
-
check_options_correctness_against_schema,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
public
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
tracer
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
cursorBefore
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
cursorBefore
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
value
|
|
187
|
-
|
|
188
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { decodeByte, decodeString, encodeByte, encodeString, LocaleId, UAString } from "node-opcua-basic-types";
|
|
6
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
7
|
+
import {
|
|
8
|
+
BaseUAObject,
|
|
9
|
+
buildStructuredType,
|
|
10
|
+
check_options_correctness_against_schema,
|
|
11
|
+
DecodeDebugOptions,
|
|
12
|
+
initialize_field,
|
|
13
|
+
parameters,
|
|
14
|
+
registerSpecialVariantEncoder,
|
|
15
|
+
StructuredTypeSchema
|
|
16
|
+
} from "node-opcua-factory";
|
|
17
|
+
|
|
18
|
+
export function coerceLocalizedText(value?: null | string | LocalizedTextOptions): LocalizedText | null {
|
|
19
|
+
if (value === undefined || value === null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (value instanceof LocalizedText) {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
return new LocalizedText(value);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// --------------------------------------------------------------------------------------------
|
|
29
|
+
// see Part 3 - $8.5 page 63
|
|
30
|
+
const schemaLocalizedText = buildStructuredType({
|
|
31
|
+
name: "LocalizedText",
|
|
32
|
+
|
|
33
|
+
baseType: "BaseUAObject",
|
|
34
|
+
|
|
35
|
+
fields: [
|
|
36
|
+
{
|
|
37
|
+
name: "locale",
|
|
38
|
+
|
|
39
|
+
fieldType: "LocaleId",
|
|
40
|
+
|
|
41
|
+
defaultValue: null
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "text",
|
|
45
|
+
|
|
46
|
+
fieldType: "UAString",
|
|
47
|
+
|
|
48
|
+
defaultValue: null
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
schemaLocalizedText.coerce = coerceLocalizedText;
|
|
53
|
+
|
|
54
|
+
export interface LocalizedTextOptions {
|
|
55
|
+
locale?: LocaleId;
|
|
56
|
+
text?: UAString;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class LocalizedText extends BaseUAObject {
|
|
60
|
+
static get schema(): StructuredTypeSchema {
|
|
61
|
+
return schemaLocalizedText;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public get schema(): StructuredTypeSchema {
|
|
65
|
+
return schemaLocalizedText;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public static possibleFields: string[] = ["locale", "text"];
|
|
69
|
+
|
|
70
|
+
public static coerce(value?: null | string | LocalizedTextOptions): LocalizedText | null {
|
|
71
|
+
return coerceLocalizedText(value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public locale: LocaleId;
|
|
75
|
+
public text: UAString;
|
|
76
|
+
|
|
77
|
+
constructor(options?: LocalizedTextOptions | string | null) {
|
|
78
|
+
super();
|
|
79
|
+
if (options === null) {
|
|
80
|
+
this.locale = null;
|
|
81
|
+
this.text = null;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (typeof options === "string") {
|
|
85
|
+
this.locale = null;
|
|
86
|
+
this.text = options;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
/* istanbul ignore next */
|
|
90
|
+
if (parameters.debugSchemaHelper) {
|
|
91
|
+
const schema = schemaLocalizedText;
|
|
92
|
+
check_options_correctness_against_schema(this, schema, options);
|
|
93
|
+
}
|
|
94
|
+
this.locale = options?.locale || null;
|
|
95
|
+
this.text = options?.text || null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public toString(): string {
|
|
99
|
+
return "locale=" + this.locale + " text=" + this.text;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// OPCUA Part 6 $ 5.2.2.14 : localizedText have a special encoding
|
|
103
|
+
public encode(stream: OutputBinaryStream): void {
|
|
104
|
+
// tslint:disable:no-bitwise
|
|
105
|
+
const encodingMask = getLocalizeText_EncodingByte(this);
|
|
106
|
+
|
|
107
|
+
encodeByte(encodingMask, stream);
|
|
108
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
109
|
+
encodeString(this.locale, stream);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
113
|
+
encodeString(this.text, stream);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void {
|
|
118
|
+
let cursorBefore;
|
|
119
|
+
const tracer = options.tracer;
|
|
120
|
+
tracer.trace("start", options.name + "(" + "LocalizedText" + ")", stream.length, stream.length);
|
|
121
|
+
cursorBefore = stream.length;
|
|
122
|
+
|
|
123
|
+
const encodingMask = decodeByte(stream);
|
|
124
|
+
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
|
|
125
|
+
cursorBefore = stream.length;
|
|
126
|
+
|
|
127
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
128
|
+
this.locale = decodeString(stream);
|
|
129
|
+
tracer.trace("member", "locale", this.locale, cursorBefore, stream.length, "locale");
|
|
130
|
+
cursorBefore = stream.length;
|
|
131
|
+
} else {
|
|
132
|
+
this.locale = null;
|
|
133
|
+
}
|
|
134
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
135
|
+
this.text = decodeString(stream);
|
|
136
|
+
tracer.trace("member", "text", this.text, cursorBefore, stream.length, "text");
|
|
137
|
+
// cursor_before = stream.length;
|
|
138
|
+
} else {
|
|
139
|
+
this.text = null;
|
|
140
|
+
}
|
|
141
|
+
tracer.trace("end", options.name, stream.length, stream.length);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public decode(stream: BinaryStream): void {
|
|
145
|
+
const encodingMask = decodeByte(stream);
|
|
146
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
147
|
+
this.locale = decodeString(stream);
|
|
148
|
+
} else {
|
|
149
|
+
this.locale = null;
|
|
150
|
+
}
|
|
151
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
152
|
+
this.text = decodeString(stream);
|
|
153
|
+
} else {
|
|
154
|
+
this.text = null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// not an extension object registerClassDefinition("LocalizedText", LocalizedText);
|
|
160
|
+
registerSpecialVariantEncoder(LocalizedText);
|
|
161
|
+
|
|
162
|
+
export type LocalizedTextLike = LocalizedTextOptions | string;
|
|
163
|
+
|
|
164
|
+
function getLocalizeText_EncodingByte(localizedText: LocalizedText): number {
|
|
165
|
+
let encodingMask = 0;
|
|
166
|
+
if (localizedText.locale) {
|
|
167
|
+
encodingMask |= 0x01;
|
|
168
|
+
}
|
|
169
|
+
if (localizedText.text) {
|
|
170
|
+
encodingMask |= 0x02;
|
|
171
|
+
}
|
|
172
|
+
return encodingMask;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const emptyLocalizedText = new LocalizedText({});
|
|
176
|
+
|
|
177
|
+
export function encodeLocalizedText(value: LocalizedText, stream: OutputBinaryStream): void {
|
|
178
|
+
if (value) {
|
|
179
|
+
value.encode(stream);
|
|
180
|
+
} else {
|
|
181
|
+
emptyLocalizedText.encode(stream);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function decodeLocalizedText(stream: BinaryStream, value?: LocalizedText): LocalizedText {
|
|
186
|
+
value = value || new LocalizedText(null);
|
|
187
|
+
value.decode(stream);
|
|
188
|
+
return value;
|
|
189
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-data-model
|
|
3
|
-
*/
|
|
4
|
-
// tslint:disable:no-bitwise
|
|
5
|
-
|
|
6
|
-
// Specifies the NodeClasses of the TargetNodes. Only TargetNodes with the
|
|
7
|
-
// selected NodeClasses are returned. The NodeClasses are assigned the
|
|
8
|
-
// following bits:
|
|
9
|
-
// If set to zero, then all NodeClasses are returned.
|
|
10
|
-
// @example
|
|
11
|
-
// var mask = NodeClassMask.get("Object | ObjectType");
|
|
12
|
-
// mask.value.should.eql(1 + (1<<3));
|
|
13
|
-
|
|
14
|
-
export enum NodeClassMask {
|
|
15
|
-
Object=
|
|
16
|
-
Variable =
|
|
17
|
-
Method=
|
|
18
|
-
ObjectType=
|
|
19
|
-
VariableType=
|
|
20
|
-
ReferenceType=
|
|
21
|
-
DataType=
|
|
22
|
-
View=
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface Enum {
|
|
26
|
-
[id: string]: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function makeFlagFromString<Type>(type: Enum, str: string): Type {
|
|
30
|
-
const flags = str.split(" | ");
|
|
31
|
-
let result: any = 0;
|
|
32
|
-
for (const flag of flags) {
|
|
33
|
-
result |= type[flag];
|
|
34
|
-
}
|
|
35
|
-
return result as Type;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// @example
|
|
39
|
-
// makeNodeClassMask("Method | Object").should.eql(5);
|
|
40
|
-
export function makeNodeClassMask(str: string): NodeClassMask {
|
|
41
|
-
const classMask = makeFlagFromString<NodeClassMask>(NodeClassMask as any, str);
|
|
42
|
-
/* istanbul ignore next */
|
|
43
|
-
if (!classMask) {
|
|
44
|
-
throw new Error(" cannot find class mask for " + str);
|
|
45
|
-
}
|
|
46
|
-
return classMask;
|
|
47
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
// tslint:disable:no-bitwise
|
|
5
|
+
|
|
6
|
+
// Specifies the NodeClasses of the TargetNodes. Only TargetNodes with the
|
|
7
|
+
// selected NodeClasses are returned. The NodeClasses are assigned the
|
|
8
|
+
// following bits:
|
|
9
|
+
// If set to zero, then all NodeClasses are returned.
|
|
10
|
+
// @example
|
|
11
|
+
// var mask = NodeClassMask.get("Object | ObjectType");
|
|
12
|
+
// mask.value.should.eql(1 + (1<<3));
|
|
13
|
+
|
|
14
|
+
export enum NodeClassMask {
|
|
15
|
+
Object = 1 << 0,
|
|
16
|
+
Variable = 1 << 1,
|
|
17
|
+
Method = 1 << 2,
|
|
18
|
+
ObjectType = 1 << 3,
|
|
19
|
+
VariableType = 1 << 4,
|
|
20
|
+
ReferenceType = 1 << 5,
|
|
21
|
+
DataType = 1 << 6,
|
|
22
|
+
View = 1 << 7
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Enum {
|
|
26
|
+
[id: string]: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function makeFlagFromString<Type>(type: Enum, str: string): Type {
|
|
30
|
+
const flags = str.split(" | ");
|
|
31
|
+
let result: any = 0;
|
|
32
|
+
for (const flag of flags) {
|
|
33
|
+
result |= type[flag];
|
|
34
|
+
}
|
|
35
|
+
return result as Type;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// @example
|
|
39
|
+
// makeNodeClassMask("Method | Object").should.eql(5);
|
|
40
|
+
export function makeNodeClassMask(str: string): NodeClassMask {
|
|
41
|
+
const classMask = makeFlagFromString<NodeClassMask>(NodeClassMask as any, str);
|
|
42
|
+
/* istanbul ignore next */
|
|
43
|
+
if (!classMask) {
|
|
44
|
+
throw new Error(" cannot find class mask for " + str);
|
|
45
|
+
}
|
|
46
|
+
return classMask;
|
|
47
|
+
}
|
package/source/nodeclass.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-data-model
|
|
3
|
-
*/
|
|
4
|
-
import { registerEnumeration } from "node-opcua-factory";
|
|
5
|
-
|
|
6
|
-
export enum NodeClass {
|
|
7
|
-
Unspecified=
|
|
8
|
-
Object=
|
|
9
|
-
Variable=
|
|
10
|
-
Method=
|
|
11
|
-
ObjectType=
|
|
12
|
-
VariableType=
|
|
13
|
-
ReferenceType=
|
|
14
|
-
DataType=
|
|
15
|
-
View=
|
|
16
|
-
}
|
|
17
|
-
export const schemaEnumNodeClass = {
|
|
18
|
-
name: "NodeClass",
|
|
19
|
-
|
|
20
|
-
documentation: "A mask specifying the class of the node.",
|
|
21
|
-
enumValues: NodeClass
|
|
22
|
-
};
|
|
23
|
-
registerEnumeration(schemaEnumNodeClass);
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
import { registerEnumeration } from "node-opcua-factory";
|
|
5
|
+
|
|
6
|
+
export enum NodeClass {
|
|
7
|
+
Unspecified = 0, // No classes are selected.
|
|
8
|
+
Object = 1, // The node is an object.
|
|
9
|
+
Variable = 2, // The node is a variable.
|
|
10
|
+
Method = 4, // The node is a method.
|
|
11
|
+
ObjectType = 8, // The node is an object type.
|
|
12
|
+
VariableType = 16, // The node is an variable type.
|
|
13
|
+
ReferenceType = 32, // The node is a reference type.
|
|
14
|
+
DataType = 64, // The node is a data type.
|
|
15
|
+
View = 128 // The node is a view.
|
|
16
|
+
}
|
|
17
|
+
export const schemaEnumNodeClass = {
|
|
18
|
+
name: "NodeClass",
|
|
19
|
+
|
|
20
|
+
documentation: "A mask specifying the class of the node.",
|
|
21
|
+
enumValues: NodeClass
|
|
22
|
+
};
|
|
23
|
+
registerEnumeration(schemaEnumNodeClass);
|
|
@@ -25,14 +25,14 @@ export enum PermissionFlag {
|
|
|
25
25
|
ReadRolePermissions = 2,
|
|
26
26
|
/**
|
|
27
27
|
* The Client is allowed to write to Attributes other than the Value,
|
|
28
|
-
* Historizing or RolePermissions Attribute if the WriteMask indicates that
|
|
28
|
+
* Historizing or RolePermissions Attribute if the WriteMask indicates that
|
|
29
29
|
* the Attribute is writeable.
|
|
30
30
|
* This bit affects the value of a UserWriteMask Attribute.
|
|
31
31
|
* This Permission is valid for all NodeClasses.
|
|
32
32
|
*/
|
|
33
33
|
WriteAttribute = 4,
|
|
34
34
|
/**
|
|
35
|
-
* The Client is allowed to write to the RolePermissions Attribute if the WriteMask
|
|
35
|
+
* The Client is allowed to write to the RolePermissions Attribute if the WriteMask
|
|
36
36
|
* indicates that the Attribute is writeable.
|
|
37
37
|
* This bit affects the value of the UserWriteMask Attribute.
|
|
38
38
|
* This Permission is valid for all NodeClasses.
|
|
@@ -81,14 +81,14 @@ export enum PermissionFlag {
|
|
|
81
81
|
*/
|
|
82
82
|
DeleteHistory = 1024,
|
|
83
83
|
/**
|
|
84
|
-
* A Client only receives an Event if this bit is set on the Node identified
|
|
84
|
+
* A Client only receives an Event if this bit is set on the Node identified
|
|
85
85
|
* by the EventTypeId field and on the Node identified by the SourceNode field.
|
|
86
86
|
* This Permission is only valid for EventType Nodes or SourceNodes.
|
|
87
87
|
*/
|
|
88
88
|
ReceiveEvents = 2048,
|
|
89
89
|
/**
|
|
90
|
-
* The Client is allowed to call the Method if this bit is set on the Object or
|
|
91
|
-
* ObjectType Node passed in the Call request and the Method Instance associated
|
|
90
|
+
* The Client is allowed to call the Method if this bit is set on the Object or
|
|
91
|
+
* ObjectType Node passed in the Call request and the Method Instance associated
|
|
92
92
|
* with that Object or ObjectType.
|
|
93
93
|
* This bit affects the UserExecutable Attribute when set on Method Node.
|
|
94
94
|
* This Permission is only valid for Objects, ObjectType or Methods.
|
|
@@ -101,7 +101,7 @@ export enum PermissionFlag {
|
|
|
101
101
|
AddReference = 8192,
|
|
102
102
|
/**
|
|
103
103
|
* The Client is allowed to remove references from the Node.
|
|
104
|
-
* This Permission is valid for all NodeClasses.
|
|
104
|
+
* This Permission is valid for all NodeClasses.
|
|
105
105
|
*/
|
|
106
106
|
RemoveReference = 16384,
|
|
107
107
|
/**
|
|
@@ -117,7 +117,8 @@ export enum PermissionFlag {
|
|
|
117
117
|
AddNode = 65536
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
export const allPermissions =
|
|
120
|
+
export const allPermissions =
|
|
121
|
+
PermissionFlag.Browse |
|
|
121
122
|
PermissionFlag.Browse |
|
|
122
123
|
PermissionFlag.ReadRolePermissions |
|
|
123
124
|
PermissionFlag.WriteAttribute |
|
|
@@ -146,7 +147,6 @@ export function makePermissionFlag(str: string | number | null): number {
|
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
export function permissionFlagToString(permissionFlag: PermissionFlag): string {
|
|
149
|
-
|
|
150
150
|
const retVal = [];
|
|
151
151
|
for (const [key, value] of Object.entries(PermissionFlag)) {
|
|
152
152
|
const numKey = parseInt(key, 10);
|
package/source/qualified_name.ts
CHANGED
|
@@ -98,7 +98,7 @@ export class QualifiedName extends BaseUAObject {
|
|
|
98
98
|
return this.name || "<null>";
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
public isEmpty() {
|
|
101
|
+
public isEmpty(): boolean {
|
|
102
102
|
return !this.name || this.name.length === 0;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -154,8 +154,8 @@ export function coerceQualifiedName(value: null | QualifiedNameLike): QualifiedN
|
|
|
154
154
|
} else if (typeof value === "string") {
|
|
155
155
|
return stringToQualifiedName(value);
|
|
156
156
|
} else {
|
|
157
|
-
assert(
|
|
158
|
-
assert(
|
|
157
|
+
assert(Object.prototype.hasOwnProperty.call(value, "namespaceIndex"));
|
|
158
|
+
assert(Object.prototype.hasOwnProperty.call(value, "name"));
|
|
159
159
|
return new QualifiedName(value);
|
|
160
160
|
}
|
|
161
161
|
}
|