node-opcua-address-space 2.152.0 → 2.154.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/helpers/dump_tools.d.ts +1 -1
- package/dist/source/helpers/dump_tools.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +2 -2
- package/dist/source/loader/load_nodeset2.js +1 -7
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/ua_addin.d.ts +4 -1
- package/dist/source/ua_addin.js +3 -2
- package/dist/source/ua_addin.js.map +1 -1
- package/dist/src/address_space.d.ts +1 -1
- package/dist/src/address_space.js +10 -4
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_change_event_tools.js +13 -11
- package/dist/src/address_space_change_event_tools.js.map +1 -1
- package/dist/src/address_space_private.d.ts +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +2 -2
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +2 -2
- package/dist/src/base_node_impl.d.ts +13 -6
- package/dist/src/base_node_impl.js +129 -102
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.d.ts +16 -10
- package/dist/src/base_node_private.js +80 -27
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +3 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +1 -2
- package/dist/src/namespace_impl.js +12 -7
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.d.ts +1 -1
- package/dist/src/namespace_private.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +4 -4
- package/dist/src/nodeid_manager.js +3 -1
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +1 -4
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +1 -1
- package/dist/tsconfig_common.tsbuildinfo +1 -1
- package/distHelpers/boiler_system.js +11 -0
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.js +2 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/package.json +36 -35
- package/source/helpers/dump_tools.ts +4 -1
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +2 -2
- package/source/loader/load_nodeset2.ts +4 -9
- package/source/ua_addin.ts +8 -3
- package/src/address_space.ts +13 -6
- package/src/address_space_change_event_tools.ts +16 -12
- package/src/address_space_private.ts +1 -1
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +4 -3
- package/src/alarms_and_conditions/ua_condition_impl.ts +2 -2
- package/src/base_node_impl.ts +167 -123
- package/src/base_node_private.ts +134 -76
- package/src/data_access/ua_multistate_value_discrete_impl.ts +3 -1
- package/src/namespace_impl.ts +26 -22
- package/src/namespace_private.ts +4 -1
- package/src/nodeid_manager.ts +14 -10
- package/src/reference_impl.ts +1 -3
- package/src/state_machine/finite_state_machine.ts +1 -2
package/src/nodeid_manager.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable max-depth */
|
|
2
2
|
/* eslint-disable max-statements */
|
|
3
3
|
import { assert } from "node-opcua-assert";
|
|
4
|
-
import { NodeClass, QualifiedName } from "node-opcua-data-model";
|
|
4
|
+
import { NodeClass, QualifiedName, QualifiedNameLike, QualifiedNameOptions } from "node-opcua-data-model";
|
|
5
5
|
import { makeNodeId, NodeId, NodeIdLike, NodeIdType, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
6
6
|
import { make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
7
|
-
import { BaseNode, UAReference, UAReferenceType } from "node-opcua-address-space-base";
|
|
7
|
+
import { AddReferenceOpts, BaseNode, UAReference, UAReferenceType } from "node-opcua-address-space-base";
|
|
8
8
|
import { getReferenceType } from "./base_node_impl";
|
|
9
9
|
import { resolveReferenceNode, resolveReferenceType } from "./reference_impl";
|
|
10
10
|
|
|
@@ -69,8 +69,8 @@ function _findParentNodeId(addressSpace: AddressSpacePartial, options: Construct
|
|
|
69
69
|
return _filterAggregates(addressSpace, options.references);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function prepareName(browseName
|
|
73
|
-
const m = browseName
|
|
72
|
+
function prepareName(browseName?: QualifiedName | QualifiedNameOptions): string {
|
|
73
|
+
const m = browseName!.name!.toString().replace(/[ ]/g, "").replace(/(<|>)/g, "");
|
|
74
74
|
return m;
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -79,9 +79,9 @@ export interface AddressSpacePartial {
|
|
|
79
79
|
findReferenceType(refType: NodeIdLike, namespaceIndex?: number): UAReferenceType | null;
|
|
80
80
|
}
|
|
81
81
|
export interface ConstructNodeIdOptions {
|
|
82
|
-
nodeId?: string | NodeIdLike | null;
|
|
83
|
-
browseName:
|
|
84
|
-
nodeClass
|
|
82
|
+
nodeId?: string | NodeIdLike | BaseNode | null;
|
|
83
|
+
browseName: QualifiedNameOptions;
|
|
84
|
+
nodeClass?: NodeClass;
|
|
85
85
|
references?: UAReference[];
|
|
86
86
|
registerSymbolicNames?: boolean;
|
|
87
87
|
}
|
|
@@ -148,6 +148,7 @@ export class NodeIdManager {
|
|
|
148
148
|
|
|
149
149
|
const compose = (left: string, right: string) => { return right ? (left ? left + '_' + right : right) : left };
|
|
150
150
|
|
|
151
|
+
|
|
151
152
|
const buildUpName2 = (nodeId: NodeId, suffix: string) => {
|
|
152
153
|
const namespaceIndex = nodeId.namespace;
|
|
153
154
|
let name = "";
|
|
@@ -167,13 +168,13 @@ export class NodeIdManager {
|
|
|
167
168
|
const [parentNodeId, suffix] = parentInfo;
|
|
168
169
|
fullParentName = buildUpName2(parentNodeId, suffix);
|
|
169
170
|
}
|
|
170
|
-
const fullName = compose(fullParentName, prepareName(options.browseName));
|
|
171
|
+
const fullName = compose(fullParentName, prepareName(options.browseName!));
|
|
171
172
|
if (this._cacheSymbolicName[fullName]) {
|
|
172
173
|
return makeNodeId(this._cacheSymbolicName[fullName][0], this.namespaceIndex);
|
|
173
174
|
}
|
|
174
175
|
const nodeId = this._constructNodeId(options);
|
|
175
176
|
if (nodeId.identifierType === NodeIdType.NUMERIC) {
|
|
176
|
-
this._cacheSymbolicName[fullName] = [nodeId.value as number, options.nodeClass];
|
|
177
|
+
this._cacheSymbolicName[fullName] = [nodeId.value as number, options.nodeClass!];
|
|
177
178
|
this._cacheSymbolicNameRev.add(nodeId.value as number);
|
|
178
179
|
}
|
|
179
180
|
return nodeId;
|
|
@@ -183,6 +184,9 @@ export class NodeIdManager {
|
|
|
183
184
|
|
|
184
185
|
private _constructNodeId(options: ConstructNodeIdOptions): NodeId {
|
|
185
186
|
|
|
187
|
+
const resolveNodeIdEx = (nodeId: BaseNode | NodeIdLike) =>
|
|
188
|
+
(nodeId && typeof nodeId == "object" && nodeId instanceof BaseNode) ? nodeId.nodeId : resolveNodeId(nodeId);
|
|
189
|
+
|
|
186
190
|
let nodeId = options.nodeId;
|
|
187
191
|
|
|
188
192
|
if (!nodeId) {
|
|
@@ -214,7 +218,7 @@ export class NodeIdManager {
|
|
|
214
218
|
assert(nodeId.namespace === this.namespaceIndex);
|
|
215
219
|
return nodeId;
|
|
216
220
|
}
|
|
217
|
-
nodeId =
|
|
221
|
+
nodeId = resolveNodeIdEx(nodeId);
|
|
218
222
|
assert(nodeId.namespace === this.namespaceIndex);
|
|
219
223
|
return nodeId;
|
|
220
224
|
}
|
package/src/reference_impl.ts
CHANGED
|
@@ -118,11 +118,9 @@ export class ReferenceImpl implements UAReference {
|
|
|
118
118
|
this.referenceType = coerceNodeId(options.referenceType);
|
|
119
119
|
this.isForward = options.isForward === undefined ? true : !!options.isForward;
|
|
120
120
|
this.nodeId = _localCoerceToNodeID(options.nodeId);
|
|
121
|
-
|
|
122
121
|
// optional to speed up when AddReferenceOpts is in fact a Reference !
|
|
123
122
|
this._referenceType = (options as any)._referenceType;
|
|
124
|
-
this.node =
|
|
125
|
-
|
|
123
|
+
this.node = options.node;
|
|
126
124
|
assert(is_valid_reference(this));
|
|
127
125
|
}
|
|
128
126
|
|
|
@@ -19,7 +19,7 @@ import { NodeId, sameNodeId } from "node-opcua-nodeid";
|
|
|
19
19
|
import { StatusCodes } from "node-opcua-status-code";
|
|
20
20
|
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
|
|
21
21
|
import { UAString } from "node-opcua-basic-types";
|
|
22
|
-
import { BaseNode, UAMethod, UAObject, UAObjectType, UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
22
|
+
import { BaseNode, UAMethod, UAObject, UAObjectType, UAProperty, UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
23
23
|
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
24
24
|
|
|
25
25
|
import {
|
|
@@ -651,7 +651,6 @@ export class UAStateMachineTypeImpl extends UAObjectTypeImpl implements UAStateM
|
|
|
651
651
|
getTransitions(): UATransitionEx[] {
|
|
652
652
|
return getFiniteStateMachineTypeTransitions(this);
|
|
653
653
|
}
|
|
654
|
-
nodeVersion?: UAVariableT<UAString, DataType.String> | undefined;
|
|
655
654
|
_post_initialize(): void {
|
|
656
655
|
/** */
|
|
657
656
|
}
|