node-opcua-address-space 2.168.0 → 2.169.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/loader/namespace_post_step.js +25 -17
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/session_context.d.ts +3 -1
- package/dist/source/session_context.js +26 -1
- package/dist/source/session_context.js.map +1 -1
- package/dist/src/address_space.d.ts +14 -11
- package/dist/src/address_space.js +55 -54
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/base_node_impl.d.ts +1 -0
- package/dist/src/base_node_impl.js +11 -0
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +2 -0
- package/dist/src/namespace_impl.js +13 -0
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/ua_method_impl.d.ts +11 -9
- package/dist/src/ua_method_impl.js +24 -27
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/package.json +34 -34
- package/source/loader/namespace_post_step.ts +28 -19
- package/source/session_context.ts +30 -1
- package/src/address_space.ts +113 -109
- package/src/alarms_and_conditions/ua_condition_impl.ts +1 -1
- package/src/base_node_impl.ts +13 -0
- package/src/namespace_impl.ts +16 -0
- package/src/ua_method_impl.ts +43 -50
|
@@ -19,26 +19,34 @@ function parentIsObjectOrVariableType(node) {
|
|
|
19
19
|
}
|
|
20
20
|
async function promoteObjectAndVariablesInNamespace(namespace) {
|
|
21
21
|
const namespaceP = namespace;
|
|
22
|
-
|
|
23
|
-
if (a.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// c8 ignore next
|
|
36
|
-
if (doDebug) {
|
|
37
|
-
debugLog(`promoting ${a.browseName.toString()} from ${before} to ${after}`);
|
|
38
|
-
}
|
|
22
|
+
const promoteNode = (a) => {
|
|
23
|
+
if (a.typeDefinition) {
|
|
24
|
+
const promoter = exports.g_promotableObject.get(a.typeDefinition.toString());
|
|
25
|
+
if (promoter) {
|
|
26
|
+
if (promoter.onInstanceOnly && parentIsObjectOrVariableType(a)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const before = a.constructor.name;
|
|
30
|
+
promoter.promoter(a);
|
|
31
|
+
const after = a.constructor.name;
|
|
32
|
+
// c8 ignore next
|
|
33
|
+
if (doDebug) {
|
|
34
|
+
debugLog(`promoting ${a.browseName.toString()} from ${before} to ${after}`);
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
}
|
|
38
|
+
};
|
|
39
|
+
// Promote variables first so that TwoStateVariables and other variable types
|
|
40
|
+
// are fully promoted before objects (like StateMachines or Alarms) that contain them.
|
|
41
|
+
for (const a of namespaceP.nodeIterator()) {
|
|
42
|
+
if (a.nodeClass === node_opcua_data_model_1.NodeClass.Variable) {
|
|
43
|
+
promoteNode(a);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const a of namespaceP.nodeIterator()) {
|
|
47
|
+
if (a.nodeClass === node_opcua_data_model_1.NodeClass.Object) {
|
|
48
|
+
promoteNode(a);
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
async function promoteObjectsAndVariables(addressSpace) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace_post_step.js","sourceRoot":"","sources":["../../../source/loader/namespace_post_step.ts"],"names":[],"mappings":";;;AA6BA,
|
|
1
|
+
{"version":3,"file":"namespace_post_step.js","sourceRoot":"","sources":["../../../source/loader/namespace_post_step.ts"],"names":[],"mappings":";;;AA6BA,oFAkCC;AACD,gEAIC;AApED,iEAAkD;AAClD,uDAAiE;AAKjE,MAAM,QAAQ,G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AC,QAAQ,EAAE,SAAS,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC;gBAChF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,6EAA6E;IAC7E,sFAAsF;IACtF,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,CAAC,SAAS,KAAK,iCAAS,CAAC,QAAQ,EAAE,CAAC;YACrC,WAAW,CAAC,CAAe,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,CAAC,SAAS,KAAK,iCAAS,CAAC,MAAM,EAAE,CAAC;YACnC,WAAW,CAAC,CAAa,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;AACL,CAAC;AACM,KAAK,UAAU,0BAA0B,CAAC,YAA2B;IACxE,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACvD,oCAAoC,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;AACL,CAAC"}
|
|
@@ -87,7 +87,6 @@ export declare class SessionContext implements ISessionContext {
|
|
|
87
87
|
object: UAObject | UAObjectType | undefined;
|
|
88
88
|
currentTime?: PreciseClock;
|
|
89
89
|
continuationPoints: Buffer[];
|
|
90
|
-
userIdentity?: string;
|
|
91
90
|
readonly session?: ISessionBase;
|
|
92
91
|
readonly server?: IServerBase;
|
|
93
92
|
constructor(options?: SessionContextOptions);
|
|
@@ -102,6 +101,9 @@ export declare class SessionContext implements ISessionContext {
|
|
|
102
101
|
* no certificate is available.
|
|
103
102
|
*/
|
|
104
103
|
get clientApplicationUri(): string | null;
|
|
104
|
+
toJSON(): Record<string, string | null>;
|
|
105
|
+
toString(): string;
|
|
106
|
+
getUserName(): string;
|
|
105
107
|
/**
|
|
106
108
|
* getCurrentUserRoles
|
|
107
109
|
*
|
|
@@ -142,7 +142,6 @@ class SessionContext {
|
|
|
142
142
|
object;
|
|
143
143
|
currentTime;
|
|
144
144
|
continuationPoints = [];
|
|
145
|
-
userIdentity;
|
|
146
145
|
session;
|
|
147
146
|
server;
|
|
148
147
|
constructor(options) {
|
|
@@ -178,6 +177,32 @@ class SessionContext {
|
|
|
178
177
|
return null;
|
|
179
178
|
}
|
|
180
179
|
}
|
|
180
|
+
toJSON() {
|
|
181
|
+
return {
|
|
182
|
+
userName: this.getUserName(),
|
|
183
|
+
clientApplicationUri: this.clientApplicationUri,
|
|
184
|
+
session: this.session ? this.session.getSessionId().toString() : null
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
toString() {
|
|
188
|
+
if (this === SessionContext.defaultContext) {
|
|
189
|
+
return "SessionContext({ default })";
|
|
190
|
+
}
|
|
191
|
+
return `SessionContext({ userName: "${this.getUserName()}", session: ${this.session ? this.session.getSessionId().toString() : "none"} })`;
|
|
192
|
+
}
|
|
193
|
+
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
194
|
+
return this.toString();
|
|
195
|
+
}
|
|
196
|
+
getUserName() {
|
|
197
|
+
if (!this.session) {
|
|
198
|
+
return "<unknown client user id>";
|
|
199
|
+
}
|
|
200
|
+
const userIdentityToken = this.session.userIdentityToken;
|
|
201
|
+
if (!userIdentityToken) {
|
|
202
|
+
return "<unknown client user id>";
|
|
203
|
+
}
|
|
204
|
+
return getUserName(userIdentityToken);
|
|
205
|
+
}
|
|
181
206
|
/**
|
|
182
207
|
* getCurrentUserRoles
|
|
183
208
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_context.js","sourceRoot":"","sources":["../../source/session_context.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,sEAAsE;;;AAqMtE,8BAQC;AA1MD,yDAA2C;AAE3C,+CAAwG;AACxG,iEAA6G;AAE7G,yDAA4F;AAC5F,uDAO0B;AAG1B,qDAAiG;AAAxF,kHAAA,cAAc,OAAA;AAAE,sHAAA,k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|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import type { AddReferenceOpts, BaseNode, IEventData, IHistoricalDataNodeOptions, ISessionContext, MethodCallInterceptor, RaiseEventData, ShutdownTask, UADataType, UAEventType, UAMethod, UAObject, UAObjectType, UAReference, UAReferenceType, UAVariable, UAVariableType, UAView } from "node-opcua-address-space-base";
|
|
5
|
+
import type { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
|
|
5
6
|
import { NodeClass } from "node-opcua-data-model";
|
|
6
|
-
import { ExtensionObject } from "node-opcua-extension-object";
|
|
7
|
-
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
7
|
+
import type { ExtensionObject } from "node-opcua-extension-object";
|
|
8
|
+
import { NodeId, type NodeIdLike } from "node-opcua-nodeid";
|
|
8
9
|
import { BrowseResult } from "node-opcua-service-browse";
|
|
9
|
-
import { BrowseDescription,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { AddressSpacePrivate } from "./address_space_private";
|
|
10
|
+
import type { BrowseDescription, ModelChangeStructureDataType } from "node-opcua-types";
|
|
11
|
+
import { BrowsePath, BrowsePathResult } from "node-opcua-types";
|
|
12
|
+
import { DataType, type VariantT } from "node-opcua-variant";
|
|
13
|
+
import type { ExtensionObjectConstructorFuncWithSchema } from "../source/interfaces/extension_object_constructor";
|
|
14
|
+
import type { UARootFolder } from "../source/ua_root_folder";
|
|
15
|
+
import type { AddressSpacePrivate } from "./address_space_private";
|
|
15
16
|
import { isNonEmptyQualifiedName } from "./namespace_impl";
|
|
16
|
-
import { NamespacePrivate } from "./namespace_private";
|
|
17
|
+
import type { NamespacePrivate } from "./namespace_private";
|
|
17
18
|
import { ReferenceImpl } from "./reference_impl";
|
|
18
19
|
/**
|
|
19
20
|
* returns true if str matches a nodeID, e.g i=123 or ns=...
|
|
@@ -46,6 +47,8 @@ export declare class AddressSpace implements AddressSpacePrivate {
|
|
|
46
47
|
private _modelChanges;
|
|
47
48
|
_methodCallInterceptors: MethodCallInterceptor[];
|
|
48
49
|
constructor();
|
|
50
|
+
toJSON(): Record<string, string | number | undefined>;
|
|
51
|
+
toString(): string;
|
|
49
52
|
/**
|
|
50
53
|
* @internal
|
|
51
54
|
*/
|
|
@@ -308,7 +311,7 @@ export declare class AddressSpace implements AddressSpacePrivate {
|
|
|
308
311
|
* @param modelChange
|
|
309
312
|
* @private
|
|
310
313
|
*/
|
|
311
|
-
_collectModelChange(
|
|
314
|
+
_collectModelChange(_view: UAView | null, modelChange: ModelChangeStructureDataType): void;
|
|
312
315
|
/**
|
|
313
316
|
*
|
|
314
317
|
* walk up the hierarchy of objects until a view is found
|
|
@@ -7,32 +7,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AddressSpace = void 0;
|
|
10
|
-
const
|
|
10
|
+
const node_crypto_1 = require("node:crypto");
|
|
11
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
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_data_model_1 = require("node-opcua-data-model");
|
|
15
|
+
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
15
16
|
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
16
17
|
const node_opcua_object_registry_1 = require("node-opcua-object-registry");
|
|
17
18
|
const node_opcua_service_browse_1 = require("node-opcua-service-browse");
|
|
18
19
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
19
20
|
const node_opcua_types_1 = require("node-opcua-types");
|
|
20
21
|
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
21
|
-
const node_opcua_utils_2 = require("node-opcua-utils");
|
|
22
22
|
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
23
|
-
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
24
23
|
const adjust_browse_direction_1 = require("../source/helpers/adjust_browse_direction");
|
|
25
24
|
const alarms_and_conditions_1 = require("./alarms_and_conditions");
|
|
25
|
+
const base_node_impl_1 = require("./base_node_impl");
|
|
26
26
|
const event_data_1 = require("./event_data");
|
|
27
27
|
const address_space_historical_data_node_1 = require("./historical_access/address_space_historical_data_node");
|
|
28
28
|
const namespace_impl_1 = require("./namespace_impl");
|
|
29
|
-
const
|
|
29
|
+
const reference_impl_1 = require("./reference_impl");
|
|
30
30
|
const ua_data_type_impl_1 = require("./ua_data_type_impl");
|
|
31
|
-
const ua_object_type_impl_1 = require("./ua_object_type_impl");
|
|
32
31
|
const ua_object_impl_1 = require("./ua_object_impl");
|
|
33
|
-
const
|
|
32
|
+
const ua_object_type_impl_1 = require("./ua_object_type_impl");
|
|
34
33
|
const ua_reference_type_impl_1 = require("./ua_reference_type_impl");
|
|
35
|
-
const base_node_impl_1 = require("./base_node_impl");
|
|
36
34
|
const doDebug = false;
|
|
37
35
|
const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
|
|
38
36
|
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
@@ -54,7 +52,7 @@ function _extract_namespace_and_browse_name_as_string(addressSpace, browseNameOr
|
|
|
54
52
|
let result;
|
|
55
53
|
if (namespaceIndex !== undefined && namespaceIndex > 0) {
|
|
56
54
|
(0, node_opcua_assert_1.assert)(typeof browseNameOrNodeId === "string", "expecting a string when namespaceIndex is specified");
|
|
57
|
-
result = [addressSpace.getNamespace(namespaceIndex), browseNameOrNodeId];
|
|
55
|
+
result = [addressSpace.getNamespace(namespaceIndex), browseNameOrNodeId.toString()];
|
|
58
56
|
}
|
|
59
57
|
else if (typeof browseNameOrNodeId === "string") {
|
|
60
58
|
// we may have a string like "ns=1;i=1234" or "ns=1:MyBrowseName"
|
|
@@ -71,7 +69,7 @@ function _extract_namespace_and_browse_name_as_string(addressSpace, browseNameOr
|
|
|
71
69
|
}
|
|
72
70
|
else if (browseNameOrNodeId instanceof node_opcua_data_model_1.QualifiedName) {
|
|
73
71
|
namespaceIndex = browseNameOrNodeId.namespaceIndex;
|
|
74
|
-
result = [addressSpace.getNamespace(namespaceIndex), browseNameOrNodeId.name];
|
|
72
|
+
result = [addressSpace.getNamespace(namespaceIndex), browseNameOrNodeId.name || ""];
|
|
75
73
|
}
|
|
76
74
|
else if (typeof browseNameOrNodeId === "number") {
|
|
77
75
|
result = [addressSpace.getDefaultNamespace(), node_opcua_variant_1.DataType[browseNameOrNodeId]];
|
|
@@ -113,7 +111,7 @@ class AddressSpace {
|
|
|
113
111
|
}
|
|
114
112
|
return rootFolder;
|
|
115
113
|
}
|
|
116
|
-
static isNonEmptyQualifiedName =
|
|
114
|
+
static isNonEmptyQualifiedName = namespace_impl_1.isNonEmptyQualifiedName;
|
|
117
115
|
static historizerFactory;
|
|
118
116
|
static create() {
|
|
119
117
|
return new AddressSpace();
|
|
@@ -141,6 +139,17 @@ class AddressSpace {
|
|
|
141
139
|
this.registerNamespace("http://opcfoundation.org/UA/");
|
|
142
140
|
AddressSpace.registry.register(this);
|
|
143
141
|
}
|
|
142
|
+
toJSON() {
|
|
143
|
+
return {
|
|
144
|
+
namespaces: this._namespaceArray.length
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
toString() {
|
|
148
|
+
return `AddressSpace({ namespaces: ${this._namespaceArray.length} })`;
|
|
149
|
+
}
|
|
150
|
+
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
151
|
+
return this.toString();
|
|
152
|
+
}
|
|
144
153
|
/**
|
|
145
154
|
* @internal
|
|
146
155
|
*/
|
|
@@ -400,7 +409,7 @@ class AddressSpace {
|
|
|
400
409
|
const resolvedDataType = this.resolveNodeId(dataTypeNode);
|
|
401
410
|
/* c8 ignore next */
|
|
402
411
|
if (!resolvedDataType) {
|
|
403
|
-
throw new Error(
|
|
412
|
+
throw new Error(`Cannot resolve ${_orig_dataTypeNode.toString()}`);
|
|
404
413
|
}
|
|
405
414
|
dataTypeNode = resolvedDataType;
|
|
406
415
|
}
|
|
@@ -408,7 +417,7 @@ class AddressSpace {
|
|
|
408
417
|
dataTypeNode = this.findDataType(dataTypeNode);
|
|
409
418
|
/* c8 ignore next */
|
|
410
419
|
if (!dataTypeNode) {
|
|
411
|
-
throw Error(
|
|
420
|
+
throw Error(`cannot find dataTypeNode ${_orig_dataTypeNode.toString()}`);
|
|
412
421
|
}
|
|
413
422
|
}
|
|
414
423
|
/* c8 ignore next */
|
|
@@ -418,7 +427,7 @@ class AddressSpace {
|
|
|
418
427
|
" should not refer to a " +
|
|
419
428
|
dataTypeNode.browseName.name);
|
|
420
429
|
}
|
|
421
|
-
if ((0, node_opcua_nodeid_1.sameNodeId)(enumerationTypeNodeId, dataTypeNode
|
|
430
|
+
if ((0, node_opcua_nodeid_1.sameNodeId)(enumerationTypeNodeId, dataTypeNode?.nodeId)) {
|
|
422
431
|
return node_opcua_variant_1.DataType.Int32;
|
|
423
432
|
}
|
|
424
433
|
const n = dataTypeNode.nodeId;
|
|
@@ -469,7 +478,7 @@ class AddressSpace {
|
|
|
469
478
|
// +->(hasSubtype) Organizes/OrganizedBy
|
|
470
479
|
// +->(hasSubtype) HasEventSource/EventSourceOf
|
|
471
480
|
let node;
|
|
472
|
-
if (!(refType instanceof node_opcua_nodeid_1.NodeId) && isNodeIdString(refType) || typeof refType === "number") {
|
|
481
|
+
if ((!(refType instanceof node_opcua_nodeid_1.NodeId) && isNodeIdString(refType)) || typeof refType === "number") {
|
|
473
482
|
refType = (0, node_opcua_nodeid_1.resolveNodeId)(refType);
|
|
474
483
|
}
|
|
475
484
|
if (refType instanceof node_opcua_nodeid_1.NodeId) {
|
|
@@ -503,14 +512,12 @@ class AddressSpace {
|
|
|
503
512
|
inverseReferenceType(referenceType) {
|
|
504
513
|
(0, node_opcua_assert_1.assert)(typeof referenceType === "string");
|
|
505
514
|
const n1 = this.findReferenceType(referenceType);
|
|
506
|
-
const n2 = this.findReferenceTypeFromInverseName(referenceType);
|
|
507
515
|
if (n1) {
|
|
508
|
-
|
|
509
|
-
return n1.inverseName.text;
|
|
516
|
+
return n1.inverseName?.text;
|
|
510
517
|
}
|
|
511
518
|
else {
|
|
512
|
-
|
|
513
|
-
return n2
|
|
519
|
+
const n2 = this.findReferenceTypeFromInverseName(referenceType);
|
|
520
|
+
return n2?.browseName.toString() || "";
|
|
514
521
|
}
|
|
515
522
|
}
|
|
516
523
|
/**
|
|
@@ -571,7 +578,7 @@ class AddressSpace {
|
|
|
571
578
|
const offset = 16;
|
|
572
579
|
const self = this;
|
|
573
580
|
if (!self._eventIdCounter) {
|
|
574
|
-
self._eventIdCounter = (0,
|
|
581
|
+
self._eventIdCounter = (0, node_crypto_1.randomBytes)(20);
|
|
575
582
|
self._eventIdCounter.writeInt32BE(0, offset);
|
|
576
583
|
}
|
|
577
584
|
self._eventIdCounter.writeInt32BE(self._eventIdCounter.readInt32BE(offset) + 1, offset);
|
|
@@ -602,16 +609,16 @@ class AddressSpace {
|
|
|
602
609
|
}
|
|
603
610
|
/* c8 ignore next */
|
|
604
611
|
if (!eventTypeNode) {
|
|
605
|
-
throw new Error(
|
|
612
|
+
throw new Error(` cannot find EvenType for ${eventTypeId}`);
|
|
606
613
|
}
|
|
607
614
|
(0, node_opcua_assert_1.assert)(eventTypeNode instanceof ua_object_type_impl_1.UAObjectTypeImpl, "eventTypeId must represent a UAObjectType");
|
|
608
615
|
// eventId
|
|
609
|
-
(0, node_opcua_assert_1.assert)(!Object.
|
|
616
|
+
(0, node_opcua_assert_1.assert)(!Object.hasOwn(data, "eventId"), "eventId constructEventData : options object should not have eventId property");
|
|
610
617
|
data.eventId = data.eventId || this.generateEventId();
|
|
611
618
|
// eventType
|
|
612
619
|
data.eventType = { dataType: node_opcua_variant_1.DataType.NodeId, value: eventTypeNode.nodeId };
|
|
613
620
|
// sourceNode
|
|
614
|
-
(0, node_opcua_assert_1.assert)(Object.
|
|
621
|
+
(0, node_opcua_assert_1.assert)(Object.hasOwn(data, "sourceNode"), "expecting a source node to be defined");
|
|
615
622
|
data.sourceNode = new node_opcua_variant_1.Variant(data.sourceNode);
|
|
616
623
|
(0, node_opcua_assert_1.assert)(data.sourceNode.dataType === node_opcua_variant_1.DataType.NodeId);
|
|
617
624
|
// sourceName
|
|
@@ -641,12 +648,12 @@ class AddressSpace {
|
|
|
641
648
|
if (!baseObjectType) {
|
|
642
649
|
throw new Error("BaseObjectType must be defined in the address space");
|
|
643
650
|
}
|
|
644
|
-
const hasProperty = (data, propertyName) => Object.
|
|
651
|
+
const hasProperty = (data, propertyName) => Object.hasOwn(data, propertyName);
|
|
645
652
|
const visitedProperties = {};
|
|
646
|
-
const alreadyVisited = (key) => Object.
|
|
653
|
+
const alreadyVisited = (key) => Object.hasOwn(visitedProperties, key);
|
|
647
654
|
const markAsVisited = (key) => (visitedProperties[key] = 1);
|
|
648
655
|
function _process_var(self, prefixLower, prefixStandard, node) {
|
|
649
|
-
const lowerName = prefixLower + (0,
|
|
656
|
+
const lowerName = prefixLower + (0, node_opcua_utils_1.lowerFirstLetter)(node.browseName?.name || "");
|
|
650
657
|
const fullBrowsePath = prefixStandard + node.browseName.toString();
|
|
651
658
|
if (alreadyVisited(lowerName)) {
|
|
652
659
|
return;
|
|
@@ -678,7 +685,7 @@ class AddressSpace {
|
|
|
678
685
|
}
|
|
679
686
|
// verify that all elements of data are valid
|
|
680
687
|
function verify_data_is_valid(data1) {
|
|
681
|
-
Object.keys(data1).
|
|
688
|
+
Object.keys(data1).forEach((k) => {
|
|
682
689
|
if (k === "$eventDataSource") {
|
|
683
690
|
return;
|
|
684
691
|
}
|
|
@@ -694,13 +701,13 @@ class AddressSpace {
|
|
|
694
701
|
});
|
|
695
702
|
}
|
|
696
703
|
const populate_data = (self, eventData1) => {
|
|
697
|
-
if ((0, node_opcua_nodeid_1.sameNodeId)(baseObjectType
|
|
704
|
+
if ((0, node_opcua_nodeid_1.sameNodeId)(baseObjectType?.nodeId, self.nodeId)) {
|
|
698
705
|
return; // nothing to do
|
|
699
706
|
}
|
|
700
707
|
const baseTypeNodeId = self.subtypeOf;
|
|
701
708
|
/* c8 ignore next */
|
|
702
709
|
if (!baseTypeNodeId) {
|
|
703
|
-
throw new Error(
|
|
710
|
+
throw new Error(`Object ${self.browseName.toString()} with nodeId ${self.nodeId} has no Type`);
|
|
704
711
|
}
|
|
705
712
|
const baseType = this.findNode(baseTypeNodeId);
|
|
706
713
|
/* c8 ignore next */
|
|
@@ -714,7 +721,7 @@ class AddressSpace {
|
|
|
714
721
|
const children = [].concat(properties, components);
|
|
715
722
|
// c8 ignore next
|
|
716
723
|
if (doDebug) {
|
|
717
|
-
debugLog(
|
|
724
|
+
debugLog(` ${chalk_1.default.bgWhite.cyan(self.browseName.toString())}`);
|
|
718
725
|
}
|
|
719
726
|
for (const node of children) {
|
|
720
727
|
// only keep those that have a "HasModellingRule"
|
|
@@ -730,10 +737,10 @@ class AddressSpace {
|
|
|
730
737
|
// xx eventData.__nodes[node.nodeId.toString()] = eventData[lowerName];
|
|
731
738
|
const children2 = node.getAggregates();
|
|
732
739
|
if (children2.length > 0) {
|
|
733
|
-
const lowerName = (0,
|
|
740
|
+
const lowerName = (0, node_opcua_utils_1.lowerFirstLetter)(node.browseName.name || "");
|
|
734
741
|
const standardName = node.browseName.toString();
|
|
735
742
|
for (const child2 of children2) {
|
|
736
|
-
_process_var(self, lowerName
|
|
743
|
+
_process_var(self, `${lowerName}.`, `${standardName}.`, child2);
|
|
737
744
|
}
|
|
738
745
|
}
|
|
739
746
|
}
|
|
@@ -797,7 +804,7 @@ class AddressSpace {
|
|
|
797
804
|
const empty_targetName_not_in_lastPos = browsePath.relativePath.elements.reduce((prev, e, index) => {
|
|
798
805
|
const is_last = index + 1 === elements_length;
|
|
799
806
|
const isBad = !is_last && (!e.targetName || e.targetName.isEmpty());
|
|
800
|
-
return prev + (
|
|
807
|
+
return prev + (isBad ? 1 : 0);
|
|
801
808
|
}, 0);
|
|
802
809
|
if (empty_targetName_not_in_lastPos) {
|
|
803
810
|
return new node_opcua_types_1.BrowsePathResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadBrowseNameInvalid });
|
|
@@ -812,7 +819,6 @@ class AddressSpace {
|
|
|
812
819
|
const res = [];
|
|
813
820
|
const explore_element = (curNodeObject, elements, index) => {
|
|
814
821
|
const element = elements[index];
|
|
815
|
-
(0, node_opcua_assert_1.assert)(element instanceof node_opcua_types_1.RelativePathElement);
|
|
816
822
|
const is_last = index + 1 === elements.length;
|
|
817
823
|
const nodeIds = curNodeObject.browseNodeByTargetName(element, is_last);
|
|
818
824
|
const targets = nodeIds.map((nodeId) => {
|
|
@@ -856,14 +862,14 @@ class AddressSpace {
|
|
|
856
862
|
const tmp = this.findNode(dataType);
|
|
857
863
|
/* c8 ignore next */
|
|
858
864
|
if (!tmp) {
|
|
859
|
-
throw new Error(
|
|
865
|
+
throw new Error(`getExtensionObjectConstructor: cannot resolve dataType ${dataType}`);
|
|
860
866
|
}
|
|
861
867
|
dataType = tmp;
|
|
862
868
|
}
|
|
863
869
|
/* c8 ignore next */
|
|
864
870
|
if (!(dataType instanceof ua_data_type_impl_1.UADataTypeImpl)) {
|
|
865
871
|
// may be dataType was the NodeId of the "Binary Encoding" node
|
|
866
|
-
throw new Error(
|
|
872
|
+
throw new Error(`getExtensionObjectConstructor: dataType has unexpected type${dataType}`);
|
|
867
873
|
}
|
|
868
874
|
const _dataType = dataType;
|
|
869
875
|
// to do verify that dataType is of type "Structure"
|
|
@@ -1005,7 +1011,7 @@ class AddressSpace {
|
|
|
1005
1011
|
folder = this._coerceNode(folder);
|
|
1006
1012
|
/* c8 ignore next */
|
|
1007
1013
|
if (folder && !_isFolder(this, folder)) {
|
|
1008
|
-
throw new Error(
|
|
1014
|
+
throw new Error(`Parent folder must be of FolderType ${folder.typeDefinition.toString()}`);
|
|
1009
1015
|
}
|
|
1010
1016
|
return folder;
|
|
1011
1017
|
}
|
|
@@ -1015,7 +1021,7 @@ class AddressSpace {
|
|
|
1015
1021
|
* @param modelChange
|
|
1016
1022
|
* @private
|
|
1017
1023
|
*/
|
|
1018
|
-
_collectModelChange(
|
|
1024
|
+
_collectModelChange(_view, modelChange) {
|
|
1019
1025
|
this._modelChanges.push(modelChange);
|
|
1020
1026
|
}
|
|
1021
1027
|
/**
|
|
@@ -1052,7 +1058,7 @@ class AddressSpace {
|
|
|
1052
1058
|
}
|
|
1053
1059
|
else {
|
|
1054
1060
|
const key = parent.nodeId.toString();
|
|
1055
|
-
if (Object.
|
|
1061
|
+
if (Object.hasOwn(visitedMap, key)) {
|
|
1056
1062
|
continue;
|
|
1057
1063
|
}
|
|
1058
1064
|
visitedMap[key] = parent;
|
|
@@ -1157,7 +1163,7 @@ class AddressSpace {
|
|
|
1157
1163
|
(0, node_opcua_assert_1.assert)(params.referenceType instanceof node_opcua_nodeid_1.NodeId);
|
|
1158
1164
|
// ----------- now resolve target NodeId;
|
|
1159
1165
|
if (params.nodeId instanceof base_node_impl_1.BaseNodeImpl) {
|
|
1160
|
-
(0, node_opcua_assert_1.assert)(!Object.
|
|
1166
|
+
(0, node_opcua_assert_1.assert)(!Object.hasOwn(params, "node"));
|
|
1161
1167
|
params.node = params.nodeId;
|
|
1162
1168
|
params.nodeId = params.node.nodeId;
|
|
1163
1169
|
}
|
|
@@ -1197,11 +1203,6 @@ class AddressSpace {
|
|
|
1197
1203
|
}
|
|
1198
1204
|
// -- internal stuff -----------------------------------------------------------------------------------------------
|
|
1199
1205
|
_coerceNode(node) {
|
|
1200
|
-
function hasTypeDefinition(node1) {
|
|
1201
|
-
return (node1.nodeClass === node_opcua_data_model_1.NodeClass.Variable ||
|
|
1202
|
-
node1.nodeClass === node_opcua_data_model_1.NodeClass.Object ||
|
|
1203
|
-
node1.nodeClass === node_opcua_data_model_1.NodeClass.Method);
|
|
1204
|
-
}
|
|
1205
1206
|
// coerce to BaseNode object
|
|
1206
1207
|
if (node instanceof base_node_impl_1.BaseNodeImpl) {
|
|
1207
1208
|
return node;
|
|
@@ -1243,7 +1244,7 @@ class AddressSpace {
|
|
|
1243
1244
|
const topMostBaseTypeNode = this.findNode(topMostBaseType);
|
|
1244
1245
|
/* c8 ignore next */
|
|
1245
1246
|
if (!topMostBaseTypeNode) {
|
|
1246
|
-
throw new Error(
|
|
1247
|
+
throw new Error(`Cannot find topMostBaseTypeNode ${topMostBaseType.toString()}`);
|
|
1247
1248
|
}
|
|
1248
1249
|
(0, node_opcua_assert_1.assert)(topMostBaseTypeNode instanceof base_node_impl_1.BaseNodeImpl);
|
|
1249
1250
|
(0, node_opcua_assert_1.assert)(topMostBaseTypeNode.nodeClass === nodeClass);
|
|
@@ -1260,11 +1261,11 @@ class AddressSpace {
|
|
|
1260
1261
|
}
|
|
1261
1262
|
/* c8 ignore next*/
|
|
1262
1263
|
if (!baseTypeNode) {
|
|
1263
|
-
throw new Error(
|
|
1264
|
+
throw new Error(`Cannot find ObjectType or VariableType for ${baseType.toString()}`);
|
|
1264
1265
|
}
|
|
1265
1266
|
/* c8 ignore next */
|
|
1266
1267
|
if (!baseTypeNode.isSubtypeOf) {
|
|
1267
|
-
throw new Error(
|
|
1268
|
+
throw new Error(`Cannot find ObjectType or VariableType for ${baseType.toString()}`);
|
|
1268
1269
|
}
|
|
1269
1270
|
/* c8 ignore next */
|
|
1270
1271
|
if (!baseTypeNode.isSubtypeOf(topMostBaseTypeNode)) {
|
|
@@ -1287,7 +1288,7 @@ class AddressSpace {
|
|
|
1287
1288
|
// DataType must be one of Enumeration
|
|
1288
1289
|
const dataTypeNode = this.findDataType(dataType);
|
|
1289
1290
|
if (!dataTypeNode) {
|
|
1290
|
-
throw new Error(
|
|
1291
|
+
throw new Error(` Cannot find DataType ${dataType.toString()} in standard address Space`);
|
|
1291
1292
|
}
|
|
1292
1293
|
const enumerationNode = this.findDataType("Enumeration");
|
|
1293
1294
|
if (!enumerationNode) {
|
|
@@ -1348,10 +1349,10 @@ class AddressSpace {
|
|
|
1348
1349
|
const el = finderMethod.call(this, nodeId);
|
|
1349
1350
|
if (!el) {
|
|
1350
1351
|
// verify that node Id exists in standard type map typeMap
|
|
1351
|
-
const find = Object.values(typeMap).filter((a) => a === nodeId
|
|
1352
|
+
const find = Object.values(typeMap).filter((a) => a === nodeId?.value);
|
|
1352
1353
|
/* c8 ignore next */
|
|
1353
1354
|
if (find.length !== 1) {
|
|
1354
|
-
throw new Error(
|
|
1355
|
+
throw new Error(` cannot find ${dataType.toString()} in typeMap ${typeMapName} L = ${find.length}`);
|
|
1355
1356
|
}
|
|
1356
1357
|
}
|
|
1357
1358
|
return nodeId;
|
|
@@ -1369,7 +1370,7 @@ function _getNamespace(addressSpace, nodeOrNodId) {
|
|
|
1369
1370
|
const nodeId = nodeOrNodId instanceof base_node_impl_1.BaseNodeImpl ? nodeOrNodId.nodeId : nodeOrNodId;
|
|
1370
1371
|
return addressSpace.getNamespace(nodeId.namespace);
|
|
1371
1372
|
}
|
|
1372
|
-
function _find_by_node_id(addressSpace, nodeId,
|
|
1373
|
+
function _find_by_node_id(addressSpace, nodeId, _namespaceIndex) {
|
|
1373
1374
|
const obj = addressSpace.findNode(nodeId);
|
|
1374
1375
|
return obj;
|
|
1375
1376
|
}
|
|
@@ -1387,9 +1388,9 @@ function _isFolder(addressSpace, folder) {
|
|
|
1387
1388
|
return folder.typeDefinitionObj.isSubtypeOf(folderType);
|
|
1388
1389
|
}
|
|
1389
1390
|
function _increase_version_number(node) {
|
|
1390
|
-
|
|
1391
|
+
const uaNodeVersion = node?.getNodeVersion();
|
|
1391
1392
|
if (uaNodeVersion) {
|
|
1392
|
-
|
|
1393
|
+
const rawValue = uaNodeVersion.readValue().value.value || "";
|
|
1393
1394
|
let previousValue = parseInt(rawValue || "0", 10);
|
|
1394
1395
|
if (Number.isNaN(previousValue)) {
|
|
1395
1396
|
warningLog("NodeVersion was ", rawValue);
|