node-opcua-address-space 2.184.8 → 2.186.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 (50) 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 +3 -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 +3 -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/base_node_impl.d.ts +8 -0
  26. package/dist/impl/base_node_impl.d.ts.map +1 -1
  27. package/dist/impl/base_node_impl.js +10 -0
  28. package/dist/impl/base_node_impl.js.map +1 -1
  29. package/dist/impl/data_access/semantics_changed.d.ts +1 -1
  30. package/dist/impl/data_access/semantics_changed.js +1 -1
  31. package/dist/impl/nodeset_tools/nodeset_to_records.d.ts.map +1 -1
  32. package/dist/impl/nodeset_tools/nodeset_to_records.js +11 -7
  33. package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -1
  34. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +7 -1
  35. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts.map +1 -1
  36. package/dist/impl/nodeset_tools/nodeset_to_xml.js +26 -4
  37. package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -1
  38. package/dist/impl/ua_reference_type_impl.d.ts.map +1 -1
  39. package/dist/impl/ua_reference_type_impl.js +2 -1
  40. package/dist/impl/ua_reference_type_impl.js.map +1 -1
  41. package/dist/impl/ua_variable_impl.js +1 -1
  42. package/dist/impl/ua_variable_impl.js.map +1 -1
  43. package/dist/tsconfig_base.tsbuildinfo +1 -1
  44. package/impl/base_node_impl.ts +14 -0
  45. package/impl/data_access/semantics_changed.ts +1 -1
  46. package/impl/nodeset_tools/nodeset_to_records.ts +13 -8
  47. package/impl/nodeset_tools/nodeset_to_xml.ts +26 -4
  48. package/impl/ua_reference_type_impl.ts +2 -1
  49. package/impl/ua_variable_impl.ts +1 -1
  50. package/package.json +27 -27
@@ -180,6 +180,10 @@ export interface InternalBaseNodeOptions {
180
180
  rolePermissions?: RolePermissionTypeOptions[];
181
181
  /** "Draft" or "Deprecated" as the nodeset declared it; see BaseNode.releaseStatus */
182
182
  releaseStatus?: "Draft" | "Deprecated";
183
+ /** the `<Documentation>` link as the nodeset declared it; see BaseNode.nodesetDocumentation */
184
+ nodesetDocumentation?: string;
185
+ /** the `<Category>` elements as the nodeset declared them; see BaseNode.nodesetCategory */
186
+ nodesetCategory?: string[];
183
187
  /** the AccessRestrictions as declared, whatever this loader applies; see BaseNode */
184
188
  declaredAccessRestrictions?: string;
185
189
  }
@@ -225,6 +229,10 @@ export abstract class BaseNodeImpl<T extends BaseNodeEvents & ListenerSignature<
225
229
  /** see BaseNode.releaseStatus; only set when the nodeset declared one, so that it costs
226
230
  * nothing on the overwhelming majority of nodes, which are Released */
227
231
  public releaseStatus?: "Draft" | "Deprecated";
232
+ /** see BaseNode.nodesetDocumentation; only set when the nodeset declared one */
233
+ public nodesetDocumentation?: string;
234
+ /** see BaseNode.nodesetCategory; only set when the nodeset declared at least one */
235
+ public nodesetCategory?: string[];
228
236
  /** see BaseNode.declaredAccessRestrictions */
229
237
  public declaredAccessRestrictions?: string;
230
238
  private _accessRestrictions?: AccessRestrictionsFlag;
@@ -445,6 +453,12 @@ export abstract class BaseNodeImpl<T extends BaseNodeEvents & ListenerSignature<
445
453
  if (options.releaseStatus) {
446
454
  this.releaseStatus = options.releaseStatus;
447
455
  }
456
+ if (options.nodesetDocumentation) {
457
+ this.nodesetDocumentation = options.nodesetDocumentation;
458
+ }
459
+ if (options.nodesetCategory && options.nodesetCategory.length > 0) {
460
+ this.nodesetCategory = [...options.nodesetCategory];
461
+ }
448
462
  if (options.parentNodeId) {
449
463
  _private._declaredParentNodeId =
450
464
  options.parentNodeId instanceof NodeId
@@ -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
@@ -364,6 +366,12 @@ class RecordExporter {
364
366
  if (node.releaseStatus) {
365
367
  record.releaseStatus = node.releaseStatus;
366
368
  }
369
+ if (node.nodesetCategory && node.nodesetCategory.length > 0) {
370
+ record.category = [...node.nodesetCategory];
371
+ }
372
+ if (node.nodesetDocumentation) {
373
+ record.documentation = node.nodesetDocumentation;
374
+ }
367
375
  const parentNode = this.parentOf(node);
368
376
  if (parentNode && parentNode.nodeId.namespace <= node.nodeId.namespace) {
369
377
  record.parentNodeId = this.t(parentNode.nodeId);
@@ -430,7 +438,7 @@ class RecordExporter {
430
438
  this.dumpDataType(node as UADataType);
431
439
  break;
432
440
  case NodeClass.ReferenceType:
433
- this.dumpReferenceType(node as BaseNode & { inverseName?: LocalizedText | null });
441
+ this.dumpReferenceType(node as UAReferenceType);
434
442
  break;
435
443
  case NodeClass.View:
436
444
  this.dumpView(node);
@@ -485,15 +493,12 @@ class RecordExporter {
485
493
  }
486
494
  }
487
495
 
488
- private dumpReferenceType(node: BaseNode & { inverseName?: LocalizedText | null }): void {
496
+ private dumpReferenceType(node: UAReferenceType): void {
489
497
  this.markVisited(node);
490
498
  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
- }
499
+ if (node.symmetric) record.symmetric = true;
500
+ const inverseName = explicitInverseName(node);
501
+ if (inverseName !== undefined) record.inverseName = inverseName;
497
502
  this.records.push(record);
498
503
  }
499
504
 
@@ -88,6 +88,16 @@ function _dumpDescription(xw: XmlWriter, node: { description?: LocalizedText }):
88
88
  xw.startElement("Description").text(desc).endElement();
89
89
  }
90
90
  }
91
+ // what the working group filed the node under and where the specification defines it: nothing
92
+ // in the address space acts on either, but the document said them
93
+ function _dumpCategoryAndDocumentation(xw: XmlWriter, node: BaseNode): void {
94
+ for (const category of node.nodesetCategory ?? []) {
95
+ xw.startElement("Category").text(category).endElement();
96
+ }
97
+ if (node.nodesetDocumentation) {
98
+ xw.startElement("Documentation").text(node.nodesetDocumentation).endElement();
99
+ }
100
+ }
91
101
 
92
102
  function hasHigherPriorityThan(namespaceIndex1: number, namespaceIndex2: number, priorityTable: number[]) {
93
103
  const order1 = priorityTable[namespaceIndex1];
@@ -757,6 +767,7 @@ function _dumpRolePermissions(xw: XmlWriter, node: BaseNode) {
757
767
  function dumpCommonElements(xw: XmlWriter, node: BaseNode) {
758
768
  _dumpDisplayName(xw, node);
759
769
  _dumpDescription(xw, node);
770
+ _dumpCategoryAndDocumentation(xw, node);
760
771
  _dumpReferences(xw, node);
761
772
  _dumpRolePermissions(xw, node);
762
773
  }
@@ -1095,6 +1106,17 @@ function writeAliases(xw: XmlWriter, aliases: Record<string, NodeIdString>) {
1095
1106
  xw.endElement();
1096
1107
  }
1097
1108
 
1109
+ /**
1110
+ * The InverseName the document gave, if any. A symmetric type has none, and the node stores a missing
1111
+ * one as its browse name: writing that back would add an InverseName the source never had
1112
+ * (machineVision's FromTransition is neither symmetric nor named the other way).
1113
+ */
1114
+ export function explicitInverseName(referenceType: UAReferenceType): string | undefined {
1115
+ if (referenceType.symmetric) return undefined;
1116
+ const text = referenceType.inverseName?.text;
1117
+ return text && text !== referenceType.browseName?.name ? text : undefined;
1118
+ }
1119
+
1098
1120
  function dumpReferenceType(xw: XmlWriter, referenceType: UAReferenceType) {
1099
1121
  _markAsVisited(xw, referenceType);
1100
1122
 
@@ -1102,16 +1124,16 @@ function dumpReferenceType(xw: XmlWriter, referenceType: UAReferenceType) {
1102
1124
 
1103
1125
  dumpCommonAttributes(xw, referenceType);
1104
1126
 
1105
- const isSymmetric = !referenceType.inverseName || referenceType.inverseName?.text === referenceType.browseName?.name;
1106
- if (isSymmetric) {
1127
+ if (referenceType.symmetric) {
1107
1128
  xw.writeAttribute("Symmetric", "true");
1108
1129
  }
1109
1130
 
1110
1131
  dumpCommonElements(xw, referenceType);
1111
1132
 
1112
- if (!isSymmetric) {
1133
+ const inverseName = explicitInverseName(referenceType);
1134
+ if (inverseName !== undefined) {
1113
1135
  xw.startElement("InverseName");
1114
- xw.text(referenceType.inverseName?.text || "");
1136
+ xw.text(inverseName);
1115
1137
  xw.endElement();
1116
1138
  }
1117
1139
 
@@ -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.186.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.186.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.186.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.186.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": "f39357ba4864bc83f210b40c7257e92afb0fa0ea",
87
87
  "files": [
88
88
  "dist",
89
89
  "distHelpers",