node-opcua-address-space 2.90.1 → 2.91.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 (91) hide show
  1. package/dist/source/address_space_ts.d.ts +3 -3
  2. package/dist/source/address_space_ts.js +3 -3
  3. package/dist/source/address_space_ts.js.map +1 -1
  4. package/dist/source/helpers/argument_list.js +3 -3
  5. package/dist/source/helpers/argument_list.js.map +1 -1
  6. package/dist/source/helpers/call_helpers.d.ts +1 -1
  7. package/dist/source/helpers/multiform_func.d.ts +8 -8
  8. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
  9. package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
  10. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +15 -3
  11. package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
  12. package/dist/source/loader/make_xml_extension_object_parser.d.ts +1 -1
  13. package/dist/source/loader/namespace_post_step.d.ts +1 -1
  14. package/dist/source/session_context.d.ts +1 -1
  15. package/dist/src/address_space.js +19 -19
  16. package/dist/src/address_space.js.map +1 -1
  17. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +1 -1
  18. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  19. package/dist/src/alarms_and_conditions/ua_condition_impl.js +2 -2
  20. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  21. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +1 -1
  22. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
  23. package/dist/src/apply_condition_refresh.d.ts +1 -1
  24. package/dist/src/base_node_impl.js +47 -47
  25. package/dist/src/base_node_impl.js.map +1 -1
  26. package/dist/src/base_node_private.js +4 -4
  27. package/dist/src/base_node_private.js.map +1 -1
  28. package/dist/src/event_data.d.ts +2 -2
  29. package/dist/src/extension_object_array_node.js +3 -3
  30. package/dist/src/extension_object_array_node.js.map +1 -1
  31. package/dist/src/index_current.d.ts +1 -1
  32. package/dist/src/index_current.js +2 -1
  33. package/dist/src/index_current.js.map +1 -1
  34. package/dist/src/nodeid_manager.d.ts +3 -3
  35. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
  36. package/dist/src/nodeset_tools/nodeset_to_xml.js +9 -9
  37. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  38. package/dist/src/reference_impl.js +6 -6
  39. package/dist/src/reference_impl.js.map +1 -1
  40. package/dist/src/state_machine/finite_state_machine.d.ts +16 -2
  41. package/dist/src/state_machine/finite_state_machine.js +83 -44
  42. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  43. package/dist/src/tool_isSubtypeOf.d.ts +18 -0
  44. package/dist/src/tool_isSubtypeOf.js +125 -0
  45. package/dist/src/tool_isSubtypeOf.js.map +1 -0
  46. package/dist/src/ua_data_type_impl.d.ts +6 -4
  47. package/dist/src/ua_data_type_impl.js +24 -22
  48. package/dist/src/ua_data_type_impl.js.map +1 -1
  49. package/dist/src/ua_method_impl.js +6 -6
  50. package/dist/src/ua_method_impl.js.map +1 -1
  51. package/dist/src/ua_object_impl.js +7 -7
  52. package/dist/src/ua_object_impl.js.map +1 -1
  53. package/dist/src/ua_object_type_impl.d.ts +4 -2
  54. package/dist/src/ua_object_type_impl.js +12 -10
  55. package/dist/src/ua_object_type_impl.js.map +1 -1
  56. package/dist/src/ua_reference_type_impl.d.ts +5 -3
  57. package/dist/src/ua_reference_type_impl.js +12 -10
  58. package/dist/src/ua_reference_type_impl.js.map +1 -1
  59. package/dist/src/ua_variable_impl.d.ts +7 -7
  60. package/dist/src/ua_variable_impl.js +30 -30
  61. package/dist/src/ua_variable_impl.js.map +1 -1
  62. package/dist/src/ua_variable_impl_ext_obj.js +3 -3
  63. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  64. package/dist/src/ua_variable_type_impl.d.ts +4 -2
  65. package/dist/src/ua_variable_type_impl.js +15 -10
  66. package/dist/src/ua_variable_type_impl.js.map +1 -1
  67. package/dist/src/ua_view_impl.js +3 -3
  68. package/dist/src/ua_view_impl.js.map +1 -1
  69. package/distHelpers/boiler_system.js +5 -5
  70. package/distHelpers/boiler_system.js.map +1 -1
  71. package/package.json +5 -5
  72. package/source/helpers/argument_list.ts +3 -3
  73. package/source/interfaces/state_machine/ua_state_machine_type.ts +19 -1
  74. package/src/address_space.ts +8 -8
  75. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +1 -1
  76. package/src/alarms_and_conditions/ua_condition_impl.ts +2 -2
  77. package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +1 -1
  78. package/src/base_node_impl.ts +3 -3
  79. package/src/base_node_private.ts +3 -3
  80. package/src/extension_object_array_node.ts +3 -3
  81. package/src/index_current.ts +1 -1
  82. package/src/nodeset_tools/nodeset_to_xml.ts +9 -9
  83. package/src/state_machine/finite_state_machine.ts +105 -60
  84. package/src/{tool_isSupertypeOf.ts → tool_isSubtypeOf.ts} +9 -9
  85. package/src/ua_data_type_impl.ts +21 -19
  86. package/src/ua_object_type_impl.ts +9 -3
  87. package/src/ua_reference_type_impl.ts +7 -4
  88. package/src/ua_variable_impl.ts +2033 -2033
  89. package/src/ua_variable_impl_ext_obj.ts +3 -3
  90. package/src/ua_variable_type_impl.ts +11 -4
  91. package/test_helpers/boiler_system.ts +5 -5
@@ -5,12 +5,12 @@
5
5
  import { assert } from "node-opcua-assert";
6
6
  import { NodeId, NodeIdLike, resolveNodeId } from "node-opcua-nodeid";
7
7
  import { sameNodeId } from "node-opcua-nodeid";
8
+ import { NodeClass } from "node-opcua-data-model";
8
9
  import { BaseNode, UADataType, UAObjectType, UAReference, UAReferenceType, UAVariableType } from "node-opcua-address-space-base";
9
10
 
10
11
  import { BaseNode_getCache } from "./base_node_private";
11
12
  import { ReferenceImpl } from "./reference_impl";
12
13
  import { BaseNodeImpl } from "./base_node_impl";
13
- import { NodeClass } from "node-opcua-data-model";
14
14
 
15
15
  const HasSubTypeNodeId = resolveNodeId("HasSubtype");
16
16
 
@@ -20,13 +20,13 @@ function _filterSubType(reference: UAReference) {
20
20
 
21
21
  export type BaseNodeConstructor<T extends BaseNode> = new () => T;
22
22
 
23
- function _slow_isSupertypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl, baseType: T | NodeIdLike): boolean {
23
+ function _slow_isSubtypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl, baseType: T | NodeIdLike): boolean {
24
24
  if (!(baseType instanceof Class)) {
25
25
  const node = this.addressSpace.findNode(baseType as NodeIdLike);
26
26
  if (!node || !(node instanceof Class)) {
27
27
  throw new Error("Invalid argument");
28
28
  }
29
- return _slow_isSupertypeOf.call(this, Class, node as unknown as T);
29
+ return _slow_isSubtypeOf.call(this, Class, node as unknown as T);
30
30
  }
31
31
  assert(this instanceof Class);
32
32
  assert(baseType instanceof Class, " Object must have same type");
@@ -50,7 +50,7 @@ function _slow_isSupertypeOf<T extends UAType>(this: T, Class: typeof BaseNodeIm
50
50
  if (sameNodeId(subTypeNode.nodeId, baseType.nodeId)) {
51
51
  return true;
52
52
  } else {
53
- if (_slow_isSupertypeOf.call(subTypeNode, Class, baseType)) {
53
+ if (_slow_isSubtypeOf.call(subTypeNode, Class, baseType)) {
54
54
  return true;
55
55
  }
56
56
  }
@@ -96,11 +96,11 @@ function hashBaseNode(e: BaseNode): string {
96
96
  return e.nodeId.value.toString();
97
97
  }
98
98
 
99
- export type IsSupertypeOfFunc<T extends UAType> = (this: T, baseType: T) => boolean;
99
+ export type IsSubtypeOfFunc<T extends UAType> = (this: T, baseType: T) => boolean;
100
100
 
101
101
  export type UAType = UAReferenceType | UADataType | UAObjectType | UAVariableType;
102
102
 
103
- export function construct_isSupertypeOf<T extends UAType>(Class: typeof BaseNodeImpl): IsSupertypeOfFunc<T> {
103
+ export function construct_isSubtypeOf<T extends UAType>(Class: typeof BaseNodeImpl): IsSubtypeOfFunc<T> {
104
104
  return wrap_memoize(function (this: T, baseType: T | NodeIdLike): boolean {
105
105
  if (!(baseType instanceof Class)) {
106
106
  throw new Error(
@@ -115,13 +115,13 @@ export function construct_isSupertypeOf<T extends UAType>(Class: typeof BaseNode
115
115
  if (!(this instanceof Class)) {
116
116
  throw new Error("expecting this to be " + Class.name + " but got " + baseType.constructor.name);
117
117
  }
118
- return _slow_isSupertypeOf.call(this, Class, baseType as T);
118
+ return _slow_isSubtypeOf.call(this, Class, baseType as T);
119
119
  }, hashBaseNode);
120
120
  }
121
121
 
122
- export function construct_slow_isSupertypeOf<T extends UAType>(Class: typeof BaseNodeImpl) {
122
+ export function construct_slow_isSubtypeOf<T extends UAType>(Class: typeof BaseNodeImpl) {
123
123
  return function (this: T, baseType: T | NodeIdLike): boolean {
124
- return _slow_isSupertypeOf.call(this, Class, baseType);
124
+ return _slow_isSubtypeOf.call(this, Class, baseType);
125
125
  };
126
126
  }
127
127
 
@@ -26,9 +26,9 @@ import { SessionContext } from "../source/session_context";
26
26
  import { ExtensionObjectConstructorFuncWithSchema } from "../source/interfaces/extension_object_constructor";
27
27
  import { BaseNodeImpl, InternalBaseNodeOptions } from "./base_node_impl";
28
28
  import { BaseNode_References_toString, BaseNode_toString, ToStringBuilder, ToStringOption } from "./base_node_private";
29
- import * as tools from "./tool_isSupertypeOf";
30
- import { get_subtypeOf } from "./tool_isSupertypeOf";
31
- import { get_subtypeOfObj } from "./tool_isSupertypeOf";
29
+ import * as tools from "./tool_isSubtypeOf";
30
+ import { get_subtypeOf } from "./tool_isSubtypeOf";
31
+ import { get_subtypeOfObj } from "./tool_isSubtypeOf";
32
32
  import { BaseNode_getCache } from "./base_node_private";
33
33
 
34
34
  export interface UADataTypeImpl {
@@ -62,8 +62,8 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
62
62
  *
63
63
  * var dataTypeDouble = addressSpace.findDataType("Double");
64
64
  * var dataTypeNumber = addressSpace.findDataType("Number");
65
- * assert(dataTypeDouble.isSupertypeOf(dataTypeNumber));
66
- * assert(!dataTypeNumber.isSupertypeOf(dataTypeDouble));
65
+ * assert(dataTypeDouble.isSubtypeOf(dataTypeNumber));
66
+ * assert(!dataTypeNumber.isSubtypeOf(dataTypeDouble));
67
67
  *
68
68
  */
69
69
  public get subtypeOf(): NodeId | null {
@@ -74,7 +74,9 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
74
74
  return get_subtypeOfObj.call(this) as any as UADataType;
75
75
  }
76
76
 
77
- public isSupertypeOf = tools.construct_isSupertypeOf<UADataType>(UADataTypeImpl);
77
+ /** @deprecated */
78
+ public isSupertypeOf = tools.construct_isSubtypeOf<UADataType>(UADataTypeImpl);
79
+ public isSubtypeOf = tools.construct_isSubtypeOf<UADataType>(UADataTypeImpl);
78
80
 
79
81
  public readonly isAbstract: boolean;
80
82
 
@@ -277,9 +279,9 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
277
279
 
278
280
  // we have a data type from a companion specification
279
281
  // let's see if this data type need to be registered
280
- const isEnumeration = enumeration && this.isSupertypeOf(enumeration);
281
- const isStructure = structure && this.isSupertypeOf(structure);
282
- const isUnion = !!(structure && union && this.isSupertypeOf(union));
282
+ const isEnumeration = enumeration && this.isSubtypeOf(enumeration);
283
+ const isStructure = structure && this.isSubtypeOf(structure);
284
+ const isUnion = !!(structure && union && this.isSubtypeOf(union));
283
285
 
284
286
  const isRootDataType = (n: UADataType) => n.nodeId.namespace === 0 && n.nodeId.value === DataTypeIds.BaseDataType;
285
287
  // https://reference.opcfoundation.org/v104/Core/docs/Part3/8.49/#Table34
@@ -367,24 +369,24 @@ export function DataType_toString(this: UADataTypeImpl, options: ToStringOption)
367
369
 
368
370
  options.add(
369
371
  options.padding +
370
- chalk.yellow(" binaryEncodingNodeId: ") +
371
- (this.binaryEncodingNodeId ? this.binaryEncodingNodeId.toString() : "<none>")
372
+ chalk.yellow(" binaryEncodingNodeId: ") +
373
+ (this.binaryEncodingNodeId ? this.binaryEncodingNodeId.toString() : "<none>")
372
374
  );
373
375
  options.add(
374
376
  options.padding +
375
- chalk.yellow(" xmlEncodingNodeId : ") +
376
- (this.xmlEncodingNodeId ? this.xmlEncodingNodeId.toString() : "<none>")
377
+ chalk.yellow(" xmlEncodingNodeId : ") +
378
+ (this.xmlEncodingNodeId ? this.xmlEncodingNodeId.toString() : "<none>")
377
379
  );
378
380
  options.add(
379
381
  options.padding +
380
- chalk.yellow(" jsonEncodingNodeId : ") +
381
- (this.jsonEncodingNodeId ? this.jsonEncodingNodeId.toString() : "<none>")
382
+ chalk.yellow(" jsonEncodingNodeId : ") +
383
+ (this.jsonEncodingNodeId ? this.jsonEncodingNodeId.toString() : "<none>")
382
384
  );
383
385
  if (this.subtypeOfObj) {
384
386
  options.add(
385
387
  options.padding +
386
- chalk.yellow(" subtypeOfObj : ") +
387
- (this.subtypeOfObj ? this.subtypeOfObj.browseName.toString() : "")
388
+ chalk.yellow(" subtypeOfObj : ") +
389
+ (this.subtypeOfObj ? this.subtypeOfObj.browseName.toString() : "")
388
390
  );
389
391
  }
390
392
  // references
@@ -418,8 +420,8 @@ function makeStructureDefinition(
418
420
  const structureType = isUnion
419
421
  ? StructureType.Union
420
422
  : hasOptionalFields
421
- ? StructureType.StructureWithOptionalFields
422
- : StructureType.Structure;
423
+ ? StructureType.StructureWithOptionalFields
424
+ : StructureType.Structure;
423
425
 
424
426
  const sd = new StructureDefinition({
425
427
  baseDataType,
@@ -21,8 +21,8 @@ import {
21
21
  import { SessionContext } from "../source/session_context";
22
22
  import { BaseNodeImpl } from "./base_node_impl";
23
23
  import { ToStringBuilder, UAObjectType_toString } from "./base_node_private";
24
- import { get_subtypeOf, get_subtypeOfObj } from "./tool_isSupertypeOf";
25
- import * as tools from "./tool_isSupertypeOf";
24
+ import { get_subtypeOf, get_subtypeOfObj } from "./tool_isSubtypeOf";
25
+ import * as tools from "./tool_isSubtypeOf";
26
26
  import {
27
27
  assertUnusedChildBrowseName,
28
28
  initialize_properties_and_components,
@@ -42,10 +42,16 @@ export class UAObjectTypeImpl extends BaseNodeImpl implements UAObjectType {
42
42
  public get subtypeOf(): NodeId | null {
43
43
  return get_subtypeOf.call(this);
44
44
  }
45
+
46
+
45
47
  public get subtypeOfObj(): UAObjectType | null {
46
48
  return get_subtypeOfObj.call(this) as any as UAObjectType;
47
49
  }
48
- public isSupertypeOf = tools.construct_isSupertypeOf<UAObjectType>(UAObjectTypeImpl);
50
+
51
+
52
+ public isSubtypeOf = tools.construct_isSubtypeOf<UAObjectType>(UAObjectTypeImpl);
53
+ /** @deprecated - use isSubtypeOf instead */
54
+ public isSupertypeOf = tools.construct_isSubtypeOf<UAObjectType>(UAObjectTypeImpl);
49
55
 
50
56
  constructor(options: any) {
51
57
  super(options);
@@ -14,8 +14,8 @@ import { DataType } from "node-opcua-variant";
14
14
 
15
15
  import { SessionContext, UAReferenceType as UAReferenceTypePublic } from "../source";
16
16
  import { BaseNodeImpl, InternalBaseNodeOptions } from "./base_node_impl";
17
- import * as tools from "./tool_isSupertypeOf";
18
- import { get_subtypeOf, get_subtypeOfObj } from "./tool_isSupertypeOf";
17
+ import * as tools from "./tool_isSubtypeOf";
18
+ import { get_subtypeOf, get_subtypeOfObj } from "./tool_isSubtypeOf";
19
19
  import { ReferenceImpl } from "./reference_impl";
20
20
  import { BaseNode_getCache } from "./base_node_private";
21
21
 
@@ -98,12 +98,15 @@ export class UAReferenceTypeImpl extends BaseNodeImpl implements UAReferenceType
98
98
  /**
99
99
  * returns true if self is a super type of baseType
100
100
  */
101
- public isSupertypeOf = tools.construct_isSupertypeOf<UAReferenceType>(UAReferenceTypeImpl);
101
+ public isSubtypeOf = tools.construct_isSubtypeOf<UAReferenceType>(UAReferenceTypeImpl);
102
+
103
+ /** @deprecated - use `isSubtypeOf` instead*/
104
+ public isSupertypeOf = tools.construct_isSubtypeOf<UAReferenceType>(UAReferenceTypeImpl);
102
105
 
103
106
  /**
104
107
  * @private
105
108
  */
106
- public _slow_isSupertypeOf = tools.construct_slow_isSupertypeOf<UAReferenceType>(UAReferenceTypeImpl);
109
+ public _slow_isSubtypeOf = tools.construct_slow_isSubtypeOf<UAReferenceType>(UAReferenceTypeImpl);
107
110
 
108
111
  constructor(options: UAReferenceTypeOptions) {
109
112
  super(options);