node-opcua-address-space 2.96.0 → 2.97.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/source/address_space_ts.d.ts +3 -3
- package/dist/source/address_space_ts.js +3 -3
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/helpers/call_helpers.d.ts +1 -1
- package/dist/source/helpers/multiform_func.d.ts +8 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
- package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +2 -2
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.js +8 -7
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.d.ts +1 -1
- package/dist/source/session_context.d.ts +1 -1
- package/dist/src/address_space.js +16 -15
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/apply_condition_refresh.d.ts +1 -1
- package/dist/src/base_node_impl.d.ts +1 -0
- package/dist/src/base_node_impl.js +47 -44
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.js +2 -0
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +1 -1
- package/dist/src/event_data.d.ts +2 -2
- package/dist/src/nodeid_manager.d.ts +3 -3
- package/dist/src/nodeset_tools/dump_to_bsd.js +2 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
- package/dist/src/reference_impl.js +6 -6
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/tool_isSubtypeOf.d.ts +4 -4
- package/dist/src/ua_data_type_impl.js +14 -14
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.js +6 -6
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.js +7 -7
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.js +8 -8
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.js +6 -6
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.js +15 -14
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_type_impl.js +6 -6
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/src/ua_view_impl.js +3 -3
- package/dist/src/ua_view_impl.js.map +1 -1
- package/package.json +24 -24
- package/source/loader/make_xml_extension_object_parser.ts +10 -9
- package/src/address_space.ts +6 -5
- package/src/base_node_impl.ts +6 -2
- package/src/data_access/ua_two_state_discrete_impl.ts +2 -0
- package/src/nodeset_tools/dump_to_bsd.ts +6 -4
- package/src/ua_variable_impl.ts +2039 -2037
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.97.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -address-space",
|
|
5
5
|
"main": "./dist/src/index_current.js",
|
|
6
6
|
"types": "./dist/source/index.d.ts",
|
|
@@ -22,35 +22,35 @@
|
|
|
22
22
|
"chalk": "4.1.2",
|
|
23
23
|
"dequeue": "^1.0.5",
|
|
24
24
|
"lodash": "4.17.21",
|
|
25
|
-
"node-opcua-address-space-base": "2.
|
|
25
|
+
"node-opcua-address-space-base": "2.97.0",
|
|
26
26
|
"node-opcua-assert": "2.88.0",
|
|
27
|
-
"node-opcua-basic-types": "2.
|
|
27
|
+
"node-opcua-basic-types": "2.97.0",
|
|
28
28
|
"node-opcua-binary-stream": "2.90.1",
|
|
29
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
29
|
+
"node-opcua-client-dynamic-extension-object": "2.97.0",
|
|
30
30
|
"node-opcua-constants": "2.88.0",
|
|
31
31
|
"node-opcua-crypto": "^2.1.2",
|
|
32
|
-
"node-opcua-data-access": "2.
|
|
33
|
-
"node-opcua-data-model": "2.
|
|
34
|
-
"node-opcua-data-value": "2.
|
|
32
|
+
"node-opcua-data-access": "2.97.0",
|
|
33
|
+
"node-opcua-data-model": "2.97.0",
|
|
34
|
+
"node-opcua-data-value": "2.97.0",
|
|
35
35
|
"node-opcua-date-time": "2.90.1",
|
|
36
36
|
"node-opcua-debug": "2.90.1",
|
|
37
37
|
"node-opcua-enum": "2.90.1",
|
|
38
|
-
"node-opcua-extension-object": "2.
|
|
39
|
-
"node-opcua-factory": "2.
|
|
40
|
-
"node-opcua-nodeid": "2.
|
|
41
|
-
"node-opcua-nodeset-ua": "2.
|
|
42
|
-
"node-opcua-numeric-range": "2.
|
|
38
|
+
"node-opcua-extension-object": "2.97.0",
|
|
39
|
+
"node-opcua-factory": "2.97.0",
|
|
40
|
+
"node-opcua-nodeid": "2.97.0",
|
|
41
|
+
"node-opcua-nodeset-ua": "2.97.0",
|
|
42
|
+
"node-opcua-numeric-range": "2.97.0",
|
|
43
43
|
"node-opcua-object-registry": "2.90.1",
|
|
44
|
-
"node-opcua-pseudo-session": "2.
|
|
45
|
-
"node-opcua-service-browse": "2.
|
|
46
|
-
"node-opcua-service-call": "2.
|
|
47
|
-
"node-opcua-service-history": "2.
|
|
48
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
49
|
-
"node-opcua-service-write": "2.
|
|
44
|
+
"node-opcua-pseudo-session": "2.97.0",
|
|
45
|
+
"node-opcua-service-browse": "2.97.0",
|
|
46
|
+
"node-opcua-service-call": "2.97.0",
|
|
47
|
+
"node-opcua-service-history": "2.97.0",
|
|
48
|
+
"node-opcua-service-translate-browse-path": "2.97.0",
|
|
49
|
+
"node-opcua-service-write": "2.97.0",
|
|
50
50
|
"node-opcua-status-code": "2.90.1",
|
|
51
|
-
"node-opcua-types": "2.
|
|
51
|
+
"node-opcua-types": "2.97.0",
|
|
52
52
|
"node-opcua-utils": "2.90.1",
|
|
53
|
-
"node-opcua-variant": "2.
|
|
53
|
+
"node-opcua-variant": "2.97.0",
|
|
54
54
|
"node-opcua-xml2json": "2.96.0",
|
|
55
55
|
"semver": "^7.3.8",
|
|
56
56
|
"set-prototype-of": "^1.0.0",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"node-opcua-benchmarker": "2.90.1",
|
|
63
63
|
"node-opcua-leak-detector": "2.90.1",
|
|
64
64
|
"node-opcua-nodesets": "2.96.0",
|
|
65
|
-
"node-opcua-packet-analyzer": "2.
|
|
66
|
-
"node-opcua-service-filter": "2.
|
|
67
|
-
"node-opcua-test-fixtures": "2.
|
|
65
|
+
"node-opcua-packet-analyzer": "2.97.0",
|
|
66
|
+
"node-opcua-service-filter": "2.97.0",
|
|
67
|
+
"node-opcua-test-fixtures": "2.97.0",
|
|
68
68
|
"should": "^13.2.3",
|
|
69
69
|
"sinon": "^15.0.1",
|
|
70
70
|
"source-map-support": "^0.5.21"
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"internet of things"
|
|
85
85
|
],
|
|
86
86
|
"homepage": "http://node-opcua.github.io/",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "19c96bda0810d2dec73dd1c2427546be40908646"
|
|
88
88
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Byte, coerceInt64, coerceUInt64, Int16, Int32, Int64, SByte, UAString, UInt16, UInt32, UInt64 } from "node-opcua-basic-types";
|
|
2
2
|
import { LocalizedTextOptions } from "node-opcua-data-model";
|
|
3
3
|
import { make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
4
|
-
import { coerceNodeId, NodeId, NodeIdType } from "node-opcua-nodeid";
|
|
4
|
+
import { coerceNodeId, INodeId, NodeId, NodeIdType } from "node-opcua-nodeid";
|
|
5
5
|
import { EnumDefinition, StructureDefinition } from "node-opcua-types";
|
|
6
6
|
import { lowerFirstLetter } from "node-opcua-utils";
|
|
7
7
|
import { DataType } from "node-opcua-variant";
|
|
@@ -82,7 +82,7 @@ const localizedTextReader: ReaderStateParserLike = {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
function clamp(value: number, minValue: number, maxValue: number) {
|
|
85
|
-
if (value< minValue) {
|
|
85
|
+
if (value < minValue) {
|
|
86
86
|
warningLog(`invalid value range : ${value} < ${minValue} but should be [${minValue} , ${maxValue}]`);
|
|
87
87
|
return minValue;
|
|
88
88
|
}
|
|
@@ -257,25 +257,26 @@ function _clone(a: any): any {
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
function _makeTypeReader(
|
|
260
|
-
|
|
260
|
+
dataTypeNodeId1: NodeId,
|
|
261
261
|
definitionMap: DefinitionMap2,
|
|
262
262
|
readerMap: Record<string, ReaderStateParserLike>
|
|
263
263
|
): { name: string; parser: ReaderStateParserLike } {
|
|
264
|
-
|
|
264
|
+
const n = dataTypeNodeId1 as INodeId;
|
|
265
|
+
if (n.identifierType === NodeIdType.NUMERIC && n.namespace === 0 && n.value === 0) {
|
|
265
266
|
// a generic Extension Object
|
|
266
267
|
return { name: "Variant", parser: partials["Variant"] };
|
|
267
268
|
}
|
|
268
269
|
if (
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
n.namespace === 0 &&
|
|
271
|
+
n.identifierType === NodeIdType.NUMERIC &&
|
|
272
|
+
n.value < DataType.ExtensionObject
|
|
272
273
|
) {
|
|
273
|
-
const name = DataType[
|
|
274
|
+
const name = DataType[n.value as number] as string;
|
|
274
275
|
const parser = partials[name];
|
|
275
276
|
return { name, parser };
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
const { name, definition } = definitionMap.findDefinition(
|
|
279
|
+
const { name, definition } = definitionMap.findDefinition(n);
|
|
279
280
|
const dataTypeName = name;
|
|
280
281
|
|
|
281
282
|
// console.log("NAME = ", dataTypeNodeId.toString(), name, definition);
|
package/src/address_space.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object
|
|
|
10
10
|
import { DataTypeIds, VariableTypeIds } from "node-opcua-constants";
|
|
11
11
|
import { BrowseDirection, NodeClass, QualifiedName } from "node-opcua-data-model";
|
|
12
12
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
13
|
-
import { coerceExpandedNodeId, coerceNodeId, makeNodeId, NodeId, NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
13
|
+
import { coerceExpandedNodeId, coerceNodeId, INodeId, makeNodeId, NodeId, NodeIdLike, NodeIdType, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
14
14
|
import { ObjectRegistry } from "node-opcua-object-registry";
|
|
15
15
|
import { BrowseResult } from "node-opcua-service-browse";
|
|
16
16
|
import { StatusCodes } from "node-opcua-status-code";
|
|
@@ -483,18 +483,19 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
483
483
|
if (sameNodeId(enumerationTypeNodeId, dataTypeNode!.nodeId)) {
|
|
484
484
|
return DataType.Int32;
|
|
485
485
|
}
|
|
486
|
+
const n = dataTypeNode.nodeId as INodeId;
|
|
486
487
|
|
|
487
|
-
if (
|
|
488
|
+
if (n.namespace === 0 && n.value === 29) {
|
|
488
489
|
// Number
|
|
489
490
|
return DataType.Null; //which one ?
|
|
490
491
|
}
|
|
491
492
|
|
|
492
|
-
if (
|
|
493
|
+
if (n.namespace === 0 && n.value === 0) {
|
|
493
494
|
return DataType.Null;
|
|
494
495
|
}
|
|
495
496
|
|
|
496
|
-
if (
|
|
497
|
-
return
|
|
497
|
+
if (n.identifierType === NodeIdType.NUMERIC && n.namespace === 0 && n.value <= 25) {
|
|
498
|
+
return n.value as DataType;
|
|
498
499
|
}
|
|
499
500
|
|
|
500
501
|
const result = this.findCorrespondingBasicDataType(dataTypeNode.subtypeOfObj as UADataType);
|
package/src/base_node_impl.ts
CHANGED
|
@@ -1159,6 +1159,10 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
|
|
|
1159
1159
|
BaseNode_removePrivate(this);
|
|
1160
1160
|
}
|
|
1161
1161
|
|
|
1162
|
+
public isDisposed(): boolean {
|
|
1163
|
+
return !this.addressSpacePrivate;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1162
1166
|
// istanbul ignore next
|
|
1163
1167
|
public dumpXML(xmlWriter: XmlWriter): void {
|
|
1164
1168
|
console.error(" This ", (NodeClass as any)[this.nodeClass]);
|
|
@@ -1504,8 +1508,8 @@ function _asObject<T extends BaseNode>(references: UAReference[], addressSpace:
|
|
|
1504
1508
|
// tslint:disable-next-line:no-console
|
|
1505
1509
|
console.log(
|
|
1506
1510
|
chalk.red(" Warning : object with nodeId ") +
|
|
1507
|
-
|
|
1508
|
-
|
|
1511
|
+
chalk.cyan(reference.nodeId.toString()) +
|
|
1512
|
+
chalk.red(" cannot be found in the address space !")
|
|
1509
1513
|
);
|
|
1510
1514
|
}
|
|
1511
1515
|
return obj as any as T;
|
|
@@ -130,7 +130,9 @@ export function _addTwoStateDiscrete(namespace: INamespace, options: AddTwoState
|
|
|
130
130
|
const variable = namespace.addVariable({
|
|
131
131
|
accessLevel: options.accessLevel,
|
|
132
132
|
browseName: options.browseName,
|
|
133
|
+
displayName: options.displayName,
|
|
133
134
|
componentOf: options.componentOf,
|
|
135
|
+
propertyOf: options.propertyOf,
|
|
134
136
|
dataType: DataType.Boolean,
|
|
135
137
|
nodeId: options.nodeId,
|
|
136
138
|
typeDefinition: twoStateDiscreteType.nodeId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAddressSpace, INamespace, UADataType } from "node-opcua-address-space-base";
|
|
2
2
|
import { assert } from "node-opcua-assert";
|
|
3
3
|
import { StructureDefinition, EnumDefinition } from "node-opcua-types";
|
|
4
|
-
import { NodeId } from "node-opcua-nodeid";
|
|
4
|
+
import { INodeId, NodeId, NodeIdType } from "node-opcua-nodeid";
|
|
5
5
|
import { AddressSpacePrivate } from "../address_space_private";
|
|
6
6
|
import { XmlWriter } from "../../source/xml_writer";
|
|
7
7
|
import { NamespacePrivate } from "../namespace_private";
|
|
@@ -33,7 +33,9 @@ function buildXmlName(addressSpace: AddressSpacePrivate, map: { [key: number]: s
|
|
|
33
33
|
throw new Error("Cannot find Node for" + nodeId?.toString());
|
|
34
34
|
}
|
|
35
35
|
const typeName = node.browseName.name!;
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
const n = node.nodeId as INodeId;
|
|
38
|
+
const prefix = (n.identifierType === NodeIdType.NUMERIC && n.namespace === 0) ? (n.value <= 15 ? "opc" : "ua") : map[node.nodeId.namespace];
|
|
37
39
|
return prefix + ":" + (typeName === "Structure" && prefix === "ua" ? "ExtensionObject" : typeName);
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -162,7 +164,7 @@ export function dumpToBSD(namespace: NamespacePrivate): string {
|
|
|
162
164
|
xw.writeAttribute("xmlns:tns", namespace.namespaceUri);
|
|
163
165
|
|
|
164
166
|
const map: { [key: number]: string } = {};
|
|
165
|
-
|
|
167
|
+
|
|
166
168
|
map[namespace.index] = "tns";
|
|
167
169
|
|
|
168
170
|
for (const dependantNamespace of dependency) {
|
|
@@ -190,7 +192,7 @@ export function dumpToBSD(namespace: NamespacePrivate): string {
|
|
|
190
192
|
dumpDataTypeToBSD(xw, dataType, map);
|
|
191
193
|
}
|
|
192
194
|
xw.endElement();
|
|
193
|
-
// xw.endDocument();
|
|
195
|
+
// xw.endDocument();
|
|
194
196
|
|
|
195
197
|
return xw.toString();
|
|
196
198
|
}
|