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.
Files changed (60) hide show
  1. package/dist/source/helpers/dump_tools.d.ts +1 -1
  2. package/dist/source/helpers/dump_tools.js.map +1 -1
  3. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +2 -2
  4. package/dist/source/loader/load_nodeset2.js +1 -7
  5. package/dist/source/loader/load_nodeset2.js.map +1 -1
  6. package/dist/source/ua_addin.d.ts +4 -1
  7. package/dist/source/ua_addin.js +3 -2
  8. package/dist/source/ua_addin.js.map +1 -1
  9. package/dist/src/address_space.d.ts +1 -1
  10. package/dist/src/address_space.js +10 -4
  11. package/dist/src/address_space.js.map +1 -1
  12. package/dist/src/address_space_change_event_tools.js +13 -11
  13. package/dist/src/address_space_change_event_tools.js.map +1 -1
  14. package/dist/src/address_space_private.d.ts +1 -1
  15. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +2 -2
  16. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  17. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +2 -2
  18. package/dist/src/base_node_impl.d.ts +13 -6
  19. package/dist/src/base_node_impl.js +129 -102
  20. package/dist/src/base_node_impl.js.map +1 -1
  21. package/dist/src/base_node_private.d.ts +16 -10
  22. package/dist/src/base_node_private.js +80 -27
  23. package/dist/src/base_node_private.js.map +1 -1
  24. package/dist/src/data_access/ua_multistate_value_discrete_impl.js +3 -1
  25. package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
  26. package/dist/src/namespace_impl.d.ts +1 -2
  27. package/dist/src/namespace_impl.js +12 -7
  28. package/dist/src/namespace_impl.js.map +1 -1
  29. package/dist/src/namespace_private.d.ts +1 -1
  30. package/dist/src/namespace_private.js.map +1 -1
  31. package/dist/src/nodeid_manager.d.ts +4 -4
  32. package/dist/src/nodeid_manager.js +3 -1
  33. package/dist/src/nodeid_manager.js.map +1 -1
  34. package/dist/src/reference_impl.js.map +1 -1
  35. package/dist/src/state_machine/finite_state_machine.d.ts +1 -4
  36. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  37. package/dist/src/ua_reference_type_impl.d.ts +1 -1
  38. package/dist/tsconfig_common.tsbuildinfo +1 -1
  39. package/distHelpers/boiler_system.js +11 -0
  40. package/distHelpers/boiler_system.js.map +1 -1
  41. package/distHelpers/create_minimalist_address_space_nodeset.js +2 -0
  42. package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
  43. package/package.json +36 -35
  44. package/source/helpers/dump_tools.ts +4 -1
  45. package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +2 -2
  46. package/source/loader/load_nodeset2.ts +4 -9
  47. package/source/ua_addin.ts +8 -3
  48. package/src/address_space.ts +13 -6
  49. package/src/address_space_change_event_tools.ts +16 -12
  50. package/src/address_space_private.ts +1 -1
  51. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +4 -3
  52. package/src/alarms_and_conditions/ua_condition_impl.ts +2 -2
  53. package/src/base_node_impl.ts +167 -123
  54. package/src/base_node_private.ts +134 -76
  55. package/src/data_access/ua_multistate_value_discrete_impl.ts +3 -1
  56. package/src/namespace_impl.ts +26 -22
  57. package/src/namespace_private.ts +4 -1
  58. package/src/nodeid_manager.ts +14 -10
  59. package/src/reference_impl.ts +1 -3
  60. package/src/state_machine/finite_state_machine.ts +1 -2
@@ -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: QualifiedName): string {
73
- const m = browseName.name!.toString().replace(/[ ]/g, "").replace(/(<|>)/g, "");
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: QualifiedName;
84
- nodeClass: 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 = resolveNodeId(nodeId);
221
+ nodeId = resolveNodeIdEx(nodeId);
218
222
  assert(nodeId.namespace === this.namespaceIndex);
219
223
  return nodeId;
220
224
  }
@@ -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 = (options as any).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
  }