node-opcua-address-space 2.184.8 → 2.185.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.
Files changed (45) hide show
  1. package/api/helpers/argument_list.ts +1 -1
  2. package/api/helpers/call_helpers.ts +152 -7
  3. package/api/loader/nodeset_record.ts +1 -1
  4. package/api/loader/nodeset_record_applier.ts +1 -0
  5. package/api/loader/nodeset_xml_producer.ts +1 -0
  6. package/api/session_context.ts +38 -0
  7. package/dist/api/helpers/argument_list.js +1 -1
  8. package/dist/api/helpers/argument_list.js.map +1 -1
  9. package/dist/api/helpers/call_helpers.d.ts +1 -1
  10. package/dist/api/helpers/call_helpers.d.ts.map +1 -1
  11. package/dist/api/helpers/call_helpers.js +137 -4
  12. package/dist/api/helpers/call_helpers.js.map +1 -1
  13. package/dist/api/loader/nodeset_record.d.ts +1 -1
  14. package/dist/api/loader/nodeset_record.js +1 -1
  15. package/dist/api/loader/nodeset_record_applier.d.ts.map +1 -1
  16. package/dist/api/loader/nodeset_record_applier.js +1 -0
  17. package/dist/api/loader/nodeset_record_applier.js.map +1 -1
  18. package/dist/api/loader/nodeset_xml_producer.d.ts.map +1 -1
  19. package/dist/api/loader/nodeset_xml_producer.js +1 -0
  20. package/dist/api/loader/nodeset_xml_producer.js.map +1 -1
  21. package/dist/api/session_context.d.ts +28 -1
  22. package/dist/api/session_context.d.ts.map +1 -1
  23. package/dist/api/session_context.js +32 -0
  24. package/dist/api/session_context.js.map +1 -1
  25. package/dist/impl/data_access/semantics_changed.d.ts +1 -1
  26. package/dist/impl/data_access/semantics_changed.js +1 -1
  27. package/dist/impl/nodeset_tools/nodeset_to_records.d.ts.map +1 -1
  28. package/dist/impl/nodeset_tools/nodeset_to_records.js +5 -7
  29. package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -1
  30. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +7 -1
  31. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts.map +1 -1
  32. package/dist/impl/nodeset_tools/nodeset_to_xml.js +15 -4
  33. package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -1
  34. package/dist/impl/ua_reference_type_impl.d.ts.map +1 -1
  35. package/dist/impl/ua_reference_type_impl.js +2 -1
  36. package/dist/impl/ua_reference_type_impl.js.map +1 -1
  37. package/dist/impl/ua_variable_impl.js +1 -1
  38. package/dist/impl/ua_variable_impl.js.map +1 -1
  39. package/dist/tsconfig_base.tsbuildinfo +1 -1
  40. package/impl/data_access/semantics_changed.ts +1 -1
  41. package/impl/nodeset_tools/nodeset_to_records.ts +7 -8
  42. package/impl/nodeset_tools/nodeset_to_xml.ts +15 -4
  43. package/impl/ua_reference_type_impl.ts +2 -1
  44. package/impl/ua_variable_impl.ts +1 -1
  45. package/package.json +27 -27
@@ -104,7 +104,7 @@ export function notifySemanticsChangedIfNeeded(property: UAVariable): void {
104
104
  }
105
105
 
106
106
  /**
107
- * OPC 10000-5 6.4.31: besides the SemanticsChanged bit on the DataItem's next notification, the
107
+ * OPC 10000-5 v1.05.06 §6.4.33: besides the SemanticsChanged bit on the DataItem's next notification, the
108
108
  * Server reports a semantics change as a SemanticChangeEventType on the Server object, carrying
109
109
  * the affected Node and its TypeDefinition. A client subscribed to the Server's events learns of
110
110
  * the change without monitoring the DataItem itself.
@@ -17,6 +17,7 @@ import type {
17
17
  UADataType,
18
18
  UAObject,
19
19
  UAReference,
20
+ UAReferenceType,
20
21
  UAVariable,
21
22
  UAVariableType
22
23
  } from "node-opcua-address-space-base";
@@ -76,6 +77,7 @@ import {
76
77
  import {
77
78
  _dumpVariantExtensionObjectValue_Body,
78
79
  coerceInt64ToInt32,
80
+ explicitInverseName,
79
81
  initXmlWriterEx,
80
82
  makeTypeXsd,
81
83
  sortByBrowseName
@@ -430,7 +432,7 @@ class RecordExporter {
430
432
  this.dumpDataType(node as UADataType);
431
433
  break;
432
434
  case NodeClass.ReferenceType:
433
- this.dumpReferenceType(node as BaseNode & { inverseName?: LocalizedText | null });
435
+ this.dumpReferenceType(node as UAReferenceType);
434
436
  break;
435
437
  case NodeClass.View:
436
438
  this.dumpView(node);
@@ -485,15 +487,12 @@ class RecordExporter {
485
487
  }
486
488
  }
487
489
 
488
- private dumpReferenceType(node: BaseNode & { inverseName?: LocalizedText | null }): void {
490
+ private dumpReferenceType(node: UAReferenceType): void {
489
491
  this.markVisited(node);
490
492
  const record = this.common(node);
491
- const isSymmetric = !node.inverseName || node.inverseName?.text === node.browseName?.name;
492
- if (isSymmetric) {
493
- record.symmetric = true;
494
- } else {
495
- record.inverseName = node.inverseName?.text || "";
496
- }
493
+ if (node.symmetric) record.symmetric = true;
494
+ const inverseName = explicitInverseName(node);
495
+ if (inverseName !== undefined) record.inverseName = inverseName;
497
496
  this.records.push(record);
498
497
  }
499
498
 
@@ -1095,6 +1095,17 @@ function writeAliases(xw: XmlWriter, aliases: Record<string, NodeIdString>) {
1095
1095
  xw.endElement();
1096
1096
  }
1097
1097
 
1098
+ /**
1099
+ * The InverseName the document gave, if any. A symmetric type has none, and the node stores a missing
1100
+ * one as its browse name: writing that back would add an InverseName the source never had
1101
+ * (machineVision's FromTransition is neither symmetric nor named the other way).
1102
+ */
1103
+ export function explicitInverseName(referenceType: UAReferenceType): string | undefined {
1104
+ if (referenceType.symmetric) return undefined;
1105
+ const text = referenceType.inverseName?.text;
1106
+ return text && text !== referenceType.browseName?.name ? text : undefined;
1107
+ }
1108
+
1098
1109
  function dumpReferenceType(xw: XmlWriter, referenceType: UAReferenceType) {
1099
1110
  _markAsVisited(xw, referenceType);
1100
1111
 
@@ -1102,16 +1113,16 @@ function dumpReferenceType(xw: XmlWriter, referenceType: UAReferenceType) {
1102
1113
 
1103
1114
  dumpCommonAttributes(xw, referenceType);
1104
1115
 
1105
- const isSymmetric = !referenceType.inverseName || referenceType.inverseName?.text === referenceType.browseName?.name;
1106
- if (isSymmetric) {
1116
+ if (referenceType.symmetric) {
1107
1117
  xw.writeAttribute("Symmetric", "true");
1108
1118
  }
1109
1119
 
1110
1120
  dumpCommonElements(xw, referenceType);
1111
1121
 
1112
- if (!isSymmetric) {
1122
+ const inverseName = explicitInverseName(referenceType);
1123
+ if (inverseName !== undefined) {
1113
1124
  xw.startElement("InverseName");
1114
- xw.text(referenceType.inverseName?.text || "");
1125
+ xw.text(inverseName);
1115
1126
  xw.endElement();
1116
1127
  }
1117
1128
 
@@ -120,7 +120,8 @@ export class UAReferenceTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements
120
120
  constructor(options: UAReferenceTypeOptions) {
121
121
  super(options);
122
122
  this.isAbstract = options.isAbstract === undefined ? false : !!options.isAbstract;
123
- this.symmetric = options.symmetric === undefined ? false : !!options.symmetric;
123
+ // without either, a type is symmetric: that is how it has always been exported
124
+ this.symmetric = options.symmetric === undefined ? !options.inverseName : !!options.symmetric;
124
125
  // Note: Inverse name is not required anymore in 1.0.4
125
126
  this.inverseName = new LocalizedText(options.inverseName || this.browseName.name);
126
127
 
@@ -2002,7 +2002,7 @@ export class UAVariableImpl<T extends UAVariableEvents & ListenerSignature<T> =
2002
2002
  this.semantic_version = this.semantic_version + 1;
2003
2003
  (this as UAVariable).emit("semantic_changed");
2004
2004
  // the bit tells whoever monitors this DataItem; the event tells whoever monitors the
2005
- // Server object (OPC 10000-5 6.4.31). Both have to come from this one place.
2005
+ // Server object (OPC 10000-5 v1.05.06 §6.4.33). Both have to come from this one place.
2006
2006
  raiseSemanticChangeEvent(this as UAVariable);
2007
2007
  }
2008
2008
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-opcua-address-space",
3
3
  "type": "module",
4
- "version": "2.184.8",
4
+ "version": "2.185.0",
5
5
  "description": "pure nodejs OPCUA SDK - module address-space",
6
6
  "main": "./dist/api/index.js",
7
7
  "types": "./dist/api/index.d.ts",
@@ -23,35 +23,35 @@
23
23
  "@types/semver": "7.8.0",
24
24
  "chalk": "4.1.2",
25
25
  "dequeue": "^1.0.5",
26
- "node-opcua-address-space-base": "2.184.8",
26
+ "node-opcua-address-space-base": "2.185.0",
27
27
  "node-opcua-assert": "2.184.0",
28
- "node-opcua-basic-types": "2.184.1",
28
+ "node-opcua-basic-types": "2.185.0",
29
29
  "node-opcua-binary-stream": "2.184.1",
30
- "node-opcua-client-dynamic-extension-object": "2.184.7",
31
- "node-opcua-constants": "2.184.0",
32
- "node-opcua-crypto": "5.10.1",
33
- "node-opcua-data-access": "2.184.1",
34
- "node-opcua-data-model": "2.184.1",
35
- "node-opcua-data-value": "2.184.1",
30
+ "node-opcua-client-dynamic-extension-object": "2.185.0",
31
+ "node-opcua-constants": "2.185.0",
32
+ "node-opcua-crypto": "6.0.0",
33
+ "node-opcua-data-access": "2.185.0",
34
+ "node-opcua-data-model": "2.185.0",
35
+ "node-opcua-data-value": "2.185.0",
36
36
  "node-opcua-date-time": "2.184.1",
37
37
  "node-opcua-debug": "2.184.0",
38
38
  "node-opcua-enum": "2.184.1",
39
- "node-opcua-extension-object": "2.184.1",
40
- "node-opcua-factory": "2.184.1",
41
- "node-opcua-nodeid": "2.184.1",
42
- "node-opcua-nodeset-ua": "2.184.8",
43
- "node-opcua-numeric-range": "2.184.1",
39
+ "node-opcua-extension-object": "2.185.0",
40
+ "node-opcua-factory": "2.185.0",
41
+ "node-opcua-nodeid": "2.185.0",
42
+ "node-opcua-nodeset-ua": "2.185.0",
43
+ "node-opcua-numeric-range": "2.185.0",
44
44
  "node-opcua-object-registry": "2.184.0",
45
- "node-opcua-pseudo-session": "2.184.7",
46
- "node-opcua-service-browse": "2.184.1",
47
- "node-opcua-service-call": "2.184.1",
48
- "node-opcua-service-history": "2.184.1",
49
- "node-opcua-service-translate-browse-path": "2.184.1",
50
- "node-opcua-service-write": "2.184.1",
45
+ "node-opcua-pseudo-session": "2.185.0",
46
+ "node-opcua-service-browse": "2.185.0",
47
+ "node-opcua-service-call": "2.185.0",
48
+ "node-opcua-service-history": "2.185.0",
49
+ "node-opcua-service-translate-browse-path": "2.185.0",
50
+ "node-opcua-service-write": "2.185.0",
51
51
  "node-opcua-status-code": "2.184.1",
52
- "node-opcua-types": "2.184.1",
52
+ "node-opcua-types": "2.185.0",
53
53
  "node-opcua-utils": "2.184.1",
54
- "node-opcua-variant": "2.184.1",
54
+ "node-opcua-variant": "2.185.0",
55
55
  "node-opcua-xml2json": "2.184.1",
56
56
  "semver": "^7.8.5",
57
57
  "thenify-ex": "4.4.0",
@@ -61,10 +61,10 @@
61
61
  "humanize": "0.0.9",
62
62
  "node-opcua-benchmarker": "2.184.1",
63
63
  "node-opcua-leak-detector": "2.184.1",
64
- "node-opcua-nodesets": "2.184.0",
65
- "node-opcua-packet-analyzer": "2.184.1",
66
- "node-opcua-schemas": "2.184.1",
67
- "node-opcua-service-filter": "2.184.8",
64
+ "node-opcua-nodesets": "2.185.0",
65
+ "node-opcua-packet-analyzer": "2.185.0",
66
+ "node-opcua-schemas": "2.185.0",
67
+ "node-opcua-service-filter": "2.185.0",
68
68
  "node-opcua-test-fixtures": "2.184.0",
69
69
  "node-opcua-test-helpers": "2.184.0"
70
70
  },
@@ -83,7 +83,7 @@
83
83
  "internet of things"
84
84
  ],
85
85
  "homepage": "http://node-opcua.github.io/",
86
- "gitHead": "38de7c3000010c94c5c9755dded6a42d40bfe676",
86
+ "gitHead": "7869fea1a598282415d32535dc5d5da1347f0ba7",
87
87
  "files": [
88
88
  "dist",
89
89
  "distHelpers",