node-opcua-address-space 2.167.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_alarm_condition_impl.d.ts +8 -8
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +19 -19
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +11 -13
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +21 -13
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.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 +26 -15
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +40 -31
- package/dist/src/namespace_impl.js +174 -161
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.d.ts +12 -4
- package/dist/src/namespace_private.js +1 -4
- package/dist/src/namespace_private.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 +35 -37
- 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_alarm_condition_impl.ts +26 -28
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +33 -27
- package/src/alarms_and_conditions/ua_condition_impl.ts +1 -1
- package/src/base_node_impl.ts +27 -14
- package/src/namespace_impl.ts +232 -201
- package/src/namespace_private.ts +15 -9
- package/src/ua_method_impl.ts +43 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.169.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",
|
|
@@ -18,53 +18,51 @@
|
|
|
18
18
|
"fix:tsconfig": "node ../../code_gen/extract-modules.js tsconfig_base.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@types/lodash": "4.17.24",
|
|
22
21
|
"@types/semver": "7.7.1",
|
|
23
22
|
"chalk": "4.1.2",
|
|
24
23
|
"dequeue": "^1.0.5",
|
|
25
|
-
"
|
|
26
|
-
"node-opcua-address-space-base": "2.167.0",
|
|
24
|
+
"node-opcua-address-space-base": "2.169.0",
|
|
27
25
|
"node-opcua-assert": "2.164.0",
|
|
28
|
-
"node-opcua-basic-types": "2.
|
|
29
|
-
"node-opcua-binary-stream": "2.
|
|
30
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
26
|
+
"node-opcua-basic-types": "2.169.0",
|
|
27
|
+
"node-opcua-binary-stream": "2.169.0",
|
|
28
|
+
"node-opcua-client-dynamic-extension-object": "2.169.0",
|
|
31
29
|
"node-opcua-constants": "2.157.0",
|
|
32
|
-
"node-opcua-crypto": "5.3.
|
|
33
|
-
"node-opcua-data-access": "2.
|
|
34
|
-
"node-opcua-data-model": "2.
|
|
35
|
-
"node-opcua-data-value": "2.
|
|
36
|
-
"node-opcua-date-time": "2.
|
|
37
|
-
"node-opcua-debug": "2.
|
|
38
|
-
"node-opcua-enum": "2.
|
|
39
|
-
"node-opcua-extension-object": "2.
|
|
40
|
-
"node-opcua-factory": "2.
|
|
41
|
-
"node-opcua-nodeid": "2.
|
|
42
|
-
"node-opcua-nodeset-ua": "2.
|
|
43
|
-
"node-opcua-numeric-range": "2.
|
|
44
|
-
"node-opcua-object-registry": "2.
|
|
45
|
-
"node-opcua-pseudo-session": "2.
|
|
46
|
-
"node-opcua-service-browse": "2.
|
|
47
|
-
"node-opcua-service-call": "2.
|
|
48
|
-
"node-opcua-service-history": "2.
|
|
49
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
50
|
-
"node-opcua-service-write": "2.
|
|
51
|
-
"node-opcua-status-code": "2.
|
|
52
|
-
"node-opcua-types": "2.
|
|
53
|
-
"node-opcua-utils": "2.
|
|
54
|
-
"node-opcua-variant": "2.
|
|
55
|
-
"node-opcua-xml2json": "2.
|
|
30
|
+
"node-opcua-crypto": "5.3.5",
|
|
31
|
+
"node-opcua-data-access": "2.169.0",
|
|
32
|
+
"node-opcua-data-model": "2.169.0",
|
|
33
|
+
"node-opcua-data-value": "2.169.0",
|
|
34
|
+
"node-opcua-date-time": "2.169.0",
|
|
35
|
+
"node-opcua-debug": "2.168.0",
|
|
36
|
+
"node-opcua-enum": "2.169.0",
|
|
37
|
+
"node-opcua-extension-object": "2.169.0",
|
|
38
|
+
"node-opcua-factory": "2.169.0",
|
|
39
|
+
"node-opcua-nodeid": "2.169.0",
|
|
40
|
+
"node-opcua-nodeset-ua": "2.169.0",
|
|
41
|
+
"node-opcua-numeric-range": "2.169.0",
|
|
42
|
+
"node-opcua-object-registry": "2.169.0",
|
|
43
|
+
"node-opcua-pseudo-session": "2.169.0",
|
|
44
|
+
"node-opcua-service-browse": "2.169.0",
|
|
45
|
+
"node-opcua-service-call": "2.169.0",
|
|
46
|
+
"node-opcua-service-history": "2.169.0",
|
|
47
|
+
"node-opcua-service-translate-browse-path": "2.169.0",
|
|
48
|
+
"node-opcua-service-write": "2.169.0",
|
|
49
|
+
"node-opcua-status-code": "2.169.0",
|
|
50
|
+
"node-opcua-types": "2.169.0",
|
|
51
|
+
"node-opcua-utils": "2.169.0",
|
|
52
|
+
"node-opcua-variant": "2.169.0",
|
|
53
|
+
"node-opcua-xml2json": "2.169.0",
|
|
56
54
|
"semver": "^7.7.4",
|
|
57
55
|
"thenify-ex": "4.4.0",
|
|
58
56
|
"xml-writer": "^1.7.0"
|
|
59
57
|
},
|
|
60
58
|
"devDependencies": {
|
|
61
59
|
"humanize": "0.0.9",
|
|
62
|
-
"node-opcua-benchmarker": "2.
|
|
63
|
-
"node-opcua-leak-detector": "2.
|
|
60
|
+
"node-opcua-benchmarker": "2.169.0",
|
|
61
|
+
"node-opcua-leak-detector": "2.169.0",
|
|
64
62
|
"node-opcua-nodesets": "2.163.1",
|
|
65
|
-
"node-opcua-packet-analyzer": "2.
|
|
66
|
-
"node-opcua-schemas": "2.
|
|
67
|
-
"node-opcua-service-filter": "2.
|
|
63
|
+
"node-opcua-packet-analyzer": "2.169.0",
|
|
64
|
+
"node-opcua-schemas": "2.169.0",
|
|
65
|
+
"node-opcua-service-filter": "2.169.0",
|
|
68
66
|
"node-opcua-test-fixtures": "2.157.0"
|
|
69
67
|
},
|
|
70
68
|
"author": "Etienne Rossignon",
|
|
@@ -82,7 +80,7 @@
|
|
|
82
80
|
"internet of things"
|
|
83
81
|
],
|
|
84
82
|
"homepage": "http://node-opcua.github.io/",
|
|
85
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "82d570d3e95bea689cbbe30096279885c5282245",
|
|
86
84
|
"files": [
|
|
87
85
|
"dist",
|
|
88
86
|
"distHelpers",
|
|
@@ -29,28 +29,37 @@ function parentIsObjectOrVariableType(node: UAVariable | UAObject): boolean {
|
|
|
29
29
|
|
|
30
30
|
export async function promoteObjectAndVariablesInNamespace(namespace: INamespace): Promise<void> {
|
|
31
31
|
const namespaceP = namespace as NamespacePrivate;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// c8 ignore next
|
|
48
|
-
if (doDebug) {
|
|
49
|
-
debugLog(`promoting ${a.browseName.toString()} from ${before} to ${after}`);
|
|
50
|
-
}
|
|
32
|
+
|
|
33
|
+
const promoteNode = (a: UAObject | UAVariable) => {
|
|
34
|
+
if (a.typeDefinition) {
|
|
35
|
+
const promoter = g_promotableObject.get(a.typeDefinition.toString());
|
|
36
|
+
if (promoter) {
|
|
37
|
+
if (promoter.onInstanceOnly && parentIsObjectOrVariableType(a)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const before = a.constructor.name;
|
|
41
|
+
|
|
42
|
+
promoter.promoter(a as any);
|
|
43
|
+
const after = a.constructor.name;
|
|
44
|
+
// c8 ignore next
|
|
45
|
+
if (doDebug) {
|
|
46
|
+
debugLog(`promoting ${a.browseName.toString()} from ${before} to ${after}`);
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Promote variables first so that TwoStateVariables and other variable types
|
|
53
|
+
// are fully promoted before objects (like StateMachines or Alarms) that contain them.
|
|
54
|
+
for (const a of namespaceP.nodeIterator()) {
|
|
55
|
+
if (a.nodeClass === NodeClass.Variable) {
|
|
56
|
+
promoteNode(a as UAVariable);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
for (const a of namespaceP.nodeIterator()) {
|
|
60
|
+
if (a.nodeClass === NodeClass.Object) {
|
|
61
|
+
promoteNode(a as UAObject);
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
}
|
|
56
65
|
export async function promoteObjectsAndVariables(addressSpace: IAddressSpace): Promise<void> {
|
|
@@ -207,13 +207,13 @@ export function makeRoles(roleIds: NodeIdLike[] | string | WellKnownRoles): Node
|
|
|
207
207
|
}
|
|
208
208
|
return roleIds.map((r) => resolveNodeId(r));
|
|
209
209
|
}
|
|
210
|
+
|
|
210
211
|
export class SessionContext implements ISessionContext {
|
|
211
212
|
public static defaultContext = new SessionContext({});
|
|
212
213
|
|
|
213
214
|
public object: UAObject | UAObjectType | undefined;
|
|
214
215
|
public currentTime?: PreciseClock;
|
|
215
216
|
public continuationPoints: Buffer[] = [];
|
|
216
|
-
public userIdentity?: string;
|
|
217
217
|
public readonly session?: ISessionBase;
|
|
218
218
|
public readonly server?: IServerBase;
|
|
219
219
|
|
|
@@ -252,6 +252,35 @@ export class SessionContext implements ISessionContext {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
public toJSON(): Record<string, string | null> {
|
|
256
|
+
return {
|
|
257
|
+
userName: this.getUserName(),
|
|
258
|
+
clientApplicationUri: this.clientApplicationUri,
|
|
259
|
+
session: this.session ? this.session.getSessionId().toString() : null
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public toString(): string {
|
|
264
|
+
if (this === SessionContext.defaultContext) {
|
|
265
|
+
return "SessionContext({ default })";
|
|
266
|
+
}
|
|
267
|
+
return `SessionContext({ userName: "${this.getUserName()}", session: ${this.session ? this.session.getSessionId().toString() : "none"} })`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
public [Symbol.for("nodejs.util.inspect.custom")](): string {
|
|
271
|
+
return this.toString();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
public getUserName(): string {
|
|
275
|
+
if (!this.session) {
|
|
276
|
+
return "<unknown client user id>";
|
|
277
|
+
}
|
|
278
|
+
const userIdentityToken = this.session.userIdentityToken;
|
|
279
|
+
if (!userIdentityToken) {
|
|
280
|
+
return "<unknown client user id>";
|
|
281
|
+
}
|
|
282
|
+
return getUserName(userIdentityToken);
|
|
283
|
+
}
|
|
255
284
|
/**
|
|
256
285
|
* getCurrentUserRoles
|
|
257
286
|
*
|