node-opcua-address-space 2.90.0 → 2.90.1

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 (58) 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/call_helpers.d.ts +1 -1
  5. package/dist/source/helpers/multiform_func.d.ts +8 -8
  6. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
  7. package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
  8. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +2 -2
  9. package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
  10. package/dist/source/loader/load_nodeset2.js +5 -5
  11. package/dist/source/loader/load_nodeset2.js.map +1 -1
  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 +11 -11
  16. package/dist/src/address_space.js.map +1 -1
  17. package/dist/src/apply_condition_refresh.d.ts +1 -1
  18. package/dist/src/base_node_impl.js +44 -44
  19. package/dist/src/base_node_impl.js.map +1 -1
  20. package/dist/src/check_value_rank_compatibility.d.ts +15 -0
  21. package/dist/src/check_value_rank_compatibility.js +82 -0
  22. package/dist/src/check_value_rank_compatibility.js.map +1 -0
  23. package/dist/src/event_data.d.ts +2 -2
  24. package/dist/src/namespace_impl.js +0 -2
  25. package/dist/src/namespace_impl.js.map +1 -1
  26. package/dist/src/nodeid_manager.d.ts +3 -3
  27. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
  28. package/dist/src/reference_impl.js +6 -6
  29. package/dist/src/reference_impl.js.map +1 -1
  30. package/dist/src/tool_isSupertypeOf.d.ts +4 -4
  31. package/dist/src/ua_data_type_impl.js +12 -12
  32. package/dist/src/ua_data_type_impl.js.map +1 -1
  33. package/dist/src/ua_method_impl.js +6 -6
  34. package/dist/src/ua_method_impl.js.map +1 -1
  35. package/dist/src/ua_object_impl.js +7 -7
  36. package/dist/src/ua_object_impl.js.map +1 -1
  37. package/dist/src/ua_object_type_impl.js +6 -6
  38. package/dist/src/ua_object_type_impl.js.map +1 -1
  39. package/dist/src/ua_reference_type_impl.js +6 -6
  40. package/dist/src/ua_reference_type_impl.js.map +1 -1
  41. package/dist/src/ua_variable_impl.d.ts +12 -0
  42. package/dist/src/ua_variable_impl.js +29 -14
  43. package/dist/src/ua_variable_impl.js.map +1 -1
  44. package/dist/src/ua_variable_impl_ext_obj.js +19 -10
  45. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  46. package/dist/src/ua_variable_type_impl.d.ts +11 -1
  47. package/dist/src/ua_variable_type_impl.js +12 -6
  48. package/dist/src/ua_variable_type_impl.js.map +1 -1
  49. package/dist/src/ua_view_impl.js +3 -3
  50. package/dist/src/ua_view_impl.js.map +1 -1
  51. package/package.json +34 -34
  52. package/source/loader/load_nodeset2.ts +11 -10
  53. package/src/check_value_rank_compatibility.ts +79 -0
  54. package/src/namespace_impl.ts +0 -4
  55. package/src/ua_variable_impl.ts +31 -4
  56. package/src/ua_variable_impl_ext_obj.ts +25 -12
  57. package/src/ua_variable_type_impl.ts +20 -1
  58. package/test_helpers/test_fixtures/eurange_issue.xml +3 -2
@@ -40,6 +40,7 @@ import { _clone_children_references, ToStringBuilder, UAVariableType_toString }
40
40
  import * as tools from "./tool_isSupertypeOf";
41
41
  import { get_subtypeOfObj } from "./tool_isSupertypeOf";
42
42
  import { get_subtypeOf } from "./tool_isSupertypeOf";
43
+ import { checkValueRankCompatibility } from "./check_value_rank_compatibility";
43
44
 
44
45
  const debugLog = make_debugLog(__filename);
45
46
  const doDebug = checkDebugFlag(__filename);
@@ -50,6 +51,7 @@ const errorLog = make_errorLog(__filename);
50
51
  let doTrace = checkDebugFlag("INSTANTIATE");
51
52
  const traceLog = errorLog;
52
53
 
54
+
53
55
  interface InstantiateS {
54
56
  propertyOf?: any;
55
57
  componentOf?: any;
@@ -83,7 +85,17 @@ export function topMostParentIsObjectTypeOrVariableType(addressSpace: AddressSpa
83
85
  return false;
84
86
  }
85
87
  export interface UAVariableTypeOptions extends InternalBaseNodeOptions {
86
- /** */
88
+ /**
89
+ * This attribute indicates whether the Value attribute of the Variableis an array and how many dimensions the array has.
90
+ * It may have the following values:
91
+ * * n > 1: the Value is an array with the specified number of dimensions.
92
+ * * OneDimension (1): The value is an array with one dimension.
93
+ * * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
94
+ * * Scalar (−1): The value is not an array.
95
+ * * Any (−2): The value can be a scalar or an array with any number of dimensions.
96
+ * * ScalarOrOneDimension (−3): The value can be a scalar or a one dimensional array.
97
+ * * All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.
98
+ */
87
99
  valueRank?: number;
88
100
  arrayDimensions?: number[] | null;
89
101
  historizing?: boolean;
@@ -227,6 +239,13 @@ export class UAVariableTypeImpl extends BaseNodeImpl implements UAVariableType {
227
239
  assert(dataType instanceof NodeId);
228
240
 
229
241
  const valueRank = options.valueRank !== undefined ? options.valueRank : this.valueRank;
242
+
243
+ const { result, errorMessage } = checkValueRankCompatibility(valueRank, this.valueRank);
244
+ if (!result) {
245
+ errorLog(errorMessage);
246
+ throw new Error(errorMessage);
247
+ }
248
+
230
249
  const arrayDimensions = options.arrayDimensions !== undefined ? options.arrayDimensions : this.arrayDimensions;
231
250
 
232
251
  // istanbul ignore next
@@ -18,6 +18,7 @@
18
18
  <Alias Alias="HasProperty">i=46</Alias>
19
19
  <Alias Alias="HasSubtype">i=45</Alias>
20
20
  <Alias Alias="HasTypeDefinition">i=40</Alias>
21
+ <Alias Alias="PropertyType">i=68</Alias>
21
22
  <Alias Alias="Int32">i=6</Alias>
22
23
  <Alias Alias="Range">i=884</Alias>
23
24
  <Alias Alias="String">i=12</Alias>
@@ -33,7 +34,7 @@
33
34
 
34
35
  <UAVariable NodeId="ns=1;i=1301" BrowseName="Range" AccessLevel="3" DataType="Range">
35
36
  <References>
36
- <Reference ReferenceType="HasTypeDefinition">i=1317</Reference>
37
+ <Reference ReferenceType="HasTypeDefinition">ns=1;i=1317</Reference>
37
38
  <Reference ReferenceType="HasModellingRule">i=78</Reference>
38
39
  </References>
39
40
  <Value>
@@ -54,7 +55,7 @@
54
55
  <UAVariableType NodeId="ns=1;i=1317" BrowseName="MyVariableType" AccessLevel="3" DataType="Range">
55
56
  <DisplayName>EURange</DisplayName>
56
57
  <References>
57
- <Reference ReferenceType="HasSubtype" IsForward="false">i=68</Reference>
58
+ <Reference ReferenceType="HasSubtype" IsForward="false">PropertyType</Reference>
58
59
  </References>
59
60
  <Value>
60
61
  <ExtensionObject>