node-opcua-nodeid 2.128.0 → 2.133.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/expanded_nodeid.d.ts +8 -19
- package/dist/expanded_nodeid.js +2 -20
- package/dist/expanded_nodeid.js.map +1 -1
- package/dist/nodeid.d.ts +126 -52
- package/dist/nodeid.js +122 -63
- package/dist/nodeid.js.map +1 -1
- package/package.json +5 -5
- package/source/expanded_nodeid.ts +9 -22
- package/source/nodeid.ts +158 -73
|
@@ -26,17 +26,8 @@ import { NodeId, NodeIdType } from "./nodeid";
|
|
|
26
26
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
27
27
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
28
28
|
*
|
|
29
|
-
* @class ExpandedNodeId
|
|
30
|
-
* @extends NodeId
|
|
31
29
|
*
|
|
32
30
|
*
|
|
33
|
-
*
|
|
34
|
-
* @param identifierType - the nodeID type
|
|
35
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
36
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
37
|
-
* @param namespaceUri - NamespaceUri
|
|
38
|
-
* @param serverIndex - the server Index
|
|
39
|
-
* @constructor
|
|
40
31
|
*/
|
|
41
32
|
export declare class ExpandedNodeId extends NodeId {
|
|
42
33
|
static nullExpandedNodeId: ExpandedNodeId;
|
|
@@ -44,24 +35,22 @@ export declare class ExpandedNodeId extends NodeId {
|
|
|
44
35
|
namespaceUri: null | string;
|
|
45
36
|
serverIndex: number;
|
|
46
37
|
constructor(forDeserialization: null);
|
|
47
|
-
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
48
38
|
/**
|
|
49
|
-
* @
|
|
50
|
-
* @
|
|
39
|
+
* @param identifierType - the nodeID type
|
|
40
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
41
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
42
|
+
* @param namespaceUri - NamespaceUri
|
|
43
|
+
* @param serverIndex - the server Index
|
|
51
44
|
*/
|
|
45
|
+
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
52
46
|
toString(): string;
|
|
53
47
|
/**
|
|
54
|
-
* convert nodeId to a JSON string. same as {@link
|
|
55
|
-
* @method toJSON
|
|
56
|
-
* @return {String}
|
|
48
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
57
49
|
*/
|
|
58
50
|
toJSON(): any;
|
|
59
51
|
}
|
|
60
52
|
export declare function coerceExpandedNodeId(value: unknown): ExpandedNodeId;
|
|
61
53
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @param value
|
|
64
|
-
* @param [namespace=0] the namespace
|
|
65
|
-
* @return {ExpandedNodeId}
|
|
54
|
+
* create an expanded nodeId
|
|
66
55
|
*/
|
|
67
56
|
export declare function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId;
|
package/dist/expanded_nodeid.js
CHANGED
|
@@ -27,17 +27,8 @@ const nodeid_1 = require("./nodeid");
|
|
|
27
27
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
28
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
29
|
*
|
|
30
|
-
* @class ExpandedNodeId
|
|
31
|
-
* @extends NodeId
|
|
32
30
|
*
|
|
33
31
|
*
|
|
34
|
-
*
|
|
35
|
-
* @param identifierType - the nodeID type
|
|
36
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
37
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
38
|
-
* @param namespaceUri - NamespaceUri
|
|
39
|
-
* @param serverIndex - the server Index
|
|
40
|
-
* @constructor
|
|
41
32
|
*/
|
|
42
33
|
class ExpandedNodeId extends nodeid_1.NodeId {
|
|
43
34
|
static fromNodeId(nodeId, namespaceUri, serverIndex) {
|
|
@@ -48,10 +39,6 @@ class ExpandedNodeId extends nodeid_1.NodeId {
|
|
|
48
39
|
this.namespaceUri = namespaceUri || null;
|
|
49
40
|
this.serverIndex = serverIndex || 0;
|
|
50
41
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @method toString
|
|
53
|
-
* @return {string}
|
|
54
|
-
*/
|
|
55
42
|
toString() {
|
|
56
43
|
let str = nodeid_1.NodeId.prototype.toString.call(this);
|
|
57
44
|
if (this.namespaceUri) {
|
|
@@ -63,9 +50,7 @@ class ExpandedNodeId extends nodeid_1.NodeId {
|
|
|
63
50
|
return str;
|
|
64
51
|
}
|
|
65
52
|
/**
|
|
66
|
-
* convert nodeId to a JSON string. same as {@link
|
|
67
|
-
* @method toJSON
|
|
68
|
-
* @return {String}
|
|
53
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
69
54
|
*/
|
|
70
55
|
toJSON() {
|
|
71
56
|
return this.toString();
|
|
@@ -78,10 +63,7 @@ function coerceExpandedNodeId(value) {
|
|
|
78
63
|
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
79
64
|
}
|
|
80
65
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param value
|
|
83
|
-
* @param [namespace=0] the namespace
|
|
84
|
-
* @return {ExpandedNodeId}
|
|
66
|
+
* create an expanded nodeId
|
|
85
67
|
*/
|
|
86
68
|
function makeExpandedNodeId(value, namespace) {
|
|
87
69
|
if (value === undefined && namespace === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expanded_nodeid.js","sourceRoot":"","sources":["../source/expanded_nodeid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"expanded_nodeid.js","sourceRoot":"","sources":["../source/expanded_nodeid.ts"],"names":[],"mappings":";;;AAuFA,oDAGC;AAID,gDAyBC;AAnHD,qCAA4D;AAE5D;;;;;;;;;;;;;;;;;;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AS,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/nodeid.d.ts
CHANGED
|
@@ -3,87 +3,122 @@ import { Guid } from "node-opcua-guid";
|
|
|
3
3
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
4
4
|
*/
|
|
5
5
|
export declare enum NodeIdType {
|
|
6
|
-
/**
|
|
7
|
-
* @static
|
|
8
|
-
* @property NUMERIC
|
|
9
|
-
* @default 0x1
|
|
10
|
-
*/
|
|
11
6
|
NUMERIC = 1,
|
|
12
|
-
/**
|
|
13
|
-
* @static
|
|
14
|
-
* @property STRING
|
|
15
|
-
* @default 0x2
|
|
16
|
-
*/
|
|
17
7
|
STRING = 2,
|
|
18
|
-
/**
|
|
19
|
-
* @static
|
|
20
|
-
* @property GUID
|
|
21
|
-
* @default 0x3
|
|
22
|
-
*/
|
|
23
8
|
GUID = 3,
|
|
24
|
-
/**
|
|
25
|
-
* @static
|
|
26
|
-
* @property BYTESTRING
|
|
27
|
-
* @default 0x4
|
|
28
|
-
*/
|
|
29
9
|
BYTESTRING = 4
|
|
30
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* `NodeId` specialization for numeric nodeIds.
|
|
13
|
+
*/
|
|
31
14
|
export interface INodeIdNumeric extends NodeId {
|
|
32
15
|
identifierType: NodeIdType.NUMERIC;
|
|
33
16
|
value: number;
|
|
34
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* `NodeId` specialization for GUID nodeIds.
|
|
20
|
+
*/
|
|
35
21
|
export interface INodeIdGuid extends NodeId {
|
|
36
22
|
identifierType: NodeIdType.GUID;
|
|
37
23
|
value: string;
|
|
38
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* `NodeId` specialization for ByteString nodeIds (opaque).
|
|
27
|
+
*/
|
|
39
28
|
export interface INodeIdByteString extends NodeId {
|
|
40
29
|
identifierType: NodeIdType.BYTESTRING;
|
|
41
30
|
value: Buffer;
|
|
42
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* `NodeId` specialization for String nodeId.
|
|
34
|
+
*/
|
|
43
35
|
export interface INodeIdString extends NodeId {
|
|
44
36
|
identifierType: NodeIdType.STRING;
|
|
45
37
|
value: string;
|
|
46
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* `NodeId` specialization for all possible types of NodeIds.
|
|
41
|
+
*/
|
|
47
42
|
export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
|
|
48
43
|
/**
|
|
49
|
-
* Construct a node ID
|
|
50
44
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
45
|
+
* This class holds a OPC-UA node identifier.
|
|
46
|
+
*
|
|
47
|
+
* Nodes are unambiguously identified using a constructed
|
|
48
|
+
* identifier called the NodeId. Some Servers may accept
|
|
49
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
50
|
+
* represented in this Attribute.
|
|
51
|
+
*
|
|
52
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
53
|
+
* it shall not generate new
|
|
54
|
+
* NodeIds when rebooting.
|
|
53
55
|
*
|
|
54
|
-
* ``` javascript
|
|
55
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
56
|
-
* ```
|
|
57
|
-
* @constructor
|
|
58
56
|
*/
|
|
59
57
|
export declare class NodeId {
|
|
60
58
|
static NodeIdType: typeof NodeIdType;
|
|
61
59
|
static nullNodeId: NodeId;
|
|
62
60
|
static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
61
|
+
/**
|
|
62
|
+
*/
|
|
63
63
|
static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
64
64
|
identifierType: NodeIdType;
|
|
65
65
|
value: number | string | Buffer | Guid;
|
|
66
66
|
namespace: number;
|
|
67
67
|
/**
|
|
68
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
69
|
+
*
|
|
68
70
|
* @param identifierType - the nodeID type
|
|
69
71
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
70
72
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
*
|
|
76
|
+
* ```javascript
|
|
77
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
78
|
+
* ```
|
|
71
79
|
*/
|
|
72
80
|
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
|
|
73
81
|
/**
|
|
74
82
|
* get the string representation of the nodeID.
|
|
75
83
|
*
|
|
76
|
-
* @method toString
|
|
77
84
|
* @example
|
|
78
85
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
86
|
+
* by default, toString will return the "ns=" representation
|
|
87
|
+
*
|
|
88
|
+
* ```javascript
|
|
89
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
90
|
+
* console.log(nodeid.toString());
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* ```
|
|
94
|
+
* >"ns=1;i=123"
|
|
95
|
+
* ```
|
|
96
|
+
* @example
|
|
97
|
+
*
|
|
98
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
99
|
+
*
|
|
100
|
+
* ```javascript
|
|
101
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
102
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
103
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
104
|
+
* ```
|
|
105
|
+
* ```
|
|
106
|
+
* >"nsu=http://mynamespace;i=123"
|
|
107
|
+
* ```
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
111
|
+
* with the BrowseName of the node.
|
|
112
|
+
*
|
|
113
|
+
* ```javascript
|
|
114
|
+
* const addressSpace = getAddressSpace();
|
|
115
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
116
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
117
|
+
* ```
|
|
118
|
+
* ```
|
|
119
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
120
|
+
* ```
|
|
83
121
|
*
|
|
84
|
-
* ```
|
|
85
|
-
* >"ns=1;i=123"
|
|
86
|
-
* ```
|
|
87
122
|
*
|
|
88
123
|
* @param [options.addressSpace] {AddressSpace}
|
|
89
124
|
* @return {String}
|
|
@@ -93,7 +128,7 @@ export declare class NodeId {
|
|
|
93
128
|
namespaceArray?: string[];
|
|
94
129
|
}): string;
|
|
95
130
|
/**
|
|
96
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
131
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
97
132
|
*/
|
|
98
133
|
toJSON(options?: {
|
|
99
134
|
namespaceArray?: string[];
|
|
@@ -104,45 +139,84 @@ export declare class NodeId {
|
|
|
104
139
|
*/
|
|
105
140
|
isEmpty(): boolean;
|
|
106
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* anything that could be turned into a nodeId
|
|
144
|
+
*/
|
|
107
145
|
export type NodeIdLike = string | NodeId | number;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
108
149
|
export interface ResolveNodeIdOptions {
|
|
109
150
|
namespaceArray?: string[];
|
|
110
151
|
defaultNamespaceIndex?: number;
|
|
111
152
|
}
|
|
112
153
|
/**
|
|
113
154
|
* Convert a value into a nodeId:
|
|
114
|
-
* @class opcua
|
|
115
|
-
* @method coerceNodeId
|
|
116
|
-
* @static
|
|
117
155
|
*
|
|
118
156
|
* @description:
|
|
119
157
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
120
158
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
121
159
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
122
160
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
123
|
-
* @param value
|
|
124
|
-
* @param namespaceOptions {number}
|
|
125
|
-
* @param namespaceOptions.namespace {number}
|
|
126
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
127
161
|
*
|
|
128
162
|
*/
|
|
129
163
|
export declare function coerceNodeId(value: unknown, namespaceOptions?: number | ResolveNodeIdOptions): NodeId;
|
|
130
164
|
/**
|
|
131
165
|
* construct a node Id from a value and a namespace.
|
|
132
|
-
*
|
|
133
|
-
* @method makeNodeId
|
|
134
|
-
* @static
|
|
166
|
+
*
|
|
135
167
|
* @param {String|Buffer} value
|
|
136
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
168
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
137
169
|
* @return {NodeId}
|
|
138
170
|
*/
|
|
139
171
|
export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
|
|
140
172
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
144
|
-
*
|
|
145
|
-
* @
|
|
173
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
174
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
175
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```javascript
|
|
179
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
180
|
+
* console.log(nodeId.toString());
|
|
181
|
+
* ```
|
|
182
|
+
* ```text
|
|
183
|
+
* >ns=0;i=85
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* ```javascript
|
|
187
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
188
|
+
* console.log(nodeId.toString());
|
|
189
|
+
* ```
|
|
190
|
+
* ```text
|
|
191
|
+
* >ns=0;i=33
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* ```javascript
|
|
195
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
196
|
+
* console.log(nodeId.toString());
|
|
197
|
+
* ```
|
|
198
|
+
* ```text
|
|
199
|
+
* >ns=1;i=4444
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
146
202
|
*/
|
|
147
203
|
export declare function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeIdOptions): NodeId;
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
207
|
+
* determine if they are identical. This comparison is based on the
|
|
208
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
209
|
+
*
|
|
210
|
+
|
|
211
|
+
*
|
|
212
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
213
|
+
* identical, otherwise returns false.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```javascript
|
|
217
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
218
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
219
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
148
222
|
export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;
|
package/dist/nodeid.js
CHANGED
|
@@ -12,67 +12,58 @@ exports.sameNodeId = sameNodeId;
|
|
|
12
12
|
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
13
13
|
const node_opcua_constants_1 = require("node-opcua-constants");
|
|
14
14
|
const node_opcua_guid_1 = require("node-opcua-guid");
|
|
15
|
+
const doDebug = false;
|
|
15
16
|
/**
|
|
16
17
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
17
18
|
*/
|
|
18
19
|
var NodeIdType;
|
|
19
20
|
(function (NodeIdType) {
|
|
20
|
-
/**
|
|
21
|
-
* @static
|
|
22
|
-
* @property NUMERIC
|
|
23
|
-
* @default 0x1
|
|
24
|
-
*/
|
|
25
21
|
NodeIdType[NodeIdType["NUMERIC"] = 1] = "NUMERIC";
|
|
26
|
-
/**
|
|
27
|
-
* @static
|
|
28
|
-
* @property STRING
|
|
29
|
-
* @default 0x2
|
|
30
|
-
*/
|
|
31
22
|
NodeIdType[NodeIdType["STRING"] = 2] = "STRING";
|
|
32
|
-
/**
|
|
33
|
-
* @static
|
|
34
|
-
* @property GUID
|
|
35
|
-
* @default 0x3
|
|
36
|
-
*/
|
|
37
23
|
NodeIdType[NodeIdType["GUID"] = 3] = "GUID";
|
|
38
|
-
/**
|
|
39
|
-
* @static
|
|
40
|
-
* @property BYTESTRING
|
|
41
|
-
* @default 0x4
|
|
42
|
-
*/
|
|
43
24
|
NodeIdType[NodeIdType["BYTESTRING"] = 4] = "BYTESTRING";
|
|
44
25
|
})(NodeIdType || (exports.NodeIdType = NodeIdType = {}));
|
|
45
|
-
|
|
46
|
-
function defaultValue(identifierType: NodeIdType.STRING):
|
|
47
|
-
function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
48
|
-
function defaultValue(identifierType: NodeIdType.GUID):
|
|
49
|
-
*/
|
|
26
|
+
// function defaultValue(identifierType: NodeIdType.BYTESTRING): null;
|
|
27
|
+
// function defaultValue(identifierType: NodeIdType.STRING): "";
|
|
28
|
+
// function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
29
|
+
// function defaultValue(identifierType: NodeIdType.GUID): string;
|
|
50
30
|
function defaultValue(identifierType) {
|
|
51
31
|
switch (identifierType) {
|
|
52
32
|
case NodeIdType.GUID: return node_opcua_guid_1.emptyGuid;
|
|
53
33
|
case NodeIdType.BYTESTRING: return null; // Buffer.alloc(0);
|
|
54
34
|
case NodeIdType.STRING: return "";
|
|
55
35
|
case NodeIdType.NUMERIC: return 0;
|
|
36
|
+
default:
|
|
37
|
+
throw new Error("invalid identifierType");
|
|
56
38
|
}
|
|
57
39
|
}
|
|
58
|
-
const doDebug = false;
|
|
59
40
|
/**
|
|
60
|
-
* Construct a node ID
|
|
61
41
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
42
|
+
* This class holds a OPC-UA node identifier.
|
|
43
|
+
*
|
|
44
|
+
* Nodes are unambiguously identified using a constructed
|
|
45
|
+
* identifier called the NodeId. Some Servers may accept
|
|
46
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
47
|
+
* represented in this Attribute.
|
|
48
|
+
*
|
|
49
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
50
|
+
* it shall not generate new
|
|
51
|
+
* NodeIds when rebooting.
|
|
64
52
|
*
|
|
65
|
-
* ``` javascript
|
|
66
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
67
|
-
* ```
|
|
68
|
-
* @constructor
|
|
69
53
|
*/
|
|
70
54
|
class NodeId {
|
|
71
|
-
;
|
|
72
55
|
/**
|
|
56
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
57
|
+
*
|
|
73
58
|
* @param identifierType - the nodeID type
|
|
74
59
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
75
60
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
*
|
|
64
|
+
* ```javascript
|
|
65
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
66
|
+
* ```
|
|
76
67
|
*/
|
|
77
68
|
constructor(identifierType, value, namespace) {
|
|
78
69
|
if (identifierType === null || identifierType === undefined) {
|
|
@@ -86,7 +77,8 @@ class NodeId {
|
|
|
86
77
|
this.namespace = namespace || 0;
|
|
87
78
|
// namespace shall be a UInt16
|
|
88
79
|
(0, node_opcua_assert_1.assert)(this.namespace >= 0 && this.namespace <= 0xffff, "NodeId: invalid namespace value");
|
|
89
|
-
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.NUMERIC ||
|
|
80
|
+
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.NUMERIC ||
|
|
81
|
+
(this.value !== null && this.value >= 0 && this.value <= 0xffffffff));
|
|
90
82
|
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.GUID || (0, node_opcua_guid_1.isValidGuid)(this.value), "NodeId: Guid is invalid");
|
|
91
83
|
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.STRING || typeof this.value === "string", "cannot empty string");
|
|
92
84
|
if (this.identifierType === NodeIdType.GUID) {
|
|
@@ -96,25 +88,54 @@ class NodeId {
|
|
|
96
88
|
/**
|
|
97
89
|
* get the string representation of the nodeID.
|
|
98
90
|
*
|
|
99
|
-
* @method toString
|
|
100
91
|
* @example
|
|
101
92
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
93
|
+
* by default, toString will return the "ns=" representation
|
|
94
|
+
*
|
|
95
|
+
* ```javascript
|
|
96
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
97
|
+
* console.log(nodeid.toString());
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* ```
|
|
101
|
+
* >"ns=1;i=123"
|
|
102
|
+
* ```
|
|
103
|
+
* @example
|
|
104
|
+
*
|
|
105
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
106
|
+
*
|
|
107
|
+
* ```javascript
|
|
108
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
109
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
110
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
111
|
+
* ```
|
|
112
|
+
* ```
|
|
113
|
+
* >"nsu=http://mynamespace;i=123"
|
|
114
|
+
* ```
|
|
115
|
+
* @example
|
|
116
|
+
*
|
|
117
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
118
|
+
* with the BrowseName of the node.
|
|
119
|
+
*
|
|
120
|
+
* ```javascript
|
|
121
|
+
* const addressSpace = getAddressSpace();
|
|
122
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
123
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
124
|
+
* ```
|
|
125
|
+
* ```
|
|
126
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
127
|
+
* ```
|
|
106
128
|
*
|
|
107
|
-
* ```
|
|
108
|
-
* >"ns=1;i=123"
|
|
109
|
-
* ```
|
|
110
129
|
*
|
|
111
130
|
* @param [options.addressSpace] {AddressSpace}
|
|
112
131
|
* @return {String}
|
|
113
132
|
*/
|
|
114
133
|
toString(options) {
|
|
115
134
|
const addressSpace = options ? options.addressSpace : null;
|
|
116
|
-
const namespacePart = options?.namespaceArray
|
|
117
|
-
|
|
135
|
+
const namespacePart = options?.namespaceArray
|
|
136
|
+
? this.namespace == 0
|
|
137
|
+
? ""
|
|
138
|
+
: `nsu=${options.namespaceArray[this.namespace] || `<unknown namespace with index ${this.namespace}>`};`
|
|
118
139
|
: `ns=${this.namespace};`;
|
|
119
140
|
let str;
|
|
120
141
|
const _this = this;
|
|
@@ -154,7 +175,7 @@ class NodeId {
|
|
|
154
175
|
return str;
|
|
155
176
|
}
|
|
156
177
|
/**
|
|
157
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
178
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
158
179
|
*/
|
|
159
180
|
toJSON(options) {
|
|
160
181
|
return this.toString(options);
|
|
@@ -187,6 +208,9 @@ class NodeId {
|
|
|
187
208
|
}
|
|
188
209
|
exports.NodeId = NodeId;
|
|
189
210
|
NodeId.NodeIdType = NodeIdType;
|
|
211
|
+
/**
|
|
212
|
+
* a fixed instance of a null NodeId
|
|
213
|
+
*/
|
|
190
214
|
NodeId.nullNodeId = new Proxy(new NodeId(NodeIdType.NUMERIC, 0, 0), {
|
|
191
215
|
get: (target, prop) => {
|
|
192
216
|
return target[prop];
|
|
@@ -195,6 +219,9 @@ NodeId.nullNodeId = new Proxy(new NodeId(NodeIdType.NUMERIC, 0, 0), {
|
|
|
195
219
|
throw new Error("Cannot assign a value to constant NodeId.nullNodeId");
|
|
196
220
|
}
|
|
197
221
|
});
|
|
222
|
+
/**
|
|
223
|
+
* @private
|
|
224
|
+
*/
|
|
198
225
|
const regexNamespaceI = /ns=([0-9]+);i=([0-9]+)/;
|
|
199
226
|
const regexNamespaceS = /ns=([0-9]+);s=(.*)/;
|
|
200
227
|
const regexNamespaceB = /ns=([0-9]+);b=(.*)/;
|
|
@@ -206,22 +233,14 @@ const regexNamespaceNSU_B = /nsu=(.+);b=(.*)/;
|
|
|
206
233
|
const regexNamespaceNSU_G = /nsu=(.+);g=([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})/;
|
|
207
234
|
/**
|
|
208
235
|
* Convert a value into a nodeId:
|
|
209
|
-
* @class opcua
|
|
210
|
-
* @method coerceNodeId
|
|
211
|
-
* @static
|
|
212
236
|
*
|
|
213
237
|
* @description:
|
|
214
238
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
215
239
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
216
240
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
217
241
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
218
|
-
* @param value
|
|
219
|
-
* @param namespaceOptions {number}
|
|
220
|
-
* @param namespaceOptions.namespace {number}
|
|
221
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
222
242
|
*
|
|
223
243
|
*/
|
|
224
|
-
// eslint-disable-next-line max-statements
|
|
225
244
|
function coerceNodeId(value, namespaceOptions) {
|
|
226
245
|
let matches;
|
|
227
246
|
let twoFirst;
|
|
@@ -308,11 +327,9 @@ function coerceNodeId(value, namespaceOptions) {
|
|
|
308
327
|
const regEx1 = /^(s|g|b|i|ns)=/;
|
|
309
328
|
/**
|
|
310
329
|
* construct a node Id from a value and a namespace.
|
|
311
|
-
*
|
|
312
|
-
* @method makeNodeId
|
|
313
|
-
* @static
|
|
330
|
+
*
|
|
314
331
|
* @param {String|Buffer} value
|
|
315
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
332
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
316
333
|
* @return {NodeId}
|
|
317
334
|
*/
|
|
318
335
|
function makeNodeId(value, namespace) {
|
|
@@ -368,11 +385,35 @@ function reverse_map(nodeId) {
|
|
|
368
385
|
return _nodeIdToNameIndex[nodeId];
|
|
369
386
|
}
|
|
370
387
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @
|
|
374
|
-
*
|
|
375
|
-
* @
|
|
388
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
389
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
390
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```javascript
|
|
394
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
395
|
+
* console.log(nodeId.toString());
|
|
396
|
+
* ```
|
|
397
|
+
* ```text
|
|
398
|
+
* >ns=0;i=85
|
|
399
|
+
* ```
|
|
400
|
+
*
|
|
401
|
+
* ```javascript
|
|
402
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
403
|
+
* console.log(nodeId.toString());
|
|
404
|
+
* ```
|
|
405
|
+
* ```text
|
|
406
|
+
* >ns=0;i=33
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* ```javascript
|
|
410
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
411
|
+
* console.log(nodeId.toString());
|
|
412
|
+
* ```
|
|
413
|
+
* ```text
|
|
414
|
+
* >ns=1;i=4444
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
376
417
|
*/
|
|
377
418
|
function resolveNodeId(nodeIdOrString, options) {
|
|
378
419
|
let nodeId;
|
|
@@ -386,6 +427,24 @@ function resolveNodeId(nodeIdOrString, options) {
|
|
|
386
427
|
return nodeId;
|
|
387
428
|
}
|
|
388
429
|
NodeId.resolveNodeId = resolveNodeId;
|
|
430
|
+
/**
|
|
431
|
+
*
|
|
432
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
433
|
+
* determine if they are identical. This comparison is based on the
|
|
434
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
435
|
+
*
|
|
436
|
+
|
|
437
|
+
*
|
|
438
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
439
|
+
* identical, otherwise returns false.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```javascript
|
|
443
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
444
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
445
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
389
448
|
function sameNodeId(n1, n2) {
|
|
390
449
|
if (n1.identifierType !== n2.identifierType) {
|
|
391
450
|
return false;
|
package/dist/nodeid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeid.js","sourceRoot":"","sources":["../source/nodeid.ts"],"names":[],"mappings":";;;AAkRA,oCA6EC;AAYD,gCAwBC;AAyCD,sCAUC;AAID,gCAiBC;AA3cD,+BAA+B;AAC/B;;GAEG;AACH,yDAA2C;AAC3C,+DAQ8B;AAC9B,qDAA8E;AAE9E;;GAEG;AACH,IAAY,UAyBX;AAzBD,WAAY,UAAU;IAClB;;;;OAIG;IACH,iDAAc,CAAA;IACd;;;;OAIG;IACH,+CAAa,CAAA;IACb;;;;OAIG;IACH,2CAAW,CAAA;IACX;;;;OAIG;IACH,uDAAiB,CAAA;AACrB,CAAC,EAzBW,UAAU,0BAAV,UAAU,QAyBrB;AAC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"name": "node-opcua-nodeid",
|
|
3
3
|
"main": "./dist/index.js",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.133.0",
|
|
6
6
|
"description": "pure nodejs OPCUA SDK - module nodeid",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"node-opcua-assert": "2.120.0",
|
|
15
15
|
"node-opcua-constants": "2.125.0",
|
|
16
|
-
"node-opcua-guid": "2.
|
|
16
|
+
"node-opcua-guid": "2.133.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"node-opcua-benchmarker": "2.
|
|
20
|
-
"node-opcua-debug": "2.
|
|
19
|
+
"node-opcua-benchmarker": "2.133.0",
|
|
20
|
+
"node-opcua-debug": "2.133.0"
|
|
21
21
|
},
|
|
22
22
|
"author": "Etienne Rossignon",
|
|
23
23
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"internet of things"
|
|
35
35
|
],
|
|
36
36
|
"homepage": "http://node-opcua.github.io/",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "921bb04f2e7ce3109dd051ff27a2210edf700344",
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
40
40
|
"source"
|
|
@@ -27,17 +27,8 @@ import { coerceNodeId, NodeId, NodeIdType } from "./nodeid";
|
|
|
27
27
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
28
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
29
|
*
|
|
30
|
-
* @class ExpandedNodeId
|
|
31
|
-
* @extends NodeId
|
|
32
30
|
*
|
|
33
31
|
*
|
|
34
|
-
*
|
|
35
|
-
* @param identifierType - the nodeID type
|
|
36
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
37
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
38
|
-
* @param namespaceUri - NamespaceUri
|
|
39
|
-
* @param serverIndex - the server Index
|
|
40
|
-
* @constructor
|
|
41
32
|
*/
|
|
42
33
|
export class ExpandedNodeId extends NodeId {
|
|
43
34
|
public static nullExpandedNodeId = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
|
|
@@ -50,6 +41,13 @@ export class ExpandedNodeId extends NodeId {
|
|
|
50
41
|
public serverIndex: number;
|
|
51
42
|
|
|
52
43
|
public constructor(forDeserialization: null);
|
|
44
|
+
/**
|
|
45
|
+
* @param identifierType - the nodeID type
|
|
46
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
47
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
48
|
+
* @param namespaceUri - NamespaceUri
|
|
49
|
+
* @param serverIndex - the server Index
|
|
50
|
+
*/
|
|
53
51
|
public constructor(
|
|
54
52
|
identifierType: NodeIdType,
|
|
55
53
|
value: number | string | Guid | Buffer,
|
|
@@ -68,11 +66,6 @@ export class ExpandedNodeId extends NodeId {
|
|
|
68
66
|
this.namespaceUri = namespaceUri || null;
|
|
69
67
|
this.serverIndex = serverIndex || 0;
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @method toString
|
|
74
|
-
* @return {string}
|
|
75
|
-
*/
|
|
76
69
|
public toString(): string {
|
|
77
70
|
let str = NodeId.prototype.toString.call(this);
|
|
78
71
|
if (this.namespaceUri) {
|
|
@@ -85,9 +78,7 @@ export class ExpandedNodeId extends NodeId {
|
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
/**
|
|
88
|
-
* convert nodeId to a JSON string. same as {@link
|
|
89
|
-
* @method toJSON
|
|
90
|
-
* @return {String}
|
|
81
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
91
82
|
*/
|
|
92
83
|
public toJSON(): any {
|
|
93
84
|
return this.toString();
|
|
@@ -98,12 +89,8 @@ export function coerceExpandedNodeId(value: unknown): ExpandedNodeId {
|
|
|
98
89
|
const n = coerceNodeId(value);
|
|
99
90
|
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
100
91
|
}
|
|
101
|
-
|
|
102
92
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @param value
|
|
105
|
-
* @param [namespace=0] the namespace
|
|
106
|
-
* @return {ExpandedNodeId}
|
|
93
|
+
* create an expanded nodeId
|
|
107
94
|
*/
|
|
108
95
|
export function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId {
|
|
109
96
|
if (value === undefined && namespace === undefined) {
|
package/source/nodeid.ts
CHANGED
|
@@ -13,99 +13,108 @@ import {
|
|
|
13
13
|
VariableTypeIds
|
|
14
14
|
} from "node-opcua-constants";
|
|
15
15
|
import { emptyGuid, Guid, isValidGuid, normalizeGuid } from "node-opcua-guid";
|
|
16
|
-
|
|
16
|
+
const doDebug = false;
|
|
17
17
|
/**
|
|
18
18
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
19
19
|
*/
|
|
20
20
|
export enum NodeIdType {
|
|
21
|
-
/**
|
|
22
|
-
* @static
|
|
23
|
-
* @property NUMERIC
|
|
24
|
-
* @default 0x1
|
|
25
|
-
*/
|
|
26
21
|
NUMERIC = 0x01,
|
|
27
|
-
/**
|
|
28
|
-
* @static
|
|
29
|
-
* @property STRING
|
|
30
|
-
* @default 0x2
|
|
31
|
-
*/
|
|
32
22
|
STRING = 0x02,
|
|
33
|
-
/**
|
|
34
|
-
* @static
|
|
35
|
-
* @property GUID
|
|
36
|
-
* @default 0x3
|
|
37
|
-
*/
|
|
38
23
|
GUID = 0x03,
|
|
39
|
-
/**
|
|
40
|
-
* @static
|
|
41
|
-
* @property BYTESTRING
|
|
42
|
-
* @default 0x4
|
|
43
|
-
*/
|
|
44
24
|
BYTESTRING = 0x04
|
|
45
25
|
}
|
|
46
|
-
|
|
47
|
-
function defaultValue(identifierType: NodeIdType.
|
|
48
|
-
function defaultValue(identifierType: NodeIdType.
|
|
49
|
-
function defaultValue(identifierType: NodeIdType.
|
|
50
|
-
|
|
51
|
-
function defaultValue(identifierType: NodeIdType): string |
|
|
26
|
+
|
|
27
|
+
// function defaultValue(identifierType: NodeIdType.BYTESTRING): null;
|
|
28
|
+
// function defaultValue(identifierType: NodeIdType.STRING): "";
|
|
29
|
+
// function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
30
|
+
// function defaultValue(identifierType: NodeIdType.GUID): string;
|
|
31
|
+
function defaultValue(identifierType: NodeIdType): string | 0 | Buffer {
|
|
52
32
|
switch (identifierType) {
|
|
53
33
|
case NodeIdType.GUID: return emptyGuid;
|
|
54
34
|
case NodeIdType.BYTESTRING: return null as any as Buffer;// Buffer.alloc(0);
|
|
55
35
|
case NodeIdType.STRING: return "";
|
|
56
36
|
case NodeIdType.NUMERIC: return 0;
|
|
37
|
+
default:
|
|
38
|
+
throw new Error("invalid identifierType");
|
|
57
39
|
}
|
|
58
40
|
}
|
|
59
|
-
|
|
41
|
+
/**
|
|
42
|
+
* `NodeId` specialization for numeric nodeIds.
|
|
43
|
+
*/
|
|
60
44
|
export interface INodeIdNumeric extends NodeId {
|
|
61
45
|
identifierType: NodeIdType.NUMERIC;
|
|
62
46
|
value: number;
|
|
63
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* `NodeId` specialization for GUID nodeIds.
|
|
50
|
+
*/
|
|
64
51
|
export interface INodeIdGuid extends NodeId {
|
|
65
52
|
identifierType: NodeIdType.GUID;
|
|
66
53
|
value: string;
|
|
67
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* `NodeId` specialization for ByteString nodeIds (opaque).
|
|
57
|
+
*/
|
|
68
58
|
export interface INodeIdByteString extends NodeId {
|
|
69
59
|
identifierType: NodeIdType.BYTESTRING;
|
|
70
60
|
value: Buffer;
|
|
71
61
|
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* `NodeId` specialization for String nodeId.
|
|
65
|
+
*/
|
|
72
66
|
export interface INodeIdString extends NodeId {
|
|
73
67
|
identifierType: NodeIdType.STRING;
|
|
74
68
|
value: string;
|
|
75
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* `NodeId` specialization for all possible types of NodeIds.
|
|
72
|
+
*/
|
|
76
73
|
export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
|
|
77
74
|
|
|
78
75
|
|
|
79
|
-
|
|
76
|
+
|
|
80
77
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
78
|
+
*
|
|
79
|
+
* This class holds a OPC-UA node identifier.
|
|
80
|
+
*
|
|
81
|
+
* Nodes are unambiguously identified using a constructed
|
|
82
|
+
* identifier called the NodeId. Some Servers may accept
|
|
83
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
84
|
+
* represented in this Attribute.
|
|
85
|
+
*
|
|
86
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
87
|
+
* it shall not generate new
|
|
88
|
+
* NodeIds when rebooting.
|
|
85
89
|
*
|
|
86
|
-
* ``` javascript
|
|
87
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
88
|
-
* ```
|
|
89
|
-
* @constructor
|
|
90
90
|
*/
|
|
91
91
|
export class NodeId {
|
|
92
92
|
public static NodeIdType = NodeIdType;
|
|
93
93
|
public static nullNodeId: NodeId;
|
|
94
94
|
public static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*/
|
|
95
98
|
public static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
96
99
|
|
|
97
100
|
public identifierType: NodeIdType;
|
|
98
|
-
public value: number | string | Buffer | Guid
|
|
101
|
+
public value: number | string | Buffer | Guid;
|
|
99
102
|
public namespace: number;
|
|
100
103
|
|
|
101
104
|
/**
|
|
105
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
106
|
+
*
|
|
102
107
|
* @param identifierType - the nodeID type
|
|
103
108
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
104
109
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
*
|
|
113
|
+
* ```javascript
|
|
114
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
115
|
+
* ```
|
|
105
116
|
*/
|
|
106
117
|
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number) {
|
|
107
|
-
|
|
108
|
-
|
|
109
118
|
if (identifierType === null || identifierType === undefined) {
|
|
110
119
|
this.identifierType = NodeIdType.NUMERIC;
|
|
111
120
|
this.value = 0;
|
|
@@ -114,12 +123,15 @@ export class NodeId {
|
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
this.identifierType = identifierType;
|
|
117
|
-
this.value = value || defaultValue(identifierType);
|
|
126
|
+
this.value = value || defaultValue(identifierType as NodeIdType);
|
|
118
127
|
this.namespace = namespace || 0;
|
|
119
128
|
|
|
120
129
|
// namespace shall be a UInt16
|
|
121
130
|
assert(this.namespace >= 0 && this.namespace <= 0xffff, "NodeId: invalid namespace value");
|
|
122
|
-
assert(
|
|
131
|
+
assert(
|
|
132
|
+
this.identifierType !== NodeIdType.NUMERIC ||
|
|
133
|
+
(this.value !== null && (this.value as number) >= 0 && (this.value as number) <= 0xffffffff)
|
|
134
|
+
);
|
|
123
135
|
assert(this.identifierType !== NodeIdType.GUID || isValidGuid(this.value as string), "NodeId: Guid is invalid");
|
|
124
136
|
assert(this.identifierType !== NodeIdType.STRING || typeof this.value === "string", "cannot empty string");
|
|
125
137
|
if (this.identifierType === NodeIdType.GUID) {
|
|
@@ -130,26 +142,55 @@ export class NodeId {
|
|
|
130
142
|
/**
|
|
131
143
|
* get the string representation of the nodeID.
|
|
132
144
|
*
|
|
133
|
-
* @method toString
|
|
134
145
|
* @example
|
|
135
146
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
147
|
+
* by default, toString will return the "ns=" representation
|
|
148
|
+
*
|
|
149
|
+
* ```javascript
|
|
150
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
151
|
+
* console.log(nodeid.toString());
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* ```
|
|
155
|
+
* >"ns=1;i=123"
|
|
156
|
+
* ```
|
|
157
|
+
* @example
|
|
158
|
+
*
|
|
159
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
160
|
+
*
|
|
161
|
+
* ```javascript
|
|
162
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
163
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
164
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
165
|
+
* ```
|
|
166
|
+
* ```
|
|
167
|
+
* >"nsu=http://mynamespace;i=123"
|
|
168
|
+
* ```
|
|
169
|
+
* @example
|
|
170
|
+
*
|
|
171
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
172
|
+
* with the BrowseName of the node.
|
|
173
|
+
*
|
|
174
|
+
* ```javascript
|
|
175
|
+
* const addressSpace = getAddressSpace();
|
|
176
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
177
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
178
|
+
* ```
|
|
179
|
+
* ```
|
|
180
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
181
|
+
* ```
|
|
140
182
|
*
|
|
141
|
-
* ```
|
|
142
|
-
* >"ns=1;i=123"
|
|
143
|
-
* ```
|
|
144
183
|
*
|
|
145
184
|
* @param [options.addressSpace] {AddressSpace}
|
|
146
185
|
* @return {String}
|
|
147
186
|
*/
|
|
148
|
-
public toString(options?: { addressSpace?: any
|
|
187
|
+
public toString(options?: { addressSpace?: any; namespaceArray?: string[] }): string {
|
|
149
188
|
const addressSpace = options ? options.addressSpace : null;
|
|
150
189
|
|
|
151
|
-
const namespacePart: string = options?.namespaceArray
|
|
152
|
-
|
|
190
|
+
const namespacePart: string = options?.namespaceArray
|
|
191
|
+
? this.namespace == 0
|
|
192
|
+
? ""
|
|
193
|
+
: `nsu=${options.namespaceArray[this.namespace] || `<unknown namespace with index ${this.namespace}>`};`
|
|
153
194
|
: `ns=${this.namespace};`;
|
|
154
195
|
|
|
155
196
|
let str;
|
|
@@ -169,7 +210,7 @@ export class NodeId {
|
|
|
169
210
|
if (this.value) {
|
|
170
211
|
str = `${namespacePart}b=${(this.value as Buffer).toString("base64")}`;
|
|
171
212
|
} else {
|
|
172
|
-
str = `${
|
|
213
|
+
str = `${namespacePart}b=<null>`;
|
|
173
214
|
}
|
|
174
215
|
break;
|
|
175
216
|
}
|
|
@@ -190,9 +231,9 @@ export class NodeId {
|
|
|
190
231
|
}
|
|
191
232
|
|
|
192
233
|
/**
|
|
193
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
234
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
194
235
|
*/
|
|
195
|
-
public toJSON(options?: {namespaceArray?: string[]}): string {
|
|
236
|
+
public toJSON(options?: { namespaceArray?: string[] }): string {
|
|
196
237
|
return this.toString(options);
|
|
197
238
|
}
|
|
198
239
|
|
|
@@ -224,6 +265,9 @@ export class NodeId {
|
|
|
224
265
|
}
|
|
225
266
|
}
|
|
226
267
|
|
|
268
|
+
/**
|
|
269
|
+
* a fixed instance of a null NodeId
|
|
270
|
+
*/
|
|
227
271
|
NodeId.nullNodeId = new Proxy(
|
|
228
272
|
new NodeId(NodeIdType.NUMERIC, 0, 0),
|
|
229
273
|
{
|
|
@@ -236,8 +280,14 @@ NodeId.nullNodeId = new Proxy(
|
|
|
236
280
|
});
|
|
237
281
|
|
|
238
282
|
|
|
283
|
+
/**
|
|
284
|
+
* anything that could be turned into a nodeId
|
|
285
|
+
*/
|
|
239
286
|
export type NodeIdLike = string | NodeId | number;
|
|
240
287
|
|
|
288
|
+
/**
|
|
289
|
+
* @private
|
|
290
|
+
*/
|
|
241
291
|
const regexNamespaceI = /ns=([0-9]+);i=([0-9]+)/;
|
|
242
292
|
const regexNamespaceS = /ns=([0-9]+);s=(.*)/;
|
|
243
293
|
const regexNamespaceB = /ns=([0-9]+);b=(.*)/;
|
|
@@ -250,28 +300,23 @@ const regexNamespaceNSU_B = /nsu=(.+);b=(.*)/;
|
|
|
250
300
|
const regexNamespaceNSU_G = /nsu=(.+);g=([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})/;
|
|
251
301
|
|
|
252
302
|
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
*/
|
|
253
306
|
export interface ResolveNodeIdOptions {
|
|
254
307
|
namespaceArray?: string[];
|
|
255
308
|
defaultNamespaceIndex?: number ;
|
|
256
309
|
}
|
|
257
310
|
/**
|
|
258
311
|
* Convert a value into a nodeId:
|
|
259
|
-
* @class opcua
|
|
260
|
-
* @method coerceNodeId
|
|
261
|
-
* @static
|
|
262
312
|
*
|
|
263
313
|
* @description:
|
|
264
314
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
265
315
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
266
316
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
267
317
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
268
|
-
* @param value
|
|
269
|
-
* @param namespaceOptions {number}
|
|
270
|
-
* @param namespaceOptions.namespace {number}
|
|
271
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
272
318
|
*
|
|
273
319
|
*/
|
|
274
|
-
// eslint-disable-next-line max-statements
|
|
275
320
|
export function coerceNodeId(value: unknown, namespaceOptions?: number | ResolveNodeIdOptions): NodeId {
|
|
276
321
|
let matches;
|
|
277
322
|
let twoFirst;
|
|
@@ -354,11 +399,9 @@ export function coerceNodeId(value: unknown, namespaceOptions?: number | Resolve
|
|
|
354
399
|
const regEx1 = /^(s|g|b|i|ns)=/;
|
|
355
400
|
/**
|
|
356
401
|
* construct a node Id from a value and a namespace.
|
|
357
|
-
*
|
|
358
|
-
* @method makeNodeId
|
|
359
|
-
* @static
|
|
402
|
+
*
|
|
360
403
|
* @param {String|Buffer} value
|
|
361
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
404
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
362
405
|
* @return {NodeId}
|
|
363
406
|
*/
|
|
364
407
|
export function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId {
|
|
@@ -420,11 +463,35 @@ function reverse_map(nodeId: string) {
|
|
|
420
463
|
}
|
|
421
464
|
|
|
422
465
|
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* @
|
|
426
|
-
*
|
|
427
|
-
* @
|
|
466
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
467
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
468
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```javascript
|
|
472
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
473
|
+
* console.log(nodeId.toString());
|
|
474
|
+
* ```
|
|
475
|
+
* ```text
|
|
476
|
+
* >ns=0;i=85
|
|
477
|
+
* ```
|
|
478
|
+
*
|
|
479
|
+
* ```javascript
|
|
480
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
481
|
+
* console.log(nodeId.toString());
|
|
482
|
+
* ```
|
|
483
|
+
* ```text
|
|
484
|
+
* >ns=0;i=33
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* ```javascript
|
|
488
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
489
|
+
* console.log(nodeId.toString());
|
|
490
|
+
* ```
|
|
491
|
+
* ```text
|
|
492
|
+
* >ns=1;i=4444
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
428
495
|
*/
|
|
429
496
|
export function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeIdOptions): NodeId {
|
|
430
497
|
let nodeId;
|
|
@@ -440,6 +507,24 @@ export function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeI
|
|
|
440
507
|
|
|
441
508
|
NodeId.resolveNodeId = resolveNodeId;
|
|
442
509
|
|
|
510
|
+
/**
|
|
511
|
+
*
|
|
512
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
513
|
+
* determine if they are identical. This comparison is based on the
|
|
514
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
515
|
+
*
|
|
516
|
+
|
|
517
|
+
*
|
|
518
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
519
|
+
* identical, otherwise returns false.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```javascript
|
|
523
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
524
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
525
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
443
528
|
export function sameNodeId(n1: NodeId, n2: NodeId): boolean {
|
|
444
529
|
if (n1.identifierType !== n2.identifierType) {
|
|
445
530
|
return false;
|