node-opcua-nodeid 2.64.1 → 2.66.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 +68 -68
- package/dist/expanded_nodeid.js +109 -109
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/dist/nodeid.d.ts +121 -121
- package/dist/nodeid.js +372 -372
- package/package.json +10 -10
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-nodeid
|
|
4
|
-
*/
|
|
5
|
-
import { Guid } from "node-opcua-guid";
|
|
6
|
-
import { NodeId, NodeIdType } from "./nodeid";
|
|
7
|
-
/**
|
|
8
|
-
* An ExpandedNodeId extends the NodeId structure.
|
|
9
|
-
*
|
|
10
|
-
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be
|
|
11
|
-
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it
|
|
12
|
-
* is specified then the NamespaceIndex inside the NodeId shall be ignored.
|
|
13
|
-
*
|
|
14
|
-
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9
|
|
15
|
-
* and then encoding NamespaceUri as a String.
|
|
16
|
-
*
|
|
17
|
-
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the
|
|
18
|
-
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of
|
|
19
|
-
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding
|
|
20
|
-
* format byte for the NodeId.
|
|
21
|
-
*
|
|
22
|
-
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in
|
|
23
|
-
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in
|
|
24
|
-
* the stream for consistency,
|
|
25
|
-
*
|
|
26
|
-
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the
|
|
27
|
-
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
|
-
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
|
-
*
|
|
30
|
-
* @class ExpandedNodeId
|
|
31
|
-
* @extends NodeId
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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
|
-
*/
|
|
42
|
-
export declare class ExpandedNodeId extends NodeId {
|
|
43
|
-
static nullExpandedNodeId: ExpandedNodeId;
|
|
44
|
-
static fromNodeId(nodeId: NodeId, namespaceUri?: string, serverIndex?: number): ExpandedNodeId;
|
|
45
|
-
namespaceUri: null | string;
|
|
46
|
-
serverIndex: number;
|
|
47
|
-
constructor(forDeserialization: null);
|
|
48
|
-
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
49
|
-
/**
|
|
50
|
-
* @method toString
|
|
51
|
-
* @return {string}
|
|
52
|
-
*/
|
|
53
|
-
toString(): string;
|
|
54
|
-
/**
|
|
55
|
-
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
56
|
-
* @method toJSON
|
|
57
|
-
* @return {String}
|
|
58
|
-
*/
|
|
59
|
-
toJSON(): any;
|
|
60
|
-
}
|
|
61
|
-
export declare function coerceExpandedNodeId(value: unknown): ExpandedNodeId;
|
|
62
|
-
/**
|
|
63
|
-
* @method makeExpandedNodeId
|
|
64
|
-
* @param value
|
|
65
|
-
* @param [namespace=0] the namespace
|
|
66
|
-
* @return {ExpandedNodeId}
|
|
67
|
-
*/
|
|
68
|
-
export declare function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-nodeid
|
|
4
|
+
*/
|
|
5
|
+
import { Guid } from "node-opcua-guid";
|
|
6
|
+
import { NodeId, NodeIdType } from "./nodeid";
|
|
7
|
+
/**
|
|
8
|
+
* An ExpandedNodeId extends the NodeId structure.
|
|
9
|
+
*
|
|
10
|
+
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be
|
|
11
|
+
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it
|
|
12
|
+
* is specified then the NamespaceIndex inside the NodeId shall be ignored.
|
|
13
|
+
*
|
|
14
|
+
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9
|
|
15
|
+
* and then encoding NamespaceUri as a String.
|
|
16
|
+
*
|
|
17
|
+
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the
|
|
18
|
+
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of
|
|
19
|
+
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding
|
|
20
|
+
* format byte for the NodeId.
|
|
21
|
+
*
|
|
22
|
+
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in
|
|
23
|
+
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in
|
|
24
|
+
* the stream for consistency,
|
|
25
|
+
*
|
|
26
|
+
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the
|
|
27
|
+
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
|
+
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
|
+
*
|
|
30
|
+
* @class ExpandedNodeId
|
|
31
|
+
* @extends NodeId
|
|
32
|
+
*
|
|
33
|
+
*
|
|
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
|
+
*/
|
|
42
|
+
export declare class ExpandedNodeId extends NodeId {
|
|
43
|
+
static nullExpandedNodeId: ExpandedNodeId;
|
|
44
|
+
static fromNodeId(nodeId: NodeId, namespaceUri?: string, serverIndex?: number): ExpandedNodeId;
|
|
45
|
+
namespaceUri: null | string;
|
|
46
|
+
serverIndex: number;
|
|
47
|
+
constructor(forDeserialization: null);
|
|
48
|
+
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
49
|
+
/**
|
|
50
|
+
* @method toString
|
|
51
|
+
* @return {string}
|
|
52
|
+
*/
|
|
53
|
+
toString(): string;
|
|
54
|
+
/**
|
|
55
|
+
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
56
|
+
* @method toJSON
|
|
57
|
+
* @return {String}
|
|
58
|
+
*/
|
|
59
|
+
toJSON(): any;
|
|
60
|
+
}
|
|
61
|
+
export declare function coerceExpandedNodeId(value: unknown): ExpandedNodeId;
|
|
62
|
+
/**
|
|
63
|
+
* @method makeExpandedNodeId
|
|
64
|
+
* @param value
|
|
65
|
+
* @param [namespace=0] the namespace
|
|
66
|
+
* @return {ExpandedNodeId}
|
|
67
|
+
*/
|
|
68
|
+
export declare function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId;
|
package/dist/expanded_nodeid.js
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeExpandedNodeId = exports.coerceExpandedNodeId = exports.ExpandedNodeId = void 0;
|
|
4
|
-
const nodeid_1 = require("./nodeid");
|
|
5
|
-
/**
|
|
6
|
-
* An ExpandedNodeId extends the NodeId structure.
|
|
7
|
-
*
|
|
8
|
-
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be
|
|
9
|
-
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it
|
|
10
|
-
* is specified then the NamespaceIndex inside the NodeId shall be ignored.
|
|
11
|
-
*
|
|
12
|
-
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9
|
|
13
|
-
* and then encoding NamespaceUri as a String.
|
|
14
|
-
*
|
|
15
|
-
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the
|
|
16
|
-
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of
|
|
17
|
-
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding
|
|
18
|
-
* format byte for the NodeId.
|
|
19
|
-
*
|
|
20
|
-
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in
|
|
21
|
-
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in
|
|
22
|
-
* the stream for consistency,
|
|
23
|
-
*
|
|
24
|
-
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the
|
|
25
|
-
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
26
|
-
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
27
|
-
*
|
|
28
|
-
* @class ExpandedNodeId
|
|
29
|
-
* @extends NodeId
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @param identifierType - the nodeID type
|
|
34
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
35
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
36
|
-
* @param namespaceUri - NamespaceUri
|
|
37
|
-
* @param serverIndex - the server Index
|
|
38
|
-
* @constructor
|
|
39
|
-
*/
|
|
40
|
-
class ExpandedNodeId extends nodeid_1.NodeId {
|
|
41
|
-
constructor(identifierType, value, namespace, namespaceUri, serverIndex) {
|
|
42
|
-
super(identifierType, value, namespace);
|
|
43
|
-
this.namespaceUri = namespaceUri || null;
|
|
44
|
-
this.serverIndex = serverIndex || 0;
|
|
45
|
-
}
|
|
46
|
-
static fromNodeId(nodeId, namespaceUri, serverIndex) {
|
|
47
|
-
return new ExpandedNodeId(nodeId.identifierType, nodeId.value, nodeId.namespace, namespaceUri, serverIndex);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @method toString
|
|
51
|
-
* @return {string}
|
|
52
|
-
*/
|
|
53
|
-
toString() {
|
|
54
|
-
let str = nodeid_1.NodeId.prototype.toString.call(this);
|
|
55
|
-
if (this.namespaceUri) {
|
|
56
|
-
str += ";namespaceUri:" + this.namespaceUri;
|
|
57
|
-
}
|
|
58
|
-
if (this.serverIndex) {
|
|
59
|
-
str += ";serverIndex:" + this.serverIndex;
|
|
60
|
-
}
|
|
61
|
-
return str;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
65
|
-
* @method toJSON
|
|
66
|
-
* @return {String}
|
|
67
|
-
*/
|
|
68
|
-
toJSON() {
|
|
69
|
-
return this.toString();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.ExpandedNodeId = ExpandedNodeId;
|
|
73
|
-
ExpandedNodeId.nullExpandedNodeId = new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0);
|
|
74
|
-
function coerceExpandedNodeId(value) {
|
|
75
|
-
const n = (0, nodeid_1.coerceNodeId)(value);
|
|
76
|
-
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
77
|
-
}
|
|
78
|
-
exports.coerceExpandedNodeId = coerceExpandedNodeId;
|
|
79
|
-
/**
|
|
80
|
-
* @method makeExpandedNodeId
|
|
81
|
-
* @param value
|
|
82
|
-
* @param [namespace=0] the namespace
|
|
83
|
-
* @return {ExpandedNodeId}
|
|
84
|
-
*/
|
|
85
|
-
function makeExpandedNodeId(value, namespace) {
|
|
86
|
-
if (value === undefined && namespace === undefined) {
|
|
87
|
-
return new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0, null, 0);
|
|
88
|
-
}
|
|
89
|
-
const serverIndex = 0;
|
|
90
|
-
let n;
|
|
91
|
-
const namespaceUri = null;
|
|
92
|
-
if (value instanceof ExpandedNodeId) {
|
|
93
|
-
// construct from a ExpandedNodeId => copy
|
|
94
|
-
n = value;
|
|
95
|
-
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, n.namespaceUri, n.serverIndex);
|
|
96
|
-
}
|
|
97
|
-
if (value instanceof nodeid_1.NodeId) {
|
|
98
|
-
// construct from a nodeId
|
|
99
|
-
n = value;
|
|
100
|
-
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, namespaceUri, serverIndex);
|
|
101
|
-
}
|
|
102
|
-
const valueInt = parseInt(value, 10);
|
|
103
|
-
if (!isFinite(valueInt)) {
|
|
104
|
-
throw new Error(" cannot makeExpandedNodeId out of " + value);
|
|
105
|
-
}
|
|
106
|
-
namespace = namespace || 0;
|
|
107
|
-
return new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, valueInt, namespace, namespaceUri, serverIndex);
|
|
108
|
-
}
|
|
109
|
-
exports.makeExpandedNodeId = makeExpandedNodeId;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeExpandedNodeId = exports.coerceExpandedNodeId = exports.ExpandedNodeId = void 0;
|
|
4
|
+
const nodeid_1 = require("./nodeid");
|
|
5
|
+
/**
|
|
6
|
+
* An ExpandedNodeId extends the NodeId structure.
|
|
7
|
+
*
|
|
8
|
+
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be
|
|
9
|
+
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it
|
|
10
|
+
* is specified then the NamespaceIndex inside the NodeId shall be ignored.
|
|
11
|
+
*
|
|
12
|
+
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9
|
|
13
|
+
* and then encoding NamespaceUri as a String.
|
|
14
|
+
*
|
|
15
|
+
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the
|
|
16
|
+
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of
|
|
17
|
+
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding
|
|
18
|
+
* format byte for the NodeId.
|
|
19
|
+
*
|
|
20
|
+
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in
|
|
21
|
+
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in
|
|
22
|
+
* the stream for consistency,
|
|
23
|
+
*
|
|
24
|
+
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the
|
|
25
|
+
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
26
|
+
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
27
|
+
*
|
|
28
|
+
* @class ExpandedNodeId
|
|
29
|
+
* @extends NodeId
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* @param identifierType - the nodeID type
|
|
34
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
35
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
36
|
+
* @param namespaceUri - NamespaceUri
|
|
37
|
+
* @param serverIndex - the server Index
|
|
38
|
+
* @constructor
|
|
39
|
+
*/
|
|
40
|
+
class ExpandedNodeId extends nodeid_1.NodeId {
|
|
41
|
+
constructor(identifierType, value, namespace, namespaceUri, serverIndex) {
|
|
42
|
+
super(identifierType, value, namespace);
|
|
43
|
+
this.namespaceUri = namespaceUri || null;
|
|
44
|
+
this.serverIndex = serverIndex || 0;
|
|
45
|
+
}
|
|
46
|
+
static fromNodeId(nodeId, namespaceUri, serverIndex) {
|
|
47
|
+
return new ExpandedNodeId(nodeId.identifierType, nodeId.value, nodeId.namespace, namespaceUri, serverIndex);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @method toString
|
|
51
|
+
* @return {string}
|
|
52
|
+
*/
|
|
53
|
+
toString() {
|
|
54
|
+
let str = nodeid_1.NodeId.prototype.toString.call(this);
|
|
55
|
+
if (this.namespaceUri) {
|
|
56
|
+
str += ";namespaceUri:" + this.namespaceUri;
|
|
57
|
+
}
|
|
58
|
+
if (this.serverIndex) {
|
|
59
|
+
str += ";serverIndex:" + this.serverIndex;
|
|
60
|
+
}
|
|
61
|
+
return str;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
65
|
+
* @method toJSON
|
|
66
|
+
* @return {String}
|
|
67
|
+
*/
|
|
68
|
+
toJSON() {
|
|
69
|
+
return this.toString();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ExpandedNodeId = ExpandedNodeId;
|
|
73
|
+
ExpandedNodeId.nullExpandedNodeId = new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0);
|
|
74
|
+
function coerceExpandedNodeId(value) {
|
|
75
|
+
const n = (0, nodeid_1.coerceNodeId)(value);
|
|
76
|
+
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
77
|
+
}
|
|
78
|
+
exports.coerceExpandedNodeId = coerceExpandedNodeId;
|
|
79
|
+
/**
|
|
80
|
+
* @method makeExpandedNodeId
|
|
81
|
+
* @param value
|
|
82
|
+
* @param [namespace=0] the namespace
|
|
83
|
+
* @return {ExpandedNodeId}
|
|
84
|
+
*/
|
|
85
|
+
function makeExpandedNodeId(value, namespace) {
|
|
86
|
+
if (value === undefined && namespace === undefined) {
|
|
87
|
+
return new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0, null, 0);
|
|
88
|
+
}
|
|
89
|
+
const serverIndex = 0;
|
|
90
|
+
let n;
|
|
91
|
+
const namespaceUri = null;
|
|
92
|
+
if (value instanceof ExpandedNodeId) {
|
|
93
|
+
// construct from a ExpandedNodeId => copy
|
|
94
|
+
n = value;
|
|
95
|
+
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, n.namespaceUri, n.serverIndex);
|
|
96
|
+
}
|
|
97
|
+
if (value instanceof nodeid_1.NodeId) {
|
|
98
|
+
// construct from a nodeId
|
|
99
|
+
n = value;
|
|
100
|
+
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, namespaceUri, serverIndex);
|
|
101
|
+
}
|
|
102
|
+
const valueInt = parseInt(value, 10);
|
|
103
|
+
if (!isFinite(valueInt)) {
|
|
104
|
+
throw new Error(" cannot makeExpandedNodeId out of " + value);
|
|
105
|
+
}
|
|
106
|
+
namespace = namespace || 0;
|
|
107
|
+
return new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, valueInt, namespace, namespaceUri, serverIndex);
|
|
108
|
+
}
|
|
109
|
+
exports.makeExpandedNodeId = makeExpandedNodeId;
|
|
110
110
|
//# sourceMappingURL=expanded_nodeid.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-nodeid
|
|
3
|
-
*/
|
|
4
|
-
export * from "./nodeid";
|
|
5
|
-
export * from "./expanded_nodeid";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-nodeid
|
|
3
|
+
*/
|
|
4
|
+
export * from "./nodeid";
|
|
5
|
+
export * from "./expanded_nodeid";
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @module node-opcua-nodeid
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("./nodeid"), exports);
|
|
21
|
+
__exportStar(require("./expanded_nodeid"), exports);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,2CAAyB;AACzB,oDAAkC"}
|
package/dist/nodeid.d.ts
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Guid } from "node-opcua-guid";
|
|
3
|
-
/**
|
|
4
|
-
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
5
|
-
*/
|
|
6
|
-
export declare enum NodeIdType {
|
|
7
|
-
/**
|
|
8
|
-
* @static
|
|
9
|
-
* @property NUMERIC
|
|
10
|
-
* @default 0x1
|
|
11
|
-
*/
|
|
12
|
-
NUMERIC = 1,
|
|
13
|
-
/**
|
|
14
|
-
* @static
|
|
15
|
-
* @property STRING
|
|
16
|
-
* @default 0x2
|
|
17
|
-
*/
|
|
18
|
-
STRING = 2,
|
|
19
|
-
/**
|
|
20
|
-
* @static
|
|
21
|
-
* @property GUID
|
|
22
|
-
* @default 0x3
|
|
23
|
-
*/
|
|
24
|
-
GUID = 3,
|
|
25
|
-
/**
|
|
26
|
-
* @static
|
|
27
|
-
* @property BYTESTRING
|
|
28
|
-
* @default 0x4
|
|
29
|
-
*/
|
|
30
|
-
BYTESTRING = 4
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Construct a node ID
|
|
34
|
-
*
|
|
35
|
-
* @class NodeId
|
|
36
|
-
* @example
|
|
37
|
-
*
|
|
38
|
-
* ``` javascript
|
|
39
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
40
|
-
* ```
|
|
41
|
-
* @constructor
|
|
42
|
-
*/
|
|
43
|
-
export declare class NodeId {
|
|
44
|
-
static NodeIdType: typeof NodeIdType;
|
|
45
|
-
static nullNodeId: NodeId;
|
|
46
|
-
static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
47
|
-
static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
48
|
-
identifierType: NodeIdType;
|
|
49
|
-
value: number | string | Buffer | Guid;
|
|
50
|
-
namespace: number;
|
|
51
|
-
/**
|
|
52
|
-
* @param identifierType - the nodeID type
|
|
53
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
54
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
55
|
-
*/
|
|
56
|
-
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
|
|
57
|
-
/**
|
|
58
|
-
* get the string representation of the nodeID.
|
|
59
|
-
*
|
|
60
|
-
* @method toString
|
|
61
|
-
* @example
|
|
62
|
-
*
|
|
63
|
-
* ``` javascript
|
|
64
|
-
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
65
|
-
* console.log(nodeid.toString());
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* ```
|
|
69
|
-
* >"ns=1;i=123"
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @param [options.addressSpace] {AddressSpace}
|
|
73
|
-
* @return {String}
|
|
74
|
-
*/
|
|
75
|
-
toString(options?: {
|
|
76
|
-
addressSpace?: any;
|
|
77
|
-
}): string;
|
|
78
|
-
/**
|
|
79
|
-
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
80
|
-
*/
|
|
81
|
-
toJSON(): string;
|
|
82
|
-
displayText(): string;
|
|
83
|
-
/**
|
|
84
|
-
* returns true if the NodeId is null or empty
|
|
85
|
-
*/
|
|
86
|
-
isEmpty(): boolean;
|
|
87
|
-
}
|
|
88
|
-
export declare type NodeIdLike = string | NodeId | number;
|
|
89
|
-
/**
|
|
90
|
-
* Convert a value into a nodeId:
|
|
91
|
-
* @class opcua
|
|
92
|
-
* @method coerceNodeId
|
|
93
|
-
* @static
|
|
94
|
-
*
|
|
95
|
-
* @description:
|
|
96
|
-
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
97
|
-
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
98
|
-
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
99
|
-
* @param value
|
|
100
|
-
* @param namespace {number}
|
|
101
|
-
*/
|
|
102
|
-
export declare function coerceNodeId(value: unknown, namespace?: number): NodeId;
|
|
103
|
-
/**
|
|
104
|
-
* construct a node Id from a value and a namespace.
|
|
105
|
-
* @class opcua
|
|
106
|
-
* @method makeNodeId
|
|
107
|
-
* @static
|
|
108
|
-
* @param {String|Buffer} value
|
|
109
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
110
|
-
* @return {NodeId}
|
|
111
|
-
*/
|
|
112
|
-
export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
|
|
113
|
-
/**
|
|
114
|
-
* @class opcua
|
|
115
|
-
* @method resolveNodeId
|
|
116
|
-
* @static
|
|
117
|
-
* @param nodeIdOrString
|
|
118
|
-
* @return the nodeId
|
|
119
|
-
*/
|
|
120
|
-
export declare function resolveNodeId(nodeIdOrString: NodeIdLike): NodeId;
|
|
121
|
-
export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Guid } from "node-opcua-guid";
|
|
3
|
+
/**
|
|
4
|
+
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum NodeIdType {
|
|
7
|
+
/**
|
|
8
|
+
* @static
|
|
9
|
+
* @property NUMERIC
|
|
10
|
+
* @default 0x1
|
|
11
|
+
*/
|
|
12
|
+
NUMERIC = 1,
|
|
13
|
+
/**
|
|
14
|
+
* @static
|
|
15
|
+
* @property STRING
|
|
16
|
+
* @default 0x2
|
|
17
|
+
*/
|
|
18
|
+
STRING = 2,
|
|
19
|
+
/**
|
|
20
|
+
* @static
|
|
21
|
+
* @property GUID
|
|
22
|
+
* @default 0x3
|
|
23
|
+
*/
|
|
24
|
+
GUID = 3,
|
|
25
|
+
/**
|
|
26
|
+
* @static
|
|
27
|
+
* @property BYTESTRING
|
|
28
|
+
* @default 0x4
|
|
29
|
+
*/
|
|
30
|
+
BYTESTRING = 4
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Construct a node ID
|
|
34
|
+
*
|
|
35
|
+
* @class NodeId
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* ``` javascript
|
|
39
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
40
|
+
* ```
|
|
41
|
+
* @constructor
|
|
42
|
+
*/
|
|
43
|
+
export declare class NodeId {
|
|
44
|
+
static NodeIdType: typeof NodeIdType;
|
|
45
|
+
static nullNodeId: NodeId;
|
|
46
|
+
static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
47
|
+
static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
48
|
+
identifierType: NodeIdType;
|
|
49
|
+
value: number | string | Buffer | Guid;
|
|
50
|
+
namespace: number;
|
|
51
|
+
/**
|
|
52
|
+
* @param identifierType - the nodeID type
|
|
53
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
54
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
55
|
+
*/
|
|
56
|
+
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
|
|
57
|
+
/**
|
|
58
|
+
* get the string representation of the nodeID.
|
|
59
|
+
*
|
|
60
|
+
* @method toString
|
|
61
|
+
* @example
|
|
62
|
+
*
|
|
63
|
+
* ``` javascript
|
|
64
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
65
|
+
* console.log(nodeid.toString());
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* ```
|
|
69
|
+
* >"ns=1;i=123"
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param [options.addressSpace] {AddressSpace}
|
|
73
|
+
* @return {String}
|
|
74
|
+
*/
|
|
75
|
+
toString(options?: {
|
|
76
|
+
addressSpace?: any;
|
|
77
|
+
}): string;
|
|
78
|
+
/**
|
|
79
|
+
* convert nodeId to a JSON string. same as {@link NodeId#toString }
|
|
80
|
+
*/
|
|
81
|
+
toJSON(): string;
|
|
82
|
+
displayText(): string;
|
|
83
|
+
/**
|
|
84
|
+
* returns true if the NodeId is null or empty
|
|
85
|
+
*/
|
|
86
|
+
isEmpty(): boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare type NodeIdLike = string | NodeId | number;
|
|
89
|
+
/**
|
|
90
|
+
* Convert a value into a nodeId:
|
|
91
|
+
* @class opcua
|
|
92
|
+
* @method coerceNodeId
|
|
93
|
+
* @static
|
|
94
|
+
*
|
|
95
|
+
* @description:
|
|
96
|
+
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
97
|
+
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
98
|
+
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
99
|
+
* @param value
|
|
100
|
+
* @param namespace {number}
|
|
101
|
+
*/
|
|
102
|
+
export declare function coerceNodeId(value: unknown, namespace?: number): NodeId;
|
|
103
|
+
/**
|
|
104
|
+
* construct a node Id from a value and a namespace.
|
|
105
|
+
* @class opcua
|
|
106
|
+
* @method makeNodeId
|
|
107
|
+
* @static
|
|
108
|
+
* @param {String|Buffer} value
|
|
109
|
+
* @param [namespace]=0 {Number} the node id namespace
|
|
110
|
+
* @return {NodeId}
|
|
111
|
+
*/
|
|
112
|
+
export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
|
|
113
|
+
/**
|
|
114
|
+
* @class opcua
|
|
115
|
+
* @method resolveNodeId
|
|
116
|
+
* @static
|
|
117
|
+
* @param nodeIdOrString
|
|
118
|
+
* @return the nodeId
|
|
119
|
+
*/
|
|
120
|
+
export declare function resolveNodeId(nodeIdOrString: NodeIdLike): NodeId;
|
|
121
|
+
export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;
|