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