node-opcua-address-space 2.179.0 → 2.181.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 (1085) hide show
  1. package/api/address_space_public.ts +63 -0
  2. package/api/address_space_ts.ts +129 -0
  3. package/api/continuation_points/continuation_point_manager.ts +271 -0
  4. package/api/helpers/argument_list.ts +310 -0
  5. package/api/helpers/call_helpers.ts +100 -0
  6. package/api/helpers/coerce_enum_value.ts +33 -0
  7. package/api/helpers/dump_tools.ts +90 -0
  8. package/api/helpers/ensure_secure_access.ts +78 -0
  9. package/api/helpers/multiform_func.ts +78 -0
  10. package/api/helpers/resolve_opaque_on_address_space.ts +26 -0
  11. package/api/index.ts +210 -0
  12. package/api/interfaces/alarms_and_conditions/condition_info_i.ts +60 -0
  13. package/api/interfaces/alarms_and_conditions/condition_snapshot.ts +236 -0
  14. package/api/interfaces/alarms_and_conditions/deviation_stuff.ts +16 -0
  15. package/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +8 -0
  16. package/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +6 -0
  17. package/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +6 -0
  18. package/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +13 -0
  19. package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +6 -0
  20. package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +6 -0
  21. package/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +21 -0
  22. package/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +28 -0
  23. package/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +72 -0
  24. package/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +36 -0
  25. package/api/interfaces/alarms_and_conditions/ua_condition_ex.ts +55 -0
  26. package/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +17 -0
  27. package/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +21 -0
  28. package/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +21 -0
  29. package/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +26 -0
  30. package/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +29 -0
  31. package/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +25 -0
  32. package/api/interfaces/data_access/ua_multistate_discrete_ex.ts +57 -0
  33. package/api/interfaces/data_access/ua_multistate_value_discrete_ex.ts +31 -0
  34. package/api/interfaces/data_access/ua_two_state_discrete_ex.ts +15 -0
  35. package/api/interfaces/nodeset_loader_options.ts +58 -0
  36. package/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +20 -0
  37. package/api/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
  38. package/api/interfaces/state_machine/ua_program_state_machine_type.ts +14 -0
  39. package/api/interfaces/state_machine/ua_shelved_state_machine_ex.ts +35 -0
  40. package/api/interfaces/state_machine/ua_state_machine_type.ts +288 -0
  41. package/api/loader/decode_xml_extension_object.ts +80 -0
  42. package/api/loader/ensure_datatype_extracted.ts +122 -0
  43. package/api/loader/generateAddressSpaceRaw.ts +470 -0
  44. package/api/loader/load_nodeset2.ts +278 -0
  45. package/api/loader/make_xml_extension_object_parser.ts +518 -0
  46. package/api/loader/namespace_post_step.ts +68 -0
  47. package/api/loader/nodeset_image.ts +451 -0
  48. package/api/loader/nodeset_image_codec.ts +576 -0
  49. package/api/loader/nodeset_image_store.ts +78 -0
  50. package/api/loader/nodeset_record.ts +141 -0
  51. package/api/loader/nodeset_record_applier.ts +889 -0
  52. package/api/loader/nodeset_source.ts +367 -0
  53. package/api/loader/nodeset_source_helpers.ts +50 -0
  54. package/api/loader/nodeset_to_image.ts +29 -0
  55. package/api/loader/nodeset_xml_producer.ts +383 -0
  56. package/api/loader/parsers/extension_object_parser.ts +374 -0
  57. package/api/loader/parsers/variant_parser.ts +363 -0
  58. package/api/loader/register_node_promoter.ts +6 -0
  59. package/api/namespace.ts +25 -0
  60. package/api/namespace_alarm_and_condition.ts +78 -0
  61. package/api/namespace_data_access.ts +92 -0
  62. package/api/namespace_machine_state.ts +20 -0
  63. package/api/pseudo_session.ts +415 -0
  64. package/api/session_context.ts +729 -0
  65. package/api/ua_interface.ts +38 -0
  66. package/api/ua_two_state_variable_ex.ts +36 -0
  67. package/bin/opcua-nodeset-image.js +192 -0
  68. package/dist/api/address_space_public.d.ts +57 -0
  69. package/dist/api/address_space_public.js +19 -0
  70. package/dist/api/address_space_public.js.map +1 -0
  71. package/dist/api/address_space_ts.d.ts +79 -0
  72. package/dist/api/address_space_ts.js +13 -0
  73. package/dist/api/address_space_ts.js.map +1 -0
  74. package/dist/api/continuation_points/continuation_point_manager.js +230 -0
  75. package/dist/api/continuation_points/continuation_point_manager.js.map +1 -0
  76. package/dist/api/helpers/adjust_browse_direction.js.map +1 -0
  77. package/dist/api/helpers/argument_list.js +263 -0
  78. package/dist/api/helpers/argument_list.js.map +1 -0
  79. package/dist/api/helpers/call_helpers.js +80 -0
  80. package/dist/api/helpers/call_helpers.js.map +1 -0
  81. package/dist/api/helpers/coerce_enum_value.d.ts +6 -0
  82. package/dist/api/helpers/coerce_enum_value.js.map +1 -0
  83. package/dist/api/helpers/dump_tools.js +81 -0
  84. package/dist/api/helpers/dump_tools.js.map +1 -0
  85. package/dist/api/helpers/ensure_secure_access.d.ts +19 -0
  86. package/dist/api/helpers/ensure_secure_access.js +67 -0
  87. package/dist/api/helpers/ensure_secure_access.js.map +1 -0
  88. package/dist/api/helpers/make_optionals_map.js.map +1 -0
  89. package/dist/api/helpers/multiform_func.js +75 -0
  90. package/dist/api/helpers/multiform_func.js.map +1 -0
  91. package/dist/api/helpers/resolve_opaque_on_address_space.js +25 -0
  92. package/dist/api/helpers/resolve_opaque_on_address_space.js.map +1 -0
  93. package/dist/api/index.d.ts +113 -0
  94. package/dist/api/index.js +234 -0
  95. package/dist/api/index.js.map +1 -0
  96. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.d.ts +54 -0
  97. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js +28 -0
  98. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
  99. package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.d.ts +151 -0
  100. package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.js.map +1 -0
  101. package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.d.ts +12 -0
  102. package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.js.map +1 -0
  103. package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.js.map +1 -0
  104. package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +7 -0
  105. package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +1 -0
  106. package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +1 -0
  107. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +4 -0
  108. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +1 -0
  109. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +4 -0
  110. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +1 -0
  111. package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +10 -0
  112. package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +1 -0
  113. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +4 -0
  114. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +1 -0
  115. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -0
  116. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +1 -0
  117. package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +20 -0
  118. package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +1 -0
  119. package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +21 -0
  120. package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +1 -0
  121. package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +56 -0
  122. package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +1 -0
  123. package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
  124. package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +19 -0
  125. package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +1 -0
  126. package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +44 -0
  127. package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.js.map +1 -0
  128. package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +4 -0
  129. package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -0
  130. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +5 -0
  131. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +1 -0
  132. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +19 -0
  133. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +1 -0
  134. package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +25 -0
  135. package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +1 -0
  136. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +8 -0
  137. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +1 -0
  138. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +10 -0
  139. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +1 -0
  140. package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.d.ts +44 -0
  141. package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
  142. package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +22 -0
  143. package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
  144. package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.d.ts +13 -0
  145. package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
  146. package/dist/api/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
  147. package/dist/api/interfaces/extension_object_constructor.js.map +1 -0
  148. package/dist/api/interfaces/i_condition_variable_type_setter_options.js.map +1 -0
  149. package/dist/api/interfaces/i_set_state_options.js.map +1 -0
  150. package/dist/api/interfaces/nodeset_loader_options.d.ts +56 -0
  151. package/dist/api/interfaces/nodeset_loader_options.js.map +1 -0
  152. package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
  153. package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
  154. package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
  155. package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
  156. package/dist/api/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
  157. package/dist/api/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
  158. package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +29 -0
  159. package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +1 -0
  160. package/dist/api/interfaces/state_machine/ua_state_machine_type.d.ts +236 -0
  161. package/dist/api/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
  162. package/dist/api/interfaces/state_machine/ua_transition_ex.js.map +1 -0
  163. package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
  164. package/dist/api/loader/decode_xml_extension_object.d.ts +6 -0
  165. package/dist/api/loader/decode_xml_extension_object.js +69 -0
  166. package/dist/api/loader/decode_xml_extension_object.js.map +1 -0
  167. package/dist/api/loader/ensure_datatype_extracted.js +88 -0
  168. package/dist/api/loader/ensure_datatype_extracted.js.map +1 -0
  169. package/dist/api/loader/generateAddressSpaceRaw.d.ts +64 -0
  170. package/dist/api/loader/generateAddressSpaceRaw.js +379 -0
  171. package/dist/api/loader/generateAddressSpaceRaw.js.map +1 -0
  172. package/dist/api/loader/load_nodeset2.d.ts +38 -0
  173. package/dist/api/loader/load_nodeset2.js +245 -0
  174. package/dist/api/loader/load_nodeset2.js.map +1 -0
  175. package/dist/api/loader/make_semver_compatible.js.map +1 -0
  176. package/dist/api/loader/make_xml_extension_object_parser.js +417 -0
  177. package/dist/api/loader/make_xml_extension_object_parser.js.map +1 -0
  178. package/dist/api/loader/namespace_post_step.js +57 -0
  179. package/dist/api/loader/namespace_post_step.js.map +1 -0
  180. package/dist/api/loader/nodeset_image.d.ts +94 -0
  181. package/dist/api/loader/nodeset_image.js +406 -0
  182. package/dist/api/loader/nodeset_image.js.map +1 -0
  183. package/dist/api/loader/nodeset_image_codec.d.ts +104 -0
  184. package/dist/api/loader/nodeset_image_codec.js +489 -0
  185. package/dist/api/loader/nodeset_image_codec.js.map +1 -0
  186. package/dist/api/loader/nodeset_image_store.d.ts +27 -0
  187. package/dist/api/loader/nodeset_image_store.js +72 -0
  188. package/dist/api/loader/nodeset_image_store.js.map +1 -0
  189. package/dist/api/loader/nodeset_record.d.ts +125 -0
  190. package/dist/api/loader/nodeset_record.js +26 -0
  191. package/dist/api/loader/nodeset_record.js.map +1 -0
  192. package/dist/api/loader/nodeset_record_applier.d.ts +106 -0
  193. package/dist/api/loader/nodeset_record_applier.js +731 -0
  194. package/dist/api/loader/nodeset_record_applier.js.map +1 -0
  195. package/dist/api/loader/nodeset_source.d.ts +124 -0
  196. package/dist/api/loader/nodeset_source.js +307 -0
  197. package/dist/api/loader/nodeset_source.js.map +1 -0
  198. package/dist/api/loader/nodeset_source_helpers.d.ts +27 -0
  199. package/dist/api/loader/nodeset_source_helpers.js +30 -0
  200. package/dist/api/loader/nodeset_source_helpers.js.map +1 -0
  201. package/dist/api/loader/nodeset_to_image.d.ts +13 -0
  202. package/dist/api/loader/nodeset_to_image.js +30 -0
  203. package/dist/api/loader/nodeset_to_image.js.map +1 -0
  204. package/dist/api/loader/nodeset_xml_producer.d.ts +16 -0
  205. package/dist/api/loader/nodeset_xml_producer.js +349 -0
  206. package/dist/api/loader/nodeset_xml_producer.js.map +1 -0
  207. package/dist/api/loader/parsers/extension_object_parser.js +274 -0
  208. package/dist/api/loader/parsers/extension_object_parser.js.map +1 -0
  209. package/dist/api/loader/parsers/localized_text_parser.js.map +1 -0
  210. package/dist/api/loader/parsers/nodeid_parser.js.map +1 -0
  211. package/dist/api/loader/parsers/qualified_name_parser.js.map +1 -0
  212. package/dist/api/loader/parsers/variant_parser.d.ts +42 -0
  213. package/dist/api/loader/parsers/variant_parser.js +294 -0
  214. package/dist/api/loader/parsers/variant_parser.js.map +1 -0
  215. package/dist/api/loader/register_node_promoter.d.ts +2 -0
  216. package/dist/api/loader/register_node_promoter.js +9 -0
  217. package/dist/api/loader/register_node_promoter.js.map +1 -0
  218. package/dist/api/namespace.d.ts +18 -0
  219. package/dist/api/namespace.js.map +1 -0
  220. package/dist/api/namespace_alarm_and_condition.d.ts +33 -0
  221. package/dist/api/namespace_alarm_and_condition.js.map +1 -0
  222. package/dist/api/namespace_data_access.d.ts +67 -0
  223. package/dist/api/namespace_data_access.js.map +1 -0
  224. package/dist/api/namespace_machine_state.d.ts +8 -0
  225. package/dist/api/namespace_machine_state.js.map +1 -0
  226. package/dist/api/pseudo_session.d.ts +74 -0
  227. package/dist/api/pseudo_session.js +308 -0
  228. package/dist/api/pseudo_session.js.map +1 -0
  229. package/dist/api/session_context.d.ts +242 -0
  230. package/dist/api/session_context.js +524 -0
  231. package/dist/api/session_context.js.map +1 -0
  232. package/dist/api/set_namespace_meta_data.js.map +1 -0
  233. package/dist/api/ua_addin.js.map +1 -0
  234. package/dist/api/ua_interface.js +25 -0
  235. package/dist/api/ua_interface.js.map +1 -0
  236. package/dist/api/ua_root_folder.js.map +1 -0
  237. package/dist/api/ua_two_state_variable_ex.d.ts +24 -0
  238. package/dist/api/ua_two_state_variable_ex.js.map +1 -0
  239. package/dist/api/xml_writer.js.map +1 -0
  240. package/dist/impl/_instantiate_helpers.js +99 -0
  241. package/dist/impl/_instantiate_helpers.js.map +1 -0
  242. package/dist/impl/_mandatory_child_or_requested_optional_filter.js +82 -0
  243. package/dist/impl/_mandatory_child_or_requested_optional_filter.js.map +1 -0
  244. package/dist/impl/address_space.d.ts +379 -0
  245. package/dist/impl/address_space.js +1383 -0
  246. package/dist/impl/address_space.js.map +1 -0
  247. package/dist/impl/address_space_change_event_tools.d.ts +6 -0
  248. package/dist/impl/address_space_change_event_tools.js.map +1 -0
  249. package/dist/impl/address_space_private.d.ts +48 -0
  250. package/dist/impl/address_space_private.js.map +1 -0
  251. package/dist/impl/alarms_and_conditions/condition.js.map +1 -0
  252. package/dist/impl/alarms_and_conditions/condition_info_impl.d.ts +19 -0
  253. package/dist/impl/alarms_and_conditions/condition_info_impl.js +39 -0
  254. package/dist/impl/alarms_and_conditions/condition_info_impl.js.map +1 -0
  255. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.d.ts +271 -0
  256. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js +700 -0
  257. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js.map +1 -0
  258. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.d.ts +12 -0
  259. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js +66 -0
  260. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
  261. package/dist/impl/alarms_and_conditions/index.d.ts +16 -0
  262. package/dist/impl/alarms_and_conditions/index.js +33 -0
  263. package/dist/impl/alarms_and_conditions/index.js.map +1 -0
  264. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +54 -0
  265. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
  266. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
  267. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts +105 -0
  268. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +428 -0
  269. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
  270. package/dist/impl/alarms_and_conditions/ua_base_event_impl.d.ts +36 -0
  271. package/dist/impl/alarms_and_conditions/ua_base_event_impl.js +32 -0
  272. package/dist/impl/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
  273. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +47 -0
  274. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +204 -0
  275. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
  276. package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts +152 -0
  277. package/dist/impl/alarms_and_conditions/ua_condition_impl.js +1016 -0
  278. package/dist/impl/alarms_and_conditions/ua_condition_impl.js.map +1 -0
  279. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +22 -0
  280. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js +41 -0
  281. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
  282. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +30 -0
  283. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +54 -0
  284. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
  285. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +12 -0
  286. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +13 -0
  287. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
  288. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +28 -0
  289. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +86 -0
  290. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
  291. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
  292. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
  293. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
  294. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts +49 -0
  295. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js +207 -0
  296. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
  297. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
  298. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +54 -0
  299. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
  300. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +38 -0
  301. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +172 -0
  302. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
  303. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +44 -0
  304. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js +164 -0
  305. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
  306. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +18 -0
  307. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
  308. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
  309. package/dist/impl/apply_condition_refresh.d.ts +4 -0
  310. package/dist/impl/apply_condition_refresh.js +29 -0
  311. package/dist/impl/apply_condition_refresh.js.map +1 -0
  312. package/dist/impl/base_node_impl.d.ts +347 -0
  313. package/dist/impl/base_node_impl.js +1768 -0
  314. package/dist/impl/base_node_impl.js.map +1 -0
  315. package/dist/impl/base_node_private.d.ts +138 -0
  316. package/dist/impl/base_node_private.js +1028 -0
  317. package/dist/impl/base_node_private.js.map +1 -0
  318. package/dist/impl/check_value_rank_compatibility.js.map +1 -0
  319. package/dist/impl/child_accessors.d.ts +43 -0
  320. package/dist/impl/child_accessors.js +222 -0
  321. package/dist/impl/child_accessors.js.map +1 -0
  322. package/dist/impl/data_access/add_dataItem_stuff.js.map +1 -0
  323. package/dist/impl/data_access/adjust_datavalue_status_code.d.ts +7 -0
  324. package/dist/impl/data_access/adjust_datavalue_status_code.js.map +1 -0
  325. package/dist/impl/data_access/ua_multistate_discrete_impl.d.ts +38 -0
  326. package/dist/impl/data_access/ua_multistate_discrete_impl.js +143 -0
  327. package/dist/impl/data_access/ua_multistate_discrete_impl.js.map +1 -0
  328. package/dist/impl/data_access/ua_multistate_value_discrete_impl.d.ts +61 -0
  329. package/dist/impl/data_access/ua_multistate_value_discrete_impl.js +303 -0
  330. package/dist/impl/data_access/ua_multistate_value_discrete_impl.js.map +1 -0
  331. package/dist/impl/data_access/ua_two_state_discrete_impl.d.ts +30 -0
  332. package/dist/impl/data_access/ua_two_state_discrete_impl.js +164 -0
  333. package/dist/impl/data_access/ua_two_state_discrete_impl.js.map +1 -0
  334. package/dist/impl/event_data.d.ts +27 -0
  335. package/dist/impl/event_data.js +73 -0
  336. package/dist/impl/event_data.js.map +1 -0
  337. package/dist/impl/event_layout.d.ts +40 -0
  338. package/dist/impl/event_layout.js +103 -0
  339. package/dist/impl/event_layout.js.map +1 -0
  340. package/dist/impl/extension_object_array_node.d.ts +41 -0
  341. package/dist/impl/extension_object_array_node.js +274 -0
  342. package/dist/impl/extension_object_array_node.js.map +1 -0
  343. package/dist/impl/get_basic_datatype.js.map +1 -0
  344. package/dist/impl/handle_hierarchy_parent.d.ts +33 -0
  345. package/dist/impl/handle_hierarchy_parent.js +103 -0
  346. package/dist/impl/handle_hierarchy_parent.js.map +1 -0
  347. package/dist/impl/historical_access/address_space_historical_data_node.d.ts +21 -0
  348. package/dist/impl/historical_access/address_space_historical_data_node.js +658 -0
  349. package/dist/impl/historical_access/address_space_historical_data_node.js.map +1 -0
  350. package/dist/impl/historizer_factory.d.ts +18 -0
  351. package/dist/impl/historizer_factory.js +16 -0
  352. package/dist/impl/historizer_factory.js.map +1 -0
  353. package/dist/impl/idx_iterator.js.map +1 -0
  354. package/dist/impl/namespace_impl.d.ts +469 -0
  355. package/dist/impl/namespace_impl.js +1845 -0
  356. package/dist/impl/namespace_impl.js.map +1 -0
  357. package/dist/impl/namespace_private.d.ts +25 -0
  358. package/dist/impl/namespace_private.js.map +1 -0
  359. package/dist/impl/nodeid_manager.js +249 -0
  360. package/dist/impl/nodeid_manager.js.map +1 -0
  361. package/dist/impl/nodeset_tools/adjust_namespace_array.js.map +1 -0
  362. package/dist/impl/nodeset_tools/construct_namespace_dependency.d.ts +37 -0
  363. package/dist/impl/nodeset_tools/construct_namespace_dependency.js +352 -0
  364. package/dist/impl/nodeset_tools/construct_namespace_dependency.js.map +1 -0
  365. package/dist/impl/nodeset_tools/dump_to_bsd.d.ts +10 -0
  366. package/dist/impl/nodeset_tools/dump_to_bsd.js +176 -0
  367. package/dist/impl/nodeset_tools/dump_to_bsd.js.map +1 -0
  368. package/dist/impl/nodeset_tools/nodeset_to_records.d.ts +67 -0
  369. package/dist/impl/nodeset_tools/nodeset_to_records.js +773 -0
  370. package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -0
  371. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +28 -0
  372. package/dist/impl/nodeset_tools/nodeset_to_xml.js +1132 -0
  373. package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -0
  374. package/dist/impl/private_namespace.d.ts +5 -0
  375. package/dist/impl/private_namespace.js.map +1 -0
  376. package/dist/impl/reference_impl.d.ts +82 -0
  377. package/dist/impl/reference_impl.js +207 -0
  378. package/dist/impl/reference_impl.js.map +1 -0
  379. package/dist/impl/reference_type_version.d.ts +22 -0
  380. package/dist/impl/reference_type_version.js +22 -0
  381. package/dist/impl/reference_type_version.js.map +1 -0
  382. package/dist/impl/role_permissions.js.map +1 -0
  383. package/dist/impl/state_machine/finite_state_machine.d.ts +81 -0
  384. package/dist/impl/state_machine/finite_state_machine.js +573 -0
  385. package/dist/impl/state_machine/finite_state_machine.js.map +1 -0
  386. package/dist/impl/state_machine/ua_shelving_state_machine_ex.d.ts +64 -0
  387. package/dist/impl/state_machine/ua_shelving_state_machine_ex.js +249 -0
  388. package/dist/impl/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
  389. package/dist/impl/state_machine/ua_two_state_variable.d.ts +55 -0
  390. package/dist/impl/state_machine/ua_two_state_variable.js +323 -0
  391. package/dist/impl/state_machine/ua_two_state_variable.js.map +1 -0
  392. package/dist/impl/tool_isSubtypeOf.d.ts +18 -0
  393. package/dist/impl/tool_isSubtypeOf.js +138 -0
  394. package/dist/impl/tool_isSubtypeOf.js.map +1 -0
  395. package/dist/impl/ua_condition_type.js.map +1 -0
  396. package/dist/impl/ua_data_type_impl.d.ts +87 -0
  397. package/dist/impl/ua_data_type_impl.js +391 -0
  398. package/dist/impl/ua_data_type_impl.js.map +1 -0
  399. package/dist/impl/ua_method_impl.d.ts +48 -0
  400. package/dist/impl/ua_method_impl.js +281 -0
  401. package/dist/impl/ua_method_impl.js.map +1 -0
  402. package/dist/impl/ua_object_impl.d.ts +38 -0
  403. package/dist/impl/ua_object_impl.js +214 -0
  404. package/dist/impl/ua_object_impl.js.map +1 -0
  405. package/dist/impl/ua_object_type_impl.d.ts +55 -0
  406. package/dist/impl/ua_object_type_impl.js +131 -0
  407. package/dist/impl/ua_object_type_impl.js.map +1 -0
  408. package/dist/impl/ua_reference_type_impl.d.ts +42 -0
  409. package/dist/impl/ua_reference_type_impl.js +157 -0
  410. package/dist/impl/ua_reference_type_impl.js.map +1 -0
  411. package/dist/impl/ua_variable_impl.d.ts +391 -0
  412. package/dist/impl/ua_variable_impl.js +2001 -0
  413. package/dist/impl/ua_variable_impl.js.map +1 -0
  414. package/dist/impl/ua_variable_impl_ext_obj.d.ts +23 -0
  415. package/dist/impl/ua_variable_impl_ext_obj.js +753 -0
  416. package/dist/impl/ua_variable_impl_ext_obj.js.map +1 -0
  417. package/dist/impl/ua_variable_type_impl.d.ts +79 -0
  418. package/dist/impl/ua_variable_type_impl.js +279 -0
  419. package/dist/impl/ua_variable_type_impl.js.map +1 -0
  420. package/dist/impl/ua_view_impl.d.ts +18 -0
  421. package/dist/impl/ua_view_impl.js +45 -0
  422. package/dist/impl/ua_view_impl.js.map +1 -0
  423. package/dist/impl/validate_data_type_correctness.d.ts +6 -0
  424. package/dist/impl/validate_data_type_correctness.js +123 -0
  425. package/dist/impl/validate_data_type_correctness.js.map +1 -0
  426. package/dist/tsconfig_base.tsbuildinfo +1 -1
  427. package/distHelpers/address_space_digest.d.ts +4 -0
  428. package/distHelpers/address_space_digest.js +9 -0
  429. package/distHelpers/address_space_digest.js.map +1 -0
  430. package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
  431. package/distHelpers/assertHasMatchingReference.d.ts +1 -1
  432. package/distHelpers/boiler_system.d.ts +1 -1
  433. package/distHelpers/boiler_system.js +3 -3
  434. package/distHelpers/boiler_system.js.map +1 -1
  435. package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
  436. package/distHelpers/get_address_space_fixture.js +38 -22
  437. package/distHelpers/get_address_space_fixture.js.map +1 -1
  438. package/distHelpers/get_mini_address_space.d.ts +1 -1
  439. package/distHelpers/get_mini_address_space.js +7 -7
  440. package/distHelpers/get_mini_address_space.js.map +1 -1
  441. package/distHelpers/index.d.ts +9 -9
  442. package/distHelpers/index.js +9 -9
  443. package/distHelpers/index.js.map +1 -1
  444. package/distHelpers/mock_session.d.ts +1 -1
  445. package/distHelpers/mock_session.js +2 -2
  446. package/distHelpers/mock_session.js.map +1 -1
  447. package/distNodeJS/address_space_digest.d.ts +13 -0
  448. package/distNodeJS/address_space_digest.js +31 -0
  449. package/distNodeJS/address_space_digest.js.map +1 -0
  450. package/distNodeJS/generate_address_space.d.ts +35 -2
  451. package/distNodeJS/generate_address_space.js +201 -7
  452. package/distNodeJS/generate_address_space.js.map +1 -1
  453. package/distNodeJS/index.d.ts +3 -1
  454. package/distNodeJS/index.js +3 -1
  455. package/distNodeJS/index.js.map +1 -1
  456. package/distNodeJS/nodeset_image_file_store.d.ts +29 -0
  457. package/distNodeJS/nodeset_image_file_store.js +120 -0
  458. package/distNodeJS/nodeset_image_file_store.js.map +1 -0
  459. package/impl/_instantiate_helpers.ts +197 -0
  460. package/impl/_mandatory_child_or_requested_optional_filter.ts +100 -0
  461. package/impl/address_space.ts +1572 -0
  462. package/impl/address_space_change_event_tools.ts +177 -0
  463. package/impl/address_space_private.ts +100 -0
  464. package/impl/alarms_and_conditions/condition_info_impl.ts +45 -0
  465. package/impl/alarms_and_conditions/condition_snapshot_impl.ts +793 -0
  466. package/impl/alarms_and_conditions/deviation_alarm_helper.ts +73 -0
  467. package/impl/alarms_and_conditions/index.ts +16 -0
  468. package/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +351 -0
  469. package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +515 -0
  470. package/impl/alarms_and_conditions/ua_base_event_impl.ts +61 -0
  471. package/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +246 -0
  472. package/impl/alarms_and_conditions/ua_condition_impl.ts +1286 -0
  473. package/impl/alarms_and_conditions/ua_discrete_alarm_impl.ts +60 -0
  474. package/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +95 -0
  475. package/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +21 -0
  476. package/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +112 -0
  477. package/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +25 -0
  478. package/impl/alarms_and_conditions/ua_limit_alarm_impl.ts +265 -0
  479. package/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +94 -0
  480. package/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +232 -0
  481. package/impl/alarms_and_conditions/ua_off_normal_alarm_impl.ts +216 -0
  482. package/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +26 -0
  483. package/impl/apply_condition_refresh.ts +56 -0
  484. package/impl/base_node_impl.ts +2165 -0
  485. package/impl/base_node_private.ts +1420 -0
  486. package/impl/child_accessors.ts +239 -0
  487. package/impl/data_access/adjust_datavalue_status_code.ts +36 -0
  488. package/impl/data_access/ua_multistate_discrete_impl.ts +198 -0
  489. package/impl/data_access/ua_multistate_value_discrete_impl.ts +384 -0
  490. package/impl/data_access/ua_two_state_discrete_impl.ts +195 -0
  491. package/impl/event_data.ts +80 -0
  492. package/impl/event_layout.ts +141 -0
  493. package/impl/extension_object_array_node.ts +343 -0
  494. package/impl/handle_hierarchy_parent.ts +133 -0
  495. package/impl/historical_access/address_space_historical_data_node.ts +849 -0
  496. package/impl/historizer_factory.ts +17 -0
  497. package/impl/namespace_impl.ts +2323 -0
  498. package/impl/namespace_private.ts +68 -0
  499. package/impl/nodeid_manager.ts +293 -0
  500. package/impl/nodeset_tools/construct_namespace_dependency.ts +381 -0
  501. package/impl/nodeset_tools/dump_to_bsd.ts +210 -0
  502. package/impl/nodeset_tools/nodeset_to_records.ts +846 -0
  503. package/impl/nodeset_tools/nodeset_to_xml.ts +1326 -0
  504. package/impl/private_namespace.ts +21 -0
  505. package/impl/reference_impl.ts +244 -0
  506. package/impl/reference_type_version.ts +19 -0
  507. package/impl/state_machine/finite_state_machine.ts +676 -0
  508. package/impl/state_machine/ua_shelving_state_machine_ex.ts +356 -0
  509. package/impl/state_machine/ua_two_state_variable.ts +421 -0
  510. package/impl/tool_isSubtypeOf.ts +168 -0
  511. package/impl/ua_data_type_impl.ts +486 -0
  512. package/impl/ua_method_impl.ts +364 -0
  513. package/impl/ua_object_impl.ts +278 -0
  514. package/impl/ua_object_type_impl.ts +179 -0
  515. package/impl/ua_reference_type_impl.ts +179 -0
  516. package/impl/ua_variable_impl.ts +2559 -0
  517. package/impl/ua_variable_impl_ext_obj.ts +904 -0
  518. package/impl/ua_variable_type_impl.ts +390 -0
  519. package/impl/ua_view_impl.ts +53 -0
  520. package/impl/validate_data_type_correctness.ts +142 -0
  521. package/package.json +49 -44
  522. package/source_nodejs/address_space_digest.ts +35 -0
  523. package/source_nodejs/generate_address_space.ts +181 -8
  524. package/source_nodejs/index.ts +3 -1
  525. package/source_nodejs/nodeset_image_file_store.ts +127 -0
  526. package/dist/source/address_space_ts.d.ts +0 -128
  527. package/dist/source/address_space_ts.js +0 -23
  528. package/dist/source/address_space_ts.js.map +0 -1
  529. package/dist/source/continuation_points/continuation_point_manager.js +0 -230
  530. package/dist/source/continuation_points/continuation_point_manager.js.map +0 -1
  531. package/dist/source/helpers/adjust_browse_direction.js.map +0 -1
  532. package/dist/source/helpers/argument_list.js +0 -263
  533. package/dist/source/helpers/argument_list.js.map +0 -1
  534. package/dist/source/helpers/call_helpers.js +0 -80
  535. package/dist/source/helpers/call_helpers.js.map +0 -1
  536. package/dist/source/helpers/coerce_enum_value.d.ts +0 -6
  537. package/dist/source/helpers/coerce_enum_value.js.map +0 -1
  538. package/dist/source/helpers/dump_tools.js +0 -81
  539. package/dist/source/helpers/dump_tools.js.map +0 -1
  540. package/dist/source/helpers/ensure_secure_access.d.ts +0 -9
  541. package/dist/source/helpers/ensure_secure_access.js +0 -58
  542. package/dist/source/helpers/ensure_secure_access.js.map +0 -1
  543. package/dist/source/helpers/make_optionals_map.js.map +0 -1
  544. package/dist/source/helpers/multiform_func.js +0 -75
  545. package/dist/source/helpers/multiform_func.js.map +0 -1
  546. package/dist/source/helpers/resolve_opaque_on_address_space.js +0 -25
  547. package/dist/source/helpers/resolve_opaque_on_address_space.js.map +0 -1
  548. package/dist/source/index.d.ts +0 -66
  549. package/dist/source/index.js +0 -97
  550. package/dist/source/index.js.map +0 -1
  551. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +0 -21
  552. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +0 -3
  553. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +0 -1
  554. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +0 -150
  555. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +0 -1
  556. package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +0 -12
  557. package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js.map +0 -1
  558. package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js.map +0 -1
  559. package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +0 -7
  560. package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +0 -1
  561. package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +0 -1
  562. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +0 -4
  563. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +0 -1
  564. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +0 -4
  565. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +0 -1
  566. package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +0 -10
  567. package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +0 -1
  568. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +0 -4
  569. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +0 -1
  570. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +0 -4
  571. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +0 -1
  572. package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +0 -20
  573. package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +0 -1
  574. package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +0 -21
  575. package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +0 -1
  576. package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +0 -33
  577. package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +0 -1
  578. package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +0 -1
  579. package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +0 -19
  580. package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +0 -1
  581. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +0 -44
  582. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js.map +0 -1
  583. package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +0 -4
  584. package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +0 -1
  585. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +0 -5
  586. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +0 -1
  587. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +0 -19
  588. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +0 -1
  589. package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +0 -25
  590. package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +0 -1
  591. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +0 -8
  592. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +0 -1
  593. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +0 -10
  594. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +0 -1
  595. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +0 -44
  596. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +0 -1
  597. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +0 -22
  598. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +0 -1
  599. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +0 -13
  600. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +0 -1
  601. package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +0 -1
  602. package/dist/source/interfaces/extension_object_constructor.js.map +0 -1
  603. package/dist/source/interfaces/i_condition_variable_type_setter_options.js.map +0 -1
  604. package/dist/source/interfaces/i_set_state_options.js.map +0 -1
  605. package/dist/source/interfaces/nodeset_loader_options.d.ts +0 -37
  606. package/dist/source/interfaces/nodeset_loader_options.js.map +0 -1
  607. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +0 -12
  608. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +0 -1
  609. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +0 -49
  610. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +0 -1
  611. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +0 -11
  612. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +0 -1
  613. package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +0 -29
  614. package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +0 -1
  615. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +0 -236
  616. package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +0 -1
  617. package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +0 -1
  618. package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +0 -1
  619. package/dist/source/loader/decode_xml_extension_object.d.ts +0 -6
  620. package/dist/source/loader/decode_xml_extension_object.js +0 -69
  621. package/dist/source/loader/decode_xml_extension_object.js.map +0 -1
  622. package/dist/source/loader/ensure_datatype_extracted.js +0 -88
  623. package/dist/source/loader/ensure_datatype_extracted.js.map +0 -1
  624. package/dist/source/loader/generateAddressSpaceRaw.d.ts +0 -29
  625. package/dist/source/loader/generateAddressSpaceRaw.js +0 -188
  626. package/dist/source/loader/generateAddressSpaceRaw.js.map +0 -1
  627. package/dist/source/loader/load_nodeset2.d.ts +0 -15
  628. package/dist/source/loader/load_nodeset2.js +0 -1047
  629. package/dist/source/loader/load_nodeset2.js.map +0 -1
  630. package/dist/source/loader/make_semver_compatible.js.map +0 -1
  631. package/dist/source/loader/make_xml_extension_object_parser.js +0 -422
  632. package/dist/source/loader/make_xml_extension_object_parser.js.map +0 -1
  633. package/dist/source/loader/namespace_post_step.js +0 -57
  634. package/dist/source/loader/namespace_post_step.js.map +0 -1
  635. package/dist/source/loader/parsers/extension_object_parser.js +0 -274
  636. package/dist/source/loader/parsers/extension_object_parser.js.map +0 -1
  637. package/dist/source/loader/parsers/localized_text_parser.js.map +0 -1
  638. package/dist/source/loader/parsers/nodeid_parser.js.map +0 -1
  639. package/dist/source/loader/parsers/qualified_name_parser.js.map +0 -1
  640. package/dist/source/loader/parsers/variant_parser.d.ts +0 -35
  641. package/dist/source/loader/parsers/variant_parser.js +0 -331
  642. package/dist/source/loader/parsers/variant_parser.js.map +0 -1
  643. package/dist/source/loader/register_node_promoter.d.ts +0 -2
  644. package/dist/source/loader/register_node_promoter.js +0 -9
  645. package/dist/source/loader/register_node_promoter.js.map +0 -1
  646. package/dist/source/namespace.d.ts +0 -6
  647. package/dist/source/namespace.js.map +0 -1
  648. package/dist/source/namespace_alarm_and_condition.d.ts +0 -33
  649. package/dist/source/namespace_alarm_and_condition.js.map +0 -1
  650. package/dist/source/namespace_data_access.d.ts +0 -67
  651. package/dist/source/namespace_data_access.js.map +0 -1
  652. package/dist/source/namespace_machine_state.d.ts +0 -8
  653. package/dist/source/namespace_machine_state.js.map +0 -1
  654. package/dist/source/pseudo_session.d.ts +0 -74
  655. package/dist/source/pseudo_session.js +0 -308
  656. package/dist/source/pseudo_session.js.map +0 -1
  657. package/dist/source/session_context.d.ts +0 -241
  658. package/dist/source/session_context.js +0 -517
  659. package/dist/source/session_context.js.map +0 -1
  660. package/dist/source/set_namespace_meta_data.js.map +0 -1
  661. package/dist/source/ua_addin.js.map +0 -1
  662. package/dist/source/ua_interface.js +0 -25
  663. package/dist/source/ua_interface.js.map +0 -1
  664. package/dist/source/ua_root_folder.js.map +0 -1
  665. package/dist/source/ua_two_state_variable_ex.d.ts +0 -24
  666. package/dist/source/ua_two_state_variable_ex.js.map +0 -1
  667. package/dist/source/xml_writer.js.map +0 -1
  668. package/dist/src/_instantiate_helpers.js +0 -99
  669. package/dist/src/_instantiate_helpers.js.map +0 -1
  670. package/dist/src/_mandatory_child_or_requested_optional_filter.js +0 -82
  671. package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +0 -1
  672. package/dist/src/address_space.d.ts +0 -369
  673. package/dist/src/address_space.js +0 -1416
  674. package/dist/src/address_space.js.map +0 -1
  675. package/dist/src/address_space_change_event_tools.d.ts +0 -6
  676. package/dist/src/address_space_change_event_tools.js.map +0 -1
  677. package/dist/src/address_space_private.d.ts +0 -45
  678. package/dist/src/address_space_private.js.map +0 -1
  679. package/dist/src/alarms_and_conditions/condition.js.map +0 -1
  680. package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +0 -18
  681. package/dist/src/alarms_and_conditions/condition_info_impl.js +0 -38
  682. package/dist/src/alarms_and_conditions/condition_info_impl.js.map +0 -1
  683. package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +0 -269
  684. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +0 -699
  685. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +0 -1
  686. package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +0 -12
  687. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +0 -66
  688. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +0 -1
  689. package/dist/src/alarms_and_conditions/index.d.ts +0 -16
  690. package/dist/src/alarms_and_conditions/index.js +0 -33
  691. package/dist/src/alarms_and_conditions/index.js.map +0 -1
  692. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +0 -42
  693. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +0 -243
  694. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +0 -1
  695. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +0 -80
  696. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +0 -415
  697. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +0 -1
  698. package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +0 -18
  699. package/dist/src/alarms_and_conditions/ua_base_event_impl.js +0 -33
  700. package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +0 -1
  701. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +0 -44
  702. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -203
  703. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +0 -1
  704. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -104
  705. package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -1017
  706. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +0 -1
  707. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +0 -19
  708. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +0 -39
  709. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +0 -1
  710. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +0 -25
  711. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +0 -55
  712. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +0 -1
  713. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +0 -11
  714. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +0 -12
  715. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +0 -1
  716. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -23
  717. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -87
  718. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +0 -1
  719. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +0 -10
  720. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +0 -8
  721. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +0 -1
  722. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -26
  723. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -208
  724. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +0 -1
  725. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +0 -23
  726. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +0 -55
  727. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +0 -1
  728. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +0 -27
  729. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -173
  730. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +0 -1
  731. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -43
  732. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -168
  733. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +0 -1
  734. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +0 -18
  735. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +0 -18
  736. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +0 -1
  737. package/dist/src/apply_condition_refresh.d.ts +0 -4
  738. package/dist/src/apply_condition_refresh.js +0 -27
  739. package/dist/src/apply_condition_refresh.js.map +0 -1
  740. package/dist/src/base_node_impl.d.ts +0 -287
  741. package/dist/src/base_node_impl.js +0 -1538
  742. package/dist/src/base_node_impl.js.map +0 -1
  743. package/dist/src/base_node_private.d.ts +0 -87
  744. package/dist/src/base_node_private.js +0 -925
  745. package/dist/src/base_node_private.js.map +0 -1
  746. package/dist/src/check_value_rank_compatibility.js.map +0 -1
  747. package/dist/src/data_access/add_dataItem_stuff.js.map +0 -1
  748. package/dist/src/data_access/adjust_datavalue_status_code.d.ts +0 -7
  749. package/dist/src/data_access/adjust_datavalue_status_code.js.map +0 -1
  750. package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +0 -35
  751. package/dist/src/data_access/ua_multistate_discrete_impl.js +0 -142
  752. package/dist/src/data_access/ua_multistate_discrete_impl.js.map +0 -1
  753. package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +0 -51
  754. package/dist/src/data_access/ua_multistate_value_discrete_impl.js +0 -302
  755. package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +0 -1
  756. package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +0 -20
  757. package/dist/src/data_access/ua_two_state_discrete_impl.js +0 -163
  758. package/dist/src/data_access/ua_two_state_discrete_impl.js.map +0 -1
  759. package/dist/src/event_data.d.ts +0 -18
  760. package/dist/src/event_data.js +0 -70
  761. package/dist/src/event_data.js.map +0 -1
  762. package/dist/src/extension_object_array_node.d.ts +0 -34
  763. package/dist/src/extension_object_array_node.js +0 -262
  764. package/dist/src/extension_object_array_node.js.map +0 -1
  765. package/dist/src/get_basic_datatype.js.map +0 -1
  766. package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -21
  767. package/dist/src/historical_access/address_space_historical_data_node.js +0 -654
  768. package/dist/src/historical_access/address_space_historical_data_node.js.map +0 -1
  769. package/dist/src/idx_iterator.js.map +0 -1
  770. package/dist/src/index_current.d.ts +0 -50
  771. package/dist/src/index_current.js +0 -82
  772. package/dist/src/index_current.js.map +0 -1
  773. package/dist/src/namespace_impl.d.ts +0 -450
  774. package/dist/src/namespace_impl.js +0 -1876
  775. package/dist/src/namespace_impl.js.map +0 -1
  776. package/dist/src/namespace_private.d.ts +0 -31
  777. package/dist/src/namespace_private.js.map +0 -1
  778. package/dist/src/nodeid_manager.js +0 -249
  779. package/dist/src/nodeid_manager.js.map +0 -1
  780. package/dist/src/nodeset_tools/adjust_namespace_array.js.map +0 -1
  781. package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +0 -33
  782. package/dist/src/nodeset_tools/construct_namespace_dependency.js +0 -347
  783. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +0 -1
  784. package/dist/src/nodeset_tools/dump_to_bsd.d.ts +0 -2
  785. package/dist/src/nodeset_tools/dump_to_bsd.js +0 -164
  786. package/dist/src/nodeset_tools/dump_to_bsd.js.map +0 -1
  787. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +0 -12
  788. package/dist/src/nodeset_tools/nodeset_to_xml.js +0 -1381
  789. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +0 -1
  790. package/dist/src/private_namespace.d.ts +0 -5
  791. package/dist/src/private_namespace.js.map +0 -1
  792. package/dist/src/reference_impl.d.ts +0 -43
  793. package/dist/src/reference_impl.js +0 -152
  794. package/dist/src/reference_impl.js.map +0 -1
  795. package/dist/src/role_permissions.js.map +0 -1
  796. package/dist/src/state_machine/finite_state_machine.d.ts +0 -70
  797. package/dist/src/state_machine/finite_state_machine.js +0 -574
  798. package/dist/src/state_machine/finite_state_machine.js.map +0 -1
  799. package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +0 -39
  800. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +0 -249
  801. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +0 -1
  802. package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -55
  803. package/dist/src/state_machine/ua_two_state_variable.js +0 -323
  804. package/dist/src/state_machine/ua_two_state_variable.js.map +0 -1
  805. package/dist/src/tool_isSubtypeOf.d.ts +0 -18
  806. package/dist/src/tool_isSubtypeOf.js +0 -130
  807. package/dist/src/tool_isSubtypeOf.js.map +0 -1
  808. package/dist/src/ua_condition_type.js.map +0 -1
  809. package/dist/src/ua_data_type_impl.d.ts +0 -87
  810. package/dist/src/ua_data_type_impl.js +0 -393
  811. package/dist/src/ua_data_type_impl.js.map +0 -1
  812. package/dist/src/ua_method_impl.d.ts +0 -48
  813. package/dist/src/ua_method_impl.js +0 -280
  814. package/dist/src/ua_method_impl.js.map +0 -1
  815. package/dist/src/ua_object_impl.d.ts +0 -38
  816. package/dist/src/ua_object_impl.js +0 -214
  817. package/dist/src/ua_object_impl.js.map +0 -1
  818. package/dist/src/ua_object_type_impl.d.ts +0 -55
  819. package/dist/src/ua_object_type_impl.js +0 -131
  820. package/dist/src/ua_object_type_impl.js.map +0 -1
  821. package/dist/src/ua_reference_type_impl.d.ts +0 -42
  822. package/dist/src/ua_reference_type_impl.js +0 -146
  823. package/dist/src/ua_reference_type_impl.js.map +0 -1
  824. package/dist/src/ua_variable_impl.d.ts +0 -379
  825. package/dist/src/ua_variable_impl.js +0 -1940
  826. package/dist/src/ua_variable_impl.js.map +0 -1
  827. package/dist/src/ua_variable_impl_ext_obj.d.ts +0 -23
  828. package/dist/src/ua_variable_impl_ext_obj.js +0 -752
  829. package/dist/src/ua_variable_impl_ext_obj.js.map +0 -1
  830. package/dist/src/ua_variable_type_impl.d.ts +0 -79
  831. package/dist/src/ua_variable_type_impl.js +0 -276
  832. package/dist/src/ua_variable_type_impl.js.map +0 -1
  833. package/dist/src/ua_view_impl.d.ts +0 -18
  834. package/dist/src/ua_view_impl.js +0 -45
  835. package/dist/src/ua_view_impl.js.map +0 -1
  836. package/dist/src/validate_data_type_correctness.d.ts +0 -6
  837. package/dist/src/validate_data_type_correctness.js +0 -106
  838. package/dist/src/validate_data_type_correctness.js.map +0 -1
  839. package/source/address_space_ts.ts +0 -220
  840. package/source/continuation_points/continuation_point_manager.ts +0 -271
  841. package/source/helpers/argument_list.ts +0 -310
  842. package/source/helpers/call_helpers.ts +0 -100
  843. package/source/helpers/coerce_enum_value.ts +0 -33
  844. package/source/helpers/dump_tools.ts +0 -90
  845. package/source/helpers/ensure_secure_access.ts +0 -57
  846. package/source/helpers/multiform_func.ts +0 -78
  847. package/source/helpers/resolve_opaque_on_address_space.ts +0 -26
  848. package/source/index.ts +0 -72
  849. package/source/interfaces/alarms_and_conditions/condition_info_i.ts +0 -24
  850. package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +0 -235
  851. package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +0 -16
  852. package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +0 -8
  853. package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +0 -6
  854. package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +0 -6
  855. package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +0 -13
  856. package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +0 -6
  857. package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +0 -6
  858. package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +0 -21
  859. package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +0 -28
  860. package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +0 -43
  861. package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +0 -36
  862. package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +0 -55
  863. package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +0 -17
  864. package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +0 -21
  865. package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +0 -21
  866. package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +0 -26
  867. package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +0 -29
  868. package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +0 -25
  869. package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +0 -57
  870. package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +0 -31
  871. package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +0 -15
  872. package/source/interfaces/nodeset_loader_options.ts +0 -38
  873. package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +0 -20
  874. package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +0 -50
  875. package/source/interfaces/state_machine/ua_program_state_machine_type.ts +0 -14
  876. package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +0 -35
  877. package/source/interfaces/state_machine/ua_state_machine_type.ts +0 -288
  878. package/source/loader/decode_xml_extension_object.ts +0 -80
  879. package/source/loader/ensure_datatype_extracted.ts +0 -122
  880. package/source/loader/generateAddressSpaceRaw.ts +0 -219
  881. package/source/loader/load_nodeset2.ts +0 -1275
  882. package/source/loader/make_xml_extension_object_parser.ts +0 -524
  883. package/source/loader/namespace_post_step.ts +0 -68
  884. package/source/loader/parsers/extension_object_parser.ts +0 -374
  885. package/source/loader/parsers/variant_parser.ts +0 -433
  886. package/source/loader/register_node_promoter.ts +0 -6
  887. package/source/namespace.ts +0 -7
  888. package/source/namespace_alarm_and_condition.ts +0 -78
  889. package/source/namespace_data_access.ts +0 -92
  890. package/source/namespace_machine_state.ts +0 -20
  891. package/source/pseudo_session.ts +0 -415
  892. package/source/session_context.ts +0 -717
  893. package/source/ua_interface.ts +0 -38
  894. package/source/ua_two_state_variable_ex.ts +0 -36
  895. package/src/_instantiate_helpers.ts +0 -197
  896. package/src/_mandatory_child_or_requested_optional_filter.ts +0 -100
  897. package/src/address_space.ts +0 -1631
  898. package/src/address_space_change_event_tools.ts +0 -177
  899. package/src/address_space_private.ts +0 -96
  900. package/src/alarms_and_conditions/condition_info_impl.ts +0 -44
  901. package/src/alarms_and_conditions/condition_snapshot_impl.ts +0 -792
  902. package/src/alarms_and_conditions/deviation_alarm_helper.ts +0 -73
  903. package/src/alarms_and_conditions/index.ts +0 -16
  904. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +0 -331
  905. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +0 -479
  906. package/src/alarms_and_conditions/ua_base_event_impl.ts +0 -42
  907. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +0 -244
  908. package/src/alarms_and_conditions/ua_condition_impl.ts +0 -1261
  909. package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +0 -57
  910. package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +0 -94
  911. package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +0 -20
  912. package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +0 -109
  913. package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +0 -25
  914. package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +0 -244
  915. package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +0 -88
  916. package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +0 -223
  917. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -218
  918. package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +0 -26
  919. package/src/apply_condition_refresh.ts +0 -29
  920. package/src/base_node_impl.ts +0 -1907
  921. package/src/base_node_private.ts +0 -1287
  922. package/src/data_access/adjust_datavalue_status_code.ts +0 -36
  923. package/src/data_access/ua_multistate_discrete_impl.ts +0 -189
  924. package/src/data_access/ua_multistate_value_discrete_impl.ts +0 -369
  925. package/src/data_access/ua_two_state_discrete_impl.ts +0 -184
  926. package/src/event_data.ts +0 -83
  927. package/src/extension_object_array_node.ts +0 -331
  928. package/src/historical_access/address_space_historical_data_node.ts +0 -842
  929. package/src/index_current.ts +0 -51
  930. package/src/namespace_impl.ts +0 -2380
  931. package/src/namespace_private.ts +0 -77
  932. package/src/nodeid_manager.ts +0 -293
  933. package/src/nodeset_tools/construct_namespace_dependency.ts +0 -375
  934. package/src/nodeset_tools/dump_to_bsd.ts +0 -201
  935. package/src/nodeset_tools/nodeset_to_xml.ts +0 -1652
  936. package/src/private_namespace.ts +0 -21
  937. package/src/reference_impl.ts +0 -171
  938. package/src/state_machine/finite_state_machine.ts +0 -668
  939. package/src/state_machine/ua_shelving_state_machine_ex.ts +0 -330
  940. package/src/state_machine/ua_two_state_variable.ts +0 -421
  941. package/src/tool_isSubtypeOf.ts +0 -160
  942. package/src/ua_data_type_impl.ts +0 -483
  943. package/src/ua_method_impl.ts +0 -362
  944. package/src/ua_object_impl.ts +0 -278
  945. package/src/ua_object_type_impl.ts +0 -179
  946. package/src/ua_reference_type_impl.ts +0 -170
  947. package/src/ua_variable_impl.ts +0 -2489
  948. package/src/ua_variable_impl_ext_obj.ts +0 -903
  949. package/src/ua_variable_type_impl.ts +0 -385
  950. package/src/ua_view_impl.ts +0 -53
  951. package/src/validate_data_type_correctness.ts +0 -124
  952. /package/{source → api}/helpers/adjust_browse_direction.ts +0 -0
  953. /package/{source → api}/helpers/make_optionals_map.ts +0 -0
  954. /package/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.ts +0 -0
  955. /package/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.ts +0 -0
  956. /package/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.ts +0 -0
  957. /package/{source → api}/interfaces/data_access/ua_y_array_item_ex.ts +0 -0
  958. /package/{source → api}/interfaces/extension_object_constructor.ts +0 -0
  959. /package/{source → api}/interfaces/i_condition_variable_type_setter_options.ts +0 -0
  960. /package/{source → api}/interfaces/i_set_state_options.ts +0 -0
  961. /package/{source → api}/interfaces/state_machine/ua_transition_ex.ts +0 -0
  962. /package/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.ts +0 -0
  963. /package/{source → api}/loader/make_semver_compatible.ts +0 -0
  964. /package/{source → api}/loader/parsers/localized_text_parser.ts +0 -0
  965. /package/{source → api}/loader/parsers/nodeid_parser.ts +0 -0
  966. /package/{source → api}/loader/parsers/qualified_name_parser.ts +0 -0
  967. /package/{source → api}/set_namespace_meta_data.ts +0 -0
  968. /package/{source → api}/ua_addin.ts +0 -0
  969. /package/{source → api}/ua_root_folder.ts +0 -0
  970. /package/{source → api}/xml_writer.ts +0 -0
  971. /package/dist/{source → api}/continuation_points/continuation_point_manager.d.ts +0 -0
  972. /package/dist/{source → api}/helpers/adjust_browse_direction.d.ts +0 -0
  973. /package/dist/{source → api}/helpers/adjust_browse_direction.js +0 -0
  974. /package/dist/{source → api}/helpers/argument_list.d.ts +0 -0
  975. /package/dist/{source → api}/helpers/call_helpers.d.ts +0 -0
  976. /package/dist/{source → api}/helpers/coerce_enum_value.js +0 -0
  977. /package/dist/{source → api}/helpers/dump_tools.d.ts +0 -0
  978. /package/dist/{source → api}/helpers/make_optionals_map.d.ts +0 -0
  979. /package/dist/{source → api}/helpers/make_optionals_map.js +0 -0
  980. /package/dist/{source → api}/helpers/multiform_func.d.ts +0 -0
  981. /package/dist/{source → api}/helpers/resolve_opaque_on_address_space.d.ts +0 -0
  982. /package/dist/{source → api}/interfaces/alarms_and_conditions/condition_snapshot.js +0 -0
  983. /package/dist/{source → api}/interfaces/alarms_and_conditions/deviation_stuff.js +0 -0
  984. /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +0 -0
  985. /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.js +0 -0
  986. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +0 -0
  987. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +0 -0
  988. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.js +0 -0
  989. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +0 -0
  990. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +0 -0
  991. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +0 -0
  992. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +0 -0
  993. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +0 -0
  994. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +0 -0
  995. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +0 -0
  996. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +0 -0
  997. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +0 -0
  998. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.js +0 -0
  999. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +0 -0
  1000. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_condition_ex.js +0 -0
  1001. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -0
  1002. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +0 -0
  1003. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +0 -0
  1004. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +0 -0
  1005. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +0 -0
  1006. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +0 -0
  1007. /package/dist/{source → api}/interfaces/data_access/ua_multistate_discrete_ex.js +0 -0
  1008. /package/dist/{source → api}/interfaces/data_access/ua_multistate_value_discrete_ex.js +0 -0
  1009. /package/dist/{source → api}/interfaces/data_access/ua_two_state_discrete_ex.js +0 -0
  1010. /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.d.ts +0 -0
  1011. /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.js +0 -0
  1012. /package/dist/{source → api}/interfaces/extension_object_constructor.d.ts +0 -0
  1013. /package/dist/{source → api}/interfaces/extension_object_constructor.js +0 -0
  1014. /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.d.ts +0 -0
  1015. /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.js +0 -0
  1016. /package/dist/{source → api}/interfaces/i_set_state_options.d.ts +0 -0
  1017. /package/dist/{source → api}/interfaces/i_set_state_options.js +0 -0
  1018. /package/dist/{source → api}/interfaces/nodeset_loader_options.js +0 -0
  1019. /package/dist/{source → api}/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +0 -0
  1020. /package/dist/{source → api}/interfaces/state_machine/ua_finite_state_machine_type.js +0 -0
  1021. /package/dist/{source → api}/interfaces/state_machine/ua_program_state_machine_type.js +0 -0
  1022. /package/dist/{source → api}/interfaces/state_machine/ua_shelved_state_machine_ex.js +0 -0
  1023. /package/dist/{source → api}/interfaces/state_machine/ua_state_machine_type.js +0 -0
  1024. /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.d.ts +0 -0
  1025. /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.js +0 -0
  1026. /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +0 -0
  1027. /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.js +0 -0
  1028. /package/dist/{source → api}/loader/ensure_datatype_extracted.d.ts +0 -0
  1029. /package/dist/{source → api}/loader/make_semver_compatible.d.ts +0 -0
  1030. /package/dist/{source → api}/loader/make_semver_compatible.js +0 -0
  1031. /package/dist/{source → api}/loader/make_xml_extension_object_parser.d.ts +0 -0
  1032. /package/dist/{source → api}/loader/namespace_post_step.d.ts +0 -0
  1033. /package/dist/{source → api}/loader/parsers/extension_object_parser.d.ts +0 -0
  1034. /package/dist/{source → api}/loader/parsers/localized_text_parser.d.ts +0 -0
  1035. /package/dist/{source → api}/loader/parsers/localized_text_parser.js +0 -0
  1036. /package/dist/{source → api}/loader/parsers/nodeid_parser.d.ts +0 -0
  1037. /package/dist/{source → api}/loader/parsers/nodeid_parser.js +0 -0
  1038. /package/dist/{source → api}/loader/parsers/qualified_name_parser.d.ts +0 -0
  1039. /package/dist/{source → api}/loader/parsers/qualified_name_parser.js +0 -0
  1040. /package/dist/{source → api}/namespace.js +0 -0
  1041. /package/dist/{source → api}/namespace_alarm_and_condition.js +0 -0
  1042. /package/dist/{source → api}/namespace_data_access.js +0 -0
  1043. /package/dist/{source → api}/namespace_machine_state.js +0 -0
  1044. /package/dist/{source → api}/set_namespace_meta_data.d.ts +0 -0
  1045. /package/dist/{source → api}/set_namespace_meta_data.js +0 -0
  1046. /package/dist/{source → api}/ua_addin.d.ts +0 -0
  1047. /package/dist/{source → api}/ua_addin.js +0 -0
  1048. /package/dist/{source → api}/ua_interface.d.ts +0 -0
  1049. /package/dist/{source → api}/ua_root_folder.d.ts +0 -0
  1050. /package/dist/{source → api}/ua_root_folder.js +0 -0
  1051. /package/dist/{source → api}/ua_two_state_variable_ex.js +0 -0
  1052. /package/dist/{source → api}/xml_writer.d.ts +0 -0
  1053. /package/dist/{source → api}/xml_writer.js +0 -0
  1054. /package/dist/{src → impl}/_instantiate_helpers.d.ts +0 -0
  1055. /package/dist/{src → impl}/_mandatory_child_or_requested_optional_filter.d.ts +0 -0
  1056. /package/dist/{src → impl}/address_space_change_event_tools.js +0 -0
  1057. /package/dist/{src → impl}/address_space_private.js +0 -0
  1058. /package/dist/{src → impl}/alarms_and_conditions/condition.d.ts +0 -0
  1059. /package/dist/{src → impl}/alarms_and_conditions/condition.js +0 -0
  1060. /package/dist/{src → impl}/check_value_rank_compatibility.d.ts +0 -0
  1061. /package/dist/{src → impl}/check_value_rank_compatibility.js +0 -0
  1062. /package/dist/{src → impl}/data_access/add_dataItem_stuff.d.ts +0 -0
  1063. /package/dist/{src → impl}/data_access/add_dataItem_stuff.js +0 -0
  1064. /package/dist/{src → impl}/data_access/adjust_datavalue_status_code.js +0 -0
  1065. /package/dist/{src → impl}/get_basic_datatype.d.ts +0 -0
  1066. /package/dist/{src → impl}/get_basic_datatype.js +0 -0
  1067. /package/dist/{src → impl}/idx_iterator.d.ts +0 -0
  1068. /package/dist/{src → impl}/idx_iterator.js +0 -0
  1069. /package/dist/{src → impl}/namespace_private.js +0 -0
  1070. /package/dist/{src → impl}/nodeid_manager.d.ts +0 -0
  1071. /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.d.ts +0 -0
  1072. /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.js +0 -0
  1073. /package/dist/{src → impl}/private_namespace.js +0 -0
  1074. /package/dist/{src → impl}/role_permissions.d.ts +0 -0
  1075. /package/dist/{src → impl}/role_permissions.js +0 -0
  1076. /package/dist/{src → impl}/ua_condition_type.d.ts +0 -0
  1077. /package/dist/{src → impl}/ua_condition_type.js +0 -0
  1078. /package/{src → impl}/alarms_and_conditions/condition.ts +0 -0
  1079. /package/{src → impl}/check_value_rank_compatibility.ts +0 -0
  1080. /package/{src → impl}/data_access/add_dataItem_stuff.ts +0 -0
  1081. /package/{src → impl}/get_basic_datatype.ts +0 -0
  1082. /package/{src → impl}/idx_iterator.ts +0 -0
  1083. /package/{src → impl}/nodeset_tools/adjust_namespace_array.ts +0 -0
  1084. /package/{src → impl}/role_permissions.ts +0 -0
  1085. /package/{src → impl}/ua_condition_type.ts +0 -0
@@ -0,0 +1,2001 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UAVariableImplT = exports.UAVariableImpl = void 0;
7
+ exports.adjust_accessLevel = adjust_accessLevel;
8
+ exports.adjust_userAccessLevel = adjust_userAccessLevel;
9
+ /**
10
+ * @module node-opcua-address-space
11
+ */
12
+ const node_util_1 = require("node:util");
13
+ const chalk_1 = __importDefault(require("chalk"));
14
+ const node_opcua_address_space_base_1 = require("node-opcua-address-space-base");
15
+ const node_opcua_assert_1 = require("node-opcua-assert");
16
+ const node_opcua_data_model_1 = require("node-opcua-data-model");
17
+ const node_opcua_data_value_1 = require("node-opcua-data-value");
18
+ const node_opcua_date_time_1 = require("node-opcua-date-time");
19
+ const node_opcua_debug_1 = require("node-opcua-debug");
20
+ const node_opcua_extension_object_1 = require("node-opcua-extension-object");
21
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
22
+ const node_opcua_numeric_range_1 = require("node-opcua-numeric-range");
23
+ const node_opcua_service_write_1 = require("node-opcua-service-write");
24
+ const node_opcua_status_code_1 = require("node-opcua-status-code");
25
+ const node_opcua_types_1 = require("node-opcua-types");
26
+ const node_opcua_variant_1 = require("node-opcua-variant");
27
+ const multiform_func_js_1 = require("../api/helpers/multiform_func.js");
28
+ const session_context_js_1 = require("../api/session_context.js");
29
+ const apply_condition_refresh_js_1 = require("./apply_condition_refresh.js");
30
+ const base_node_impl_js_1 = require("./base_node_impl.js");
31
+ const base_node_private_js_1 = require("./base_node_private.js");
32
+ const adjust_datavalue_status_code_js_1 = require("./data_access/adjust_datavalue_status_code.js");
33
+ const get_basic_datatype_js_1 = require("./get_basic_datatype.js");
34
+ const ua_data_type_impl_js_1 = require("./ua_data_type_impl.js");
35
+ const ua_variable_impl_ext_obj_js_1 = require("./ua_variable_impl_ext_obj.js");
36
+ const validate_data_type_correctness_js_1 = require("./validate_data_type_correctness.js");
37
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)("ua_variable_impl");
38
+ const warningLog = (0, node_opcua_debug_1.make_warningLog)("ua_variable_impl");
39
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("ua_variable_impl");
40
+ const errorLog = (0, node_opcua_debug_1.make_errorLog)("ua_variable_impl");
41
+ const plainChalk = new Proxy(chalk_1.default, { get: () => (s) => s });
42
+ function adjust_accessLevel(accessLevel) {
43
+ const flag = (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel ?? "CurrentRead | CurrentWrite");
44
+ (0, node_opcua_assert_1.assert)(Number.isFinite(flag));
45
+ return flag;
46
+ }
47
+ function adjust_userAccessLevel(userAccessLevel, accessLevel) {
48
+ if (userAccessLevel === undefined) {
49
+ return undefined;
50
+ }
51
+ userAccessLevel = adjust_accessLevel(userAccessLevel);
52
+ accessLevel = adjust_accessLevel(accessLevel);
53
+ return (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel & userAccessLevel);
54
+ }
55
+ function adjust_samplingInterval(minimumSamplingInterval) {
56
+ (0, node_opcua_assert_1.assert)(Number.isFinite(minimumSamplingInterval));
57
+ if (minimumSamplingInterval < 0) {
58
+ return -1; // only -1 is a valid negative value for samplingInterval and means "unspecified"
59
+ }
60
+ return minimumSamplingInterval;
61
+ }
62
+ function is_Variant(v) {
63
+ return v instanceof node_opcua_variant_1.Variant;
64
+ }
65
+ function is_StatusCode(v) {
66
+ return !!(v?.constructor &&
67
+ (v instanceof node_opcua_status_code_1.StatusCode ||
68
+ v.constructor.name === "ConstantStatusCode" ||
69
+ v.constructor.name === "StatusCode" ||
70
+ v.constructor.name === "ModifiableStatusCode"));
71
+ }
72
+ function is_Variant_or_StatusCode(v) {
73
+ if (is_Variant(v)) {
74
+ // /@@assert(v.isValid());
75
+ }
76
+ return is_Variant(v) || is_StatusCode(v);
77
+ }
78
+ function default_func(dataValue1, callback1) {
79
+ return _default_writable_timestamped_set_func.call(this, dataValue1, callback1);
80
+ }
81
+ /**
82
+ * A OPCUA Variable Node
83
+ *
84
+ * @class UAVariable
85
+ * @constructor
86
+ * @extends BaseNode
87
+ * The AccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it
88
+ * contains current and/or historic data. The AccessLevel does not take any user access rights into account,
89
+ * i.e. although the Variable is writable this may be restricted to a certain user / user group.
90
+ * The AccessLevel is an 8-bit unsigned integer with the structure defined in the following table:
91
+ *
92
+ * Field Bit Description
93
+ * CurrentRead 0 Indicates if the current value is readable
94
+ * (0 means not readable, 1 means readable).
95
+ * CurrentWrite 1 Indicates if the current value is writable
96
+ * (0 means not writable, 1 means writable).
97
+ * HistoryRead 2 Indicates if the history of the value is readable
98
+ * (0 means not readable, 1 means readable).
99
+ * HistoryWrite 3 Indicates if the history of the value is writable (0 means not writable, 1 means writable).
100
+ * SemanticChange 4 Indicates if the Variable used as Property generates SemanticChangeEvents (see 9.31).
101
+ * Reserved 5:7 Reserved for future use. Shall always be zero.
102
+ *
103
+ * The first two bits also indicate if a current value of this Variable is available and the second two bits
104
+ * indicates if the history of the Variable is available via the OPC UA server.
105
+ *
106
+ */
107
+ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
108
+ // -------------- UAvaraibleImplExArray
109
+ $$variableType;
110
+ $$dataType = undefined;
111
+ $$getElementBrowseName;
112
+ $$extensionObjectArray;
113
+ $$indexPropertyName;
114
+ // --------------
115
+ nodeClass = node_opcua_data_model_1.NodeClass.Variable;
116
+ dataType;
117
+ _basicDataType;
118
+ // narrowing this to ExtensionObject breaks declaration-merging in ua_two_state_variable.ts and elsewhere
119
+ // (concrete *T variants bind $extensionObject to a different, more specific shape) — see the matching
120
+ // comment on UAVariable.$extensionObject in node-opcua-address-space-base for the documented precedent.
121
+ // biome-ignore lint/suspicious/noExplicitAny: see comment above
122
+ $extensionObject;
123
+ $set_ExtensionObject;
124
+ $historicalDataConfiguration;
125
+ varHistorian;
126
+ /**
127
+ * @internal @private
128
+ */
129
+ $dataValue;
130
+ accessLevel;
131
+ userAccessLevel;
132
+ valueRank;
133
+ minimumSamplingInterval;
134
+ historizing;
135
+ semantic_version;
136
+ arrayDimensions;
137
+ _timestamped_get_func;
138
+ _timestamped_set_func;
139
+ _get_func;
140
+ _set_func;
141
+ refreshFunc;
142
+ __waiting_callbacks;
143
+ get typeDefinitionObj() {
144
+ // c8 ignore next
145
+ if (super.typeDefinitionObj && super.typeDefinitionObj.nodeClass !== node_opcua_data_model_1.NodeClass.VariableType) {
146
+ // this could happen in faulty external nodeset and has been seen once
147
+ // in an nano server
148
+ warningLog(super.typeDefinitionObj.toString());
149
+ const baseVariableType = this.addressSpace.findVariableType("BaseVariableType");
150
+ if (!baseVariableType)
151
+ throw new Error("Cannot find BaseVariableType in address space");
152
+ return baseVariableType;
153
+ }
154
+ return super.typeDefinitionObj;
155
+ }
156
+ get typeDefinition() {
157
+ return super.typeDefinition;
158
+ }
159
+ constructor(options) {
160
+ super(options);
161
+ (0, node_opcua_variant_1.verifyRankAndDimensions)(options);
162
+ this.valueRank = options.valueRank ?? -1;
163
+ this.arrayDimensions = options.arrayDimensions ?? null;
164
+ this.dataType = this.resolveNodeId(options.dataType); // DataType (NodeId)
165
+ this.accessLevel = adjust_accessLevel(options.accessLevel);
166
+ this.userAccessLevel = adjust_userAccessLevel(options.userAccessLevel, this.accessLevel);
167
+ this.minimumSamplingInterval = adjust_samplingInterval(options.minimumSamplingInterval || 0);
168
+ this.historizing = !!options.historizing; // coerced to boolean"
169
+ // a Variant built from null takes the constructor's short path; the options form costs twice as much
170
+ this.$dataValue = new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.UncertainInitialValue, value: new node_opcua_variant_1.Variant(null) });
171
+ if (options.value) {
172
+ this.bindVariable(options.value);
173
+ }
174
+ this.setMaxListeners(5000);
175
+ this.semantic_version = 0;
176
+ }
177
+ checkAccessLevelPrivate(_context, accessLevel) {
178
+ if (this.userAccessLevel === undefined) {
179
+ return true;
180
+ }
181
+ return (this.userAccessLevel & accessLevel) === accessLevel;
182
+ }
183
+ checkPermissionPrivate(context, permission) {
184
+ if (!context)
185
+ return true;
186
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
187
+ if (context.checkPermission) {
188
+ if (!(context.checkPermission instanceof Function)) {
189
+ errorLog("context checkPermission is not a function");
190
+ return false;
191
+ }
192
+ if (!context.checkPermission(this, permission)) {
193
+ return false;
194
+ }
195
+ }
196
+ return true;
197
+ }
198
+ checkPermissionAndAccessLevelPrivate(context, permission, accessLevel) {
199
+ if (!this.checkPermissionPrivate(context, permission)) {
200
+ return false;
201
+ }
202
+ return this.checkAccessLevelPrivate(context, accessLevel);
203
+ }
204
+ isReadable(_context) {
205
+ return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentRead) === node_opcua_data_model_1.AccessLevelFlag.CurrentRead;
206
+ }
207
+ isUserReadable(context) {
208
+ if (!this.isReadable(context)) {
209
+ return false;
210
+ }
211
+ if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
212
+ return false;
213
+ }
214
+ return this.checkAccessLevelPrivate(context, node_opcua_data_model_1.AccessLevelFlag.CurrentRead);
215
+ }
216
+ isWritable(_context) {
217
+ return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentWrite) === node_opcua_data_model_1.AccessLevelFlag.CurrentWrite;
218
+ }
219
+ isUserWritable(context) {
220
+ if (!this.isWritable(context)) {
221
+ return false;
222
+ }
223
+ return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.CurrentWrite);
224
+ }
225
+ canUserReadHistory(context) {
226
+ return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.ReadHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryRead);
227
+ }
228
+ canUserWriteHistorizingAttribute(context) {
229
+ if (context && !context.checkPermission(this, node_opcua_types_1.PermissionType.WriteHistorizing)) {
230
+ return false;
231
+ }
232
+ return true;
233
+ }
234
+ canUserInsertHistory(context) {
235
+ return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.InsertHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
236
+ }
237
+ canUserModifyHistory(context) {
238
+ return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.ModifyHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
239
+ }
240
+ canUserDeleteHistory(context) {
241
+ return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.DeleteHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
242
+ }
243
+ /**
244
+ *
245
+ *
246
+ * from OPC.UA.Spec 1.02 part 4
247
+ * 5.10.2.4 StatusCodes
248
+ * Table 51 defines values for the operation level statusCode contained in the DataValue structure of
249
+ * each values element. Common StatusCodes are defined in Table 166.
250
+ *
251
+ * Table 51 Read Operation Level Result Codes
252
+ *
253
+ * | Symbolic Id | Description
254
+ * |-----------------------------|---------------------------------------------------------------------------------------------|
255
+ * |BadNodeIdInvalid | The syntax of the node id is not valid.|
256
+ * |BadNodeIdUnknown |The node id refers to a node that does not exist in the server address space.|
257
+ * |BadAttributeIdInvalid | BadAttributeIdInvalid The attribute is not supported for the specified node.|
258
+ * |BadIndexRangeInvalid | The syntax of the index range parameter is invalid.|
259
+ * |BadIndexRangeNoData | No data exists within the range of indexes specified.|
260
+ * |BadDataEncodingInvalid | The data encoding is invalid.|
261
+ * | | This result is used if no dataEncoding can be applied because an Attribute other|
262
+ * | | than Value was requested or the DataType of the Value Attribute is not a subtype|
263
+ * | | of the Structure DataType.|
264
+ * |BadDataEncodingUnsupported | The server does not support the requested data encoding for the node. |
265
+ * | | This result is used if a dataEncoding can be applied but the passed data encoding |
266
+ * | | is not known to the Server. |
267
+ * |BadNotReadable | The access level does not allow reading or subscribing to the Node.|
268
+ * |BadUserAccessDenied | User does not have permission to perform the requested operation. (table 165)|
269
+ */
270
+ readValue(context, indexRange, dataEncoding) {
271
+ if (!context) {
272
+ context = session_context_js_1.SessionContext.defaultContext;
273
+ }
274
+ if (context.isAccessRestricted(this)) {
275
+ return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadSecurityModeInsufficient });
276
+ }
277
+ if (!this.isReadable(context)) {
278
+ return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable });
279
+ }
280
+ if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
281
+ return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied });
282
+ }
283
+ if (!this.isUserReadable(context)) {
284
+ return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable });
285
+ }
286
+ if (!(0, node_opcua_data_model_1.isValidDataEncoding)(dataEncoding)) {
287
+ // Table 51: no encoding can be applied to a non-Structure value. The CTT
288
+ // (Attribute Read 037) still expects the requested timestamps on this Bad
289
+ // result, and a DataValue may carry them whatever its status.
290
+ return (0, node_opcua_data_value_1.makeNowDataValue)({ statusCode: node_opcua_status_code_1.StatusCodes.BadDataEncodingInvalid });
291
+ }
292
+ if (this._timestamped_get_func) {
293
+ if (this._timestamped_get_func.length === 0) {
294
+ const dataValueOrPromise = this._timestamped_get_func();
295
+ if (!Object.hasOwn(dataValueOrPromise.constructor.prototype, "then")) {
296
+ if (dataValueOrPromise !== this.$dataValue) {
297
+ // we may have a problem here if we use a getter that returns a dataValue that is a ExtensionObject
298
+ if (dataValueOrPromise.value?.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
299
+ if (this.$extensionObject || this.$$extensionObjectArray) {
300
+ // we have an extension object already bound to this node
301
+ // the client is asking us to replace the object entirely by a new one
302
+ // const ext = dataValue.value.value;
303
+ this._internal_set_dataValue(dataValueOrPromise);
304
+ return dataValueOrPromise;
305
+ }
306
+ }
307
+ // TO DO : is this necessary ? this may interfere with current use of $dataValue
308
+ this.$dataValue = dataValueOrPromise;
309
+ if (this.$dataValue.statusCode.isGoodish()) {
310
+ this.verifyVariantCompatibility(this.$dataValue.value);
311
+ }
312
+ }
313
+ }
314
+ else {
315
+ errorLog("[NODE-OPCUA-E28] Unsupported: _timestamped_get_func returns a Promise ! , when the uaVariable has an async getter. Fix your application code.");
316
+ }
317
+ }
318
+ }
319
+ let dataValue = this.$dataValue;
320
+ if (dataValue.statusCode.isGoodish()) {
321
+ // note : extractRange will clone the dataValue
322
+ dataValue = (0, node_opcua_data_value_1.extractRange)(dataValue, indexRange);
323
+ }
324
+ /* c8 ignore next */
325
+ if (dataValue.statusCode.equals(node_opcua_status_code_1.StatusCodes.BadWaitingForInitialData) ||
326
+ dataValue.statusCode.equals(node_opcua_status_code_1.StatusCodes.UncertainInitialValue)) {
327
+ // c8 ignore next
328
+ doDebug &&
329
+ debugLog(chalk_1.default.red(" Warning: UAVariable#readValue ") +
330
+ chalk_1.default.cyan(this.browseName.toString()) +
331
+ " (" +
332
+ chalk_1.default.yellow(this.nodeId.toString()) +
333
+ ") exists but dataValue has not been defined");
334
+ }
335
+ return dataValue;
336
+ }
337
+ isEnumeration() {
338
+ return this.addressSpacePrivate.isEnumeration(this.dataType);
339
+ }
340
+ /**
341
+ * return true if the DataType is of type Extension object
342
+ * this is not taking into account the valueRank of the variable
343
+ */
344
+ isExtensionObject() {
345
+ // DataType must be one of Structure
346
+ if (this.dataType.isEmpty())
347
+ return false;
348
+ const dataTypeNode = this.addressSpace.findDataType(this.dataType);
349
+ if (!dataTypeNode) {
350
+ throw new Error(` Cannot find DataType ${this.dataType.toString()} in standard address Space`);
351
+ }
352
+ const structureNode = this.addressSpace.findDataType("Structure");
353
+ if (!structureNode) {
354
+ throw new Error(" Cannot find 'Structure' DataType in standard address Space");
355
+ }
356
+ return dataTypeNode.isSubtypeOf(structureNode);
357
+ }
358
+ _getEnumerationInfo() {
359
+ // DataType must be one of Enumeration
360
+ (0, node_opcua_assert_1.assert)(this.isEnumeration(), "Variable is not an enumeration");
361
+ const dataTypeNode = this.addressSpace.findDataType(this.dataType);
362
+ return dataTypeNode._getEnumerationInfo();
363
+ }
364
+ asyncRefresh(oldestDate, callback) {
365
+ // asyncRefresh is always invoked with a callback at runtime: the public overload without
366
+ // a callback is only reachable through the withCallback() wrapper installed below, which
367
+ // synthesizes one before calling into this implementation.
368
+ const cb = callback;
369
+ if (this.$dataValue.statusCode.isGoodish()) {
370
+ this.verifyVariantCompatibility(this.$dataValue.value);
371
+ }
372
+ const lessOrEqual = (a, b) => {
373
+ return (a.timestamp.getTime() < b.timestamp.getTime() ||
374
+ (a.timestamp.getTime() === b.timestamp.getTime() && a.picoseconds <= b.picoseconds));
375
+ };
376
+ if (!this.refreshFunc) {
377
+ // no refresh func
378
+ const dataValue = this.readValue();
379
+ dataValue.serverTimestamp = oldestDate.timestamp;
380
+ dataValue.serverPicoseconds = oldestDate.picoseconds;
381
+ const serverClock = (0, node_opcua_date_time_1.coerceClock)(dataValue.serverTimestamp, dataValue.serverPicoseconds);
382
+ if (lessOrEqual(oldestDate, serverClock)) {
383
+ cb(null, dataValue);
384
+ return;
385
+ }
386
+ else {
387
+ // fake
388
+ cb(null, dataValue);
389
+ return;
390
+ }
391
+ }
392
+ const c1 = this.$dataValue.serverTimestamp
393
+ ? (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.serverTimestamp, this.$dataValue.serverPicoseconds)
394
+ : null;
395
+ if (c1 && lessOrEqual(oldestDate, c1)) {
396
+ const dataValue = this.readValue().clone();
397
+ dataValue.serverTimestamp = oldestDate.timestamp;
398
+ dataValue.serverPicoseconds = oldestDate.picoseconds;
399
+ cb(null, dataValue);
400
+ return;
401
+ }
402
+ try {
403
+ this.refreshFunc.call(this, (err, dataValue) => {
404
+ // c8 ignore next
405
+ if (err || !dataValue) {
406
+ errorLog("-------------- refresh call failed", this.browseName.toString(), this.nodeId.toString(), err?.message);
407
+ dataValue = { statusCode: node_opcua_status_code_1.StatusCodes.BadNoDataAvailable };
408
+ }
409
+ if (dataValue && dataValue !== this.$dataValue) {
410
+ this._internal_set_dataValue(coerceDataValue(dataValue), null);
411
+ }
412
+ cb(err, this.$dataValue);
413
+ });
414
+ }
415
+ catch (err) {
416
+ errorLog("-------------- refresh call failed 2", this.browseName.toString(), this.nodeId.toString());
417
+ errorLog(err);
418
+ const dataValue = new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError });
419
+ this._internal_set_dataValue(dataValue, null);
420
+ cb(err, this.$dataValue);
421
+ }
422
+ return undefined;
423
+ }
424
+ readEnumValue() {
425
+ const value = this.readValue().value.value;
426
+ const enumInfo = this._getEnumerationInfo();
427
+ const enumV = enumInfo.valueIndex[value];
428
+ return { value, name: enumV ? enumV.name : "?????" };
429
+ }
430
+ writeEnumValue(value) {
431
+ const enumInfo = this._getEnumerationInfo();
432
+ if (typeof value === "string") {
433
+ if (!Object.hasOwn(enumInfo.nameIndex, value)) {
434
+ const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
435
+ throw new Error(`UAVariable#writeEnumValue: cannot find value ${value} in [${possibleValues}]`);
436
+ }
437
+ const valueIndex = enumInfo.nameIndex[value].value;
438
+ value = valueIndex;
439
+ }
440
+ if (Number.isFinite(value)) {
441
+ const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
442
+ if (!enumInfo.valueIndex[value]) {
443
+ throw new Error(`UAVariable#writeEnumValue : value out of range ${value} in [${possibleValues}]`);
444
+ }
445
+ this.setValueFromSource({
446
+ dataType: node_opcua_variant_1.DataType.Int32,
447
+ value
448
+ });
449
+ }
450
+ else {
451
+ throw new Error("UAVariable#writeEnumValue: value type mismatch");
452
+ }
453
+ }
454
+ readAttribute(context, attributeId, indexRange, dataEncoding) {
455
+ context = context || session_context_js_1.SessionContext.defaultContext;
456
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
457
+ const options = {};
458
+ if (attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
459
+ if (indexRange?.isDefined()) {
460
+ options.statusCode = node_opcua_status_code_1.StatusCodes.BadIndexRangeNoData;
461
+ return new node_opcua_data_value_1.DataValue(options);
462
+ }
463
+ if ((0, node_opcua_data_model_1.isDataEncoding)(dataEncoding)) {
464
+ options.statusCode = node_opcua_status_code_1.StatusCodes.BadDataEncodingInvalid;
465
+ return new node_opcua_data_value_1.DataValue(options);
466
+ }
467
+ }
468
+ switch (attributeId) {
469
+ case node_opcua_data_model_1.AttributeIds.Value:
470
+ return this.readValue(context, indexRange, dataEncoding);
471
+ case node_opcua_data_model_1.AttributeIds.DataType:
472
+ return this._readDataType();
473
+ case node_opcua_data_model_1.AttributeIds.ValueRank:
474
+ return this._readValueRank();
475
+ case node_opcua_data_model_1.AttributeIds.ArrayDimensions:
476
+ return this._readArrayDimensions();
477
+ case node_opcua_data_model_1.AttributeIds.AccessLevel:
478
+ return this._readAccessLevel(context);
479
+ case node_opcua_data_model_1.AttributeIds.UserAccessLevel:
480
+ return this._readUserAccessLevel(context);
481
+ case node_opcua_data_model_1.AttributeIds.MinimumSamplingInterval:
482
+ return this._readMinimumSamplingInterval();
483
+ case node_opcua_data_model_1.AttributeIds.Historizing:
484
+ return this._readHistorizing();
485
+ case node_opcua_data_model_1.AttributeIds.AccessLevelEx:
486
+ return this._readAccessLevelEx(context);
487
+ default:
488
+ return base_node_impl_js_1.BaseNodeImpl.prototype.readAttribute.call(this, context, attributeId);
489
+ }
490
+ }
491
+ getBasicDataType() {
492
+ return (0, get_basic_datatype_js_1._getBasicDataType)(this);
493
+ }
494
+ adjustVariant(variant) {
495
+ return (0, node_opcua_variant_1.adjustVariant)(variant, this.valueRank, this.getBasicDataType());
496
+ }
497
+ verifyVariantCompatibility(variant) {
498
+ try {
499
+ // c8 ignore next
500
+ if (Object.hasOwn(variant, "value")) {
501
+ if (variant.dataType === null || variant.dataType === undefined) {
502
+ throw new Error("Variant must provide a valid dataType : variant = " +
503
+ variant.toString() +
504
+ " this.dataType= " +
505
+ this.dataType.toString());
506
+ }
507
+ if (variant.dataType === node_opcua_variant_1.DataType.Boolean &&
508
+ (this.dataType.namespace !== 0 || this.dataType.value !== node_opcua_variant_1.DataType.Boolean)) {
509
+ throw new Error("Variant must provide a valid Boolean : variant = " +
510
+ variant.toString() +
511
+ " this.dataType= " +
512
+ this.dataType.toString());
513
+ }
514
+ if (this.dataType.namespace === 0 &&
515
+ this.dataType.value === node_opcua_variant_1.DataType.LocalizedText &&
516
+ variant.dataType !== node_opcua_variant_1.DataType.LocalizedText &&
517
+ variant.dataType !== node_opcua_variant_1.DataType.Null) {
518
+ throw new Error("Variant must provide a valid LocalizedText : variant = " +
519
+ variant.toString() +
520
+ " this.dataType= " +
521
+ this.dataType.toString());
522
+ }
523
+ }
524
+ const basicType = this.getBasicDataType();
525
+ if (basicType === node_opcua_variant_1.DataType.String && variant.dataType === node_opcua_variant_1.DataType.ByteString) {
526
+ return; // this is allowed
527
+ }
528
+ if (basicType === node_opcua_variant_1.DataType.ByteString && variant.dataType === node_opcua_variant_1.DataType.String) {
529
+ return; // this is allowed
530
+ }
531
+ if (basicType !== node_opcua_variant_1.DataType.Null &&
532
+ basicType !== node_opcua_variant_1.DataType.Variant &&
533
+ variant.dataType !== node_opcua_variant_1.DataType.Null &&
534
+ variant.dataType !== basicType) {
535
+ const message = "UAVariable.setValueFromSource " +
536
+ this.browseName.toString() +
537
+ " nodeId:" +
538
+ this.nodeId.toString() +
539
+ " dataType:" +
540
+ this.dataType.toString() +
541
+ ":\n" +
542
+ "the provided variant must have the expected dataType!\n" +
543
+ " - the expected dataType is " +
544
+ chalk_1.default.cyan(node_opcua_variant_1.DataType[basicType]) +
545
+ "\n" +
546
+ " - the actual dataType is " +
547
+ chalk_1.default.magenta(node_opcua_variant_1.DataType[variant.dataType]) +
548
+ "\n" +
549
+ " - " +
550
+ variant.toString();
551
+ throw new Error(message);
552
+ }
553
+ }
554
+ catch (err) {
555
+ errorLog("UAVariable ", err?.message, this.browseName.toString(), " nodeId=", this.nodeId.toString());
556
+ errorLog(err.message);
557
+ errorLog(err.stack);
558
+ throw err;
559
+ }
560
+ }
561
+ /**
562
+ * setValueFromSource is used to let the device sets the variable values
563
+ * this method also records the current time as sourceTimestamp and serverTimestamp.
564
+ . *
565
+ * The method will raise an exception if the value is not compatible with the dataType and expected dimension
566
+ *
567
+
568
+ * @param variant {Variant}
569
+ * @param [statusCode {StatusCode} = StatusCodes.Good]
570
+ * @param [sourceTimestamp= Now]
571
+ */
572
+ setValueFromSource(variant, statusCode, sourceTimestamp) {
573
+ try {
574
+ statusCode = statusCode || node_opcua_status_code_1.StatusCodes.Good;
575
+ const variant1 = node_opcua_variant_1.Variant.coerce(variant);
576
+ this.verifyVariantCompatibility(variant1);
577
+ const now = (0, node_opcua_date_time_1.coerceClock)(sourceTimestamp, 0);
578
+ const dataValue = new node_opcua_data_value_1.DataValue(null);
579
+ dataValue.serverPicoseconds = now.picoseconds;
580
+ dataValue.serverTimestamp = now.timestamp;
581
+ dataValue.sourcePicoseconds = now.picoseconds;
582
+ dataValue.sourceTimestamp = now.timestamp;
583
+ dataValue.statusCode = statusCode;
584
+ dataValue.value = variant1;
585
+ if (dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
586
+ // early, detailed diagnostics on a malformed extension object (the actual throw
587
+ // happens below in _internal_set_dataValue).
588
+ const valueIsCorrect = this.checkExtensionObjectIsCorrect(dataValue.value.value);
589
+ if (!valueIsCorrect) {
590
+ errorLog("setValueFromSource Invalid value !");
591
+ errorLog(this.toString());
592
+ errorLog(dataValue.toString());
593
+ }
594
+ }
595
+ // Route every value - scalar or ExtensionObject - through _internal_set_dataValue.
596
+ // This guarantees the change is consistently propagated to observers (historian,
597
+ // monitored items) and, when the node is a bound extension object (or a bound
598
+ // sub-structure child), cascaded through the proxy field setters by the overridden
599
+ // _inner_replace_dataValue. Previously ExtensionObject values were special-cased with a
600
+ // silent "this.$dataValue = dataValue" assignment that skipped notification for plain
601
+ // (unbound) extension object variables and threw on bound sub-structure children.
602
+ this._internal_set_dataValue(dataValue);
603
+ }
604
+ catch (err) {
605
+ errorLog("UAVariable#setValueFromString Error : ", this.browseName.toString(), this.nodeId.toString());
606
+ errorLog(err.message);
607
+ errorLog(this.parent?.toString());
608
+ throw err;
609
+ }
610
+ }
611
+ /**
612
+ * The initial value of a variable a nodeset file declares, or the default of its data type.
613
+ *
614
+ * What setValueFromSource does, minus what a variable nobody has seen yet cannot need: the
615
+ * clone of the previous value and the comparison with it, the change event and the touch of
616
+ * the parents. The compatibility checks stay, since a wrong <Value> in a third-party nodeset
617
+ * is exactly what they catch. A variable that is bound already (an extension object proxy,
618
+ * a setter) takes the full path.
619
+ *
620
+ * @internal
621
+ */
622
+ _setInitialDataValue(variant, statusCode = node_opcua_status_code_1.StatusCodes.Good) {
623
+ // the loader creates every variable with an empty value object, which the constructor
624
+ // binds, so a bound setter is the norm here and not a reason to take the long path:
625
+ // setValueFromSource never consults it either. A bound extension object is.
626
+ if (this.$$extensionObjectArray || this.$set_ExtensionObject) {
627
+ this.setValueFromSource(variant, statusCode);
628
+ return;
629
+ }
630
+ try {
631
+ const variant1 = node_opcua_variant_1.Variant.coerce(variant);
632
+ this.verifyVariantCompatibility(variant1);
633
+ if (variant1.dataType === node_opcua_variant_1.DataType.ExtensionObject && !this.checkExtensionObjectIsCorrect(variant1.value)) {
634
+ throw new Error("invalid extension object");
635
+ }
636
+ const now = (0, node_opcua_date_time_1.getCurrentClock)();
637
+ this.$dataValue = new node_opcua_data_value_1.DataValue({
638
+ value: variant1,
639
+ statusCode,
640
+ sourceTimestamp: now.timestamp,
641
+ sourcePicoseconds: now.picoseconds,
642
+ serverTimestamp: now.timestamp,
643
+ serverPicoseconds: now.picoseconds
644
+ });
645
+ }
646
+ catch (err) {
647
+ throw new Error(`UAVariable#_setInitialDataValue ${this.browseName.toString()} ${this.nodeId.toString()}: ${err.message}`);
648
+ }
649
+ }
650
+ adjustDataValueStatusCode(dataValue) {
651
+ const statusCode = (0, adjust_datavalue_status_code_js_1.adjustDataValueStatusCode)(this, dataValue, this.acceptValueOutOfRange || false);
652
+ return statusCode;
653
+ }
654
+ writeValue(context, dataValue, ...args) {
655
+ context = context || session_context_js_1.SessionContext.defaultContext;
656
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
657
+ if (!dataValue.sourceTimestamp) {
658
+ // source timestamp was not specified by the caller
659
+ // we will set the timestamp ourself with the current clock
660
+ if (context.currentTime) {
661
+ dataValue.sourceTimestamp = context.currentTime.timestamp;
662
+ dataValue.sourcePicoseconds = context.currentTime.picoseconds;
663
+ }
664
+ else {
665
+ const { timestamp, picoseconds } = (0, node_opcua_date_time_1.getCurrentClock)();
666
+ dataValue.sourceTimestamp = timestamp;
667
+ dataValue.sourcePicoseconds = picoseconds;
668
+ }
669
+ }
670
+ if (context.currentTime && !dataValue.serverTimestamp) {
671
+ dataValue.serverTimestamp = context.currentTime.timestamp;
672
+ dataValue.serverPicoseconds = context.currentTime.picoseconds;
673
+ }
674
+ // adjust arguments if optional indexRange Parameter is not given
675
+ let indexRange = null;
676
+ let callback;
677
+ if (args.length === 1) {
678
+ indexRange = new node_opcua_numeric_range_1.NumericRange();
679
+ callback = args[0];
680
+ }
681
+ else if (args.length === 2) {
682
+ indexRange = args[0];
683
+ callback = args[1];
684
+ }
685
+ else {
686
+ throw new Error("Invalid Number of args");
687
+ }
688
+ (0, node_opcua_assert_1.assert)(typeof callback === "function");
689
+ (0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
690
+ // index range could be string
691
+ indexRange = node_opcua_numeric_range_1.NumericRange.coerce(indexRange);
692
+ // test write permission
693
+ if (!this.isWritable(context)) {
694
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
695
+ return;
696
+ }
697
+ if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Write)) {
698
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
699
+ return;
700
+ }
701
+ // isWritable() and the role permission above already passed, so a false result
702
+ // here can only come from the UserAccessLevel attribute withholding CurrentWrite
703
+ // for this user (Part 3 5.6.3): that is an access decision, not an unsupported call.
704
+ if (!this.isUserWritable(context)) {
705
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
706
+ return;
707
+ }
708
+ // adjust special case
709
+ const variant = adjustVariant2.call(this, dataValue.value);
710
+ const statusCode = this.checkVariantCompatibility(variant);
711
+ if (statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
712
+ callback?.(null, statusCode);
713
+ return;
714
+ }
715
+ // adjust dataValue.statusCode based on InstrumentRange and EngineeringUnits
716
+ const statusCode2 = this.adjustDataValueStatusCode(dataValue);
717
+ if (statusCode2.isNotGood()) {
718
+ callback?.(null, statusCode2);
719
+ return;
720
+ }
721
+ const write_func = this._timestamped_set_func || default_func;
722
+ if (!write_func) {
723
+ warningLog(` warning ${this.nodeId.toString()} ${this.browseName.toString()} has no setter. \n`);
724
+ warningLog("Please make sure to bind the variable or to pass a valid value: new Variant({}) during construction time");
725
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
726
+ return;
727
+ }
728
+ (0, node_opcua_assert_1.assert)(write_func);
729
+ write_func.call(this, dataValue, (err, statusCode1) => {
730
+ if (!err) {
731
+ dataValue && this.verifyVariantCompatibility(dataValue.value);
732
+ if (indexRange && !indexRange.isEmpty()) {
733
+ if (!indexRange.isValid()) {
734
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadIndexRangeInvalid);
735
+ return;
736
+ }
737
+ const newArrayOrMatrix = dataValue.value.value;
738
+ if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Array) {
739
+ if (this.$dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Array) {
740
+ callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
741
+ return;
742
+ }
743
+ // check that destination data is also an array
744
+ (0, node_opcua_assert_1.assert)(check_valid_array(this.$dataValue.value.dataType, this.$dataValue.value.value));
745
+ const destArr = this.$dataValue.value.value;
746
+ const result = indexRange.set_values(destArr, newArrayOrMatrix);
747
+ if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
748
+ callback?.(null, result.statusCode);
749
+ return;
750
+ }
751
+ dataValue.value.value = result.array;
752
+ // scrap original array so we detect range
753
+ this.$dataValue.value.value = null;
754
+ }
755
+ else if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Matrix) {
756
+ const dimensions = this.$dataValue.value.dimensions;
757
+ if (this.$dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Matrix || !dimensions) {
758
+ // not a matrix !
759
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
760
+ return;
761
+ }
762
+ const matrix = this.$dataValue.value.value;
763
+ const result = indexRange.set_values_matrix({
764
+ matrix,
765
+ dimensions
766
+ }, newArrayOrMatrix);
767
+ if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
768
+ callback?.(null, result.statusCode);
769
+ return;
770
+ }
771
+ dataValue.value.dimensions = this.$dataValue.value.dimensions;
772
+ dataValue.value.value = result.matrix;
773
+ // scrap original array so we detect range
774
+ this.$dataValue.value.value = null;
775
+ }
776
+ else {
777
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
778
+ return;
779
+ }
780
+ }
781
+ try {
782
+ this._internal_set_dataValue(dataValue, indexRange);
783
+ }
784
+ catch (err) {
785
+ if (node_util_1.types.isNativeError(err)) {
786
+ warningLog(err.message);
787
+ }
788
+ callback?.(null, node_opcua_status_code_1.StatusCodes.BadInternalError);
789
+ return;
790
+ }
791
+ }
792
+ callback?.(err || null, statusCode1);
793
+ });
794
+ return undefined;
795
+ }
796
+ writeAttribute(context, writeValueOptions, callback) {
797
+ // c8 ignore next
798
+ if (!callback) {
799
+ throw new Error("Internal error");
800
+ }
801
+ if (!this.canUserWriteAttribute(context, writeValueOptions.attributeId)) {
802
+ callback(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
803
+ return;
804
+ }
805
+ const writeValue = writeValueOptions instanceof node_opcua_service_write_1.WriteValue ? writeValueOptions : new node_opcua_service_write_1.WriteValue(writeValueOptions);
806
+ context = context || session_context_js_1.SessionContext.defaultContext;
807
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
808
+ (0, node_opcua_assert_1.assert)(writeValue instanceof node_opcua_service_write_1.WriteValue);
809
+ (0, node_opcua_assert_1.assert)(writeValue.value instanceof node_opcua_data_value_1.DataValue);
810
+ (0, node_opcua_assert_1.assert)(writeValue.value?.value instanceof node_opcua_variant_1.Variant);
811
+ (0, node_opcua_assert_1.assert)(typeof callback === "function");
812
+ // Spec 1.0.2 Part 4 page 58
813
+ // If the SourceTimestamp or the ServerTimestamp is specified, the Server shall
814
+ // use these values.
815
+ // xx _apply_default_timestamps(writeValue.value);
816
+ switch (writeValue.attributeId) {
817
+ case node_opcua_data_model_1.AttributeIds.Value:
818
+ this.writeValue(context, writeValue.value, writeValue.indexRange, callback);
819
+ break;
820
+ case node_opcua_data_model_1.AttributeIds.Historizing:
821
+ if (writeValue.value?.value.dataType !== node_opcua_variant_1.DataType.Boolean) {
822
+ callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
823
+ break;
824
+ }
825
+ if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.WriteHistorizing)) {
826
+ callback(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
827
+ break;
828
+ }
829
+ if (!this.canUserWriteHistorizingAttribute(context)) {
830
+ callback(null, node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported);
831
+ break;
832
+ }
833
+ // Historizing is a real, writable attribute of a Variable (Part 3 5.6.2); a node
834
+ // without an HA Configuration simply cannot honour it right now, which is
835
+ // BadNotWritable, not BadNotSupported (that would mean the attribute never applies).
836
+ if (!this.getChildByName("HA Configuration")) {
837
+ callback(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
838
+ break;
839
+ }
840
+ // check if user is allowed to do that !
841
+ // TODO
842
+ this.historizing = !!writeValue.value?.value.value; // yes ! indeed !
843
+ callback(null, node_opcua_status_code_1.StatusCodes.Good);
844
+ break;
845
+ default:
846
+ super.writeAttribute(context, writeValue, callback);
847
+ break;
848
+ }
849
+ return undefined;
850
+ }
851
+ /**
852
+
853
+ * note:
854
+ * this method is overridden in address-space-data-access
855
+ * @return {StatusCode}
856
+ */
857
+ checkVariantCompatibility(value) {
858
+ // test dataType
859
+ if (!this._validate_DataType(value.dataType)) {
860
+ return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
861
+ }
862
+ try {
863
+ this.verifyVariantCompatibility(value);
864
+ }
865
+ catch (_err) {
866
+ return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
867
+ }
868
+ return node_opcua_status_code_1.StatusCodes.Good;
869
+ }
870
+ /**
871
+ * touch the source timestamp of a Variable and cascade up the change
872
+ * to the parent variable if any.
873
+ */
874
+ touchValue(optionalNow) {
875
+ const now = optionalNow || (0, node_opcua_date_time_1.getCurrentClock)();
876
+ (0, ua_variable_impl_ext_obj_js_1.propagateTouchValueUpward)(this, now);
877
+ }
878
+ /**
879
+ * bind a variable with a get and set functions.
880
+ *
881
+ * properties:
882
+ * - value: a Variant or a status code
883
+ * - sourceTimestamp
884
+ * - sourcePicoseconds
885
+ * @param [options.timestamped_set]
886
+ * @param [options.refreshFunc] the variable asynchronous getter function.
887
+ * @param [overwrite {Boolean} = false] set overwrite to true to overwrite existing binding
888
+ * @return void
889
+ *
890
+ *
891
+ * ### Providing read access to the underlying value
892
+ *
893
+ * #### Variation 1
894
+ *
895
+ * In this variation, the user provides a function that returns a Variant with the current value.
896
+ *
897
+ * The sourceTimestamp will be set automatically.
898
+ *
899
+ * The get function is called synchronously.
900
+ *
901
+ * @example
902
+ *
903
+ *
904
+ * ```javascript
905
+ * ...
906
+ * var options = {
907
+ * get : () => {
908
+ * return new Variant({...});
909
+ * },
910
+ * set : function(variant) {
911
+ * // store the variant somewhere
912
+ * return StatusCodes.Good;
913
+ * }
914
+ * };
915
+ * ...
916
+ * engine.bindVariable(nodeId,options):
917
+ * ...
918
+ * ```
919
+ *
920
+ *
921
+ * #### Variation 2:
922
+ *
923
+ * This variation can be used when the user wants to specify a specific '''sourceTimestamp''' associated
924
+ * with the current value of the UAVariable.
925
+ *
926
+ * The provided ```timestamped_get``` function should return an object with three properties:
927
+ * * value: containing the variant value or a error StatusCode,
928
+ * * sourceTimestamp
929
+ * * sourcePicoseconds
930
+ *
931
+ * ```javascript
932
+ * ...
933
+ * var myDataValue = new DataValue({
934
+ * value: {dataType: DataType.Double , value: 10.0},
935
+ * sourceTimestamp : new Date(),
936
+ * sourcePicoseconds: 0
937
+ * });
938
+ * ...
939
+ * var options = {
940
+ * timestamped_get : () => { return myDataValue; }
941
+ * };
942
+ * ...
943
+ * engine.bindVariable(nodeId,options):
944
+ * ...
945
+ * // record a new value
946
+ * myDataValue.value.value = 5.0;
947
+ * myDataValue.sourceTimestamp = new Date();
948
+ * ...
949
+ * ```
950
+ *
951
+ *
952
+ * #### Variation 3:
953
+ *
954
+ * This variation can be used when the value associated with the variables requires a asynchronous function call to be
955
+ * extracted. In this case, the user should provide an async method ```refreshFunc```.
956
+ *
957
+ *
958
+ * The ```refreshFunc``` shall do whatever is necessary to fetch the most up to date version of the variable value, and
959
+ * call the ```callback``` function when the data is ready.
960
+ *
961
+ *
962
+ * The ```callback``` function follow the standard callback function signature:
963
+ * * the first argument shall be **null** or **Error**, depending of the outcome of the fetch operation,
964
+ * * the second argument shall be a DataValue with the new UAVariable Value, a StatusCode, and time stamps.
965
+ *
966
+ *
967
+ * Optionally, it is possible to pass a sourceTimestamp and a sourcePicoseconds value as a third and fourth arguments
968
+ * of the callback. When sourceTimestamp and sourcePicoseconds are missing, the system will set their default value
969
+ * to the current time..
970
+ *
971
+ *
972
+ * ```javascript
973
+ * ...
974
+ * var options = {
975
+ * refreshFunc : function(callback) {
976
+ * ... do_some_async_stuff_to_get_the_new_variable_value
977
+ * var dataValue = new DataValue({
978
+ * value: new Variant({...}),
979
+ * statusCode: StatusCodes.Good,
980
+ * sourceTimestamp: new Date()
981
+ * });
982
+ * callback(null,dataValue);
983
+ * }
984
+ * };
985
+ * ...
986
+ * variable.bindVariable(nodeId,options):
987
+ * ...
988
+ * ```
989
+ *
990
+ * ### Providing write access to the underlying value
991
+ *
992
+ * #### Variation1 - provide a simple synchronous set function
993
+ *
994
+ *
995
+ * #### Notes
996
+ * to do : explain return StatusCodes.GoodCompletesAsynchronously;
997
+ *
998
+ */
999
+ bindVariable(options, overwrite) {
1000
+ if (overwrite) {
1001
+ this._timestamped_set_func = null;
1002
+ this._timestamped_get_func = null;
1003
+ this._get_func = null;
1004
+ this._set_func = null;
1005
+ this.refreshFunc = undefined;
1006
+ this._historyRead = UAVariableImpl.prototype._historyRead;
1007
+ }
1008
+ options = options || {};
1009
+ (0, node_opcua_assert_1.assert)(typeof this._timestamped_set_func !== "function", "UAVariable already bound");
1010
+ (0, node_opcua_assert_1.assert)(typeof this._timestamped_get_func !== "function", "UAVariable already bound");
1011
+ bind_getter.call(this, options);
1012
+ bind_setter.call(this, options);
1013
+ const _historyRead = options.historyRead;
1014
+ if (_historyRead) {
1015
+ (0, node_opcua_assert_1.assert)(typeof this._historyRead !== "function" || this._historyRead === UAVariableImpl.prototype._historyRead);
1016
+ (0, node_opcua_assert_1.assert)(typeof _historyRead === "function");
1017
+ this._historyRead = _historyRead;
1018
+ (0, node_opcua_assert_1.assert)(this._historyRead.length === 6);
1019
+ }
1020
+ // post conditions
1021
+ (0, node_opcua_assert_1.assert)(typeof this._timestamped_set_func === "function");
1022
+ (0, node_opcua_assert_1.assert)(this._timestamped_set_func?.length === 2, "expecting 2 parameters");
1023
+ }
1024
+ readValueAsync(context, callback) {
1025
+ (0, node_opcua_assert_1.assert)(typeof callback === "function");
1026
+ context = context || session_context_js_1.SessionContext.defaultContext;
1027
+ this.__waiting_callbacks = this.__waiting_callbacks || [];
1028
+ this.__waiting_callbacks.push(callback);
1029
+ const _readValueAsync_in_progress = this.__waiting_callbacks.length >= 2;
1030
+ if (_readValueAsync_in_progress) {
1031
+ return;
1032
+ }
1033
+ if (this.isDisposed()) {
1034
+ callback?.(null, new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdUnknown }));
1035
+ return;
1036
+ }
1037
+ const readImmediate = (innerCallback) => {
1038
+ (0, node_opcua_assert_1.assert)(this.$dataValue instanceof node_opcua_data_value_1.DataValue);
1039
+ const dataValue = this.readValue(context);
1040
+ innerCallback(null, dataValue);
1041
+ };
1042
+ let func;
1043
+ const answerStatusOnly = (statusCode) => (innerCallback) => innerCallback(null, new node_opcua_data_value_1.DataValue({ statusCode }));
1044
+ if (context.isAccessRestricted(this)) {
1045
+ // same gate as readValue(): a variable bound with a simple get()
1046
+ // also gets a refreshFunc, sending every read down the asyncRefresh
1047
+ // branch below - which calls the getter directly and never passes
1048
+ // through readValue(). Without this check here, a node hardened
1049
+ // with AccessRestrictions(EncryptionRequired) answered its value
1050
+ // over an unencrypted channel.
1051
+ func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadSecurityModeInsufficient);
1052
+ }
1053
+ else if (!this.isReadable(context)) {
1054
+ func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadNotReadable);
1055
+ }
1056
+ else if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
1057
+ func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
1058
+ }
1059
+ else if (!this.isUserReadable(context)) {
1060
+ func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadNotReadable);
1061
+ }
1062
+ else {
1063
+ const clock = (0, node_opcua_date_time_1.getCurrentClock)();
1064
+ func = typeof this.refreshFunc === "function" ? this.asyncRefresh.bind(this, clock) : readImmediate;
1065
+ }
1066
+ const satisfy_callbacks = (err, dataValue) => {
1067
+ // now call all pending callbacks
1068
+ const callbacks = this.__waiting_callbacks || [];
1069
+ this.__waiting_callbacks = [];
1070
+ const _n = callbacks.length;
1071
+ for (const callback1 of callbacks) {
1072
+ callback1.call(this, err, dataValue);
1073
+ }
1074
+ };
1075
+ try {
1076
+ func.call(this, satisfy_callbacks);
1077
+ }
1078
+ catch (err) {
1079
+ // c8 ignore next
1080
+ if (doDebug) {
1081
+ debugLog(chalk_1.default.red("func readValueAsync has failed "));
1082
+ if (node_util_1.types.isNativeError(err)) {
1083
+ debugLog(" stack", err.stack);
1084
+ }
1085
+ }
1086
+ satisfy_callbacks(err);
1087
+ }
1088
+ return undefined;
1089
+ }
1090
+ getWriteMask() {
1091
+ return super.getWriteMask();
1092
+ }
1093
+ getUserWriteMask() {
1094
+ return super.getUserWriteMask();
1095
+ }
1096
+ clone(options, optionalFilter, extraInfo) {
1097
+ options = {
1098
+ ...options,
1099
+ // check this eventNotifier: this.eventNotifier,
1100
+ // check this symbolicName: this.symbolicName,
1101
+ accessLevel: this.accessLevel,
1102
+ arrayDimensions: this.arrayDimensions,
1103
+ dataType: this.dataType,
1104
+ historizing: this.historizing,
1105
+ minimumSamplingInterval: this.minimumSamplingInterval,
1106
+ userAccessLevel: this.userAccessLevel,
1107
+ valueRank: this.valueRank
1108
+ };
1109
+ const newVariable = (0, base_node_private_js_1._clone)(this, (UAVariableImpl), options, optionalFilter || node_opcua_address_space_base_1.defaultCloneFilter, extraInfo || (0, node_opcua_address_space_base_1.makeDefaultCloneExtraInfo)(this));
1110
+ newVariable.bindVariable();
1111
+ (0, node_opcua_assert_1.assert)(typeof newVariable._timestamped_set_func === "function");
1112
+ (0, node_opcua_assert_1.assert)(newVariable.dataType === this.dataType);
1113
+ newVariable.$dataValue = this.$dataValue.clone();
1114
+ // also bind extension object
1115
+ const v = newVariable.$dataValue.value;
1116
+ if (v.dataType === node_opcua_variant_1.DataType.ExtensionObject && v.value && v.arrayType === node_opcua_variant_1.VariantArrayType.Scalar) {
1117
+ try {
1118
+ newVariable.bindExtensionObject(newVariable.$dataValue.value.value);
1119
+ }
1120
+ catch (err) {
1121
+ errorLog("Error binding extension objects");
1122
+ errorLog(err.message);
1123
+ errorLog(this.toString());
1124
+ errorLog("---------------------------------------");
1125
+ errorLog(this.$dataValue.toString());
1126
+ errorLog("---------------------------------------");
1127
+ errorLog(newVariable.$dataValue.toString());
1128
+ throw err;
1129
+ }
1130
+ }
1131
+ return newVariable;
1132
+ }
1133
+ getDataTypeNode() {
1134
+ const addressSpace = this.addressSpace;
1135
+ if (this.dataType.isEmpty()) {
1136
+ this.dataType = this.resolveNodeId(node_opcua_variant_1.DataType.Variant);
1137
+ }
1138
+ const dt = addressSpace.findNode(this.dataType);
1139
+ // c8 ignore next
1140
+ if (!dt) {
1141
+ throw new Error(`getDataTypeNode: cannot find dataType ${this.dataType.toString()}`);
1142
+ }
1143
+ return dt;
1144
+ }
1145
+ get dataTypeObj() {
1146
+ return this.getDataTypeNode();
1147
+ }
1148
+ checkExtensionObjectIsCorrect(extObj) {
1149
+ if (!extObj) {
1150
+ return true;
1151
+ }
1152
+ const addressSpace = this.addressSpace;
1153
+ if (!addressSpace) {
1154
+ return true;
1155
+ }
1156
+ const dataType = addressSpace.findDataType(this.dataType);
1157
+ if (!dataType) {
1158
+ // may be we are in the process of loading a xml file and the corresponding dataType
1159
+ // has not yet been loaded !
1160
+ return true;
1161
+ }
1162
+ if (dataType.nodeId.namespace === 0 && dataType.nodeId.value === node_opcua_variant_1.DataType.ExtensionObject) {
1163
+ return true;
1164
+ }
1165
+ const Constructor = addressSpace.getExtensionObjectConstructor(this.dataType);
1166
+ if (this.valueRank === -1) {
1167
+ /** Scalar */
1168
+ if (Array.isArray(extObj)) {
1169
+ return false;
1170
+ }
1171
+ return checkExtensionObjectIsCorrectScalar.call(this, extObj);
1172
+ }
1173
+ else if (this.valueRank >= 1) {
1174
+ /** array */
1175
+ if (!Array.isArray(extObj)) {
1176
+ // let's coerce this scalar into an 1-element array if it is a valid extension object
1177
+ if (checkExtensionObjectIsCorrectScalar.call(this, extObj)) {
1178
+ warningLog(`warning: checkExtensionObjectIsCorrect : expecting a array but got a scalar (value rank of '${this.browseName.toString()}' is 1)\nautomatic conversion from scalar to array with 1 element is taking place.`);
1179
+ extObj = [extObj];
1180
+ }
1181
+ else {
1182
+ return false;
1183
+ }
1184
+ }
1185
+ return checkExtensionObjectIsCorrectArray.call(this, extObj);
1186
+ }
1187
+ else if (this.valueRank === 0) {
1188
+ // Scalar or Array
1189
+ const isCorrectScalar = !Array.isArray(extObj) && checkExtensionObjectIsCorrectScalar.call(this, extObj);
1190
+ const isCorrectArray = Array.isArray(extObj) && checkExtensionObjectIsCorrectArray.call(this, extObj);
1191
+ return isCorrectArray || isCorrectScalar;
1192
+ }
1193
+ else {
1194
+ throw new Error(`checkExtensionObjectIsCorrect: Not Implemented case, please contact sterfive : this.valueRank =${this.valueRank}`);
1195
+ }
1196
+ function checkExtensionObjectIsCorrectScalar(extObj) {
1197
+ // c8 ignore next
1198
+ if (!extObj?.constructor) {
1199
+ errorLog(extObj);
1200
+ throw new Error("expecting an valid extension object");
1201
+ }
1202
+ if (extObj.constructor.name === Constructor.name) {
1203
+ return true;
1204
+ }
1205
+ if (extObj instanceof node_opcua_extension_object_1.OpaqueStructure) {
1206
+ throw new Error("An opaque structure is not expected here");
1207
+ }
1208
+ // let's verify that the constructor is a sub-class of Constructor
1209
+ let current = extObj.schema;
1210
+ while (current) {
1211
+ if (current.name === Constructor.name) {
1212
+ return true;
1213
+ }
1214
+ current = current.getBaseSchema();
1215
+ }
1216
+ return false;
1217
+ }
1218
+ function checkExtensionObjectIsCorrectArray(extObjArray) {
1219
+ // c8 ignore next
1220
+ for (const extObj of extObjArray) {
1221
+ if (!extObj?.constructor) {
1222
+ errorLog(extObj);
1223
+ throw new Error("expecting an valid extension object");
1224
+ }
1225
+ }
1226
+ try {
1227
+ for (const e of extObjArray) {
1228
+ if (!e) {
1229
+ continue;
1230
+ }
1231
+ if (e.constructor.name !== Constructor.name) {
1232
+ // c8 ignore next
1233
+ doDebug && debugLog("extObj.constructor.name ", e.constructor.name, "expected", Constructor.name);
1234
+ return false;
1235
+ }
1236
+ }
1237
+ return true;
1238
+ }
1239
+ catch (err) {
1240
+ errorLog(err);
1241
+ return false;
1242
+ }
1243
+ }
1244
+ }
1245
+ changeDataType(newDataType, newValue) {
1246
+ changeUAVariableDataType(this, newDataType, newValue);
1247
+ }
1248
+ /**
1249
+ * @private
1250
+ * install UAVariable to exposed th
1251
+ *
1252
+ * precondition:
1253
+ */
1254
+ installExtensionObjectVariables() {
1255
+ (0, ua_variable_impl_ext_obj_js_1._installExtensionObjectBindingOnProperties)(this, { createMissingProp: true });
1256
+ }
1257
+ /**
1258
+
1259
+ * @return {ExtensionObject}
1260
+ */
1261
+ bindExtensionObjectScalar(optionalExtensionObject, options) {
1262
+ (0, node_opcua_assert_1.assert)(this.valueRank === -1, "expecting an Scalar variable here");
1263
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObject)(this, optionalExtensionObject, options);
1264
+ }
1265
+ bindExtensionObjectArray(optionalExtensionObject, options) {
1266
+ (0, node_opcua_assert_1.assert)(this.valueRank >= 1, "expecting an Array or a Matrix variable here");
1267
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObjectArrayOrMatrix)(this, optionalExtensionObject, options);
1268
+ }
1269
+ bindExtensionObject(optionalExtensionObject, options) {
1270
+ // coerce to ExtensionObject[] when this.valueRank === 1
1271
+ if (optionalExtensionObject &&
1272
+ this.valueRank === 1 &&
1273
+ !Array.isArray(optionalExtensionObject) &&
1274
+ optionalExtensionObject instanceof node_opcua_extension_object_1.ExtensionObject) {
1275
+ warningLog("bindExtensionObject: coerce to ExtensionObject[] when valueRank === 1 and value is a scalar extension object");
1276
+ optionalExtensionObject = [optionalExtensionObject];
1277
+ }
1278
+ if (optionalExtensionObject) {
1279
+ if (Array.isArray(optionalExtensionObject)) {
1280
+ (0, node_opcua_assert_1.assert)(this.valueRank >= 1, "bindExtensionObject: expecting an Array of Matrix variable here");
1281
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObjectArrayOrMatrix)(this, optionalExtensionObject, options);
1282
+ }
1283
+ else {
1284
+ if (this.valueRank !== -1 && this.valueRank !== 0) {
1285
+ throw new Error(`bindExtensionObject: expecting an Scalar variable here but got value rank ${this.valueRank}`);
1286
+ }
1287
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObject)(this, optionalExtensionObject, options);
1288
+ }
1289
+ }
1290
+ (0, node_opcua_assert_1.assert)(optionalExtensionObject === undefined || optionalExtensionObject === null);
1291
+ if (this.valueRank === -1) {
1292
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObject)(this, undefined, options);
1293
+ }
1294
+ else if (this.valueRank === 1) {
1295
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObjectArrayOrMatrix)(this, undefined, options);
1296
+ }
1297
+ else if (this.valueRank > 1) {
1298
+ return (0, ua_variable_impl_ext_obj_js_1._bindExtensionObjectArrayOrMatrix)(this, undefined, options);
1299
+ }
1300
+ // unsupported case ...
1301
+ return null;
1302
+ }
1303
+ updateExtensionObjectPartial(partialExtensionObject) {
1304
+ (0, ua_variable_impl_ext_obj_js_1.setExtensionObjectPartialValue)(this, partialExtensionObject);
1305
+ return this.$extensionObject;
1306
+ }
1307
+ incrementExtensionObjectPartial(path) {
1308
+ const extensionObject = this.readValue().value.value;
1309
+ const partialData = (0, ua_variable_impl_ext_obj_js_1.extractPartialData)(path, extensionObject);
1310
+ (0, ua_variable_impl_ext_obj_js_1.incrementElement)(path, partialData);
1311
+ (0, ua_variable_impl_ext_obj_js_1.setExtensionObjectPartialValue)(this, partialData);
1312
+ }
1313
+ toString() {
1314
+ const options = new base_node_private_js_1.ToStringBuilder();
1315
+ base_node_private_js_1.UAVariable_toString.call(this, options);
1316
+ return options.toString();
1317
+ }
1318
+ toJSON() {
1319
+ let value;
1320
+ let statusCode;
1321
+ try {
1322
+ const dv = this.$dataValue;
1323
+ if (dv) {
1324
+ statusCode = dv.statusCode?.toString();
1325
+ if (dv.value && !(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
1326
+ value = dv.value.value;
1327
+ }
1328
+ }
1329
+ }
1330
+ catch {
1331
+ // ignore — value access may fail for bound variables
1332
+ }
1333
+ return {
1334
+ ...super.toJSON(),
1335
+ typeDefinition: this.typeDefinitionObj?.browseName.toString(),
1336
+ dataType: this.dataType?.toString(),
1337
+ valueRank: this.valueRank,
1338
+ arrayDimensions: this.arrayDimensions,
1339
+ accessLevel: node_opcua_data_model_1.AccessLevelFlag[this.accessLevel],
1340
+ statusCode,
1341
+ value
1342
+ };
1343
+ }
1344
+ [Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions) {
1345
+ const c = inspectOptions?.colors === false ? plainChalk : chalk_1.default;
1346
+ const typeName = this.typeDefinitionObj?.browseName.toString() ?? "?";
1347
+ const displayName = this.displayName.length ? this.displayName.map((d) => d.text).join(" | ") : "";
1348
+ if (depth !== null && depth <= 0) {
1349
+ return `${c.cyan("UAVariable<")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}${c.cyan(">")}`;
1350
+ }
1351
+ const dt = this.dataType?.toString() ?? "?";
1352
+ let valueStr = "";
1353
+ let statusStr = "";
1354
+ try {
1355
+ const dv = this.$dataValue;
1356
+ if (dv) {
1357
+ if (dv.statusCode)
1358
+ statusStr = dv.statusCode.toString();
1359
+ if (dv.value &&
1360
+ dv.value.value !== undefined &&
1361
+ dv.value.value !== null &&
1362
+ !(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
1363
+ const v = dv.value.value;
1364
+ valueStr = typeof v === "object" ? Object.prototype.toString.call(v) : String(v);
1365
+ if (valueStr.length > 80)
1366
+ valueStr = `${valueStr.slice(0, 77)}...`;
1367
+ }
1368
+ }
1369
+ }
1370
+ catch {
1371
+ // ignore
1372
+ }
1373
+ const lines = [
1374
+ `${c.cyan("UAVariable ")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}`,
1375
+ c.yellow(" typeDefinition : ") + typeName,
1376
+ c.yellow(" displayName : ") + displayName,
1377
+ c.yellow(" dataType : ") + dt,
1378
+ c.yellow(" valueRank : ") + (0, base_node_private_js_1.valueRankToString)(this.valueRank),
1379
+ c.yellow(" accessLevel : ") + node_opcua_data_model_1.AccessLevelFlag[this.accessLevel]
1380
+ ];
1381
+ if (this.arrayDimensions?.length) {
1382
+ lines.push(c.yellow(" arrayDimensions: ") + JSON.stringify(this.arrayDimensions));
1383
+ }
1384
+ if (valueStr) {
1385
+ lines.push(c.yellow(" value : ") + valueStr);
1386
+ }
1387
+ if (statusStr && statusStr !== "Good (0x00000000)") {
1388
+ lines.push(c.yellow(" statusCode : ") + statusStr);
1389
+ }
1390
+ if (this.description?.text) {
1391
+ lines.push(c.yellow(" description : ") + this.description.text);
1392
+ }
1393
+ return lines.join("\n");
1394
+ }
1395
+ historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback) {
1396
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
1397
+ (0, node_opcua_assert_1.assert)(typeof callback === "function");
1398
+ if (typeof this._historyRead !== "function") {
1399
+ callback?.(null, new node_opcua_types_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable }));
1400
+ return;
1401
+ }
1402
+ this._historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback);
1403
+ return undefined;
1404
+ }
1405
+ _historyReadRaw(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
1406
+ throw new Error("");
1407
+ }
1408
+ _historyReadRawModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
1409
+ throw new Error("");
1410
+ }
1411
+ _historyRead(context, _historyReadDetails, _indexRange, _dataEncoding, _continuationData, callback) {
1412
+ if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.ReadHistory)) {
1413
+ const result = new node_opcua_types_1.HistoryReadResult({
1414
+ statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied
1415
+ });
1416
+ callback(null, result);
1417
+ }
1418
+ if (!this.canUserReadHistory(context)) {
1419
+ const result = new node_opcua_types_1.HistoryReadResult({
1420
+ statusCode: node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported
1421
+ });
1422
+ callback(null, result);
1423
+ }
1424
+ const result = new node_opcua_types_1.HistoryReadResult({
1425
+ statusCode: node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported
1426
+ });
1427
+ callback(null, result);
1428
+ }
1429
+ _historyPush(_newDataValue) {
1430
+ throw new Error("");
1431
+ }
1432
+ _historyReadRawAsync(_historyReadRawModifiedDetails, _maxNumberToExtract, _isReversed, _reverseDataValue, _callback) {
1433
+ throw new Error("");
1434
+ }
1435
+ _historyReadModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
1436
+ throw new Error("");
1437
+ }
1438
+ _update_startOfOnlineArchive(_newDate) {
1439
+ // please install
1440
+ throw new Error("");
1441
+ }
1442
+ _update_startOfArchive(_newDate) {
1443
+ throw new Error("");
1444
+ }
1445
+ _validate_DataType(variantDataType) {
1446
+ return (0, validate_data_type_correctness_js_1.validateDataTypeCorrectness)(this.addressSpace, this.dataType, variantDataType, /* allow Nulls */ false, this.nodeId);
1447
+ }
1448
+ _internal_set_value(value) {
1449
+ if (value.dataType !== node_opcua_variant_1.DataType.Null) {
1450
+ this.verifyVariantCompatibility(value);
1451
+ }
1452
+ this.$dataValue.value = value;
1453
+ }
1454
+ _internal_set_dataValue(dataValue, indexRange) {
1455
+ (0, node_opcua_assert_1.assert)(dataValue, "expecting a dataValue");
1456
+ (0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue, "expecting dataValue to be a DataValue");
1457
+ (0, node_opcua_assert_1.assert)(dataValue !== this.$dataValue, "expecting dataValue to be different from previous DataValue instance");
1458
+ const addressSpace = this.addressSpace;
1459
+ // c8 ignore next
1460
+ if (!addressSpace) {
1461
+ warningLog("UAVariable#_internal_set_dataValue : no addressSpace ! may be node has already been deleted ?");
1462
+ return;
1463
+ }
1464
+ // c8 ignore next
1465
+ if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Matrix) {
1466
+ if (!dataValue.value.dimensions) {
1467
+ throw new Error("missing dimensions: a Matrix Variant needs a dimension");
1468
+ }
1469
+ const nbElements = dataValue.value.dimensions.reduce((acc, x) => acc * x, 1);
1470
+ if (dataValue.value.value.length !== 0 && dataValue.value.value.length !== nbElements) {
1471
+ throw new Error(`Internal Error: matrix dimension doesn't match the number of element in the array : ${dataValue.toString()} "\n expecting ${nbElements} elements but got ${dataValue.value.value.length}`);
1472
+ }
1473
+ }
1474
+ // c8 ignore next
1475
+ if (dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
1476
+ // c8 ignore next
1477
+ if (!this.checkExtensionObjectIsCorrect(dataValue.value.value)) {
1478
+ warningLog(dataValue.toString());
1479
+ throw new Error(`Invalid Extension Object on nodeId =${this.nodeId.toString()}`);
1480
+ }
1481
+ }
1482
+ this.verifyVariantCompatibility(dataValue.value);
1483
+ this._inner_replace_dataValue(dataValue, indexRange);
1484
+ }
1485
+ /**
1486
+ * @private
1487
+ */
1488
+ _inner_replace_dataValue(dataValue, indexRange) {
1489
+ (0, node_opcua_assert_1.assert)(this.$dataValue.value instanceof node_opcua_variant_1.Variant);
1490
+ const old_dataValue = this.$dataValue.clone();
1491
+ if (this.$$extensionObjectArray && dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Scalar) {
1492
+ // we have a bounded array or matrix
1493
+ (0, node_opcua_assert_1.assert)(Array.isArray(dataValue.value.value));
1494
+ if (this.$$extensionObjectArray !== this.$dataValue.value.value) {
1495
+ throw new Error("internal error");
1496
+ }
1497
+ this.$$extensionObjectArray = dataValue.value.value;
1498
+ this.$dataValue.value.value = dataValue.value.value;
1499
+ this.$dataValue.statusCode = dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
1500
+ this.$dataValue.serverTimestamp = dataValue.serverTimestamp;
1501
+ this.$dataValue.serverPicoseconds = dataValue.serverPicoseconds;
1502
+ this.$dataValue.sourceTimestamp = dataValue.sourceTimestamp;
1503
+ this.$dataValue.sourcePicoseconds = dataValue.sourcePicoseconds;
1504
+ }
1505
+ else if (this._basicDataType === node_opcua_variant_1.DataType.ExtensionObject &&
1506
+ this.valueRank === -1 &&
1507
+ this.$set_ExtensionObject &&
1508
+ dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Scalar) {
1509
+ // the entire extension object is changed.
1510
+ this.$dataValue.statusCode = this.$dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
1511
+ const preciseClock = (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
1512
+ this.$set_ExtensionObject(dataValue.value.value, preciseClock, new Set());
1513
+ }
1514
+ else {
1515
+ this.$dataValue = dataValue;
1516
+ this.$dataValue.statusCode = this.$dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
1517
+ }
1518
+ // repair missing timestamps
1519
+ const now = new Date();
1520
+ if (!dataValue.serverTimestamp) {
1521
+ this.$dataValue.serverTimestamp = old_dataValue.serverTimestamp || now;
1522
+ this.$dataValue.serverPicoseconds = old_dataValue.serverPicoseconds || 0;
1523
+ }
1524
+ if (!dataValue.sourceTimestamp) {
1525
+ this.$dataValue.sourceTimestamp = old_dataValue.sourceTimestamp || now;
1526
+ this.$dataValue.sourcePicoseconds = old_dataValue.sourcePicoseconds || 0;
1527
+ }
1528
+ if (!(0, node_opcua_data_value_1.sameDataValue)(old_dataValue, dataValue)) {
1529
+ if (this.getBasicDataType() === node_opcua_variant_1.DataType.ExtensionObject) {
1530
+ const preciseClock = (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
1531
+ const cache = new Set();
1532
+ if (this.$$extensionObjectArray) {
1533
+ this.touchValue(preciseClock);
1534
+ (0, ua_variable_impl_ext_obj_js_1.propagateTouchValueDownwardArray)(this, preciseClock, cache);
1535
+ }
1536
+ else {
1537
+ this.touchValue(preciseClock);
1538
+ (0, ua_variable_impl_ext_obj_js_1.propagateTouchValueDownward)(this, preciseClock, cache);
1539
+ }
1540
+ }
1541
+ else {
1542
+ this.emit("value_changed", this.$dataValue.clone(), indexRange);
1543
+ }
1544
+ }
1545
+ }
1546
+ _conditionRefresh(_cache) {
1547
+ apply_condition_refresh_js_1.apply_condition_refresh.call(this, _cache);
1548
+ }
1549
+ handle_semantic_changed(_dataValue) {
1550
+ this.semantic_version = this.semantic_version + 1;
1551
+ this.emit("semantic_changed");
1552
+ }
1553
+ _readDataType() {
1554
+ (0, node_opcua_assert_1.assert)(this.dataType instanceof node_opcua_nodeid_1.NodeId);
1555
+ const options = {
1556
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1557
+ value: {
1558
+ dataType: node_opcua_variant_1.DataType.NodeId,
1559
+ value: this.dataType
1560
+ }
1561
+ };
1562
+ return new node_opcua_data_value_1.DataValue(options);
1563
+ }
1564
+ _readValueRank() {
1565
+ (0, node_opcua_assert_1.assert)(typeof this.valueRank === "number");
1566
+ const options = {
1567
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1568
+ value: { dataType: node_opcua_variant_1.DataType.Int32, value: this.valueRank }
1569
+ };
1570
+ return new node_opcua_data_value_1.DataValue(options);
1571
+ }
1572
+ _readArrayDimensions() {
1573
+ (0, node_opcua_assert_1.assert)(Array.isArray(this.arrayDimensions) || this.arrayDimensions === null);
1574
+ (0, node_opcua_assert_1.assert)(!this.arrayDimensions || this.valueRank > 0, "arrayDimension must be null if valueRank <0");
1575
+ const options = {
1576
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1577
+ value: { dataType: node_opcua_variant_1.DataType.UInt32, arrayType: node_opcua_variant_1.VariantArrayType.Array, value: this.arrayDimensions }
1578
+ };
1579
+ return new node_opcua_data_value_1.DataValue(options);
1580
+ }
1581
+ _readAccessLevel(context) {
1582
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
1583
+ const options = {
1584
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1585
+ value: { dataType: node_opcua_variant_1.DataType.Byte, value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(this.accessLevel) }
1586
+ };
1587
+ return new node_opcua_data_value_1.DataValue(options);
1588
+ }
1589
+ _readAccessLevelEx(context) {
1590
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
1591
+ const options = {
1592
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1593
+ // Extra flags are not supported yet. to do:
1594
+ value: { dataType: node_opcua_variant_1.DataType.UInt32, value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(this.accessLevel) }
1595
+ };
1596
+ return new node_opcua_data_value_1.DataValue(options);
1597
+ }
1598
+ _readUserAccessLevel(context) {
1599
+ (0, node_opcua_assert_1.assert)(context instanceof session_context_js_1.SessionContext);
1600
+ const effectiveUserAccessLevel = _calculateEffectiveUserAccessLevelFromPermission(this, context, this.userAccessLevel);
1601
+ const options = {
1602
+ value: {
1603
+ dataType: node_opcua_variant_1.DataType.Byte,
1604
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1605
+ value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(effectiveUserAccessLevel)
1606
+ }
1607
+ };
1608
+ return new node_opcua_data_value_1.DataValue(options);
1609
+ }
1610
+ _readMinimumSamplingInterval() {
1611
+ // expect a Duration => Double
1612
+ const options = {};
1613
+ if (this.minimumSamplingInterval === undefined) {
1614
+ options.statusCode = node_opcua_status_code_1.StatusCodes.BadAttributeIdInvalid;
1615
+ }
1616
+ else {
1617
+ options.value = { dataType: node_opcua_variant_1.DataType.Double, value: this.minimumSamplingInterval };
1618
+ options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
1619
+ }
1620
+ return new node_opcua_data_value_1.DataValue(options);
1621
+ }
1622
+ _readHistorizing() {
1623
+ (0, node_opcua_assert_1.assert)(typeof this.historizing === "boolean");
1624
+ const options = {
1625
+ statusCode: node_opcua_status_code_1.StatusCodes.Good,
1626
+ value: { dataType: node_opcua_variant_1.DataType.Boolean, value: !!this.historizing }
1627
+ };
1628
+ return new node_opcua_data_value_1.DataValue(options);
1629
+ }
1630
+ }
1631
+ exports.UAVariableImpl = UAVariableImpl;
1632
+ const thenify_ex_1 = require("thenify-ex");
1633
+ UAVariableImpl.prototype.asyncRefresh = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.asyncRefresh);
1634
+ UAVariableImpl.prototype.writeValue = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.writeValue);
1635
+ UAVariableImpl.prototype.writeAttribute = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.writeAttribute);
1636
+ UAVariableImpl.prototype.historyRead = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.historyRead);
1637
+ UAVariableImpl.prototype.readValueAsync = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.readValueAsync);
1638
+ function check_valid_array(dataType, array) {
1639
+ if (Array.isArray(array)) {
1640
+ return true;
1641
+ }
1642
+ switch (dataType) {
1643
+ case node_opcua_variant_1.DataType.Double:
1644
+ return array instanceof Float64Array;
1645
+ case node_opcua_variant_1.DataType.Float:
1646
+ return array instanceof Float32Array;
1647
+ case node_opcua_variant_1.DataType.Int32:
1648
+ return array instanceof Int32Array;
1649
+ case node_opcua_variant_1.DataType.Int16:
1650
+ return array instanceof Int16Array;
1651
+ case node_opcua_variant_1.DataType.SByte:
1652
+ return array instanceof Int8Array;
1653
+ case node_opcua_variant_1.DataType.UInt32:
1654
+ return array instanceof Uint32Array;
1655
+ case node_opcua_variant_1.DataType.UInt16:
1656
+ return array instanceof Uint16Array;
1657
+ case node_opcua_variant_1.DataType.Byte:
1658
+ return array instanceof Uint8Array || array instanceof Buffer;
1659
+ }
1660
+ return false;
1661
+ }
1662
+ // function _apply_default_timestamps(dataValue: DataValue): void {
1663
+ // const now = getCurrentClock();
1664
+ // assert(dataValue instanceof DataValue);
1665
+ // if (!dataValue.sourceTimestamp) {
1666
+ // dataValue.sourceTimestamp = now.timestamp;
1667
+ // dataValue.sourcePicoseconds = now.picoseconds;
1668
+ // }
1669
+ // if (!dataValue.serverTimestamp) {
1670
+ // dataValue.serverTimestamp = now.timestamp;
1671
+ // dataValue.serverPicoseconds = now.picoseconds;
1672
+ // }
1673
+ // }
1674
+ function unsetFlag(flags, mask) {
1675
+ return flags & ~mask;
1676
+ }
1677
+ function _setFlag(flags, mask) {
1678
+ return flags | mask;
1679
+ }
1680
+ function _calculateEffectiveUserAccessLevelFromPermission(node, context, userAccessLevel) {
1681
+ function __adjustFlag(permissionType, access, userAccessLevel1) {
1682
+ if ((node.accessLevel & access) === 0 || (userAccessLevel1 & access) === 0) {
1683
+ userAccessLevel1 = unsetFlag(userAccessLevel1, access);
1684
+ }
1685
+ else {
1686
+ if (!context.checkPermission(node, permissionType)) {
1687
+ userAccessLevel1 = unsetFlag(userAccessLevel1, access);
1688
+ }
1689
+ }
1690
+ return userAccessLevel1;
1691
+ }
1692
+ userAccessLevel = node.userAccessLevel === undefined ? node.accessLevel : node.userAccessLevel & node.accessLevel;
1693
+ if (context.checkPermission) {
1694
+ (0, node_opcua_assert_1.assert)(context.checkPermission instanceof Function);
1695
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Read, node_opcua_data_model_1.AccessLevelFlag.CurrentRead, userAccessLevel);
1696
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.CurrentWrite, userAccessLevel);
1697
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.StatusWrite, userAccessLevel);
1698
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.TimestampWrite, userAccessLevel);
1699
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.ReadHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryRead, userAccessLevel);
1700
+ userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.DeleteHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite, userAccessLevel);
1701
+ return userAccessLevel;
1702
+ }
1703
+ else {
1704
+ return userAccessLevel;
1705
+ }
1706
+ }
1707
+ function adjustVariant2(variant) {
1708
+ // convert Variant( Scalar|ByteString) => Variant(Array|ByteArray)
1709
+ const _addressSpace = this.addressSpace;
1710
+ const basicType = this.getBasicDataType();
1711
+ variant = (0, node_opcua_variant_1.adjustVariant)(variant, this.valueRank, basicType);
1712
+ return variant;
1713
+ }
1714
+ function _not_writable_timestamped_set_func(dataValue, callback) {
1715
+ (0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
1716
+ callback(null, node_opcua_status_code_1.StatusCodes.BadNotWritable, null);
1717
+ }
1718
+ function _default_writable_timestamped_set_func(dataValue, callback) {
1719
+ (0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
1720
+ callback(null, node_opcua_status_code_1.StatusCodes.Good, dataValue);
1721
+ }
1722
+ function turn_sync_to_async(f, numberOfArgs) {
1723
+ if (f.length <= numberOfArgs) {
1724
+ return function (data, callback) {
1725
+ new Promise((resolve, reject) => {
1726
+ try {
1727
+ // const ff1 = f as f1<T, D, R>;
1728
+ const ff2 = f;
1729
+ const r = ff2.call(this, data);
1730
+ if (r instanceof Promise) {
1731
+ r.then(resolve, reject);
1732
+ }
1733
+ else {
1734
+ resolve(r);
1735
+ }
1736
+ }
1737
+ catch (err) {
1738
+ reject(err);
1739
+ }
1740
+ })
1741
+ .then((r) => {
1742
+ callback(null, r);
1743
+ })
1744
+ .catch((err) => {
1745
+ callback(err);
1746
+ });
1747
+ };
1748
+ }
1749
+ else {
1750
+ (0, node_opcua_assert_1.assert)(f.length === numberOfArgs + 1);
1751
+ return f;
1752
+ }
1753
+ }
1754
+ const _default_minimumSamplingInterval = 1000;
1755
+ function coerceDataValue(dataValue) {
1756
+ if (dataValue instanceof node_opcua_data_value_1.DataValue) {
1757
+ return dataValue;
1758
+ }
1759
+ return new node_opcua_data_value_1.DataValue(dataValue);
1760
+ }
1761
+ // variation #3 :
1762
+ function _Variable_bind_with_async_refresh(options) {
1763
+ (0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
1764
+ (0, node_opcua_assert_1.assert)(typeof options.refreshFunc === "function");
1765
+ (0, node_opcua_assert_1.assert)(!options.get, "a getter shall not be specified when refreshFunc is set");
1766
+ (0, node_opcua_assert_1.assert)(!options.timestamped_get, "a getter shall not be specified when refreshFunc is set");
1767
+ (0, node_opcua_assert_1.assert)(!this.refreshFunc);
1768
+ this.refreshFunc = options.refreshFunc;
1769
+ /*
1770
+ // TO DO : REVISIT THIS ASSUMPTION
1771
+ if (false && this.minimumSamplingInterval === 0) {
1772
+ // when a getter /timestamped_getter or async_getter is provided
1773
+ // samplingInterval cannot be 0, as the item value must be scanned to be updated.
1774
+ this.minimumSamplingInterval = _default_minimumSamplingInterval; // MonitoredItem.minimumSamplingInterval;
1775
+ // c8 ignore next
1776
+ doDebug && debugLog(`adapting minimumSamplingInterval on ${this.browseName.toString()} to ${this.minimumSamplingInterval}`);
1777
+ }
1778
+ */
1779
+ }
1780
+ // variation 2
1781
+ function _Variable_bind_with_timestamped_get(options) {
1782
+ /* jshint validthis: true */
1783
+ (0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
1784
+ (0, node_opcua_assert_1.assert)(typeof options.timestamped_get === "function");
1785
+ (0, node_opcua_assert_1.assert)(!options.get, "should not specify 'get' when 'timestamped_get' exists ");
1786
+ (0, node_opcua_assert_1.assert)(!this._timestamped_get_func);
1787
+ const async_refresh_func = (callback) => {
1788
+ Promise.resolve(this._timestamped_get_func.call(this))
1789
+ .then((dataValue) => callback(null, dataValue))
1790
+ .catch((err) => {
1791
+ errorLog("asyncRefresh error: Variable is ", this.nodeId.toString(), this.browseName.toString());
1792
+ callback(err);
1793
+ });
1794
+ };
1795
+ const pThis = this;
1796
+ if (options.timestamped_get.length === 0) {
1797
+ const timestamped_get = options.timestamped_get;
1798
+ // sync version | Promise version
1799
+ this._timestamped_get_func = timestamped_get;
1800
+ const dataValue_verify = timestamped_get.call(pThis);
1801
+ // dataValue_verify should be a DataValue or a Promise
1802
+ /* c8 ignore next */
1803
+ if (!(dataValue_verify instanceof node_opcua_data_value_1.DataValue) && typeof dataValue_verify.then !== "function") {
1804
+ errorLog(chalk_1.default.red(" Bind variable error: "), " the timestamped_get function must return a DataValue or a Promise<DataValue>" +
1805
+ "\n value_check.constructor.name ", dataValue_verify ? dataValue_verify.constructor.name : "null");
1806
+ throw new Error(" Bind variable error: " + " the timestamped_get function must return a DataValue");
1807
+ }
1808
+ _Variable_bind_with_async_refresh.call(this, { refreshFunc: async_refresh_func });
1809
+ }
1810
+ else if (options.timestamped_get.length === 1) {
1811
+ _Variable_bind_with_async_refresh.call(this, { refreshFunc: options.timestamped_get });
1812
+ }
1813
+ else {
1814
+ errorLog("timestamped_get has a invalid number of argument , should be 0 or 1 ");
1815
+ throw new Error("timestamped_get has a invalid number of argument , should be 0 or 1 ");
1816
+ }
1817
+ }
1818
+ // variation 1
1819
+ function _Variable_bind_with_simple_get(options) {
1820
+ (0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
1821
+ (0, node_opcua_assert_1.assert)(typeof options.get === "function", "should specify get function");
1822
+ (0, node_opcua_assert_1.assert)(options.get?.length === 0, "get function should not have arguments");
1823
+ (0, node_opcua_assert_1.assert)(!options.timestamped_get, "should not specify a timestamped_get function when get is specified");
1824
+ (0, node_opcua_assert_1.assert)(!this._timestamped_get_func);
1825
+ (0, node_opcua_assert_1.assert)(!this._get_func);
1826
+ this._get_func = options.get;
1827
+ const timestamped_get_func_from__Variable_bind_with_simple_get = () => {
1828
+ const value = this._get_func();
1829
+ /* c8 ignore next */
1830
+ if (!is_Variant_or_StatusCode(value)) {
1831
+ errorLog(chalk_1.default.red(" Bind variable error: "), " : the getter must return a Variant or a StatusCode" + "\nvalue_check.constructor.name ", value ? value.constructor.name : "null");
1832
+ throw new Error(" bindVariable : the value getter function returns a invalid result ( expecting a Variant or a StatusCode !!!");
1833
+ }
1834
+ if (is_StatusCode(value)) {
1835
+ return new node_opcua_data_value_1.DataValue({ statusCode: value });
1836
+ }
1837
+ else {
1838
+ if (!this.$dataValue?.statusCode.isGoodish() || !(0, node_opcua_variant_1.sameVariant)(this.$dataValue.value, value)) {
1839
+ // rebuilding artificially timestamps with current clock as they are not provided
1840
+ // by the underlying getter function
1841
+ const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } = (0, node_opcua_date_time_1.getCurrentClock)();
1842
+ const serverTimestamp = sourceTimestamp;
1843
+ const serverPicoseconds = sourcePicoseconds;
1844
+ this._inner_replace_dataValue(new node_opcua_data_value_1.DataValue({ value, sourceTimestamp, sourcePicoseconds, serverTimestamp, serverPicoseconds }));
1845
+ }
1846
+ return this.$dataValue;
1847
+ }
1848
+ };
1849
+ _Variable_bind_with_timestamped_get.call(this, {
1850
+ get: undefined,
1851
+ timestamped_get: timestamped_get_func_from__Variable_bind_with_simple_get
1852
+ });
1853
+ }
1854
+ function _Variable_bind_with_simple_set(options) {
1855
+ (0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
1856
+ (0, node_opcua_assert_1.assert)(typeof options.set === "function", "should specify set function");
1857
+ (0, node_opcua_assert_1.assert)(!options.timestamped_set, "should not specify a timestamped_set function");
1858
+ (0, node_opcua_assert_1.assert)(!this._timestamped_set_func);
1859
+ (0, node_opcua_assert_1.assert)(!this._set_func);
1860
+ //
1861
+ const set_func = turn_sync_to_async(options.set, 1);
1862
+ this._set_func = set_func;
1863
+ (0, node_opcua_assert_1.assert)(set_func.length === 2, " set function must have 2 arguments ( variant, callback)");
1864
+ this._timestamped_set_func = (timestamped_value, callback) => {
1865
+ (0, node_opcua_assert_1.assert)(timestamped_value instanceof node_opcua_data_value_1.DataValue);
1866
+ set_func.call(this, timestamped_value.value, (err, statusCode) => {
1867
+ // c8 ignore next
1868
+ if (!err && !statusCode) {
1869
+ errorLog(chalk_1.default.red("UAVariable Binding Error _set_func must return a StatusCode, check the bindVariable parameters"));
1870
+ errorLog(chalk_1.default.yellow("StatusCode.Good is assumed"));
1871
+ return callback(err, node_opcua_status_code_1.StatusCodes.Good, timestamped_value);
1872
+ }
1873
+ if (statusCode?.isNotGood()) {
1874
+ // record the value but still record the statusCode !
1875
+ timestamped_value.statusCode = statusCode;
1876
+ }
1877
+ callback(err, statusCode ?? node_opcua_status_code_1.StatusCodes.BadInternalError, timestamped_value);
1878
+ });
1879
+ };
1880
+ }
1881
+ function _Variable_bind_with_timestamped_set(options) {
1882
+ (0, node_opcua_assert_1.assert)(options.timestamped_set.length === 2 || options.timestamped_set.length === 1, "timestamped_set must have 2 parameters timestamped_set: function(dataValue,callback){} or one paramater timestamped_set: function(dataValue): Promise<StatusCode>{}");
1883
+ (0, node_opcua_assert_1.assert)(!options.set, "should not specify set when timestamped_set_func exists ");
1884
+ this._timestamped_set_func = (0, multiform_func_js_1.convertToCallbackFunction1)(options.timestamped_set);
1885
+ }
1886
+ function bind_setter(options) {
1887
+ if (options.set && typeof options.set === "function") {
1888
+ // variation 1
1889
+ if (options.timestamped_set === undefined) {
1890
+ _Variable_bind_with_simple_set.call(this, options);
1891
+ }
1892
+ else {
1893
+ throw new Error("bind_setter : options should not specify both set and timestamped_set ");
1894
+ }
1895
+ }
1896
+ else if (typeof options.timestamped_set === "function") {
1897
+ // variation 2
1898
+ (0, node_opcua_assert_1.assert)(typeof options.timestamped_get === "function", "timestamped_set must be used with timestamped_get ");
1899
+ _Variable_bind_with_timestamped_set.call(this, {
1900
+ set: undefined,
1901
+ timestamped_set: options.timestamped_set
1902
+ });
1903
+ }
1904
+ else if (typeof options.timestamped_get === "function") {
1905
+ // timestamped_get is specified but timestamped_set is not
1906
+ // => Value is read-only
1907
+ _Variable_bind_with_timestamped_set.call(this, {
1908
+ set: undefined,
1909
+ timestamped_set: _not_writable_timestamped_set_func
1910
+ });
1911
+ }
1912
+ else {
1913
+ _Variable_bind_with_timestamped_set.call(this, {
1914
+ set: undefined,
1915
+ timestamped_set: _default_writable_timestamped_set_func
1916
+ });
1917
+ }
1918
+ }
1919
+ function bind_getter(options) {
1920
+ if (typeof options.get === "function") {
1921
+ // variation 1
1922
+ _Variable_bind_with_simple_get.call(this, options);
1923
+ }
1924
+ else if (typeof options.timestamped_get === "function") {
1925
+ // variation 2
1926
+ _Variable_bind_with_timestamped_get.call(this, {
1927
+ get: undefined,
1928
+ timestamped_get: options.timestamped_get
1929
+ });
1930
+ }
1931
+ else if (typeof options.refreshFunc === "function") {
1932
+ // variation 3
1933
+ if (options.get !== undefined || options.timestamped_get !== undefined) {
1934
+ throw new Error("bind_getter : options should not specify both get and timestamped_get ");
1935
+ }
1936
+ _Variable_bind_with_async_refresh.call(this, { refreshFunc: options.refreshFunc });
1937
+ }
1938
+ else {
1939
+ (0, node_opcua_assert_1.assert)(!Object.hasOwn(options, "set"), "getter is missing : a getter must be provided if a setter is provided");
1940
+ // xx bind_variant.call(this,options);
1941
+ if (options.dataType !== undefined) {
1942
+ // if (options.dataType !== DataType.ExtensionObject) {
1943
+ this.setValueFromSource(options);
1944
+ // }
1945
+ }
1946
+ }
1947
+ }
1948
+ class UAVariableImplT extends UAVariableImpl {
1949
+ readValue(context, indexRange, dataEncoding) {
1950
+ return super.readValue(context, indexRange, dataEncoding);
1951
+ }
1952
+ readValueAsync(context, callback) {
1953
+ // forward the arguments we were actually given. The base method is thenified, and
1954
+ // thenify decides between promise and callback form by argument count, so passing an
1955
+ // explicit undefined callback makes it hand that undefined straight through.
1956
+ if (callback === undefined) {
1957
+ return super.readValueAsync(context);
1958
+ }
1959
+ super.readValueAsync(context, callback);
1960
+ return undefined;
1961
+ }
1962
+ writeValue(context, dataValue, indexRangeOrCallback, callback) {
1963
+ if (callback === undefined) {
1964
+ if (indexRangeOrCallback === undefined) {
1965
+ return super.writeValue(context, dataValue);
1966
+ }
1967
+ return super.writeValue(context, dataValue, indexRangeOrCallback);
1968
+ }
1969
+ return super.writeValue(context, dataValue, indexRangeOrCallback, callback);
1970
+ }
1971
+ }
1972
+ exports.UAVariableImplT = UAVariableImplT;
1973
+ function changeUAVariableDataType(uaVariable, newDataType, valueLike) {
1974
+ let value = valueLike ? (valueLike instanceof node_opcua_variant_1.Variant ? valueLike : new node_opcua_variant_1.Variant(valueLike)) : null;
1975
+ const addressSpace = uaVariable.addressSpace;
1976
+ const newDataTypeNode = addressSpace.findNode(newDataType);
1977
+ // c8 ignore next
1978
+ if (!newDataTypeNode || !(newDataTypeNode instanceof ua_data_type_impl_js_1.UADataTypeImpl)) {
1979
+ throw new Error(`Cannot find newDataTypeNode ${newDataType.toString()}`);
1980
+ }
1981
+ const newBaseDataType = newDataTypeNode.basicDataType;
1982
+ // c8 ignore next
1983
+ if (newBaseDataType === node_opcua_variant_1.DataType.Null) {
1984
+ throw new Error("newDataTypeNode must be a DataType");
1985
+ }
1986
+ if (!value) {
1987
+ value = uaVariable.readValue().value;
1988
+ value.dataType = newBaseDataType;
1989
+ }
1990
+ if (newBaseDataType !== value.dataType) {
1991
+ throw new Error("newDataTypeNode must be of the same base dataType as the value");
1992
+ }
1993
+ // change uaVariable.dataType
1994
+ uaVariable.dataType = newDataTypeNode.nodeId;
1995
+ uaVariable._basicDataType = null;
1996
+ uaVariable.$dataValue.value.dataType = newBaseDataType;
1997
+ uaVariable.$dataValue.value = value;
1998
+ // also change the value to ensure that we have a default value with the correct dataType
1999
+ uaVariable._internal_set_value(value);
2000
+ }
2001
+ //# sourceMappingURL=ua_variable_impl.js.map