node-opcua-address-space 2.179.0 → 2.181.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1085) hide show
  1. package/api/address_space_public.ts +63 -0
  2. package/api/address_space_ts.ts +129 -0
  3. package/api/continuation_points/continuation_point_manager.ts +271 -0
  4. package/api/helpers/argument_list.ts +310 -0
  5. package/api/helpers/call_helpers.ts +100 -0
  6. package/api/helpers/coerce_enum_value.ts +33 -0
  7. package/api/helpers/dump_tools.ts +90 -0
  8. package/api/helpers/ensure_secure_access.ts +78 -0
  9. package/api/helpers/multiform_func.ts +78 -0
  10. package/api/helpers/resolve_opaque_on_address_space.ts +26 -0
  11. package/api/index.ts +210 -0
  12. package/api/interfaces/alarms_and_conditions/condition_info_i.ts +60 -0
  13. package/api/interfaces/alarms_and_conditions/condition_snapshot.ts +236 -0
  14. package/api/interfaces/alarms_and_conditions/deviation_stuff.ts +16 -0
  15. package/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +8 -0
  16. package/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +6 -0
  17. package/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +6 -0
  18. package/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +13 -0
  19. package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +6 -0
  20. package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +6 -0
  21. package/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +21 -0
  22. package/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +28 -0
  23. package/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +72 -0
  24. package/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +36 -0
  25. package/api/interfaces/alarms_and_conditions/ua_condition_ex.ts +55 -0
  26. package/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +17 -0
  27. package/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +21 -0
  28. package/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +21 -0
  29. package/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +26 -0
  30. package/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +29 -0
  31. package/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +25 -0
  32. package/api/interfaces/data_access/ua_multistate_discrete_ex.ts +57 -0
  33. package/api/interfaces/data_access/ua_multistate_value_discrete_ex.ts +31 -0
  34. package/api/interfaces/data_access/ua_two_state_discrete_ex.ts +15 -0
  35. package/api/interfaces/nodeset_loader_options.ts +58 -0
  36. package/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +20 -0
  37. package/api/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
  38. package/api/interfaces/state_machine/ua_program_state_machine_type.ts +14 -0
  39. package/api/interfaces/state_machine/ua_shelved_state_machine_ex.ts +35 -0
  40. package/api/interfaces/state_machine/ua_state_machine_type.ts +288 -0
  41. package/api/loader/decode_xml_extension_object.ts +80 -0
  42. package/api/loader/ensure_datatype_extracted.ts +122 -0
  43. package/api/loader/generateAddressSpaceRaw.ts +470 -0
  44. package/api/loader/load_nodeset2.ts +278 -0
  45. package/api/loader/make_xml_extension_object_parser.ts +518 -0
  46. package/api/loader/namespace_post_step.ts +68 -0
  47. package/api/loader/nodeset_image.ts +451 -0
  48. package/api/loader/nodeset_image_codec.ts +576 -0
  49. package/api/loader/nodeset_image_store.ts +78 -0
  50. package/api/loader/nodeset_record.ts +141 -0
  51. package/api/loader/nodeset_record_applier.ts +889 -0
  52. package/api/loader/nodeset_source.ts +367 -0
  53. package/api/loader/nodeset_source_helpers.ts +50 -0
  54. package/api/loader/nodeset_to_image.ts +29 -0
  55. package/api/loader/nodeset_xml_producer.ts +383 -0
  56. package/api/loader/parsers/extension_object_parser.ts +374 -0
  57. package/api/loader/parsers/variant_parser.ts +363 -0
  58. package/api/loader/register_node_promoter.ts +6 -0
  59. package/api/namespace.ts +25 -0
  60. package/api/namespace_alarm_and_condition.ts +78 -0
  61. package/api/namespace_data_access.ts +92 -0
  62. package/api/namespace_machine_state.ts +20 -0
  63. package/api/pseudo_session.ts +415 -0
  64. package/api/session_context.ts +729 -0
  65. package/api/ua_interface.ts +38 -0
  66. package/api/ua_two_state_variable_ex.ts +36 -0
  67. package/bin/opcua-nodeset-image.js +192 -0
  68. package/dist/api/address_space_public.d.ts +57 -0
  69. package/dist/api/address_space_public.js +19 -0
  70. package/dist/api/address_space_public.js.map +1 -0
  71. package/dist/api/address_space_ts.d.ts +79 -0
  72. package/dist/api/address_space_ts.js +13 -0
  73. package/dist/api/address_space_ts.js.map +1 -0
  74. package/dist/api/continuation_points/continuation_point_manager.js +230 -0
  75. package/dist/api/continuation_points/continuation_point_manager.js.map +1 -0
  76. package/dist/api/helpers/adjust_browse_direction.js.map +1 -0
  77. package/dist/api/helpers/argument_list.js +263 -0
  78. package/dist/api/helpers/argument_list.js.map +1 -0
  79. package/dist/api/helpers/call_helpers.js +80 -0
  80. package/dist/api/helpers/call_helpers.js.map +1 -0
  81. package/dist/api/helpers/coerce_enum_value.d.ts +6 -0
  82. package/dist/api/helpers/coerce_enum_value.js.map +1 -0
  83. package/dist/api/helpers/dump_tools.js +81 -0
  84. package/dist/api/helpers/dump_tools.js.map +1 -0
  85. package/dist/api/helpers/ensure_secure_access.d.ts +19 -0
  86. package/dist/api/helpers/ensure_secure_access.js +67 -0
  87. package/dist/api/helpers/ensure_secure_access.js.map +1 -0
  88. package/dist/api/helpers/make_optionals_map.js.map +1 -0
  89. package/dist/api/helpers/multiform_func.js +75 -0
  90. package/dist/api/helpers/multiform_func.js.map +1 -0
  91. package/dist/api/helpers/resolve_opaque_on_address_space.js +25 -0
  92. package/dist/api/helpers/resolve_opaque_on_address_space.js.map +1 -0
  93. package/dist/api/index.d.ts +113 -0
  94. package/dist/api/index.js +234 -0
  95. package/dist/api/index.js.map +1 -0
  96. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.d.ts +54 -0
  97. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js +28 -0
  98. package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
  99. package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.d.ts +151 -0
  100. package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.js.map +1 -0
  101. package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.d.ts +12 -0
  102. package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.js.map +1 -0
  103. package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.js.map +1 -0
  104. package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +7 -0
  105. package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +1 -0
  106. package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +1 -0
  107. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +4 -0
  108. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +1 -0
  109. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +4 -0
  110. package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +1 -0
  111. package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +10 -0
  112. package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +1 -0
  113. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +4 -0
  114. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +1 -0
  115. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -0
  116. package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +1 -0
  117. package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +20 -0
  118. package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +1 -0
  119. package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +21 -0
  120. package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +1 -0
  121. package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +56 -0
  122. package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +1 -0
  123. package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
  124. package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +19 -0
  125. package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +1 -0
  126. package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +44 -0
  127. package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.js.map +1 -0
  128. package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +4 -0
  129. package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -0
  130. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +5 -0
  131. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +1 -0
  132. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +19 -0
  133. package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +1 -0
  134. package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +25 -0
  135. package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +1 -0
  136. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +8 -0
  137. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +1 -0
  138. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +10 -0
  139. package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +1 -0
  140. package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.d.ts +44 -0
  141. package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
  142. package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +22 -0
  143. package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
  144. package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.d.ts +13 -0
  145. package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
  146. package/dist/api/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
  147. package/dist/api/interfaces/extension_object_constructor.js.map +1 -0
  148. package/dist/api/interfaces/i_condition_variable_type_setter_options.js.map +1 -0
  149. package/dist/api/interfaces/i_set_state_options.js.map +1 -0
  150. package/dist/api/interfaces/nodeset_loader_options.d.ts +56 -0
  151. package/dist/api/interfaces/nodeset_loader_options.js.map +1 -0
  152. package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
  153. package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
  154. package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
  155. package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
  156. package/dist/api/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
  157. package/dist/api/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
  158. package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +29 -0
  159. package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +1 -0
  160. package/dist/api/interfaces/state_machine/ua_state_machine_type.d.ts +236 -0
  161. package/dist/api/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
  162. package/dist/api/interfaces/state_machine/ua_transition_ex.js.map +1 -0
  163. package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
  164. package/dist/api/loader/decode_xml_extension_object.d.ts +6 -0
  165. package/dist/api/loader/decode_xml_extension_object.js +69 -0
  166. package/dist/api/loader/decode_xml_extension_object.js.map +1 -0
  167. package/dist/api/loader/ensure_datatype_extracted.js +88 -0
  168. package/dist/api/loader/ensure_datatype_extracted.js.map +1 -0
  169. package/dist/api/loader/generateAddressSpaceRaw.d.ts +64 -0
  170. package/dist/api/loader/generateAddressSpaceRaw.js +379 -0
  171. package/dist/api/loader/generateAddressSpaceRaw.js.map +1 -0
  172. package/dist/api/loader/load_nodeset2.d.ts +38 -0
  173. package/dist/api/loader/load_nodeset2.js +245 -0
  174. package/dist/api/loader/load_nodeset2.js.map +1 -0
  175. package/dist/api/loader/make_semver_compatible.js.map +1 -0
  176. package/dist/api/loader/make_xml_extension_object_parser.js +417 -0
  177. package/dist/api/loader/make_xml_extension_object_parser.js.map +1 -0
  178. package/dist/api/loader/namespace_post_step.js +57 -0
  179. package/dist/api/loader/namespace_post_step.js.map +1 -0
  180. package/dist/api/loader/nodeset_image.d.ts +94 -0
  181. package/dist/api/loader/nodeset_image.js +406 -0
  182. package/dist/api/loader/nodeset_image.js.map +1 -0
  183. package/dist/api/loader/nodeset_image_codec.d.ts +104 -0
  184. package/dist/api/loader/nodeset_image_codec.js +489 -0
  185. package/dist/api/loader/nodeset_image_codec.js.map +1 -0
  186. package/dist/api/loader/nodeset_image_store.d.ts +27 -0
  187. package/dist/api/loader/nodeset_image_store.js +72 -0
  188. package/dist/api/loader/nodeset_image_store.js.map +1 -0
  189. package/dist/api/loader/nodeset_record.d.ts +125 -0
  190. package/dist/api/loader/nodeset_record.js +26 -0
  191. package/dist/api/loader/nodeset_record.js.map +1 -0
  192. package/dist/api/loader/nodeset_record_applier.d.ts +106 -0
  193. package/dist/api/loader/nodeset_record_applier.js +731 -0
  194. package/dist/api/loader/nodeset_record_applier.js.map +1 -0
  195. package/dist/api/loader/nodeset_source.d.ts +124 -0
  196. package/dist/api/loader/nodeset_source.js +307 -0
  197. package/dist/api/loader/nodeset_source.js.map +1 -0
  198. package/dist/api/loader/nodeset_source_helpers.d.ts +27 -0
  199. package/dist/api/loader/nodeset_source_helpers.js +30 -0
  200. package/dist/api/loader/nodeset_source_helpers.js.map +1 -0
  201. package/dist/api/loader/nodeset_to_image.d.ts +13 -0
  202. package/dist/api/loader/nodeset_to_image.js +30 -0
  203. package/dist/api/loader/nodeset_to_image.js.map +1 -0
  204. package/dist/api/loader/nodeset_xml_producer.d.ts +16 -0
  205. package/dist/api/loader/nodeset_xml_producer.js +349 -0
  206. package/dist/api/loader/nodeset_xml_producer.js.map +1 -0
  207. package/dist/api/loader/parsers/extension_object_parser.js +274 -0
  208. package/dist/api/loader/parsers/extension_object_parser.js.map +1 -0
  209. package/dist/api/loader/parsers/localized_text_parser.js.map +1 -0
  210. package/dist/api/loader/parsers/nodeid_parser.js.map +1 -0
  211. package/dist/api/loader/parsers/qualified_name_parser.js.map +1 -0
  212. package/dist/api/loader/parsers/variant_parser.d.ts +42 -0
  213. package/dist/api/loader/parsers/variant_parser.js +294 -0
  214. package/dist/api/loader/parsers/variant_parser.js.map +1 -0
  215. package/dist/api/loader/register_node_promoter.d.ts +2 -0
  216. package/dist/api/loader/register_node_promoter.js +9 -0
  217. package/dist/api/loader/register_node_promoter.js.map +1 -0
  218. package/dist/api/namespace.d.ts +18 -0
  219. package/dist/api/namespace.js.map +1 -0
  220. package/dist/api/namespace_alarm_and_condition.d.ts +33 -0
  221. package/dist/api/namespace_alarm_and_condition.js.map +1 -0
  222. package/dist/api/namespace_data_access.d.ts +67 -0
  223. package/dist/api/namespace_data_access.js.map +1 -0
  224. package/dist/api/namespace_machine_state.d.ts +8 -0
  225. package/dist/api/namespace_machine_state.js.map +1 -0
  226. package/dist/api/pseudo_session.d.ts +74 -0
  227. package/dist/api/pseudo_session.js +308 -0
  228. package/dist/api/pseudo_session.js.map +1 -0
  229. package/dist/api/session_context.d.ts +242 -0
  230. package/dist/api/session_context.js +524 -0
  231. package/dist/api/session_context.js.map +1 -0
  232. package/dist/api/set_namespace_meta_data.js.map +1 -0
  233. package/dist/api/ua_addin.js.map +1 -0
  234. package/dist/api/ua_interface.js +25 -0
  235. package/dist/api/ua_interface.js.map +1 -0
  236. package/dist/api/ua_root_folder.js.map +1 -0
  237. package/dist/api/ua_two_state_variable_ex.d.ts +24 -0
  238. package/dist/api/ua_two_state_variable_ex.js.map +1 -0
  239. package/dist/api/xml_writer.js.map +1 -0
  240. package/dist/impl/_instantiate_helpers.js +99 -0
  241. package/dist/impl/_instantiate_helpers.js.map +1 -0
  242. package/dist/impl/_mandatory_child_or_requested_optional_filter.js +82 -0
  243. package/dist/impl/_mandatory_child_or_requested_optional_filter.js.map +1 -0
  244. package/dist/impl/address_space.d.ts +379 -0
  245. package/dist/impl/address_space.js +1383 -0
  246. package/dist/impl/address_space.js.map +1 -0
  247. package/dist/impl/address_space_change_event_tools.d.ts +6 -0
  248. package/dist/impl/address_space_change_event_tools.js.map +1 -0
  249. package/dist/impl/address_space_private.d.ts +48 -0
  250. package/dist/impl/address_space_private.js.map +1 -0
  251. package/dist/impl/alarms_and_conditions/condition.js.map +1 -0
  252. package/dist/impl/alarms_and_conditions/condition_info_impl.d.ts +19 -0
  253. package/dist/impl/alarms_and_conditions/condition_info_impl.js +39 -0
  254. package/dist/impl/alarms_and_conditions/condition_info_impl.js.map +1 -0
  255. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.d.ts +271 -0
  256. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js +700 -0
  257. package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js.map +1 -0
  258. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.d.ts +12 -0
  259. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js +66 -0
  260. package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
  261. package/dist/impl/alarms_and_conditions/index.d.ts +16 -0
  262. package/dist/impl/alarms_and_conditions/index.js +33 -0
  263. package/dist/impl/alarms_and_conditions/index.js.map +1 -0
  264. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +54 -0
  265. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
  266. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
  267. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts +105 -0
  268. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +428 -0
  269. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
  270. package/dist/impl/alarms_and_conditions/ua_base_event_impl.d.ts +36 -0
  271. package/dist/impl/alarms_and_conditions/ua_base_event_impl.js +32 -0
  272. package/dist/impl/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
  273. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +47 -0
  274. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +204 -0
  275. package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
  276. package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts +152 -0
  277. package/dist/impl/alarms_and_conditions/ua_condition_impl.js +1016 -0
  278. package/dist/impl/alarms_and_conditions/ua_condition_impl.js.map +1 -0
  279. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +22 -0
  280. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js +41 -0
  281. package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
  282. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +30 -0
  283. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +54 -0
  284. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
  285. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +12 -0
  286. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +13 -0
  287. package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
  288. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +28 -0
  289. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +86 -0
  290. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
  291. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
  292. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
  293. package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
  294. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts +49 -0
  295. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js +207 -0
  296. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
  297. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
  298. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +54 -0
  299. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
  300. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +38 -0
  301. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +172 -0
  302. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
  303. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +44 -0
  304. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js +164 -0
  305. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
  306. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +18 -0
  307. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
  308. package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
  309. package/dist/impl/apply_condition_refresh.d.ts +4 -0
  310. package/dist/impl/apply_condition_refresh.js +29 -0
  311. package/dist/impl/apply_condition_refresh.js.map +1 -0
  312. package/dist/impl/base_node_impl.d.ts +347 -0
  313. package/dist/impl/base_node_impl.js +1768 -0
  314. package/dist/impl/base_node_impl.js.map +1 -0
  315. package/dist/impl/base_node_private.d.ts +138 -0
  316. package/dist/impl/base_node_private.js +1028 -0
  317. package/dist/impl/base_node_private.js.map +1 -0
  318. package/dist/impl/check_value_rank_compatibility.js.map +1 -0
  319. package/dist/impl/child_accessors.d.ts +43 -0
  320. package/dist/impl/child_accessors.js +222 -0
  321. package/dist/impl/child_accessors.js.map +1 -0
  322. package/dist/impl/data_access/add_dataItem_stuff.js.map +1 -0
  323. package/dist/impl/data_access/adjust_datavalue_status_code.d.ts +7 -0
  324. package/dist/impl/data_access/adjust_datavalue_status_code.js.map +1 -0
  325. package/dist/impl/data_access/ua_multistate_discrete_impl.d.ts +38 -0
  326. package/dist/impl/data_access/ua_multistate_discrete_impl.js +143 -0
  327. package/dist/impl/data_access/ua_multistate_discrete_impl.js.map +1 -0
  328. package/dist/impl/data_access/ua_multistate_value_discrete_impl.d.ts +61 -0
  329. package/dist/impl/data_access/ua_multistate_value_discrete_impl.js +303 -0
  330. package/dist/impl/data_access/ua_multistate_value_discrete_impl.js.map +1 -0
  331. package/dist/impl/data_access/ua_two_state_discrete_impl.d.ts +30 -0
  332. package/dist/impl/data_access/ua_two_state_discrete_impl.js +164 -0
  333. package/dist/impl/data_access/ua_two_state_discrete_impl.js.map +1 -0
  334. package/dist/impl/event_data.d.ts +27 -0
  335. package/dist/impl/event_data.js +73 -0
  336. package/dist/impl/event_data.js.map +1 -0
  337. package/dist/impl/event_layout.d.ts +40 -0
  338. package/dist/impl/event_layout.js +103 -0
  339. package/dist/impl/event_layout.js.map +1 -0
  340. package/dist/impl/extension_object_array_node.d.ts +41 -0
  341. package/dist/impl/extension_object_array_node.js +274 -0
  342. package/dist/impl/extension_object_array_node.js.map +1 -0
  343. package/dist/impl/get_basic_datatype.js.map +1 -0
  344. package/dist/impl/handle_hierarchy_parent.d.ts +33 -0
  345. package/dist/impl/handle_hierarchy_parent.js +103 -0
  346. package/dist/impl/handle_hierarchy_parent.js.map +1 -0
  347. package/dist/impl/historical_access/address_space_historical_data_node.d.ts +21 -0
  348. package/dist/impl/historical_access/address_space_historical_data_node.js +658 -0
  349. package/dist/impl/historical_access/address_space_historical_data_node.js.map +1 -0
  350. package/dist/impl/historizer_factory.d.ts +18 -0
  351. package/dist/impl/historizer_factory.js +16 -0
  352. package/dist/impl/historizer_factory.js.map +1 -0
  353. package/dist/impl/idx_iterator.js.map +1 -0
  354. package/dist/impl/namespace_impl.d.ts +469 -0
  355. package/dist/impl/namespace_impl.js +1845 -0
  356. package/dist/impl/namespace_impl.js.map +1 -0
  357. package/dist/impl/namespace_private.d.ts +25 -0
  358. package/dist/impl/namespace_private.js.map +1 -0
  359. package/dist/impl/nodeid_manager.js +249 -0
  360. package/dist/impl/nodeid_manager.js.map +1 -0
  361. package/dist/impl/nodeset_tools/adjust_namespace_array.js.map +1 -0
  362. package/dist/impl/nodeset_tools/construct_namespace_dependency.d.ts +37 -0
  363. package/dist/impl/nodeset_tools/construct_namespace_dependency.js +352 -0
  364. package/dist/impl/nodeset_tools/construct_namespace_dependency.js.map +1 -0
  365. package/dist/impl/nodeset_tools/dump_to_bsd.d.ts +10 -0
  366. package/dist/impl/nodeset_tools/dump_to_bsd.js +176 -0
  367. package/dist/impl/nodeset_tools/dump_to_bsd.js.map +1 -0
  368. package/dist/impl/nodeset_tools/nodeset_to_records.d.ts +67 -0
  369. package/dist/impl/nodeset_tools/nodeset_to_records.js +773 -0
  370. package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -0
  371. package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +28 -0
  372. package/dist/impl/nodeset_tools/nodeset_to_xml.js +1132 -0
  373. package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -0
  374. package/dist/impl/private_namespace.d.ts +5 -0
  375. package/dist/impl/private_namespace.js.map +1 -0
  376. package/dist/impl/reference_impl.d.ts +82 -0
  377. package/dist/impl/reference_impl.js +207 -0
  378. package/dist/impl/reference_impl.js.map +1 -0
  379. package/dist/impl/reference_type_version.d.ts +22 -0
  380. package/dist/impl/reference_type_version.js +22 -0
  381. package/dist/impl/reference_type_version.js.map +1 -0
  382. package/dist/impl/role_permissions.js.map +1 -0
  383. package/dist/impl/state_machine/finite_state_machine.d.ts +81 -0
  384. package/dist/impl/state_machine/finite_state_machine.js +573 -0
  385. package/dist/impl/state_machine/finite_state_machine.js.map +1 -0
  386. package/dist/impl/state_machine/ua_shelving_state_machine_ex.d.ts +64 -0
  387. package/dist/impl/state_machine/ua_shelving_state_machine_ex.js +249 -0
  388. package/dist/impl/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
  389. package/dist/impl/state_machine/ua_two_state_variable.d.ts +55 -0
  390. package/dist/impl/state_machine/ua_two_state_variable.js +323 -0
  391. package/dist/impl/state_machine/ua_two_state_variable.js.map +1 -0
  392. package/dist/impl/tool_isSubtypeOf.d.ts +18 -0
  393. package/dist/impl/tool_isSubtypeOf.js +138 -0
  394. package/dist/impl/tool_isSubtypeOf.js.map +1 -0
  395. package/dist/impl/ua_condition_type.js.map +1 -0
  396. package/dist/impl/ua_data_type_impl.d.ts +87 -0
  397. package/dist/impl/ua_data_type_impl.js +391 -0
  398. package/dist/impl/ua_data_type_impl.js.map +1 -0
  399. package/dist/impl/ua_method_impl.d.ts +48 -0
  400. package/dist/impl/ua_method_impl.js +281 -0
  401. package/dist/impl/ua_method_impl.js.map +1 -0
  402. package/dist/impl/ua_object_impl.d.ts +38 -0
  403. package/dist/impl/ua_object_impl.js +214 -0
  404. package/dist/impl/ua_object_impl.js.map +1 -0
  405. package/dist/impl/ua_object_type_impl.d.ts +55 -0
  406. package/dist/impl/ua_object_type_impl.js +131 -0
  407. package/dist/impl/ua_object_type_impl.js.map +1 -0
  408. package/dist/impl/ua_reference_type_impl.d.ts +42 -0
  409. package/dist/impl/ua_reference_type_impl.js +157 -0
  410. package/dist/impl/ua_reference_type_impl.js.map +1 -0
  411. package/dist/impl/ua_variable_impl.d.ts +391 -0
  412. package/dist/impl/ua_variable_impl.js +2001 -0
  413. package/dist/impl/ua_variable_impl.js.map +1 -0
  414. package/dist/impl/ua_variable_impl_ext_obj.d.ts +23 -0
  415. package/dist/impl/ua_variable_impl_ext_obj.js +753 -0
  416. package/dist/impl/ua_variable_impl_ext_obj.js.map +1 -0
  417. package/dist/impl/ua_variable_type_impl.d.ts +79 -0
  418. package/dist/impl/ua_variable_type_impl.js +279 -0
  419. package/dist/impl/ua_variable_type_impl.js.map +1 -0
  420. package/dist/impl/ua_view_impl.d.ts +18 -0
  421. package/dist/impl/ua_view_impl.js +45 -0
  422. package/dist/impl/ua_view_impl.js.map +1 -0
  423. package/dist/impl/validate_data_type_correctness.d.ts +6 -0
  424. package/dist/impl/validate_data_type_correctness.js +123 -0
  425. package/dist/impl/validate_data_type_correctness.js.map +1 -0
  426. package/dist/tsconfig_base.tsbuildinfo +1 -1
  427. package/distHelpers/address_space_digest.d.ts +4 -0
  428. package/distHelpers/address_space_digest.js +9 -0
  429. package/distHelpers/address_space_digest.js.map +1 -0
  430. package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
  431. package/distHelpers/assertHasMatchingReference.d.ts +1 -1
  432. package/distHelpers/boiler_system.d.ts +1 -1
  433. package/distHelpers/boiler_system.js +3 -3
  434. package/distHelpers/boiler_system.js.map +1 -1
  435. package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
  436. package/distHelpers/get_address_space_fixture.js +38 -22
  437. package/distHelpers/get_address_space_fixture.js.map +1 -1
  438. package/distHelpers/get_mini_address_space.d.ts +1 -1
  439. package/distHelpers/get_mini_address_space.js +7 -7
  440. package/distHelpers/get_mini_address_space.js.map +1 -1
  441. package/distHelpers/index.d.ts +9 -9
  442. package/distHelpers/index.js +9 -9
  443. package/distHelpers/index.js.map +1 -1
  444. package/distHelpers/mock_session.d.ts +1 -1
  445. package/distHelpers/mock_session.js +2 -2
  446. package/distHelpers/mock_session.js.map +1 -1
  447. package/distNodeJS/address_space_digest.d.ts +13 -0
  448. package/distNodeJS/address_space_digest.js +31 -0
  449. package/distNodeJS/address_space_digest.js.map +1 -0
  450. package/distNodeJS/generate_address_space.d.ts +35 -2
  451. package/distNodeJS/generate_address_space.js +201 -7
  452. package/distNodeJS/generate_address_space.js.map +1 -1
  453. package/distNodeJS/index.d.ts +3 -1
  454. package/distNodeJS/index.js +3 -1
  455. package/distNodeJS/index.js.map +1 -1
  456. package/distNodeJS/nodeset_image_file_store.d.ts +29 -0
  457. package/distNodeJS/nodeset_image_file_store.js +120 -0
  458. package/distNodeJS/nodeset_image_file_store.js.map +1 -0
  459. package/impl/_instantiate_helpers.ts +197 -0
  460. package/impl/_mandatory_child_or_requested_optional_filter.ts +100 -0
  461. package/impl/address_space.ts +1572 -0
  462. package/impl/address_space_change_event_tools.ts +177 -0
  463. package/impl/address_space_private.ts +100 -0
  464. package/impl/alarms_and_conditions/condition_info_impl.ts +45 -0
  465. package/impl/alarms_and_conditions/condition_snapshot_impl.ts +793 -0
  466. package/impl/alarms_and_conditions/deviation_alarm_helper.ts +73 -0
  467. package/impl/alarms_and_conditions/index.ts +16 -0
  468. package/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +351 -0
  469. package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +515 -0
  470. package/impl/alarms_and_conditions/ua_base_event_impl.ts +61 -0
  471. package/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +246 -0
  472. package/impl/alarms_and_conditions/ua_condition_impl.ts +1286 -0
  473. package/impl/alarms_and_conditions/ua_discrete_alarm_impl.ts +60 -0
  474. package/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +95 -0
  475. package/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +21 -0
  476. package/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +112 -0
  477. package/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +25 -0
  478. package/impl/alarms_and_conditions/ua_limit_alarm_impl.ts +265 -0
  479. package/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +94 -0
  480. package/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +232 -0
  481. package/impl/alarms_and_conditions/ua_off_normal_alarm_impl.ts +216 -0
  482. package/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +26 -0
  483. package/impl/apply_condition_refresh.ts +56 -0
  484. package/impl/base_node_impl.ts +2165 -0
  485. package/impl/base_node_private.ts +1420 -0
  486. package/impl/child_accessors.ts +239 -0
  487. package/impl/data_access/adjust_datavalue_status_code.ts +36 -0
  488. package/impl/data_access/ua_multistate_discrete_impl.ts +198 -0
  489. package/impl/data_access/ua_multistate_value_discrete_impl.ts +384 -0
  490. package/impl/data_access/ua_two_state_discrete_impl.ts +195 -0
  491. package/impl/event_data.ts +80 -0
  492. package/impl/event_layout.ts +141 -0
  493. package/impl/extension_object_array_node.ts +343 -0
  494. package/impl/handle_hierarchy_parent.ts +133 -0
  495. package/impl/historical_access/address_space_historical_data_node.ts +849 -0
  496. package/impl/historizer_factory.ts +17 -0
  497. package/impl/namespace_impl.ts +2323 -0
  498. package/impl/namespace_private.ts +68 -0
  499. package/impl/nodeid_manager.ts +293 -0
  500. package/impl/nodeset_tools/construct_namespace_dependency.ts +381 -0
  501. package/impl/nodeset_tools/dump_to_bsd.ts +210 -0
  502. package/impl/nodeset_tools/nodeset_to_records.ts +846 -0
  503. package/impl/nodeset_tools/nodeset_to_xml.ts +1326 -0
  504. package/impl/private_namespace.ts +21 -0
  505. package/impl/reference_impl.ts +244 -0
  506. package/impl/reference_type_version.ts +19 -0
  507. package/impl/state_machine/finite_state_machine.ts +676 -0
  508. package/impl/state_machine/ua_shelving_state_machine_ex.ts +356 -0
  509. package/impl/state_machine/ua_two_state_variable.ts +421 -0
  510. package/impl/tool_isSubtypeOf.ts +168 -0
  511. package/impl/ua_data_type_impl.ts +486 -0
  512. package/impl/ua_method_impl.ts +364 -0
  513. package/impl/ua_object_impl.ts +278 -0
  514. package/impl/ua_object_type_impl.ts +179 -0
  515. package/impl/ua_reference_type_impl.ts +179 -0
  516. package/impl/ua_variable_impl.ts +2559 -0
  517. package/impl/ua_variable_impl_ext_obj.ts +904 -0
  518. package/impl/ua_variable_type_impl.ts +390 -0
  519. package/impl/ua_view_impl.ts +53 -0
  520. package/impl/validate_data_type_correctness.ts +142 -0
  521. package/package.json +49 -44
  522. package/source_nodejs/address_space_digest.ts +35 -0
  523. package/source_nodejs/generate_address_space.ts +181 -8
  524. package/source_nodejs/index.ts +3 -1
  525. package/source_nodejs/nodeset_image_file_store.ts +127 -0
  526. package/dist/source/address_space_ts.d.ts +0 -128
  527. package/dist/source/address_space_ts.js +0 -23
  528. package/dist/source/address_space_ts.js.map +0 -1
  529. package/dist/source/continuation_points/continuation_point_manager.js +0 -230
  530. package/dist/source/continuation_points/continuation_point_manager.js.map +0 -1
  531. package/dist/source/helpers/adjust_browse_direction.js.map +0 -1
  532. package/dist/source/helpers/argument_list.js +0 -263
  533. package/dist/source/helpers/argument_list.js.map +0 -1
  534. package/dist/source/helpers/call_helpers.js +0 -80
  535. package/dist/source/helpers/call_helpers.js.map +0 -1
  536. package/dist/source/helpers/coerce_enum_value.d.ts +0 -6
  537. package/dist/source/helpers/coerce_enum_value.js.map +0 -1
  538. package/dist/source/helpers/dump_tools.js +0 -81
  539. package/dist/source/helpers/dump_tools.js.map +0 -1
  540. package/dist/source/helpers/ensure_secure_access.d.ts +0 -9
  541. package/dist/source/helpers/ensure_secure_access.js +0 -58
  542. package/dist/source/helpers/ensure_secure_access.js.map +0 -1
  543. package/dist/source/helpers/make_optionals_map.js.map +0 -1
  544. package/dist/source/helpers/multiform_func.js +0 -75
  545. package/dist/source/helpers/multiform_func.js.map +0 -1
  546. package/dist/source/helpers/resolve_opaque_on_address_space.js +0 -25
  547. package/dist/source/helpers/resolve_opaque_on_address_space.js.map +0 -1
  548. package/dist/source/index.d.ts +0 -66
  549. package/dist/source/index.js +0 -97
  550. package/dist/source/index.js.map +0 -1
  551. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +0 -21
  552. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +0 -3
  553. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +0 -1
  554. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +0 -150
  555. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +0 -1
  556. package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +0 -12
  557. package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js.map +0 -1
  558. package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js.map +0 -1
  559. package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +0 -7
  560. package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +0 -1
  561. package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +0 -1
  562. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +0 -4
  563. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +0 -1
  564. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +0 -4
  565. package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +0 -1
  566. package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +0 -10
  567. package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +0 -1
  568. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +0 -4
  569. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +0 -1
  570. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +0 -4
  571. package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +0 -1
  572. package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +0 -20
  573. package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +0 -1
  574. package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +0 -21
  575. package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +0 -1
  576. package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +0 -33
  577. package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +0 -1
  578. package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +0 -1
  579. package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +0 -19
  580. package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +0 -1
  581. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +0 -44
  582. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js.map +0 -1
  583. package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +0 -4
  584. package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +0 -1
  585. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +0 -5
  586. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +0 -1
  587. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +0 -19
  588. package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +0 -1
  589. package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +0 -25
  590. package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +0 -1
  591. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +0 -8
  592. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +0 -1
  593. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +0 -10
  594. package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +0 -1
  595. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +0 -44
  596. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +0 -1
  597. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +0 -22
  598. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +0 -1
  599. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +0 -13
  600. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +0 -1
  601. package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +0 -1
  602. package/dist/source/interfaces/extension_object_constructor.js.map +0 -1
  603. package/dist/source/interfaces/i_condition_variable_type_setter_options.js.map +0 -1
  604. package/dist/source/interfaces/i_set_state_options.js.map +0 -1
  605. package/dist/source/interfaces/nodeset_loader_options.d.ts +0 -37
  606. package/dist/source/interfaces/nodeset_loader_options.js.map +0 -1
  607. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +0 -12
  608. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +0 -1
  609. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +0 -49
  610. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +0 -1
  611. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +0 -11
  612. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +0 -1
  613. package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +0 -29
  614. package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +0 -1
  615. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +0 -236
  616. package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +0 -1
  617. package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +0 -1
  618. package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +0 -1
  619. package/dist/source/loader/decode_xml_extension_object.d.ts +0 -6
  620. package/dist/source/loader/decode_xml_extension_object.js +0 -69
  621. package/dist/source/loader/decode_xml_extension_object.js.map +0 -1
  622. package/dist/source/loader/ensure_datatype_extracted.js +0 -88
  623. package/dist/source/loader/ensure_datatype_extracted.js.map +0 -1
  624. package/dist/source/loader/generateAddressSpaceRaw.d.ts +0 -29
  625. package/dist/source/loader/generateAddressSpaceRaw.js +0 -188
  626. package/dist/source/loader/generateAddressSpaceRaw.js.map +0 -1
  627. package/dist/source/loader/load_nodeset2.d.ts +0 -15
  628. package/dist/source/loader/load_nodeset2.js +0 -1047
  629. package/dist/source/loader/load_nodeset2.js.map +0 -1
  630. package/dist/source/loader/make_semver_compatible.js.map +0 -1
  631. package/dist/source/loader/make_xml_extension_object_parser.js +0 -422
  632. package/dist/source/loader/make_xml_extension_object_parser.js.map +0 -1
  633. package/dist/source/loader/namespace_post_step.js +0 -57
  634. package/dist/source/loader/namespace_post_step.js.map +0 -1
  635. package/dist/source/loader/parsers/extension_object_parser.js +0 -274
  636. package/dist/source/loader/parsers/extension_object_parser.js.map +0 -1
  637. package/dist/source/loader/parsers/localized_text_parser.js.map +0 -1
  638. package/dist/source/loader/parsers/nodeid_parser.js.map +0 -1
  639. package/dist/source/loader/parsers/qualified_name_parser.js.map +0 -1
  640. package/dist/source/loader/parsers/variant_parser.d.ts +0 -35
  641. package/dist/source/loader/parsers/variant_parser.js +0 -331
  642. package/dist/source/loader/parsers/variant_parser.js.map +0 -1
  643. package/dist/source/loader/register_node_promoter.d.ts +0 -2
  644. package/dist/source/loader/register_node_promoter.js +0 -9
  645. package/dist/source/loader/register_node_promoter.js.map +0 -1
  646. package/dist/source/namespace.d.ts +0 -6
  647. package/dist/source/namespace.js.map +0 -1
  648. package/dist/source/namespace_alarm_and_condition.d.ts +0 -33
  649. package/dist/source/namespace_alarm_and_condition.js.map +0 -1
  650. package/dist/source/namespace_data_access.d.ts +0 -67
  651. package/dist/source/namespace_data_access.js.map +0 -1
  652. package/dist/source/namespace_machine_state.d.ts +0 -8
  653. package/dist/source/namespace_machine_state.js.map +0 -1
  654. package/dist/source/pseudo_session.d.ts +0 -74
  655. package/dist/source/pseudo_session.js +0 -308
  656. package/dist/source/pseudo_session.js.map +0 -1
  657. package/dist/source/session_context.d.ts +0 -241
  658. package/dist/source/session_context.js +0 -517
  659. package/dist/source/session_context.js.map +0 -1
  660. package/dist/source/set_namespace_meta_data.js.map +0 -1
  661. package/dist/source/ua_addin.js.map +0 -1
  662. package/dist/source/ua_interface.js +0 -25
  663. package/dist/source/ua_interface.js.map +0 -1
  664. package/dist/source/ua_root_folder.js.map +0 -1
  665. package/dist/source/ua_two_state_variable_ex.d.ts +0 -24
  666. package/dist/source/ua_two_state_variable_ex.js.map +0 -1
  667. package/dist/source/xml_writer.js.map +0 -1
  668. package/dist/src/_instantiate_helpers.js +0 -99
  669. package/dist/src/_instantiate_helpers.js.map +0 -1
  670. package/dist/src/_mandatory_child_or_requested_optional_filter.js +0 -82
  671. package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +0 -1
  672. package/dist/src/address_space.d.ts +0 -369
  673. package/dist/src/address_space.js +0 -1416
  674. package/dist/src/address_space.js.map +0 -1
  675. package/dist/src/address_space_change_event_tools.d.ts +0 -6
  676. package/dist/src/address_space_change_event_tools.js.map +0 -1
  677. package/dist/src/address_space_private.d.ts +0 -45
  678. package/dist/src/address_space_private.js.map +0 -1
  679. package/dist/src/alarms_and_conditions/condition.js.map +0 -1
  680. package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +0 -18
  681. package/dist/src/alarms_and_conditions/condition_info_impl.js +0 -38
  682. package/dist/src/alarms_and_conditions/condition_info_impl.js.map +0 -1
  683. package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +0 -269
  684. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +0 -699
  685. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +0 -1
  686. package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +0 -12
  687. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +0 -66
  688. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +0 -1
  689. package/dist/src/alarms_and_conditions/index.d.ts +0 -16
  690. package/dist/src/alarms_and_conditions/index.js +0 -33
  691. package/dist/src/alarms_and_conditions/index.js.map +0 -1
  692. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +0 -42
  693. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +0 -243
  694. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +0 -1
  695. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +0 -80
  696. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +0 -415
  697. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +0 -1
  698. package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +0 -18
  699. package/dist/src/alarms_and_conditions/ua_base_event_impl.js +0 -33
  700. package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +0 -1
  701. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +0 -44
  702. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -203
  703. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +0 -1
  704. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -104
  705. package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -1017
  706. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +0 -1
  707. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +0 -19
  708. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +0 -39
  709. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +0 -1
  710. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +0 -25
  711. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +0 -55
  712. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +0 -1
  713. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +0 -11
  714. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +0 -12
  715. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +0 -1
  716. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -23
  717. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -87
  718. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +0 -1
  719. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +0 -10
  720. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +0 -8
  721. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +0 -1
  722. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -26
  723. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -208
  724. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +0 -1
  725. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +0 -23
  726. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +0 -55
  727. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +0 -1
  728. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +0 -27
  729. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -173
  730. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +0 -1
  731. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -43
  732. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -168
  733. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +0 -1
  734. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +0 -18
  735. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +0 -18
  736. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +0 -1
  737. package/dist/src/apply_condition_refresh.d.ts +0 -4
  738. package/dist/src/apply_condition_refresh.js +0 -27
  739. package/dist/src/apply_condition_refresh.js.map +0 -1
  740. package/dist/src/base_node_impl.d.ts +0 -287
  741. package/dist/src/base_node_impl.js +0 -1538
  742. package/dist/src/base_node_impl.js.map +0 -1
  743. package/dist/src/base_node_private.d.ts +0 -87
  744. package/dist/src/base_node_private.js +0 -925
  745. package/dist/src/base_node_private.js.map +0 -1
  746. package/dist/src/check_value_rank_compatibility.js.map +0 -1
  747. package/dist/src/data_access/add_dataItem_stuff.js.map +0 -1
  748. package/dist/src/data_access/adjust_datavalue_status_code.d.ts +0 -7
  749. package/dist/src/data_access/adjust_datavalue_status_code.js.map +0 -1
  750. package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +0 -35
  751. package/dist/src/data_access/ua_multistate_discrete_impl.js +0 -142
  752. package/dist/src/data_access/ua_multistate_discrete_impl.js.map +0 -1
  753. package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +0 -51
  754. package/dist/src/data_access/ua_multistate_value_discrete_impl.js +0 -302
  755. package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +0 -1
  756. package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +0 -20
  757. package/dist/src/data_access/ua_two_state_discrete_impl.js +0 -163
  758. package/dist/src/data_access/ua_two_state_discrete_impl.js.map +0 -1
  759. package/dist/src/event_data.d.ts +0 -18
  760. package/dist/src/event_data.js +0 -70
  761. package/dist/src/event_data.js.map +0 -1
  762. package/dist/src/extension_object_array_node.d.ts +0 -34
  763. package/dist/src/extension_object_array_node.js +0 -262
  764. package/dist/src/extension_object_array_node.js.map +0 -1
  765. package/dist/src/get_basic_datatype.js.map +0 -1
  766. package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -21
  767. package/dist/src/historical_access/address_space_historical_data_node.js +0 -654
  768. package/dist/src/historical_access/address_space_historical_data_node.js.map +0 -1
  769. package/dist/src/idx_iterator.js.map +0 -1
  770. package/dist/src/index_current.d.ts +0 -50
  771. package/dist/src/index_current.js +0 -82
  772. package/dist/src/index_current.js.map +0 -1
  773. package/dist/src/namespace_impl.d.ts +0 -450
  774. package/dist/src/namespace_impl.js +0 -1876
  775. package/dist/src/namespace_impl.js.map +0 -1
  776. package/dist/src/namespace_private.d.ts +0 -31
  777. package/dist/src/namespace_private.js.map +0 -1
  778. package/dist/src/nodeid_manager.js +0 -249
  779. package/dist/src/nodeid_manager.js.map +0 -1
  780. package/dist/src/nodeset_tools/adjust_namespace_array.js.map +0 -1
  781. package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +0 -33
  782. package/dist/src/nodeset_tools/construct_namespace_dependency.js +0 -347
  783. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +0 -1
  784. package/dist/src/nodeset_tools/dump_to_bsd.d.ts +0 -2
  785. package/dist/src/nodeset_tools/dump_to_bsd.js +0 -164
  786. package/dist/src/nodeset_tools/dump_to_bsd.js.map +0 -1
  787. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +0 -12
  788. package/dist/src/nodeset_tools/nodeset_to_xml.js +0 -1381
  789. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +0 -1
  790. package/dist/src/private_namespace.d.ts +0 -5
  791. package/dist/src/private_namespace.js.map +0 -1
  792. package/dist/src/reference_impl.d.ts +0 -43
  793. package/dist/src/reference_impl.js +0 -152
  794. package/dist/src/reference_impl.js.map +0 -1
  795. package/dist/src/role_permissions.js.map +0 -1
  796. package/dist/src/state_machine/finite_state_machine.d.ts +0 -70
  797. package/dist/src/state_machine/finite_state_machine.js +0 -574
  798. package/dist/src/state_machine/finite_state_machine.js.map +0 -1
  799. package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +0 -39
  800. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +0 -249
  801. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +0 -1
  802. package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -55
  803. package/dist/src/state_machine/ua_two_state_variable.js +0 -323
  804. package/dist/src/state_machine/ua_two_state_variable.js.map +0 -1
  805. package/dist/src/tool_isSubtypeOf.d.ts +0 -18
  806. package/dist/src/tool_isSubtypeOf.js +0 -130
  807. package/dist/src/tool_isSubtypeOf.js.map +0 -1
  808. package/dist/src/ua_condition_type.js.map +0 -1
  809. package/dist/src/ua_data_type_impl.d.ts +0 -87
  810. package/dist/src/ua_data_type_impl.js +0 -393
  811. package/dist/src/ua_data_type_impl.js.map +0 -1
  812. package/dist/src/ua_method_impl.d.ts +0 -48
  813. package/dist/src/ua_method_impl.js +0 -280
  814. package/dist/src/ua_method_impl.js.map +0 -1
  815. package/dist/src/ua_object_impl.d.ts +0 -38
  816. package/dist/src/ua_object_impl.js +0 -214
  817. package/dist/src/ua_object_impl.js.map +0 -1
  818. package/dist/src/ua_object_type_impl.d.ts +0 -55
  819. package/dist/src/ua_object_type_impl.js +0 -131
  820. package/dist/src/ua_object_type_impl.js.map +0 -1
  821. package/dist/src/ua_reference_type_impl.d.ts +0 -42
  822. package/dist/src/ua_reference_type_impl.js +0 -146
  823. package/dist/src/ua_reference_type_impl.js.map +0 -1
  824. package/dist/src/ua_variable_impl.d.ts +0 -379
  825. package/dist/src/ua_variable_impl.js +0 -1940
  826. package/dist/src/ua_variable_impl.js.map +0 -1
  827. package/dist/src/ua_variable_impl_ext_obj.d.ts +0 -23
  828. package/dist/src/ua_variable_impl_ext_obj.js +0 -752
  829. package/dist/src/ua_variable_impl_ext_obj.js.map +0 -1
  830. package/dist/src/ua_variable_type_impl.d.ts +0 -79
  831. package/dist/src/ua_variable_type_impl.js +0 -276
  832. package/dist/src/ua_variable_type_impl.js.map +0 -1
  833. package/dist/src/ua_view_impl.d.ts +0 -18
  834. package/dist/src/ua_view_impl.js +0 -45
  835. package/dist/src/ua_view_impl.js.map +0 -1
  836. package/dist/src/validate_data_type_correctness.d.ts +0 -6
  837. package/dist/src/validate_data_type_correctness.js +0 -106
  838. package/dist/src/validate_data_type_correctness.js.map +0 -1
  839. package/source/address_space_ts.ts +0 -220
  840. package/source/continuation_points/continuation_point_manager.ts +0 -271
  841. package/source/helpers/argument_list.ts +0 -310
  842. package/source/helpers/call_helpers.ts +0 -100
  843. package/source/helpers/coerce_enum_value.ts +0 -33
  844. package/source/helpers/dump_tools.ts +0 -90
  845. package/source/helpers/ensure_secure_access.ts +0 -57
  846. package/source/helpers/multiform_func.ts +0 -78
  847. package/source/helpers/resolve_opaque_on_address_space.ts +0 -26
  848. package/source/index.ts +0 -72
  849. package/source/interfaces/alarms_and_conditions/condition_info_i.ts +0 -24
  850. package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +0 -235
  851. package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +0 -16
  852. package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +0 -8
  853. package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +0 -6
  854. package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +0 -6
  855. package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +0 -13
  856. package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +0 -6
  857. package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +0 -6
  858. package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +0 -21
  859. package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +0 -28
  860. package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +0 -43
  861. package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +0 -36
  862. package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +0 -55
  863. package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +0 -17
  864. package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +0 -21
  865. package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +0 -21
  866. package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +0 -26
  867. package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +0 -29
  868. package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +0 -25
  869. package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +0 -57
  870. package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +0 -31
  871. package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +0 -15
  872. package/source/interfaces/nodeset_loader_options.ts +0 -38
  873. package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +0 -20
  874. package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +0 -50
  875. package/source/interfaces/state_machine/ua_program_state_machine_type.ts +0 -14
  876. package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +0 -35
  877. package/source/interfaces/state_machine/ua_state_machine_type.ts +0 -288
  878. package/source/loader/decode_xml_extension_object.ts +0 -80
  879. package/source/loader/ensure_datatype_extracted.ts +0 -122
  880. package/source/loader/generateAddressSpaceRaw.ts +0 -219
  881. package/source/loader/load_nodeset2.ts +0 -1275
  882. package/source/loader/make_xml_extension_object_parser.ts +0 -524
  883. package/source/loader/namespace_post_step.ts +0 -68
  884. package/source/loader/parsers/extension_object_parser.ts +0 -374
  885. package/source/loader/parsers/variant_parser.ts +0 -433
  886. package/source/loader/register_node_promoter.ts +0 -6
  887. package/source/namespace.ts +0 -7
  888. package/source/namespace_alarm_and_condition.ts +0 -78
  889. package/source/namespace_data_access.ts +0 -92
  890. package/source/namespace_machine_state.ts +0 -20
  891. package/source/pseudo_session.ts +0 -415
  892. package/source/session_context.ts +0 -717
  893. package/source/ua_interface.ts +0 -38
  894. package/source/ua_two_state_variable_ex.ts +0 -36
  895. package/src/_instantiate_helpers.ts +0 -197
  896. package/src/_mandatory_child_or_requested_optional_filter.ts +0 -100
  897. package/src/address_space.ts +0 -1631
  898. package/src/address_space_change_event_tools.ts +0 -177
  899. package/src/address_space_private.ts +0 -96
  900. package/src/alarms_and_conditions/condition_info_impl.ts +0 -44
  901. package/src/alarms_and_conditions/condition_snapshot_impl.ts +0 -792
  902. package/src/alarms_and_conditions/deviation_alarm_helper.ts +0 -73
  903. package/src/alarms_and_conditions/index.ts +0 -16
  904. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +0 -331
  905. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +0 -479
  906. package/src/alarms_and_conditions/ua_base_event_impl.ts +0 -42
  907. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +0 -244
  908. package/src/alarms_and_conditions/ua_condition_impl.ts +0 -1261
  909. package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +0 -57
  910. package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +0 -94
  911. package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +0 -20
  912. package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +0 -109
  913. package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +0 -25
  914. package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +0 -244
  915. package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +0 -88
  916. package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +0 -223
  917. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -218
  918. package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +0 -26
  919. package/src/apply_condition_refresh.ts +0 -29
  920. package/src/base_node_impl.ts +0 -1907
  921. package/src/base_node_private.ts +0 -1287
  922. package/src/data_access/adjust_datavalue_status_code.ts +0 -36
  923. package/src/data_access/ua_multistate_discrete_impl.ts +0 -189
  924. package/src/data_access/ua_multistate_value_discrete_impl.ts +0 -369
  925. package/src/data_access/ua_two_state_discrete_impl.ts +0 -184
  926. package/src/event_data.ts +0 -83
  927. package/src/extension_object_array_node.ts +0 -331
  928. package/src/historical_access/address_space_historical_data_node.ts +0 -842
  929. package/src/index_current.ts +0 -51
  930. package/src/namespace_impl.ts +0 -2380
  931. package/src/namespace_private.ts +0 -77
  932. package/src/nodeid_manager.ts +0 -293
  933. package/src/nodeset_tools/construct_namespace_dependency.ts +0 -375
  934. package/src/nodeset_tools/dump_to_bsd.ts +0 -201
  935. package/src/nodeset_tools/nodeset_to_xml.ts +0 -1652
  936. package/src/private_namespace.ts +0 -21
  937. package/src/reference_impl.ts +0 -171
  938. package/src/state_machine/finite_state_machine.ts +0 -668
  939. package/src/state_machine/ua_shelving_state_machine_ex.ts +0 -330
  940. package/src/state_machine/ua_two_state_variable.ts +0 -421
  941. package/src/tool_isSubtypeOf.ts +0 -160
  942. package/src/ua_data_type_impl.ts +0 -483
  943. package/src/ua_method_impl.ts +0 -362
  944. package/src/ua_object_impl.ts +0 -278
  945. package/src/ua_object_type_impl.ts +0 -179
  946. package/src/ua_reference_type_impl.ts +0 -170
  947. package/src/ua_variable_impl.ts +0 -2489
  948. package/src/ua_variable_impl_ext_obj.ts +0 -903
  949. package/src/ua_variable_type_impl.ts +0 -385
  950. package/src/ua_view_impl.ts +0 -53
  951. package/src/validate_data_type_correctness.ts +0 -124
  952. /package/{source → api}/helpers/adjust_browse_direction.ts +0 -0
  953. /package/{source → api}/helpers/make_optionals_map.ts +0 -0
  954. /package/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.ts +0 -0
  955. /package/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.ts +0 -0
  956. /package/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.ts +0 -0
  957. /package/{source → api}/interfaces/data_access/ua_y_array_item_ex.ts +0 -0
  958. /package/{source → api}/interfaces/extension_object_constructor.ts +0 -0
  959. /package/{source → api}/interfaces/i_condition_variable_type_setter_options.ts +0 -0
  960. /package/{source → api}/interfaces/i_set_state_options.ts +0 -0
  961. /package/{source → api}/interfaces/state_machine/ua_transition_ex.ts +0 -0
  962. /package/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.ts +0 -0
  963. /package/{source → api}/loader/make_semver_compatible.ts +0 -0
  964. /package/{source → api}/loader/parsers/localized_text_parser.ts +0 -0
  965. /package/{source → api}/loader/parsers/nodeid_parser.ts +0 -0
  966. /package/{source → api}/loader/parsers/qualified_name_parser.ts +0 -0
  967. /package/{source → api}/set_namespace_meta_data.ts +0 -0
  968. /package/{source → api}/ua_addin.ts +0 -0
  969. /package/{source → api}/ua_root_folder.ts +0 -0
  970. /package/{source → api}/xml_writer.ts +0 -0
  971. /package/dist/{source → api}/continuation_points/continuation_point_manager.d.ts +0 -0
  972. /package/dist/{source → api}/helpers/adjust_browse_direction.d.ts +0 -0
  973. /package/dist/{source → api}/helpers/adjust_browse_direction.js +0 -0
  974. /package/dist/{source → api}/helpers/argument_list.d.ts +0 -0
  975. /package/dist/{source → api}/helpers/call_helpers.d.ts +0 -0
  976. /package/dist/{source → api}/helpers/coerce_enum_value.js +0 -0
  977. /package/dist/{source → api}/helpers/dump_tools.d.ts +0 -0
  978. /package/dist/{source → api}/helpers/make_optionals_map.d.ts +0 -0
  979. /package/dist/{source → api}/helpers/make_optionals_map.js +0 -0
  980. /package/dist/{source → api}/helpers/multiform_func.d.ts +0 -0
  981. /package/dist/{source → api}/helpers/resolve_opaque_on_address_space.d.ts +0 -0
  982. /package/dist/{source → api}/interfaces/alarms_and_conditions/condition_snapshot.js +0 -0
  983. /package/dist/{source → api}/interfaces/alarms_and_conditions/deviation_stuff.js +0 -0
  984. /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +0 -0
  985. /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.js +0 -0
  986. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +0 -0
  987. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +0 -0
  988. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.js +0 -0
  989. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +0 -0
  990. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +0 -0
  991. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +0 -0
  992. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +0 -0
  993. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +0 -0
  994. /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +0 -0
  995. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +0 -0
  996. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +0 -0
  997. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +0 -0
  998. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.js +0 -0
  999. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +0 -0
  1000. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_condition_ex.js +0 -0
  1001. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -0
  1002. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +0 -0
  1003. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +0 -0
  1004. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +0 -0
  1005. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +0 -0
  1006. /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +0 -0
  1007. /package/dist/{source → api}/interfaces/data_access/ua_multistate_discrete_ex.js +0 -0
  1008. /package/dist/{source → api}/interfaces/data_access/ua_multistate_value_discrete_ex.js +0 -0
  1009. /package/dist/{source → api}/interfaces/data_access/ua_two_state_discrete_ex.js +0 -0
  1010. /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.d.ts +0 -0
  1011. /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.js +0 -0
  1012. /package/dist/{source → api}/interfaces/extension_object_constructor.d.ts +0 -0
  1013. /package/dist/{source → api}/interfaces/extension_object_constructor.js +0 -0
  1014. /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.d.ts +0 -0
  1015. /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.js +0 -0
  1016. /package/dist/{source → api}/interfaces/i_set_state_options.d.ts +0 -0
  1017. /package/dist/{source → api}/interfaces/i_set_state_options.js +0 -0
  1018. /package/dist/{source → api}/interfaces/nodeset_loader_options.js +0 -0
  1019. /package/dist/{source → api}/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +0 -0
  1020. /package/dist/{source → api}/interfaces/state_machine/ua_finite_state_machine_type.js +0 -0
  1021. /package/dist/{source → api}/interfaces/state_machine/ua_program_state_machine_type.js +0 -0
  1022. /package/dist/{source → api}/interfaces/state_machine/ua_shelved_state_machine_ex.js +0 -0
  1023. /package/dist/{source → api}/interfaces/state_machine/ua_state_machine_type.js +0 -0
  1024. /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.d.ts +0 -0
  1025. /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.js +0 -0
  1026. /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +0 -0
  1027. /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.js +0 -0
  1028. /package/dist/{source → api}/loader/ensure_datatype_extracted.d.ts +0 -0
  1029. /package/dist/{source → api}/loader/make_semver_compatible.d.ts +0 -0
  1030. /package/dist/{source → api}/loader/make_semver_compatible.js +0 -0
  1031. /package/dist/{source → api}/loader/make_xml_extension_object_parser.d.ts +0 -0
  1032. /package/dist/{source → api}/loader/namespace_post_step.d.ts +0 -0
  1033. /package/dist/{source → api}/loader/parsers/extension_object_parser.d.ts +0 -0
  1034. /package/dist/{source → api}/loader/parsers/localized_text_parser.d.ts +0 -0
  1035. /package/dist/{source → api}/loader/parsers/localized_text_parser.js +0 -0
  1036. /package/dist/{source → api}/loader/parsers/nodeid_parser.d.ts +0 -0
  1037. /package/dist/{source → api}/loader/parsers/nodeid_parser.js +0 -0
  1038. /package/dist/{source → api}/loader/parsers/qualified_name_parser.d.ts +0 -0
  1039. /package/dist/{source → api}/loader/parsers/qualified_name_parser.js +0 -0
  1040. /package/dist/{source → api}/namespace.js +0 -0
  1041. /package/dist/{source → api}/namespace_alarm_and_condition.js +0 -0
  1042. /package/dist/{source → api}/namespace_data_access.js +0 -0
  1043. /package/dist/{source → api}/namespace_machine_state.js +0 -0
  1044. /package/dist/{source → api}/set_namespace_meta_data.d.ts +0 -0
  1045. /package/dist/{source → api}/set_namespace_meta_data.js +0 -0
  1046. /package/dist/{source → api}/ua_addin.d.ts +0 -0
  1047. /package/dist/{source → api}/ua_addin.js +0 -0
  1048. /package/dist/{source → api}/ua_interface.d.ts +0 -0
  1049. /package/dist/{source → api}/ua_root_folder.d.ts +0 -0
  1050. /package/dist/{source → api}/ua_root_folder.js +0 -0
  1051. /package/dist/{source → api}/ua_two_state_variable_ex.js +0 -0
  1052. /package/dist/{source → api}/xml_writer.d.ts +0 -0
  1053. /package/dist/{source → api}/xml_writer.js +0 -0
  1054. /package/dist/{src → impl}/_instantiate_helpers.d.ts +0 -0
  1055. /package/dist/{src → impl}/_mandatory_child_or_requested_optional_filter.d.ts +0 -0
  1056. /package/dist/{src → impl}/address_space_change_event_tools.js +0 -0
  1057. /package/dist/{src → impl}/address_space_private.js +0 -0
  1058. /package/dist/{src → impl}/alarms_and_conditions/condition.d.ts +0 -0
  1059. /package/dist/{src → impl}/alarms_and_conditions/condition.js +0 -0
  1060. /package/dist/{src → impl}/check_value_rank_compatibility.d.ts +0 -0
  1061. /package/dist/{src → impl}/check_value_rank_compatibility.js +0 -0
  1062. /package/dist/{src → impl}/data_access/add_dataItem_stuff.d.ts +0 -0
  1063. /package/dist/{src → impl}/data_access/add_dataItem_stuff.js +0 -0
  1064. /package/dist/{src → impl}/data_access/adjust_datavalue_status_code.js +0 -0
  1065. /package/dist/{src → impl}/get_basic_datatype.d.ts +0 -0
  1066. /package/dist/{src → impl}/get_basic_datatype.js +0 -0
  1067. /package/dist/{src → impl}/idx_iterator.d.ts +0 -0
  1068. /package/dist/{src → impl}/idx_iterator.js +0 -0
  1069. /package/dist/{src → impl}/namespace_private.js +0 -0
  1070. /package/dist/{src → impl}/nodeid_manager.d.ts +0 -0
  1071. /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.d.ts +0 -0
  1072. /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.js +0 -0
  1073. /package/dist/{src → impl}/private_namespace.js +0 -0
  1074. /package/dist/{src → impl}/role_permissions.d.ts +0 -0
  1075. /package/dist/{src → impl}/role_permissions.js +0 -0
  1076. /package/dist/{src → impl}/ua_condition_type.d.ts +0 -0
  1077. /package/dist/{src → impl}/ua_condition_type.js +0 -0
  1078. /package/{src → impl}/alarms_and_conditions/condition.ts +0 -0
  1079. /package/{src → impl}/check_value_rank_compatibility.ts +0 -0
  1080. /package/{src → impl}/data_access/add_dataItem_stuff.ts +0 -0
  1081. /package/{src → impl}/get_basic_datatype.ts +0 -0
  1082. /package/{src → impl}/idx_iterator.ts +0 -0
  1083. /package/{src → impl}/nodeset_tools/adjust_namespace_array.ts +0 -0
  1084. /package/{src → impl}/role_permissions.ts +0 -0
  1085. /package/{src → impl}/ua_condition_type.ts +0 -0
@@ -0,0 +1,2165 @@
1
+ /**
2
+ * @module node-opcua-address-space
3
+ */
4
+
5
+ import { isDeepStrictEqual as isEqual } from "node:util";
6
+ import chalk from "chalk";
7
+ import {
8
+ type AddReferenceOpts,
9
+ type AttributeEventName,
10
+ type BaseNode,
11
+ type BaseNodeEvents,
12
+ type BrowseDescriptionOptions2,
13
+ type IAddressSpace,
14
+ type INamespace,
15
+ type ISessionContext,
16
+ type ListenerSignature,
17
+ type ModellingRuleType,
18
+ TypedEventEmitter,
19
+ type UAMethod,
20
+ type UAObject,
21
+ type UAObjectType,
22
+ type UAProperty,
23
+ type UAReference,
24
+ type UAReferenceType,
25
+ type UAVariable,
26
+ type UAVariableType
27
+ } from "node-opcua-address-space-base";
28
+ import { assert } from "node-opcua-assert";
29
+ import type { UAString } from "node-opcua-basic-types";
30
+ import { ObjectTypeIds, ReferenceTypeIds, VariableTypeIds } from "node-opcua-constants";
31
+ import {
32
+ AccessRestrictionsFlag,
33
+ AttributeIds,
34
+ attributeNameById,
35
+ BrowseDirection,
36
+ coerceLocalizedText,
37
+ coerceQualifiedName,
38
+ LocalizedText,
39
+ type LocalizedTextLike,
40
+ NodeClass,
41
+ QualifiedName,
42
+ type QualifiedNameLike,
43
+ type QualifiedNameOptions
44
+ } from "node-opcua-data-model";
45
+ import { DataValue } from "node-opcua-data-value";
46
+ import { dumpIf, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
47
+ import { coerceNodeId, makeNodeId, NodeId, type NodeIdLike, NodeIdType, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
48
+ import type { UAStateVariable } from "node-opcua-nodeset-ua";
49
+ import type { NumericRange } from "node-opcua-numeric-range";
50
+ import type { ReferenceDescription } from "node-opcua-service-browse";
51
+ import { type StatusCode, StatusCodes } from "node-opcua-status-code";
52
+ import {
53
+ PermissionType,
54
+ type RelativePathElement,
55
+ RolePermissionType,
56
+ type RolePermissionTypeOptions,
57
+ type WriteValueOptions
58
+ } from "node-opcua-types";
59
+ import { DataType, VariantArrayType } from "node-opcua-variant";
60
+ import { dumpReferenceDescriptions, dumpReferences } from "../api/helpers/dump_tools.js";
61
+ import { SessionContext, WellKnownRolesNodeId } from "../api/session_context.js";
62
+ import type { XmlWriter } from "../api/xml_writer.js";
63
+ import type { AddressSpaceImpl } from "./address_space.js";
64
+ import { _handle_add_reference_change_event } from "./address_space_change_event_tools.js";
65
+ import type { AddressSpacePrivate } from "./address_space_private.js";
66
+ import {
67
+ _constructReferenceDescription,
68
+ _get_HierarchicalReference,
69
+ _handle_HierarchicalReference,
70
+ _remove_HierarchicalReference,
71
+ BaseNode_add_backward_reference,
72
+ BaseNode_clearCache,
73
+ BaseNode_getCache,
74
+ BaseNode_getPrivate,
75
+ BaseNode_initPrivate,
76
+ BaseNode_remove_backward_reference,
77
+ BaseNode_removePrivate,
78
+ BaseNode_toString,
79
+ type HierarchicalIndexMap,
80
+ noteReferenceTypeChange,
81
+ type ReferenceScanMemo,
82
+ ToStringBuilder
83
+ } from "./base_node_private.js";
84
+ import {
85
+ defineSharedChildAccessors as defineQueuedChildAccessors,
86
+ hasSharedChildAccessor,
87
+ isReservedChildAccessorName,
88
+ registerChildName,
89
+ reservedChildAccessorNames,
90
+ resolveChildInIndex
91
+ } from "./child_accessors.js";
92
+ import {
93
+ isMassivelyUsedReferenceType,
94
+ type MinimalistAddressSpace,
95
+ nodeIdKey,
96
+ ReferenceImpl,
97
+ type ReferenceKey
98
+ } from "./reference_impl.js";
99
+ import { referenceTypeVersion } from "./reference_type_version.js";
100
+ import { coerceRolePermissions } from "./role_permissions.js";
101
+
102
+ type ApplyFunc = { apply: (...args: unknown[]) => void };
103
+
104
+ const doDebug = false;
105
+ const warningLog = make_warningLog("base_node_impl");
106
+ const errorLog = make_errorLog("base_node_impl");
107
+ const debugLog = make_debugLog("base_node_impl");
108
+
109
+ const HasEventSourceReferenceType = resolveNodeId("HasEventSource");
110
+ const HasNotifierReferenceType = resolveNodeId("HasNotifier");
111
+ const HierarchicalReferencesType = resolveNodeId("HierarchicalReferences");
112
+ const HasChildReferenceType = resolveNodeId("HasChild");
113
+ /** a node with more references than this keeps the result of its reference scans */
114
+ const referenceScanMemoThreshold = 8;
115
+
116
+ /**
117
+ * the reference types every child lookup and accessor installation needs, resolved once per
118
+ * address space rather than once per call; absent until namespace 0 has loaded them
119
+ */
120
+ interface WellKnownReferenceTypes {
121
+ hierarchicalReferences: UAReferenceType;
122
+ hasChild: UAReferenceType;
123
+ hasComponent: UAReferenceType;
124
+ hasProperty: UAReferenceType;
125
+ organizes: UAReferenceType;
126
+ }
127
+ const wellKnownReferenceTypesByAddressSpace = new WeakMap<IAddressSpace, WellKnownReferenceTypes>();
128
+
129
+ function wellKnownReferenceTypes(addressSpace: IAddressSpace): WellKnownReferenceTypes | null {
130
+ const known = wellKnownReferenceTypesByAddressSpace.get(addressSpace);
131
+ // an address space is disposed namespace by namespace, namespace 0 first: a child lookup made
132
+ // while a later namespace is torn down must not be handed reference types that are gone
133
+ if (known && !(known.hasChild as unknown as BaseNodeImpl).isDisposed()) {
134
+ return known;
135
+ }
136
+ const hierarchicalReferences = addressSpace.findReferenceType(HierarchicalReferencesType);
137
+ const hasChild = addressSpace.findReferenceType(HasChildReferenceType);
138
+ const hasComponent = addressSpace.findReferenceType(HasComponentReferenceType);
139
+ const hasProperty = addressSpace.findReferenceType(HasPropertyReferenceType);
140
+ const organizes = addressSpace.findReferenceType(OrganizesReferenceType);
141
+ if (!hierarchicalReferences || !hasChild || !hasComponent || !hasProperty || !organizes) {
142
+ return null; // namespace 0 is still loading
143
+ }
144
+ const resolved = { hierarchicalReferences, hasChild, hasComponent, hasProperty, organizes };
145
+ wellKnownReferenceTypesByAddressSpace.set(addressSpace, resolved);
146
+ return resolved;
147
+ }
148
+ const HasComponentReferenceType = resolveNodeId("HasComponent");
149
+ const HasPropertyReferenceType = resolveNodeId("HasProperty");
150
+ const OrganizesReferenceType = resolveNodeId("Organizes");
151
+
152
+ function defaultBrowseFilterFunc(_context?: ISessionContext): boolean {
153
+ return true;
154
+ }
155
+
156
+ function _get_QualifiedBrowseName(browseName: QualifiedNameLike): QualifiedName {
157
+ return coerceQualifiedName(browseName) || "";
158
+ }
159
+
160
+ export interface InternalBaseNodeOptions {
161
+ /**
162
+ * the parent address space
163
+ */
164
+ addressSpace: AddressSpacePrivate;
165
+ browseName: QualifiedName;
166
+ nodeId: NodeId;
167
+ references?: UAReference[];
168
+
169
+ displayName?: LocalizedTextLike | LocalizedTextLike[];
170
+ description?: LocalizedTextLike | null;
171
+
172
+ browseFilter?: (this: BaseNode, context?: ISessionContext) => boolean;
173
+
174
+ /**
175
+ * https://reference.opcfoundation.org/v104/Core/docs/Part3/8.56/
176
+ */
177
+ accessRestrictions?: AccessRestrictionsFlag;
178
+ rolePermissions?: RolePermissionTypeOptions[];
179
+ }
180
+
181
+ function _is_valid_BrowseDirection(browseDirection: BrowseDirection) {
182
+ return (
183
+ browseDirection === BrowseDirection.Forward ||
184
+ browseDirection === BrowseDirection.Inverse ||
185
+ browseDirection === BrowseDirection.Both
186
+ );
187
+ }
188
+ export function makeAttributeEventName(attributeId: AttributeIds): AttributeEventName {
189
+ const attributeName = attributeNameById[attributeId];
190
+ return `${attributeName}_changed` as AttributeEventName;
191
+ }
192
+
193
+ /**
194
+ * Base class for all Node classes
195
+ *
196
+ * BaseNode is the base class for all the OPCUA objects in the address space
197
+ * It provides attributes and a set of references to other nodes.
198
+ * see:
199
+ * {{#crossLink "UAObject"}}{{/crossLink}},
200
+ * {{#crossLink "UAVariable"}}{{/crossLink}},
201
+ * {{#crossLink "Reference"}}{{/crossLink}},
202
+ * {{#crossLink "UAMethod"}}{{/crossLink}},
203
+ * {{#crossLink "UAView"}}{{/crossLink}},
204
+ * {{#crossLink "UAObjectType"}}{{/crossLink}},
205
+ * {{#crossLink "UADataType"}}{{/crossLink}},
206
+ * {{#crossLink "UAVariableType"}}{{/crossLink}},
207
+ *
208
+ *
209
+ */
210
+
211
+ export abstract class BaseNodeImpl<T extends BaseNodeEvents & ListenerSignature<T> = BaseNodeEvents>
212
+ extends TypedEventEmitter<T>
213
+ implements BaseNode<T>
214
+ {
215
+ public static makeAttributeEventName(attributeId: AttributeIds): AttributeEventName {
216
+ return makeAttributeEventName(attributeId);
217
+ }
218
+
219
+ private _accessRestrictions?: AccessRestrictionsFlag;
220
+ private _rolePermissions?: RolePermissionType[];
221
+
222
+ // public onFirstBrowseAction?: (this: BaseNode<T>) => Promise<void>;
223
+
224
+ public get addressSpace(): IAddressSpace {
225
+ const _private = BaseNode_getPrivate(this);
226
+ // c8 ignore next
227
+ if (!_private) {
228
+ throw new Error(`Internal error , cannot extract private data from ${this.browseName.toString()}`);
229
+ }
230
+ return _private.__address_space as AddressSpaceImpl;
231
+ }
232
+
233
+ protected get addressSpacePrivate(): AddressSpacePrivate {
234
+ const _private = BaseNode_getPrivate(this);
235
+ // c8 ignore next
236
+ if (!_private) {
237
+ throw new Error(`Internal error , cannot extract private data from ${this.browseName.toString()}`);
238
+ }
239
+ return _private.__address_space as AddressSpacePrivate;
240
+ }
241
+
242
+ public get displayName(): LocalizedText[] {
243
+ const _private = BaseNode_getPrivate(this);
244
+ if (!_private._displayName) {
245
+ const raw = _private._displayNameRaw ?? "";
246
+ const displayNames: LocalizedTextLike[] = Array.isArray(raw) ? raw : [raw];
247
+ _private._displayName = displayNames.map(coerceLocalizedText) as LocalizedText[];
248
+ }
249
+ return _private._displayName;
250
+ }
251
+
252
+ public setDisplayName(value: LocalizedTextLike[] | LocalizedTextLike): void {
253
+ if (!Array.isArray(value)) {
254
+ this.setDisplayName([value]);
255
+ return;
256
+ }
257
+ this._setDisplayName(value);
258
+ /**
259
+ * fires when the displayName is changed.
260
+ * @event DisplayName_changed
261
+ * @param dataValue {DataValue}
262
+ */
263
+ this._notifyAttributeChange(AttributeIds.DisplayName);
264
+ }
265
+
266
+ public get description(): LocalizedText {
267
+ const _private = BaseNode_getPrivate(this);
268
+ if (!_private._description) {
269
+ _private._description = coerceLocalizedText(_private._descriptionRaw ?? null) || new LocalizedText({ text: "" });
270
+ }
271
+ return _private._description;
272
+ }
273
+
274
+ public setDescription(value: LocalizedTextLike | null): void {
275
+ this._setDescription(value);
276
+ /**
277
+ * fires when the description attribute is changed.
278
+ * @event Description_changed
279
+ * @param dataValue {DataValue}
280
+ */
281
+ this._notifyAttributeChange(AttributeIds.Description);
282
+ }
283
+
284
+ /**
285
+ * returns the nodeId of this node's Type Definition
286
+ */
287
+ public get typeDefinition(): NodeId {
288
+ const _cache = BaseNode_getCache(this);
289
+ if (!_cache.typeDefinition) {
290
+ const has_type_definition_ref = this.findReference("HasTypeDefinition", true);
291
+ let nodeId = has_type_definition_ref ? has_type_definition_ref.nodeId : null;
292
+ if (!nodeId) {
293
+ switch (this.nodeClass) {
294
+ case NodeClass.Object:
295
+ nodeId = coerceNodeId(ObjectTypeIds.BaseObjectType);
296
+ break;
297
+ case NodeClass.Variable:
298
+ nodeId = coerceNodeId(VariableTypeIds.BaseVariableType);
299
+ break;
300
+ default:
301
+ }
302
+ }
303
+ _cache.typeDefinition = nodeId as NodeId;
304
+ }
305
+ return _cache.typeDefinition;
306
+ }
307
+
308
+ /**
309
+ * returns the nodeId of this node's Type Definition
310
+ */
311
+ public get typeDefinitionObj(): UAObjectType | UAVariableType {
312
+ const _cache = BaseNode_getCache(this);
313
+ if (undefined === _cache.typeDefinitionObj) {
314
+ const nodeId = this.typeDefinition;
315
+ _cache.typeDefinitionObj = nodeId ? (this.addressSpace.findNode(nodeId) as UAObjectType | UAVariableType) : null;
316
+ }
317
+ if (!_cache.typeDefinitionObj) {
318
+ warningLog(
319
+ this.nodeClass,
320
+ "cannot find typeDefinitionObj ",
321
+ this.browseName.toString(),
322
+ this.nodeId.toString(),
323
+ NodeClass[this.nodeClass]
324
+ );
325
+ }
326
+ return _cache.typeDefinitionObj as UAObjectType | UAVariableType;
327
+ }
328
+
329
+ public get parentNodeId(): NodeId | undefined {
330
+ const parent = this.parent;
331
+ return parent ? parent.nodeId : undefined;
332
+ }
333
+
334
+ /**
335
+ * namespace index
336
+ */
337
+ public get namespaceIndex(): number {
338
+ return this.nodeId.namespace;
339
+ }
340
+
341
+ /**
342
+ * namespace uri
343
+ */
344
+ public get namespaceUri(): string {
345
+ return this.addressSpace.getNamespaceUri(this.namespaceIndex);
346
+ }
347
+
348
+ /**
349
+ * the parent node
350
+ */
351
+ public get parent(): BaseNode | null {
352
+ const _private = BaseNode_getPrivate(this);
353
+ if (_private._parent === undefined) {
354
+ // never been set before
355
+ _private._parent = _setup_parent_item.call(this, _private._referenceIdx);
356
+ }
357
+ return _private._parent || null;
358
+ }
359
+
360
+ /**
361
+ * @property modellingRule
362
+ * @type {String|undefined}
363
+ */
364
+ public get modellingRule(): ModellingRuleType | undefined {
365
+ const r = this.findReferencesAsObject("HasModellingRule");
366
+ if (!r || r.length === 0) {
367
+ return null; /// "? modellingRule missing ?"; // consider "Mandatory"
368
+ }
369
+ const r0 = r[0];
370
+ return r0.browseName.toString() as ModellingRuleType | undefined;
371
+ }
372
+
373
+ public readonly nodeClass: NodeClass = NodeClass.Unspecified;
374
+ public readonly nodeId: NodeId;
375
+ public readonly browseName: QualifiedName;
376
+
377
+ protected _postInstantiateFunc?: (instance: BaseNode, instanceType: BaseNode, options?: unknown) => void;
378
+
379
+ /**
380
+ * @internal
381
+ * @param options
382
+ */
383
+ constructor(options: InternalBaseNodeOptions) {
384
+ super();
385
+
386
+ assert(this.nodeClass === NodeClass.Unspecified, "must not be specify a nodeClass");
387
+ assert(options.addressSpace); // expecting an address space
388
+ assert(options.browseName instanceof QualifiedName, "Expecting a valid QualifiedName");
389
+ assert(options.nodeId instanceof NodeId, "Expecting a valid NodeId");
390
+ options.references = options.references || [];
391
+
392
+ const _private = BaseNode_initPrivate(this);
393
+ _private.__address_space = options.addressSpace;
394
+
395
+ this.nodeId = options.nodeId instanceof NodeId ? options.nodeId : resolveNodeId(options.nodeId);
396
+
397
+ // QualifiedName
398
+ /**
399
+ * the node browseName
400
+ * @property browseName
401
+ * @type QualifiedName
402
+ * @static
403
+ */
404
+ this.browseName = _get_QualifiedBrowseName(options.browseName);
405
+
406
+ // re-use browseName as displayName if displayName is missing
407
+ options.displayName = options.displayName || this.browseName.name?.toString();
408
+
409
+ if (options.description === undefined) {
410
+ options.description = null;
411
+ }
412
+ this._setDisplayName(options.displayName || "");
413
+
414
+ this._setDescription(options.description);
415
+
416
+ // user defined filter function for browsing
417
+ const _browseFilter = options.browseFilter || defaultBrowseFilterFunc;
418
+ assert(typeof _browseFilter === "function");
419
+
420
+ _private._browseFilter = _browseFilter;
421
+
422
+ // normalize reference type
423
+ // this will convert any referenceType expressed with its inverseName into
424
+ // its normal name and fix the isForward flag accordingly.
425
+ // ( e.g "ComponentOf" isForward:true => "HasComponent", isForward:false)
426
+ for (const reference of options.references) {
427
+ this.__addReference(reference, false);
428
+ }
429
+ // the cache was empty to start with; one clear covers every reference just added
430
+ this._clear_caches();
431
+
432
+ this._accessRestrictions = options.accessRestrictions;
433
+ this._rolePermissions = coerceRolePermissions(options.rolePermissions);
434
+
435
+ // make `parent.<thisName>` resolve to this node: through a getter shared by every node when
436
+ // a nodeset is loading (defined in one batch by the loader, see flushSharedChildAccessors),
437
+ // through the own accessor installed by install_extra_properties otherwise
438
+ // (see child_accessors.ts for why the two paths exist)
439
+ _private._accessorName = registerChildName(this.browseName.name, options.addressSpace.suspendBackReference);
440
+ }
441
+
442
+ public getDisplayName(_locale?: string): string {
443
+ return this.displayName[0].text || "";
444
+ }
445
+
446
+ public get namespace(): INamespace {
447
+ return this.addressSpacePrivate.getNamespace(this.nodeId.namespace);
448
+ }
449
+
450
+ // ---------------------------------------------------------------------------------------------------
451
+ // Finders
452
+ // ---------------------------------------------------------------------------------------------------
453
+
454
+ public findReferencesEx(referenceType: string | NodeId | UAReferenceType, browseDirection?: BrowseDirection): UAReference[] {
455
+ browseDirection = browseDirection !== undefined ? browseDirection : BrowseDirection.Forward;
456
+ assert(_is_valid_BrowseDirection(browseDirection));
457
+ assert(browseDirection !== BrowseDirection.Both);
458
+
459
+ const referenceTypeNode = this._coerceReferenceType(referenceType);
460
+
461
+ if (!referenceTypeNode) {
462
+ // note: when loading nodeset2.xml files, reference type may not exit yet
463
+ // throw new Error("expecting valid reference name " + strReference);
464
+ return [];
465
+ }
466
+
467
+ const isForward = browseDirection === BrowseDirection.Forward;
468
+ const _private = BaseNode_getPrivate(this);
469
+
470
+ // Memoized per reference type and direction, on the nodes where a scan is worth remembering:
471
+ // a scan touches every reference of the node and runs checkHasSubtype on each, and the same
472
+ // question is asked over and over (every child lookup, every browse) of folders, types and
473
+ // the Server object. A leaf variable holds three references; scanning them costs less than
474
+ // the map would, and a model with a hundred thousand of them cannot afford one map each.
475
+ // The memo goes with the rest of _cache whenever a reference is added or removed, and when
476
+ // a reference type was created since it was built.
477
+ const memoize = _private._referenceIdx.size + _private._back_referenceIdx.size > referenceScanMemoThreshold;
478
+ let entry: ReferenceScanMemo | undefined;
479
+ const slot = isForward ? 0 : 1;
480
+ if (memoize) {
481
+ const _cache = BaseNode_getCache(this);
482
+ if (_cache._refExVersion !== referenceTypeVersion.count) {
483
+ _cache._refEx = undefined;
484
+ _cache._refExVersion = referenceTypeVersion.count;
485
+ }
486
+ if (!_cache._refEx) {
487
+ _cache._refEx = new Map();
488
+ }
489
+ entry = _cache._refEx.get(referenceTypeNode);
490
+ if (!entry) {
491
+ entry = [undefined, undefined, false, false];
492
+ _cache._refEx.set(referenceTypeNode, entry);
493
+ }
494
+ const memoized = entry[slot];
495
+ if (memoized) {
496
+ if (entry[slot + 2]) {
497
+ // a reference was scanned before its target existed: the same answer as a
498
+ // fresh scan, which resolves every target it can
499
+ entry[slot + 2] = resolveScannedReferences(this.addressSpace, memoized);
500
+ }
501
+ return memoized;
502
+ }
503
+ }
504
+
505
+ const results: UAReference[] = [];
506
+ const addressSpace = this.addressSpace;
507
+ let unresolved = false;
508
+ const process = (referenceIdx: Map<ReferenceKey, UAReference>) => {
509
+ for (const ref of referenceIdx.values()) {
510
+ if (ref.isForward === isForward && referenceTypeNode.checkHasSubtype(ref.referenceType)) {
511
+ // callers read ref.node: resolved here, once per reference, for the references a
512
+ // load left unresolved (the end-of-load sweep no longer visits every one)
513
+ if (!(ref as ReferenceImpl).node && !resolveReferenceNode(addressSpace, ref)) {
514
+ unresolved = true;
515
+ }
516
+ results.push(ref);
517
+ }
518
+ }
519
+ };
520
+ process(_private._referenceIdx);
521
+ process(_private._back_referenceIdx);
522
+ if (entry) {
523
+ // the array is handed out again on every hit: frozen, so that a caller changing it
524
+ // fails loudly rather than changing what every later caller sees
525
+ entry[slot] = Object.freeze(results) as UAReference[];
526
+ entry[slot + 2] = unresolved;
527
+ }
528
+ return results;
529
+ }
530
+
531
+ public findReferences_no_cache(referenceTypeNode: UAReferenceType, isForward = true): UAReference[] {
532
+ const _private = BaseNode_getPrivate(this);
533
+ const result: UAReference[] = [];
534
+ const addressSpace = this.addressSpace;
535
+ const keep = (ref: UAReference) => {
536
+ if (ref.isForward === isForward && sameNodeId(ref.referenceType, referenceTypeNode.nodeId)) {
537
+ if (!(ref as ReferenceImpl).node) {
538
+ resolveReferenceNode(addressSpace, ref);
539
+ }
540
+ result.push(ref);
541
+ }
542
+ };
543
+ for (const ref of _private._referenceIdx.values()) {
544
+ keep(ref);
545
+ }
546
+ for (const ref of _private._back_referenceIdx.values()) {
547
+ keep(ref);
548
+ }
549
+ return result;
550
+ }
551
+
552
+ public findReferences(referenceType: string | NodeId | UAReferenceType, isForward = true): UAReference[] {
553
+ const _cache = BaseNode_getCache(this);
554
+ const referenceTypeNode = this._coerceReferenceType(referenceType);
555
+ if (!referenceTypeNode) {
556
+ // note: when loading nodeset2.xml files, reference type may not exit yet
557
+ // throw new Error("expecting valid reference name " + strReference);
558
+ return [];
559
+ }
560
+
561
+ _cache._ref = _cache._ref || new Map();
562
+
563
+ const hash = `r|${referenceTypeNode.nodeId.toString()}|${isForward ? "f" : "b"}`;
564
+
565
+ if (_cache._ref.has(hash)) {
566
+ return _cache._ref.get(hash) || [];
567
+ }
568
+ // c8 ignore next
569
+ if (doDebug && !this.addressSpace.findReferenceType(referenceTypeNode.nodeId)) {
570
+ throw new Error(`expecting valid reference name ${referenceType}`);
571
+ }
572
+ const result = Object.freeze(this.findReferences_no_cache(referenceTypeNode, isForward)) as UAReference[];
573
+ _cache._ref.set(hash, result);
574
+ return result;
575
+ }
576
+
577
+ public findReference(strReference: string | NodeId | UAReferenceType, isForward?: boolean): UAReference | null {
578
+ const refs = this.findReferences(strReference, isForward);
579
+ if (refs.length !== 1 && refs.length !== 0) {
580
+ throw new Error("findReference: expecting only one or zero element here");
581
+ }
582
+ return refs[0] || null;
583
+ }
584
+
585
+ public findReferencesExAsObject(
586
+ referenceType: string | NodeId | UAReferenceType,
587
+ browseDirection?: BrowseDirection
588
+ ): BaseNode[] {
589
+ const references = this.findReferencesEx(referenceType, browseDirection);
590
+ return _asObject<BaseNode>(references, this.addressSpace);
591
+ }
592
+
593
+ public findReferencesAsObject(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): BaseNode[] {
594
+ const references = this.findReferences(referenceType, isForward);
595
+ return _asObject<BaseNode>(references, this.addressSpace);
596
+ }
597
+
598
+ /**
599
+ * return an array with the Aggregates of this object.
600
+ */
601
+ public getAggregates(): BaseNode[] {
602
+ return this.findReferencesExAsObject("Aggregates", BrowseDirection.Forward);
603
+ }
604
+
605
+ /**
606
+ * return an array with the components of this object.
607
+ */
608
+ public getComponents(): BaseNode[] {
609
+ return this.findReferencesExAsObject("HasComponent", BrowseDirection.Forward);
610
+ }
611
+
612
+ /**
613
+ * return a array with the properties of this object.
614
+ */
615
+ public getProperties(): BaseNode[] {
616
+ return this.findReferencesExAsObject("HasProperty", BrowseDirection.Forward);
617
+ }
618
+
619
+ private static _hasChild: NodeId = new NodeId(NodeIdType.NUMERIC, ReferenceTypeIds.HasChild);
620
+ public getChildren(): BaseNode[] {
621
+ // return this.findReferencesExAsObject(BaseNodeImpl._hasChild, BrowseDirection.Forward);
622
+ const _cache = BaseNode_getCache(this);
623
+ if (!_cache._children) {
624
+ _cache._children = this.findReferencesExAsObject(BaseNodeImpl._hasChild, BrowseDirection.Forward);
625
+ }
626
+ return _cache._children;
627
+ }
628
+
629
+ /**
630
+ * return a array with the notifiers of this object.
631
+ * only reference of exact type HasNotifier are returned.
632
+ */
633
+ public getNotifiers(): BaseNode[] {
634
+ return this.findReferencesAsObject(HasNotifierReferenceType, true);
635
+ }
636
+
637
+ /**
638
+ * return a array with the event source of this object.
639
+ * only reference of exact type HasEventSource are returned.
640
+ */
641
+ public getEventSources(): BaseNode[] {
642
+ return this.findReferencesAsObject(HasEventSourceReferenceType, true);
643
+ }
644
+
645
+ /**
646
+ * return a array of the objects for which this node is an EventSource
647
+ */
648
+ public getEventSourceOfs(): BaseNode[] {
649
+ return this.findReferencesAsObject(HasEventSourceReferenceType, false);
650
+ }
651
+
652
+ /**
653
+ * the children of this node named `browseName` reached through a reference of type
654
+ * `referenceType` or a subtype of it, read from the child index rather than by scanning the
655
+ * references of the node again
656
+ */
657
+ private _selectChildren(browseName: QualifiedNameLike, namespaceIndex: number | undefined, referenceType: NodeId): BaseNode[] {
658
+ const references = _select_by_browse_name(_get_HierarchicalReference(this), browseName, namespaceIndex);
659
+ if (references.length === 0) {
660
+ return [];
661
+ }
662
+ const referenceTypeNode = this.addressSpace.findReferenceType(referenceType);
663
+ if (!referenceTypeNode) {
664
+ return [];
665
+ }
666
+ const selected: BaseNode[] = [];
667
+ for (const reference of references) {
668
+ if (referenceTypeNode.checkHasSubtype(reference.referenceType)) {
669
+ const node = ReferenceImpl.resolveReferenceNode(this.addressSpace, reference);
670
+ if (node) {
671
+ selected.push(node);
672
+ }
673
+ }
674
+ }
675
+ if (selected.length > 1 && typeof browseName === "string" && (namespaceIndex === null || namespaceIndex === undefined)) {
676
+ warningLog("Multiple children exist with name ", browseName, " please specify a namespace index");
677
+ }
678
+ return selected;
679
+ }
680
+
681
+ /**
682
+ * retrieve a component by name
683
+ */
684
+ public getComponentByName(browseName: QualifiedNameOptions): UAVariable | UAObject | null;
685
+ public getComponentByName(browseName: string, namespaceIndex?: number): UAVariable | UAObject | null;
686
+ public getComponentByName(browseName: QualifiedNameLike, namespaceIndex?: number): UAVariable | UAObject | null {
687
+ const select = this._selectChildren(browseName, namespaceIndex, HasComponentReferenceType);
688
+ assert(select.length <= 1, "BaseNode#getComponentByName found duplicated reference");
689
+ if (select.length === 1) {
690
+ const component = select[0];
691
+ if (component.nodeClass === NodeClass.Method) {
692
+ warningLog("please use getMethodByName to retrieve a method");
693
+ return null;
694
+ }
695
+ assert(component.nodeClass === NodeClass.Variable || component.nodeClass === NodeClass.Object);
696
+ return component as unknown as UAVariable | UAObject;
697
+ } else {
698
+ return null;
699
+ }
700
+ }
701
+
702
+ /**
703
+ * retrieve a property by name
704
+ */
705
+ public getPropertyByName(browseName: QualifiedNameOptions): UAVariable | null;
706
+ public getPropertyByName(browseName: string, namespaceIndex?: number): UAVariable | null;
707
+ public getPropertyByName(browseName: QualifiedNameLike, namespaceIndex?: number): UAVariable | null {
708
+ const select = this._selectChildren(browseName, namespaceIndex, HasPropertyReferenceType);
709
+ assert(select.length <= 1, "BaseNode#getPropertyByName found duplicated reference");
710
+ if (select.length === 1 && select[0].nodeClass !== NodeClass.Variable) {
711
+ throw new Error("Expecting a property to be of nodeClass==NodeClass.Variable");
712
+ }
713
+ return select.length === 1 ? (select[0] as unknown as UAVariable) : null;
714
+ }
715
+
716
+ /**
717
+ * retrieve a folder element by name
718
+ */
719
+ public getFolderElementByName(browseName: QualifiedNameOptions): BaseNode | null;
720
+ public getFolderElementByName(browseName: string, namespaceIndex?: number): BaseNode | null;
721
+ public getFolderElementByName(browseName: QualifiedNameLike, namespaceIndex?: number): BaseNode | null {
722
+ const select = this._selectChildren(browseName, namespaceIndex, OrganizesReferenceType);
723
+ return select.length === 1 ? select[0] : null;
724
+ }
725
+
726
+ /**
727
+ * returns the list of nodes that this folder object organizes
728
+ */
729
+ public getFolderElements(): BaseNodeImpl[] {
730
+ return this.findReferencesExAsObject("Organizes", BrowseDirection.Forward) as BaseNodeImpl[];
731
+ }
732
+
733
+ /**
734
+ * returns the list of methods that this object provides
735
+ * @return an array with Method objects.
736
+ *
737
+ *
738
+ * Note: internally, methods are special types of components
739
+ */
740
+ public getMethods(): UAMethod[] {
741
+ const components = this.getComponents();
742
+ return components.filter((obj) => obj.nodeClass === NodeClass.Method) as UAMethod[];
743
+ }
744
+
745
+ /**
746
+ * returns the method exposed by this object and with the given nodeId
747
+ */
748
+ public getMethodById(nodeId: NodeId): UAMethod | null {
749
+ const methods = this.getMethods();
750
+ const found = methods.find((m: UAMethod) => m.nodeId.toString() === nodeId.toString());
751
+ return found || null;
752
+ }
753
+
754
+ public getMethodByName(methodName: QualifiedNameOptions): UAMethod | null;
755
+ public getMethodByName(methodName: string, namespaceIndex?: number): UAMethod | null;
756
+ public getMethodByName(methodName: QualifiedNameLike, namespaceIndex?: number): UAMethod | null {
757
+ // methods are components of a special node class
758
+ const select = this._selectChildren(methodName, namespaceIndex, HasComponentReferenceType).filter(
759
+ (node) => node.nodeClass === NodeClass.Method
760
+ );
761
+ assert(select.length <= 1, "BaseNode#getMethodByName found duplicated reference");
762
+ return select.length === 1 ? (select[0] as UAMethod) : null;
763
+ }
764
+
765
+ public getWriteMask(): number {
766
+ return 0;
767
+ }
768
+
769
+ public getUserWriteMask(): number {
770
+ return 0;
771
+ }
772
+ public readAttribute(
773
+ context: ISessionContext | null,
774
+ attributeId: AttributeIds,
775
+ indexRange?: NumericRange,
776
+ dataEncoding?: QualifiedNameLike | null
777
+ ): DataValue {
778
+ indexRange;
779
+ dataEncoding;
780
+ assert(!context || context instanceof SessionContext);
781
+ const options: Record<string, unknown> = {};
782
+ options.statusCode = StatusCodes.Good;
783
+
784
+ switch (attributeId) {
785
+ case AttributeIds.NodeId: // NodeId
786
+ options.value = { dataType: DataType.NodeId, value: this.nodeId };
787
+ break;
788
+
789
+ case AttributeIds.NodeClass: // NodeClass
790
+ assert(Number.isFinite(this.nodeClass));
791
+ options.value = { dataType: DataType.Int32, value: this.nodeClass };
792
+ break;
793
+
794
+ case AttributeIds.BrowseName: // QualifiedName
795
+ assert(this.browseName instanceof QualifiedName);
796
+ options.value = { dataType: DataType.QualifiedName, value: this.browseName };
797
+ break;
798
+
799
+ case AttributeIds.DisplayName: // LocalizedText
800
+ options.value = { dataType: DataType.LocalizedText, value: this.displayName[0] };
801
+ break;
802
+
803
+ case AttributeIds.Description: // LocalizedText
804
+ options.value = { dataType: DataType.LocalizedText, value: this.description };
805
+ break;
806
+
807
+ case AttributeIds.WriteMask:
808
+ options.value = { dataType: DataType.UInt32, value: this.getWriteMask() };
809
+ break;
810
+
811
+ case AttributeIds.UserWriteMask:
812
+ options.value = { dataType: DataType.UInt32, value: this.getUserWriteMask() };
813
+ break;
814
+
815
+ case AttributeIds.AccessRestrictions:
816
+ return this._readAccessRestrictions(context);
817
+
818
+ case AttributeIds.RolePermissions:
819
+ return this._readRolePermissions(context);
820
+
821
+ case AttributeIds.UserRolePermissions:
822
+ return this._readUserRolePermissions(context);
823
+
824
+ default:
825
+ options.value = null;
826
+ options.statusCode = StatusCodes.BadAttributeIdInvalid;
827
+ break;
828
+ }
829
+ // xx options.serverTimestamp = new Date();
830
+ return new DataValue(options);
831
+ }
832
+
833
+ public writeAttribute(
834
+ context: ISessionContext | null,
835
+ writeValue: WriteValueOptions,
836
+ callback: (err: Error | null, statusCode?: StatusCode) => void
837
+ ): void {
838
+ context = context || SessionContext.defaultContext;
839
+
840
+ assert(context instanceof SessionContext);
841
+ assert(typeof callback === "function");
842
+
843
+ if (
844
+ writeValue.attributeId === undefined ||
845
+ writeValue.attributeId <= 0 ||
846
+ writeValue.attributeId > AttributeIds.AccessLevelEx
847
+ ) {
848
+ callback(null, StatusCodes.BadAttributeIdInvalid);
849
+ return;
850
+ }
851
+ if (!this.canUserWriteAttribute(context, writeValue.attributeId)) {
852
+ callback(null, StatusCodes.BadUserAccessDenied);
853
+ return;
854
+ }
855
+ // by default Node is read-only,
856
+ // this method needs to be overridden to change the behavior
857
+ callback(null, StatusCodes.BadNotWritable);
858
+ }
859
+
860
+ public fullName(): string {
861
+ if (this.parentNodeId) {
862
+ const parent = this.addressSpace.findNode(this.parentNodeId) as BaseNode;
863
+
864
+ // c8 ignore next
865
+ if (parent) {
866
+ return `${parent.fullName()}.${this.browseName.toString()}`;
867
+ } else {
868
+ return `NOT YET REGISTERED${this.parentNodeId.toString()}.${this.browseName.toString()}`;
869
+ }
870
+ }
871
+ return this.browseName.toString();
872
+ }
873
+
874
+ public ownReferences(): UAReference[] {
875
+ const _private = BaseNode_getPrivate(this);
876
+ return [..._private._referenceIdx.values()];
877
+ }
878
+
879
+ /**
880
+ *
881
+ * @param relativePathElement
882
+ * @param isLast
883
+ * @return {NodeId[]}
884
+ */
885
+ public browseNodeByTargetName(relativePathElement: RelativePathElement, isLast: boolean): NodeId[] {
886
+ relativePathElement.targetName = relativePathElement.targetName || new QualifiedName({});
887
+ // part 4.0 v1.03 $7.26 RelativePath
888
+ // The BrowseName of the target node.
889
+ // The final element may have an empty targetName. In this situation all targets of the references identified by
890
+ // the referenceTypeId are the targets of the RelativePath.
891
+ // The targetName shall be specified for all other elements.
892
+ // The current path cannot be followed any further if no targets with the specified BrowseName exist.
893
+ assert(relativePathElement.targetName instanceof QualifiedName);
894
+ assert(relativePathElement.targetName.namespaceIndex >= 0);
895
+ assert((relativePathElement.targetName.name?.length || 0) > 0);
896
+
897
+ // The type of reference to follow from the current node.
898
+ // The current path cannot be followed any further if the referenceTypeId is not available on the Node instance.
899
+ // If not specified then all References are included and the parameter includeSubtypes is ignored.
900
+ assert(Object.hasOwn(relativePathElement, "referenceTypeId"));
901
+
902
+ // Indicates whether the inverse Reference should be followed.
903
+ // The inverse reference is followed if this value is TRUE.
904
+ assert(Object.hasOwn(relativePathElement, "isInverse"));
905
+
906
+ // Indicates whether subtypes of the ReferenceType should be followed.
907
+ // Subtypes are included if this value is TRUE.
908
+ assert(Object.hasOwn(relativePathElement, "includeSubtypes"));
909
+
910
+ // A forward step naming its target through a hierarchical reference type, the shape of
911
+ // almost every TranslateBrowsePath element, is a lookup in the child index rather than a
912
+ // scan of every reference of the node; the filter below still applies to what it finds.
913
+ const references = this._hierarchicalStepCandidates(relativePathElement) ?? this.allReferences();
914
+
915
+ const _check_reference = (reference: UAReference) => {
916
+ if (relativePathElement.referenceTypeId.isEmpty()) {
917
+ return true;
918
+ }
919
+ assert(relativePathElement.referenceTypeId instanceof NodeId);
920
+ if (
921
+ (relativePathElement.isInverse && reference.isForward) ||
922
+ (!relativePathElement.isInverse && !reference.isForward)
923
+ ) {
924
+ return false;
925
+ }
926
+ assert(Object.hasOwn(reference, "isForward"));
927
+ const referenceType = resolveReferenceType(this.addressSpace, reference);
928
+ const referenceTypeId = referenceType.nodeId;
929
+
930
+ if (sameNodeId(relativePathElement.referenceTypeId, referenceTypeId)) {
931
+ return true;
932
+ }
933
+ if (relativePathElement.includeSubtypes) {
934
+ const baseType = this.addressSpace.findReferenceType(relativePathElement.referenceTypeId);
935
+ if (baseType && referenceType.isSubtypeOf(baseType)) {
936
+ return true;
937
+ }
938
+ }
939
+ return false;
940
+ };
941
+
942
+ const nodeIdsMap: Record<string, BaseNode> = {};
943
+ let nodeIds: NodeId[] = [];
944
+
945
+ for (const reference of references) {
946
+ if (!_check_reference(reference)) {
947
+ continue;
948
+ }
949
+
950
+ const obj = resolveReferenceNode(this.addressSpace, reference);
951
+
952
+ // c8 ignore next
953
+ if (!obj) {
954
+ throw new Error(` cannot find node with id ${reference.nodeId.toString()}`);
955
+ }
956
+
957
+ if (isEqual(obj.browseName, relativePathElement.targetName)) {
958
+ // compare QualifiedName
959
+
960
+ const key = obj.nodeId.toString();
961
+ if (!Object.hasOwn(nodeIdsMap, key)) {
962
+ nodeIds.push(obj.nodeId);
963
+ nodeIdsMap[key] = obj;
964
+ }
965
+ }
966
+ }
967
+
968
+ if (nodeIds.length === 0 && (this.nodeClass === NodeClass.ObjectType || this.nodeClass === NodeClass.VariableType)) {
969
+ const nodeType = this as unknown as UAVariableType;
970
+
971
+ if (nodeType.subtypeOf) {
972
+ // browsing also InstanceDeclarations included in base type
973
+ const baseType = this.addressSpace.findNode(nodeType.subtypeOf) as BaseNode;
974
+ const n = (baseType as BaseNodeImpl).browseNodeByTargetName(relativePathElement, isLast);
975
+ nodeIds = ([] as NodeId[]).concat(nodeIds, n);
976
+ }
977
+ }
978
+ return nodeIds;
979
+ }
980
+
981
+ /**
982
+ * the references of this node that can answer a relative path element, taken from the child
983
+ * index, or null when the element is one the index cannot answer (an inverse step, an
984
+ * unspecified or non-hierarchical reference type, no target name)
985
+ */
986
+ private _hierarchicalStepCandidates(relativePathElement: RelativePathElement): UAReference[] | null {
987
+ const targetName = relativePathElement.targetName;
988
+ if (relativePathElement.isInverse || !targetName?.name || relativePathElement.referenceTypeId.isEmpty()) {
989
+ return null;
990
+ }
991
+ const wellKnown = wellKnownReferenceTypes(this.addressSpace);
992
+ const referenceType = this.addressSpace.findReferenceType(relativePathElement.referenceTypeId);
993
+ if (!wellKnown || !referenceType) {
994
+ return null;
995
+ }
996
+ if (referenceType !== wellKnown.hierarchicalReferences && !referenceType.isSubtypeOf(wellKnown.hierarchicalReferences)) {
997
+ return null;
998
+ }
999
+ return _select_by_browse_name(_get_HierarchicalReference(this), targetName, targetName.namespaceIndex);
1000
+ }
1001
+
1002
+ /**
1003
+ * browse the node to extract information requested in browseDescription
1004
+ * and returns an array with reference descriptions
1005
+ *
1006
+ *
1007
+ *
1008
+ */
1009
+ public browseNode(browseDescription: BrowseDescriptionOptions2, context?: ISessionContext): ReferenceDescription[] {
1010
+ assert(Number.isFinite(browseDescription.nodeClassMask));
1011
+
1012
+ const do_debug = false;
1013
+
1014
+ const _private = BaseNode_getPrivate(this);
1015
+
1016
+ const addressSpace = this.addressSpace;
1017
+
1018
+ const referenceTypeId = normalize_referenceTypeId(addressSpace, browseDescription.referenceTypeId);
1019
+ assert(referenceTypeId instanceof NodeId);
1020
+
1021
+ const browseDirection =
1022
+ browseDescription.browseDirection !== undefined ? browseDescription.browseDirection : BrowseDirection.Both;
1023
+
1024
+ // get all possible references
1025
+ let references = this.allReferences();
1026
+
1027
+ /* c8 ignore next */
1028
+ if (do_debug) {
1029
+ // c8 ignore next
1030
+ doDebug && debugLog("all references :", this.nodeId.toString(), this.browseName.toString());
1031
+ dumpReferences(addressSpace, _private._referenceIdx.values());
1032
+ }
1033
+
1034
+ // filter out references not matching referenceType
1035
+ references = _filter_by_referenceType.call(this, browseDescription, references, referenceTypeId);
1036
+
1037
+ references = _filter_by_direction(references, browseDirection);
1038
+
1039
+ references = _filter_by_nodeClass.call(this, references, browseDescription.nodeClassMask);
1040
+
1041
+ references = _filter_by_userFilter.call(this, references, context);
1042
+
1043
+ if (context) {
1044
+ references = _filter_by_context(this, references, context);
1045
+ }
1046
+ const referenceDescriptions = _constructReferenceDescription(addressSpace, references, browseDescription.resultMask);
1047
+
1048
+ /* c8 ignore next */
1049
+ if (do_debug) {
1050
+ dumpReferenceDescriptions(this.addressSpace, referenceDescriptions);
1051
+ }
1052
+
1053
+ return referenceDescriptions;
1054
+ }
1055
+
1056
+ public allReferences(): UAReference[] {
1057
+ const _private = BaseNode_getPrivate(this);
1058
+ const references = [..._private._referenceIdx.values(), ..._private._back_referenceIdx.values()];
1059
+ const addressSpace = this.addressSpace;
1060
+ for (const ref of references) {
1061
+ if (!(ref as ReferenceImpl).node) {
1062
+ resolveReferenceNode(addressSpace, ref);
1063
+ }
1064
+ }
1065
+ return references;
1066
+ }
1067
+
1068
+ /**
1069
+ * @param reference
1070
+ * @param reference.referenceType {String}
1071
+ * @param [reference.isForward = true] {Boolean}
1072
+ * @param reference.nodeId {Node|NodeId|String}
1073
+ *
1074
+ * @example
1075
+ *
1076
+ * view.addReference({ referenceType: "Organizes", nodeId: myDevice });
1077
+ *
1078
+ * or
1079
+ *
1080
+ * myDevice1.addReference({ referenceType: "OrganizedBy", nodeId: view });
1081
+ */
1082
+ public addReference(reference: AddReferenceOpts): void {
1083
+ const referenceNode = this.__addReference(reference);
1084
+ const addressSpace = this.addressSpace;
1085
+
1086
+ if (!resolveReferenceType(addressSpace, referenceNode)) {
1087
+ throw new Error(`BaseNode#addReference : invalid reference ${reference.toString()}`);
1088
+ }
1089
+
1090
+ _propagate_ref.call(this, addressSpace, referenceNode);
1091
+ this.install_extra_properties();
1092
+ _handle_add_reference_change_event(this, referenceNode.nodeId);
1093
+ }
1094
+
1095
+ public removeReference(referenceOpts: AddReferenceOpts): void {
1096
+ const _private = BaseNode_getPrivate(this);
1097
+
1098
+ assert(Object.hasOwn(referenceOpts, "referenceType"));
1099
+ // xx isForward is optional : assert(Object.prototype.hasOwnProperty.call(reference,"isForward"));
1100
+ assert(Object.hasOwn(referenceOpts, "nodeId"));
1101
+
1102
+ const addressSpace = this.addressSpace as AddressSpacePrivate;
1103
+
1104
+ const reference = addressSpace.normalizeReferenceTypes([referenceOpts])?.[0];
1105
+ const h = (<ReferenceImpl>reference).key(addressSpace);
1106
+
1107
+ const relatedNode = addressSpace.findNode(reference.nodeId);
1108
+
1109
+ // c8 ignore next
1110
+ if (!relatedNode) {
1111
+ return;
1112
+ }
1113
+
1114
+ const backwardReference = new ReferenceImpl({
1115
+ isForward: !reference.isForward,
1116
+ nodeId: this.nodeId,
1117
+ referenceType: reference.referenceType
1118
+ });
1119
+
1120
+ if (_private._referenceIdx.has(h)) {
1121
+ _private._referenceIdx.delete(h);
1122
+ BaseNode_remove_backward_reference.call(relatedNode as BaseNodeImpl, backwardReference);
1123
+ _remove_HierarchicalReference(this, reference);
1124
+ this.uninstall_extra_properties(reference);
1125
+ this._clear_caches();
1126
+ noteReferenceTypeChange(this, reference);
1127
+ } else if (_private._back_referenceIdx.has(h)) {
1128
+ relatedNode.removeReference(backwardReference);
1129
+ } else {
1130
+ // A back reference of a massively used type was never installed: _propagate_ref
1131
+ // skips HasTypeDefinition and HasModellingRule deliberately, "because there are
1132
+ // too many". Removal has to mirror that, or detaching any node asks its type
1133
+ // definition to drop a reference it never held - which is where the hundred-odd
1134
+ // "Cannot find reference to remove: ns=0;i=40" lines per run came from. The
1135
+ // absence is the designed state, not a fault worth reporting.
1136
+ const referenceType = resolveReferenceType(addressSpace, reference);
1137
+ if (!reference.isForward && referenceType && isMassivelyUsedReferenceType(referenceType.nodeId)) {
1138
+ return;
1139
+ }
1140
+ warningLog(`Cannot find reference to remove: ${reference.toString()}`);
1141
+ }
1142
+ }
1143
+
1144
+ /**
1145
+ *
1146
+ */
1147
+ public resolveNodeId(nodeId: NodeIdLike): NodeId {
1148
+ return this.addressSpace.resolveNodeId(nodeId);
1149
+ }
1150
+
1151
+ /**
1152
+ * Expose the hierarchical children of this node as properties of this node, and this node as
1153
+ * a property of its parents, for the browse names that have no shared accessor.
1154
+ *
1155
+ * A node created while a nodeset loads needs nothing here: its name got a getter on the
1156
+ * prototype (see child_accessors.ts). This is the path for nodes created afterwards through the
1157
+ * namespace API, whose browse names may be anything and must not touch the prototype.
1158
+ */
1159
+ public install_extra_properties(): void {
1160
+ const addressSpace = this.addressSpace;
1161
+ if (addressSpace.isFrugal) {
1162
+ return;
1163
+ }
1164
+ const wellKnown = wellKnownReferenceTypes(addressSpace);
1165
+ if (!wellKnown) {
1166
+ return; // namespace 0 is still loading
1167
+ }
1168
+ const { hasChild, hasComponent, hasProperty, organizes } = wellKnown;
1169
+ const self = this as BaseNode;
1170
+ const visit = (reference: UAReference) => {
1171
+ if (reference.isForward) {
1172
+ if (hasChild.checkHasSubtype(reference.referenceType) || organizes.checkHasSubtype(reference.referenceType)) {
1173
+ install_child_as_object_property(self, resolveReferenceNode(addressSpace, reference));
1174
+ }
1175
+ } else if (
1176
+ hasComponent.checkHasSubtype(reference.referenceType) ||
1177
+ hasProperty.checkHasSubtype(reference.referenceType) ||
1178
+ organizes.checkHasSubtype(reference.referenceType)
1179
+ ) {
1180
+ // Only this node is new, so only this node has to appear on the parent.
1181
+ // Re-walking every child the parent already has made building a folder
1182
+ // of N children cost O(N^2) - measured at 7.2s for 3000 children.
1183
+ install_child_as_object_property(resolveReferenceNode(addressSpace, reference), self);
1184
+ }
1185
+ };
1186
+ const _private = BaseNode_getPrivate(this);
1187
+ for (const reference of _private._referenceIdx.values()) {
1188
+ visit(reference);
1189
+ }
1190
+ for (const reference of _private._back_referenceIdx.values()) {
1191
+ visit(reference);
1192
+ }
1193
+ }
1194
+
1195
+ /**
1196
+ * undo install_extra_properties for one reference, on both ends when it is an inverse one
1197
+ */
1198
+ public uninstall_extra_properties(reference: UAReference): void {
1199
+ const addressSpace = this.addressSpace;
1200
+ if (addressSpace.isFrugal) {
1201
+ return;
1202
+ }
1203
+ if (!reference.isForward) {
1204
+ const parentNode = resolveReferenceNode(addressSpace, reference);
1205
+ if (parentNode) {
1206
+ (parentNode as BaseNodeImpl).uninstall_extra_properties({
1207
+ isForward: true,
1208
+ nodeId: this.nodeId,
1209
+ referenceType: reference.referenceType
1210
+ });
1211
+ }
1212
+ }
1213
+ const childNode = resolveReferenceNode(addressSpace, reference);
1214
+ if (childNode) {
1215
+ uninstall_child_object_property(this, childNode);
1216
+ }
1217
+ }
1218
+
1219
+ public toString(): string {
1220
+ const options = new ToStringBuilder();
1221
+ BaseNode_toString.call(this, options);
1222
+ return options.toString();
1223
+ }
1224
+
1225
+ public toJSON(): Record<string, unknown> {
1226
+ return {
1227
+ nodeId: this.nodeId.toString(),
1228
+ nodeClass: NodeClass[this.nodeClass],
1229
+ browseName: this.browseName.toString(),
1230
+ displayName: this.displayName.length ? this.displayName[0].text : ""
1231
+ };
1232
+ }
1233
+
1234
+ public [Symbol.for("nodejs.util.inspect.custom")](): string {
1235
+ return this.toString();
1236
+ }
1237
+
1238
+ /**
1239
+ * @property isFalseSubStateOf
1240
+ * @type {BaseNode|null}
1241
+ */
1242
+ public get isFalseSubStateOf(): BaseNode | null {
1243
+ const r = this.findReferencesAsObject("HasFalseSubState", false);
1244
+ if (!r || r.length === 0) {
1245
+ return null;
1246
+ }
1247
+ assert(r.length === 1);
1248
+ return r[0];
1249
+ }
1250
+
1251
+ /**
1252
+ * @property isTrueSubStateOf
1253
+ * @type {BaseNode|null}
1254
+ */
1255
+ public get isTrueSubStateOf(): BaseNode | null {
1256
+ const r = this.findReferencesAsObject("HasTrueSubState", false);
1257
+ if (!r || r.length === 0) {
1258
+ return null;
1259
+ }
1260
+ assert(r.length === 1);
1261
+ return r[0] as BaseNode;
1262
+ }
1263
+
1264
+ /**
1265
+ * @return {UAStateVariable[]} return an array with the SubStates of this object.
1266
+ */
1267
+ public getFalseSubStates(): UAStateVariable<LocalizedText>[] {
1268
+ return this.findReferencesAsObject("HasFalseSubState") as UAStateVariable<LocalizedText>[];
1269
+ }
1270
+
1271
+ /**
1272
+
1273
+ * @return {UAStateVariable[]} return an array with the SubStates of this object.
1274
+ */
1275
+ public getTrueSubStates(): UAStateVariable<LocalizedText>[] {
1276
+ return this.findReferencesAsObject("HasTrueSubState") as UAStateVariable<LocalizedText>[];
1277
+ }
1278
+
1279
+ public findHierarchicalReferences(): UAReference[] {
1280
+ return this.findReferencesEx("HierarchicalReferences", BrowseDirection.Forward);
1281
+ }
1282
+
1283
+ public getChildByName(browseName: QualifiedNameOptions): BaseNode | null;
1284
+ public getChildByName(browseName: string, namespaceIndex?: number): BaseNode | null;
1285
+ //
1286
+ public getChildByName(browseName: QualifiedNameLike, namespaceIndex?: number): BaseNode | null {
1287
+ var childrenMap = _get_HierarchicalReference(this);
1288
+ const select = _select_by_browse_name(childrenMap, browseName, namespaceIndex);
1289
+ if (select.length === 0) {
1290
+ return null;
1291
+ }
1292
+ const ref = select[0];
1293
+ const r = this.addressSpace.findReferenceType(ref.referenceType);
1294
+ if (!r) return null;
1295
+ const hasChild = this.addressSpace.findReferenceType("HasChild");
1296
+ if (!hasChild) {
1297
+ return null; // too early, bmy be namespace 0 is still loading
1298
+ }
1299
+ if (r.isSubtypeOf(hasChild)) {
1300
+ return ref.node || null;
1301
+ }
1302
+ return null;
1303
+ }
1304
+ public getNodeVersion(): UAProperty<UAString, DataType.String> | null {
1305
+ return this.getChildByName("NodeVersion", 0) as UAProperty<UAString, DataType.String> | null;
1306
+ /*
1307
+ const cache = BaseNode_getCache(this);
1308
+ if (cache._versionNode == undefined) {
1309
+ cache._versionNode = this.getChildByName("NodeVersion", 0) as UAProperty<string, DataType.String> | null;
1310
+ }
1311
+ return cache._versionNode as UAProperty<UAString, DataType.String> | null;
1312
+ */
1313
+ }
1314
+
1315
+ public get nodeVersion(): UAProperty<UAString, DataType.String> | undefined {
1316
+ return this.getNodeVersion() || undefined;
1317
+ }
1318
+ public set nodeVersion(_n: unknown) {
1319
+ assert(false);
1320
+ }
1321
+
1322
+ get toStateNode(): BaseNode | null {
1323
+ const nodes = this.findReferencesAsObject("ToState", true);
1324
+ assert(nodes.length <= 1);
1325
+ return nodes.length === 1 ? nodes[0] : null;
1326
+ }
1327
+
1328
+ get fromStateNode(): BaseNode | null {
1329
+ const nodes = this.findReferencesAsObject("FromState", true);
1330
+ assert(nodes.length <= 1);
1331
+ return nodes.length === 1 ? nodes[0] : null;
1332
+ }
1333
+
1334
+ /**
1335
+ * this methods propagates the forward references to the pointed node
1336
+ * by inserting backward references to the counter part node
1337
+ * @private
1338
+ */
1339
+ public propagate_back_references(): void {
1340
+ this._propagate_back_references(undefined);
1341
+ }
1342
+
1343
+ /**
1344
+ * propagate_back_references for a node a NodeSet2 file declared: its references may be held
1345
+ * by their target as well, so each is looked up there before a back reference is built
1346
+ */
1347
+ public propagate_back_references_declared_from_both_ends(): void {
1348
+ this._propagate_back_references(nodeIdKey(this.nodeId));
1349
+ }
1350
+
1351
+ /** one reference of a node a NodeSet2 file declared, see propagate_back_references_declared_from_both_ends */
1352
+ public propagate_back_reference_declared_from_both_ends(reference: UAReference): void {
1353
+ if ((this.addressSpace as AddressSpacePrivate).suspendBackReference) {
1354
+ return;
1355
+ }
1356
+ _propagate_ref.call(this, this.addressSpace, reference, nodeIdKey(this.nodeId));
1357
+ }
1358
+
1359
+ private _propagate_back_references(sourceNodeKey: number | string | undefined): void {
1360
+ const _private = BaseNode_getPrivate(this);
1361
+ if ((this.addressSpace as AddressSpacePrivate).suspendBackReference) {
1362
+ // this indicates that the base node is constructed from an xml definition
1363
+ // propagate_back_references will be called later once the file has been completely processed.
1364
+ return;
1365
+ }
1366
+ const addressSpace = this.addressSpace;
1367
+ for (const reference of _private._referenceIdx.values()) {
1368
+ _propagate_ref.call(this, addressSpace, reference, sourceNodeKey);
1369
+ }
1370
+ }
1371
+
1372
+ /**
1373
+ * the dispose method should be called when the node is no longer used, to release
1374
+ * back pointer to the address space and clear caches.
1375
+ *
1376
+ * @private
1377
+ */
1378
+ public dispose(): void {
1379
+ (this as BaseNode).emit("dispose");
1380
+
1381
+ this.removeAllListeners();
1382
+ this._clear_caches();
1383
+
1384
+ const _private = BaseNode_getPrivate(this);
1385
+ for (const ref of _private._back_referenceIdx.values()) {
1386
+ (ref as ReferenceImpl).dispose();
1387
+ }
1388
+
1389
+ for (const ref of _private._referenceIdx.values()) {
1390
+ (ref as ReferenceImpl).dispose();
1391
+ }
1392
+
1393
+ BaseNode_removePrivate(this);
1394
+ }
1395
+
1396
+ public isDisposed(): boolean {
1397
+ return !this.addressSpacePrivate;
1398
+ }
1399
+
1400
+ // c8 ignore next
1401
+ public dumpXML(xmlWriter: XmlWriter): void {
1402
+ console.error(" This ", NodeClass[this.nodeClass]);
1403
+ assert(false, "BaseNode#dumpXML NOT IMPLEMENTED !");
1404
+ assert(xmlWriter);
1405
+ }
1406
+
1407
+ /**
1408
+ * Undo the effect of propagate_back_references
1409
+ */
1410
+ public unpropagate_back_references(): void {
1411
+ const _private = BaseNode_getPrivate(this);
1412
+
1413
+ const addressSpace = this.addressSpace;
1414
+
1415
+ for (const reference of _private._referenceIdx.values()) {
1416
+ // filter out non Hierarchical References
1417
+ const referenceType = resolveReferenceType(addressSpace, reference);
1418
+
1419
+ // c8 ignore next
1420
+ if (!referenceType) {
1421
+ console.error(chalk.red(" ERROR"), " cannot find reference ", reference.referenceType, reference.toString());
1422
+ }
1423
+
1424
+ const related_node = resolveReferenceNode(addressSpace, reference) as BaseNodeImpl;
1425
+ if (related_node) {
1426
+ assert(reference.nodeId.toString() !== this.nodeId.toString());
1427
+ BaseNode_remove_backward_reference.call(
1428
+ related_node,
1429
+ new ReferenceImpl({
1430
+ isForward: !reference.isForward,
1431
+ nodeId: this.nodeId,
1432
+ referenceType: reference.referenceType
1433
+ })
1434
+ );
1435
+ } // else addressSpace may be incomplete
1436
+ }
1437
+ }
1438
+
1439
+ public installPostInstallFunc(f: (instance: BaseNode, tpyeNode: BaseNode, opts?: unknown) => void): void {
1440
+ if (!f) {
1441
+ // nothing to do
1442
+ return;
1443
+ }
1444
+
1445
+ function chain(f1: ApplyFunc | undefined, f2: ApplyFunc | undefined) {
1446
+ return function chainingFunc(this: BaseNode, ...args: unknown[]) {
1447
+ if (f1) {
1448
+ f1.apply(this, args);
1449
+ }
1450
+ if (f2) {
1451
+ f2.apply(this, args);
1452
+ }
1453
+ };
1454
+ }
1455
+
1456
+ this._postInstantiateFunc = chain.call(this, this._postInstantiateFunc, f);
1457
+ }
1458
+
1459
+ public _on_child_added(childNode: BaseNode): void {
1460
+ // this._clear_caches();
1461
+ // return;
1462
+ const cache = BaseNode_getCache(this);
1463
+ const tmpV = cache._versionNode;
1464
+ const tmpC = cache._children;
1465
+ this._clear_caches();
1466
+ const newCache = BaseNode_getCache(this);
1467
+ newCache._versionNode = tmpV;
1468
+ newCache._children = tmpC;
1469
+ if (newCache._children) {
1470
+ newCache._children?.push(childNode);
1471
+ }
1472
+ }
1473
+
1474
+ public _on_child_removed(_obj: BaseNode): void {
1475
+ // obj; // unused;
1476
+ this._clear_caches();
1477
+ }
1478
+
1479
+ /**
1480
+ * @private
1481
+ * @param reference
1482
+ */
1483
+ public _add_backward_reference(reference: UAReference): void {
1484
+ BaseNode_add_backward_reference.call(this, reference);
1485
+ }
1486
+
1487
+ protected _coerceReferenceType(referenceType: string | NodeId | UAReferenceType): UAReferenceType | null {
1488
+ let result: UAReferenceType | null = null;
1489
+ if (typeof referenceType === "string") {
1490
+ result = this.addressSpace.findReferenceType(referenceType);
1491
+ /* c8 ignore next */
1492
+ if (!result) {
1493
+ errorLog("referenceType ", referenceType, " cannot be found");
1494
+ throw new Error(`Cannot coerce reference with name ${referenceType}`);
1495
+ }
1496
+ } else if (referenceType instanceof NodeId) {
1497
+ result = this.addressSpace.findNode(referenceType) as UAReferenceType;
1498
+ if (!result) {
1499
+ return null;
1500
+ }
1501
+ } else {
1502
+ result = referenceType;
1503
+ }
1504
+ assert(result, "reference must exists");
1505
+ assert(result.nodeClass === NodeClass.ReferenceType);
1506
+ return result as UAReferenceType;
1507
+ }
1508
+
1509
+ private __addReference(referenceOpts: AddReferenceOpts, clearCaches = true): UAReference {
1510
+ const addressSpace = this.addressSpace as AddressSpacePrivate;
1511
+ const _private = BaseNode_getPrivate(this);
1512
+ assert(Object.hasOwn(referenceOpts, "referenceType"));
1513
+ // xx isForward is optional : assert(Object.prototype.hasOwnProperty.call(reference,"isForward"));
1514
+ assert(Object.hasOwn(referenceOpts, "nodeId"));
1515
+
1516
+ const reference: UAReference = addressSpace.normalizeReferenceType(referenceOpts);
1517
+ assert(reference instanceof ReferenceImpl);
1518
+
1519
+ const h = (<ReferenceImpl>reference).key(addressSpace);
1520
+ assert(!_private._back_referenceIdx.has(h), "reference exists already in _back_references");
1521
+ assert(!_private._referenceIdx.has(h), "reference exists already in _references");
1522
+
1523
+ _private._referenceIdx.set(h, reference);
1524
+ _handle_HierarchicalReference(this, reference);
1525
+ if (clearCaches) {
1526
+ this._clear_caches();
1527
+ noteReferenceTypeChange(this, reference);
1528
+ }
1529
+ return reference;
1530
+ }
1531
+
1532
+ /** kept as given; the LocalizedText objects are built on first read (most nodes are never asked) */
1533
+ private _setDisplayName(displayName: LocalizedTextLike | LocalizedTextLike[]) {
1534
+ const _private = BaseNode_getPrivate(this);
1535
+ _private._displayNameRaw = displayName;
1536
+ _private._displayName = undefined;
1537
+ }
1538
+
1539
+ private _setDescription(description: LocalizedTextLike | null): void {
1540
+ const _private = BaseNode_getPrivate(this);
1541
+ _private._descriptionRaw = description;
1542
+ _private._description = undefined;
1543
+ }
1544
+
1545
+ private _notifyAttributeChange(attributeId: AttributeIds): void {
1546
+ const event_name = BaseNodeImpl.makeAttributeEventName(attributeId);
1547
+ (this as BaseNode).emit(event_name, this.readAttribute(SessionContext.defaultContext, attributeId));
1548
+ }
1549
+
1550
+ private _clear_caches() {
1551
+ BaseNode_clearCache(this);
1552
+ }
1553
+
1554
+ public canUserWriteAttribute(context: ISessionContext | null, attributeId: AttributeIds): boolean {
1555
+ // the Client is allowed to write to Attributes other than the Value,
1556
+ // Historizing or RolePermissions Attribute
1557
+ if (!context) return true;
1558
+ if (attributeId === AttributeIds.Historizing) {
1559
+ return context.checkPermission(this as BaseNode, PermissionType.WriteHistorizing);
1560
+ }
1561
+ if (attributeId === AttributeIds.RolePermissions) {
1562
+ return context.checkPermission(this as BaseNode, PermissionType.WriteRolePermissions);
1563
+ }
1564
+ if (attributeId === AttributeIds.Value) {
1565
+ return context.checkPermission(this as BaseNode, PermissionType.Write);
1566
+ }
1567
+ return context.checkPermission(this as BaseNode, PermissionType.WriteAttribute);
1568
+ }
1569
+
1570
+ private _readAccessRestrictions(_context: ISessionContext | null): DataValue {
1571
+ // https://reference.opcfoundation.org/v104/Core/docs/Part3/8.56/
1572
+ if (this.accessRestrictions === undefined) {
1573
+ return new DataValue({ statusCode: StatusCodes.BadAttributeIdInvalid });
1574
+ }
1575
+
1576
+ return new DataValue({
1577
+ statusCode: StatusCodes.Good,
1578
+ value: {
1579
+ dataType: DataType.UInt16,
1580
+ value: this.accessRestrictions
1581
+ }
1582
+ });
1583
+ }
1584
+ private _readRolePermissions(context: ISessionContext | null): DataValue {
1585
+ // https://reference.opcfoundation.org/v104/Core/docs/Part3/4.8.3/
1586
+
1587
+ // to do check that current user can read permission
1588
+ if (context && !context.checkPermission(this as BaseNode, PermissionType.ReadRolePermissions)) {
1589
+ return new DataValue({
1590
+ statusCode: StatusCodes.BadSecurityModeInsufficient
1591
+ });
1592
+ }
1593
+
1594
+ if (this.rolePermissions === undefined) {
1595
+ // to do : If not specified, the value of DefaultUserRolePermissions Property from
1596
+ // the Namespace Metadata Object associated with the Node is used instead.
1597
+ return new DataValue({
1598
+ statusCode: StatusCodes.BadAttributeIdInvalid
1599
+ });
1600
+ }
1601
+
1602
+ const rolePermissions = this.rolePermissions.map(({ roleId, permissions }) => {
1603
+ return new RolePermissionType({
1604
+ roleId: toRoleNodeId(roleId),
1605
+ permissions
1606
+ });
1607
+ });
1608
+ return new DataValue({
1609
+ statusCode: StatusCodes.Good,
1610
+ value: {
1611
+ dataType: DataType.ExtensionObject,
1612
+ arrayType: VariantArrayType.Array,
1613
+ value: rolePermissions
1614
+ }
1615
+ });
1616
+ }
1617
+
1618
+ private _readUserRolePermissions(context: ISessionContext | null): DataValue {
1619
+ const allUserCanSeeTheirOwnRolePermissions = true;
1620
+ if (!allUserCanSeeTheirOwnRolePermissions) {
1621
+ // to do check that current user can read permission
1622
+ if (context && !context.checkPermission(this as BaseNode, PermissionType.ReadRolePermissions)) {
1623
+ return new DataValue({
1624
+ statusCode: StatusCodes.BadSecurityModeInsufficient
1625
+ });
1626
+ }
1627
+ }
1628
+
1629
+ if (this.rolePermissions === undefined) {
1630
+ // to do : If not specified, the value of DefaultUserRolePermissions Property from
1631
+ // the Namespace Metadata Object associated with the Node is used instead.
1632
+ return new DataValue({
1633
+ statusCode: StatusCodes.BadAttributeIdInvalid
1634
+ });
1635
+ }
1636
+ const context1: ISessionContext = context === null ? SessionContext.defaultContext : context;
1637
+
1638
+ // for the time being get user Permission
1639
+ const rolePermissions = this.rolePermissions
1640
+ .map(({ roleId, permissions }) => {
1641
+ return new RolePermissionType({
1642
+ roleId: toRoleNodeId(roleId),
1643
+ permissions
1644
+ });
1645
+ })
1646
+ .filter(({ roleId }) => context1.currentUserHasRole(roleId));
1647
+
1648
+ return new DataValue({
1649
+ statusCode: StatusCodes.Good,
1650
+ value: {
1651
+ dataType: DataType.ExtensionObject,
1652
+ arrayType: VariantArrayType.Array,
1653
+ value: rolePermissions
1654
+ }
1655
+ });
1656
+ }
1657
+
1658
+ /**
1659
+ *
1660
+ * @param rolePermissions
1661
+ */
1662
+ setRolePermissions(rolePermissions: RolePermissionTypeOptions[]): void {
1663
+ this._rolePermissions = coerceRolePermissions(rolePermissions);
1664
+ }
1665
+ getRolePermissions(inherited: boolean): RolePermissionType[] | null {
1666
+ if (this.rolePermissions === undefined && inherited) {
1667
+ return this.namespace.getDefaultRolePermissions();
1668
+ }
1669
+ return this._rolePermissions || null;
1670
+ }
1671
+ get rolePermissions(): RolePermissionType[] | undefined {
1672
+ return this._rolePermissions || undefined;
1673
+ }
1674
+
1675
+ setAccessRestrictions(accessRestrictions: AccessRestrictionsFlag): void {
1676
+ this._accessRestrictions = accessRestrictions;
1677
+ }
1678
+ get accessRestrictions(): AccessRestrictionsFlag | undefined {
1679
+ return this._accessRestrictions;
1680
+ }
1681
+ getAccessRestrictions(inherited: boolean): AccessRestrictionsFlag {
1682
+ if (this._accessRestrictions === undefined && inherited) {
1683
+ return this.namespace.getDefaultAccessRestrictions();
1684
+ }
1685
+ return this._accessRestrictions || AccessRestrictionsFlag.None;
1686
+ }
1687
+ }
1688
+
1689
+ function toRoleNodeId(s: NodeIdLike): NodeId {
1690
+ if (typeof s === "string") {
1691
+ return resolveNodeId(WellKnownRolesNodeId[s as keyof typeof WellKnownRolesNodeId]);
1692
+ }
1693
+ return coerceNodeId(s);
1694
+ }
1695
+
1696
+ let displayWarning = true;
1697
+
1698
+ function toString_ReferenceDescription(ref: UAReference, options: { addressSpace: IAddressSpace }): string {
1699
+ const addressSpace = options.addressSpace as AddressSpacePrivate;
1700
+
1701
+ const refNode = addressSpace.findNode(ref.referenceType);
1702
+ if (!refNode) {
1703
+ return `Unknown Ref : ${ref}`;
1704
+ }
1705
+ const r = new ReferenceImpl({
1706
+ isForward: ref.isForward,
1707
+ nodeId: ref.nodeId,
1708
+ referenceType: refNode.nodeId
1709
+ });
1710
+ const str = r.toString(options);
1711
+ r.dispose();
1712
+ return str;
1713
+ }
1714
+
1715
+ function _setup_parent_item(this: BaseNode, referencesMap: Map<ReferenceKey, UAReference>): BaseNode | null {
1716
+ let references: UAReference[] | MapIterator<UAReference> = referencesMap.values();
1717
+
1718
+ const _private = BaseNode_getPrivate(this);
1719
+ assert(!_private._parent, "_setup_parent_item has been already called");
1720
+
1721
+ const addressSpace = this.addressSpace;
1722
+
1723
+ if (referencesMap.size > 0) {
1724
+ references = this.findReferencesEx("Aggregates", BrowseDirection.Inverse);
1725
+
1726
+ if (references.length >= 1) {
1727
+ // c8 ignore next
1728
+ if (references.length > 1) {
1729
+ if (displayWarning) {
1730
+ const options = { addressSpace };
1731
+
1732
+ warningLog(" More than one Aggregates reference have been found for parent of object");
1733
+ warningLog(" object node id:", this.nodeId.toString(), chalk.cyan(this.browseName.toString()));
1734
+ warningLog(" browseResults:");
1735
+ warningLog(references.map((f: UAReference) => toString_ReferenceDescription(f, options)).join("\n"));
1736
+ warningLog(" first one will be used as parent");
1737
+ // xx assert(browseResults.length === 1);
1738
+ displayWarning = false;
1739
+ }
1740
+ }
1741
+ return ReferenceImpl.resolveReferenceNode(addressSpace, references[0]);
1742
+ }
1743
+ }
1744
+ return null;
1745
+ }
1746
+
1747
+ function toObject(addressSpace: IAddressSpace, reference: UAReference): BaseNode {
1748
+ const obj = resolveReferenceNode(addressSpace, reference);
1749
+ // c8 ignore next
1750
+ if (doDebug && !obj) {
1751
+ // c8 ignore next
1752
+ doDebug &&
1753
+ debugLog(
1754
+ chalk.red(" Warning : object with nodeId ") +
1755
+ chalk.cyan(reference.nodeId.toString()) +
1756
+ chalk.red(" cannot be found in the address space !")
1757
+ );
1758
+ }
1759
+ return obj;
1760
+ }
1761
+
1762
+ function _asObject<T extends BaseNode>(references: UAReference[], addressSpace: IAddressSpace): T[] {
1763
+ return references.map((a) => toObject(addressSpace, a)).filter((o) => !!o) as T[];
1764
+ }
1765
+
1766
+ function _select_by_browse_name(map: HierarchicalIndexMap, browseName: QualifiedNameLike, namespaceIndex?: number): UAReference[] {
1767
+ if ((namespaceIndex === null || namespaceIndex === undefined) && typeof browseName === "string") {
1768
+ // no namespace specified and needed
1769
+ const result = map.get(browseName);
1770
+ if (result) {
1771
+ if (Array.isArray(result)) {
1772
+ return result;
1773
+ }
1774
+ return [result];
1775
+ }
1776
+ } else {
1777
+ const _browseName = coerceQualifiedName(typeof browseName === "string" ? { name: browseName, namespaceIndex } : browseName);
1778
+ // c8 ignore next
1779
+ if (!_browseName) {
1780
+ return [];
1781
+ }
1782
+ const result = map.get(_browseName.name || "");
1783
+ if (result) {
1784
+ if (Array.isArray(result)) {
1785
+ // only select the one with the matching namepsace index
1786
+ return result.filter((t) => t.node.browseName.namespaceIndex === _browseName.namespaceIndex);
1787
+ } else {
1788
+ if (result.node.browseName.namespaceIndex === _browseName.namespaceIndex) {
1789
+ return [result];
1790
+ }
1791
+ return [];
1792
+ }
1793
+ }
1794
+ }
1795
+ return [];
1796
+ }
1797
+
1798
+ let displayWarningReferencePointingToItSelf = true;
1799
+
1800
+ function _propagate_ref(
1801
+ this: BaseNode,
1802
+ addressSpace: MinimalistAddressSpace,
1803
+ reference: UAReference,
1804
+ sourceNodeKey?: number | string
1805
+ ): void {
1806
+ // filter out non Hierarchical References
1807
+ const referenceType = ReferenceImpl.resolveReferenceType(addressSpace, reference);
1808
+
1809
+ // c8 ignore next
1810
+ if (!referenceType) {
1811
+ errorLog(chalk.red(" ERROR"), " cannot find reference ", reference.referenceType, reference.toString());
1812
+ }
1813
+
1814
+ // ------------------------------- Filter out back reference when reference type
1815
+ // is HasTypeDefinition, HasModellingRule, etc ...
1816
+ //
1817
+ // var referenceNode = Reference.resolveReferenceNode(addressSpace,reference);
1818
+ // ignore propagation on back reference to UAVariableType or UAObject Type reference
1819
+ // because there are too many !
1820
+ if (!referenceType || isMassivelyUsedReferenceType(referenceType.nodeId)) {
1821
+ return;
1822
+ }
1823
+
1824
+ const related_node = resolveReferenceNode(addressSpace, reference) as BaseNodeImpl;
1825
+ if (related_node) {
1826
+ // verify that reference doesn't point to object it this (see mantis 3099)
1827
+ if (sameNodeId(reference.nodeId, this.nodeId)) {
1828
+ // c8 ignore next
1829
+ if (displayWarningReferencePointingToItSelf) {
1830
+ // this could happen with method
1831
+ warningLog(
1832
+ " Warning: a Reference is pointing to source ",
1833
+ this.nodeId.toString(),
1834
+ this.browseName.toString(),
1835
+ ". Is this intentional ?"
1836
+ );
1837
+ displayWarningReferencePointingToItSelf = false;
1838
+ }
1839
+ }
1840
+
1841
+ // NodeSet2 files declare most references from both ends, so the related node usually
1842
+ // holds the inverse as a forward reference of its own already: nothing to add, and no
1843
+ // ReferenceImpl to build for BaseNode_add_backward_reference to throw away. A node
1844
+ // created at runtime rarely is, and BaseNode_add_backward_reference copes when it is.
1845
+ if (sourceNodeKey !== undefined) {
1846
+ const inverse = BaseNode_getPrivate(related_node)._referenceIdx.get(
1847
+ (reference as ReferenceImpl).inverseKey(addressSpace as AddressSpacePrivate, sourceNodeKey)
1848
+ ) as ReferenceImpl | undefined;
1849
+ if (inverse) {
1850
+ if (!inverse.node) {
1851
+ inverse.node = this;
1852
+ }
1853
+ return;
1854
+ }
1855
+ }
1856
+ (related_node as BaseNodeImpl)._add_backward_reference(
1857
+ new ReferenceImpl({
1858
+ _referenceType: getReferenceType(reference),
1859
+ isForward: !reference.isForward,
1860
+ node: this as BaseNode,
1861
+ nodeId: this.nodeId,
1862
+ referenceType: reference.referenceType
1863
+ })
1864
+ );
1865
+ } // else addressSpace may be incomplete and under construction (while loading a nodeset.xml file for instance)
1866
+ }
1867
+
1868
+ /** resolve what can be; true when a reference still has no target */
1869
+ function resolveScannedReferences(addressSpace: IAddressSpace, references: UAReference[]): boolean {
1870
+ let unresolved = false;
1871
+ for (const ref of references) {
1872
+ if (!(ref as ReferenceImpl).node && !resolveReferenceNode(addressSpace, ref)) {
1873
+ unresolved = true;
1874
+ }
1875
+ }
1876
+ return unresolved;
1877
+ }
1878
+
1879
+ function nodeid_is_nothing(nodeid: NodeId): boolean {
1880
+ return nodeid.value === 0 && nodeid.namespace === 0;
1881
+ }
1882
+
1883
+ /**
1884
+
1885
+ * @param addressSpace {IAddressSpace}
1886
+ * @param referenceTypeId {String|NodeId|null} : the referenceType either as a string or a nodeId
1887
+ * @return {NodeId}
1888
+ */
1889
+ function normalize_referenceTypeId(addressSpace: IAddressSpace, referenceTypeId?: NodeIdLike | null): NodeId {
1890
+ if (!referenceTypeId) {
1891
+ return makeNodeId(0);
1892
+ }
1893
+ if (typeof referenceTypeId === "string") {
1894
+ const ref = addressSpace.findReferenceType(referenceTypeId);
1895
+ if (ref) {
1896
+ return ref.nodeId;
1897
+ }
1898
+ }
1899
+ let nodeId: NodeId;
1900
+ try {
1901
+ nodeId = addressSpace.resolveNodeId(referenceTypeId);
1902
+ } catch (err) {
1903
+ errorLog("cannot normalize_referenceTypeId", referenceTypeId);
1904
+ throw err;
1905
+ }
1906
+ assert(nodeId);
1907
+ return nodeId;
1908
+ }
1909
+
1910
+ const resolveReferenceNode = ReferenceImpl.resolveReferenceNode;
1911
+ const resolveReferenceType = ReferenceImpl.resolveReferenceType;
1912
+
1913
+ function _filter_by_referenceType(
1914
+ this: BaseNode,
1915
+ browseDescription: BrowseDescriptionOptions2,
1916
+ references: UAReference[],
1917
+ referenceTypeId: NodeId
1918
+ ) {
1919
+ // make sure we have a valid referenceTypeId if not null
1920
+ if (!nodeid_is_nothing(referenceTypeId)) {
1921
+ assert(referenceTypeId instanceof NodeId);
1922
+ const referenceType = this.addressSpace.findNode(referenceTypeId) as UAReferenceType;
1923
+ dumpIf(!referenceType, referenceTypeId);
1924
+ // c8 ignore next
1925
+ if (!referenceType || referenceType.nodeClass !== NodeClass.ReferenceType) {
1926
+ throw new Error("Cannot find reference type");
1927
+ }
1928
+
1929
+ if (!browseDescription.includeSubtypes && referenceType.isAbstract) {
1930
+ warningLog("filter by reference will skip all reference as referenceType is abstract and includeSubtypes is false");
1931
+ }
1932
+
1933
+ references = references.filter((reference) => {
1934
+ const ref = resolveReferenceType(this.addressSpace, reference);
1935
+ // c8 ignore next
1936
+ if (!ref) {
1937
+ throw new Error(`Cannot find reference type ${reference.toString()}`);
1938
+ }
1939
+ // unknown type ... this may happen when the address space is not fully build
1940
+ assert(ref.nodeClass === NodeClass.ReferenceType);
1941
+
1942
+ const isSameType = sameNodeId(ref.nodeId, referenceType.nodeId);
1943
+ if (isSameType) {
1944
+ return true;
1945
+ }
1946
+ if (browseDescription.includeSubtypes) {
1947
+ return ref.isSubtypeOf(referenceType);
1948
+ } else {
1949
+ return false;
1950
+ }
1951
+ });
1952
+ }
1953
+ return references;
1954
+ }
1955
+
1956
+ function forwardOnly(reference: UAReference): boolean {
1957
+ return reference.isForward;
1958
+ }
1959
+
1960
+ function reverseOnly(reference: UAReference): boolean {
1961
+ return !reference.isForward;
1962
+ }
1963
+
1964
+ function _filter_by_direction(references: UAReference[], browseDirection: BrowseDirection): UAReference[] {
1965
+ if (browseDirection === BrowseDirection.Both) {
1966
+ return references;
1967
+ }
1968
+ if (browseDirection === BrowseDirection.Forward) {
1969
+ return references.filter(forwardOnly);
1970
+ } else {
1971
+ return references.filter(reverseOnly);
1972
+ }
1973
+ }
1974
+ /*
1975
+ function _filter_by_context(node: BaseNode, references: Reference[], context: SessionContext): Reference[] {
1976
+ if (!context.isBrowseAccessRestricted(node)) {
1977
+ return references;
1978
+ }
1979
+ // browse access is restricted for forward
1980
+ return [];
1981
+ }
1982
+ */
1983
+ function _filter_by_context(node: BaseNode, references: UAReference[], context: ISessionContext): UAReference[] {
1984
+ const addressSpace = node.addressSpace;
1985
+ return references.filter((reference) => !context.isBrowseAccessRestricted(resolveReferenceNode(addressSpace, reference)));
1986
+ }
1987
+
1988
+ function _filter_by_nodeClass(this: BaseNode, references: UAReference[], nodeClassMask: number): UAReference[] {
1989
+ assert(Number.isFinite(nodeClassMask));
1990
+ if (nodeClassMask === 0) {
1991
+ return references;
1992
+ }
1993
+ const addressSpace = this.addressSpace;
1994
+ return references.filter((reference) => {
1995
+ const obj = resolveReferenceNode(addressSpace, reference);
1996
+ if (!obj) {
1997
+ return false;
1998
+ }
1999
+ // the NodeClass values are the NodeClassMask bits (Part 4, BrowseDescription.nodeClassMask)
2000
+ return (nodeClassMask & obj.nodeClass) !== 0;
2001
+ });
2002
+ }
2003
+
2004
+ function _filter_by_userFilter(this: BaseNode, references: UAReference[], context?: ISessionContext): UAReference[] {
2005
+ const addressSpace = this.addressSpace;
2006
+ return references.filter((reference: UAReference) => {
2007
+ const obj = resolveReferenceNode(addressSpace, reference) as BaseNode;
2008
+ // c8 ignore next
2009
+ if (!obj) {
2010
+ return false;
2011
+ }
2012
+
2013
+ const _private = BaseNode_getPrivate(obj);
2014
+ // c8 ignore next
2015
+ if (!_private._browseFilter) {
2016
+ throw Error("Internal error : cannot find browseFilter");
2017
+ }
2018
+
2019
+ const filter1 = _private._browseFilter.call(obj, context);
2020
+ return filter1;
2021
+ });
2022
+ }
2023
+
2024
+ /**
2025
+ * the child designated by `node.<accessorName>`: what the shared getters resolve, exposed for the
2026
+ * code that walks dotted paths by name (`_getCompositeKey`); works under `isFrugal` too, where no
2027
+ * own accessor is ever installed
2028
+ */
2029
+ export function resolveChildAccessor(node: BaseNode, accessorName: string): BaseNode | undefined {
2030
+ const _private = BaseNode_getPrivate(node);
2031
+ // the prototype itself, or a disposed node
2032
+ if (!_private?.__address_space) {
2033
+ return undefined;
2034
+ }
2035
+ // a dotted child is a component, a property, a subtype or an organized node; a node that is
2036
+ // only an event source or a notifier of this one is not exposed, and removing the structural
2037
+ // reference removes the child even when an event reference to it remains
2038
+ const wellKnown = wellKnownReferenceTypes(node.addressSpace);
2039
+ if (!wellKnown) {
2040
+ return undefined; // namespace 0 is still loading
2041
+ }
2042
+ const { hasChild, organizes } = wellKnown;
2043
+ return resolveChildInIndex(
2044
+ _get_HierarchicalReference(node),
2045
+ accessorName,
2046
+ (reference) => hasChild.checkHasSubtype(reference.referenceType) || organizes.checkHasSubtype(reference.referenceType)
2047
+ );
2048
+ }
2049
+
2050
+ /**
2051
+ * The accessor names under which a child of `node` can never be reached: the reserved names, the
2052
+ * members of the class of the node (attributes, methods, EventEmitter and Object members) and its
2053
+ * own fields. A child carrying one of these is reachable through `getChildByName` only.
2054
+ *
2055
+ * The generator of the typed nodeset interfaces reads this so that a generated interface names a
2056
+ * child exactly the way the runtime exposes it.
2057
+ *
2058
+ * @internal
2059
+ */
2060
+ export function childAccessorNamesShadowedBy(node: BaseNode): Set<string> {
2061
+ const names = new Set<string>(reservedChildAccessorNames());
2062
+ // a member of the class that resolves the child of that name itself, the way the shared
2063
+ // accessors do: BaseNode.nodeVersion is the NodeVersion property, and declared as such
2064
+ const membersExposingTheChild = new Set(["nodeVersion"]);
2065
+ for (const own of Object.getOwnPropertyNames(node)) {
2066
+ // an own accessor is a child installed by install_extra_properties, not a field
2067
+ if (!Object.getOwnPropertyDescriptor(node, own)?.get) {
2068
+ names.add(own);
2069
+ }
2070
+ }
2071
+ for (let proto = Object.getPrototypeOf(node); proto; proto = Object.getPrototypeOf(proto)) {
2072
+ // the shared child accessors sit on BaseNodeImpl.prototype and are the names the runtime
2073
+ // does expose; the same name on a subclass prototype is a real member that wins over them
2074
+ const sharedAccessorsLiveHere = proto === BaseNodeImpl.prototype;
2075
+ for (const member of Object.getOwnPropertyNames(proto)) {
2076
+ if (membersExposingTheChild.has(member) || (sharedAccessorsLiveHere && hasSharedChildAccessor(member))) {
2077
+ continue;
2078
+ }
2079
+ names.add(member);
2080
+ }
2081
+ }
2082
+ return names;
2083
+ }
2084
+
2085
+ function resolveSharedChildAccessor(node: BaseNodeImpl, accessorName: string): unknown {
2086
+ return resolveChildAccessor(node, accessorName);
2087
+ }
2088
+
2089
+ /**
2090
+ * Define the shared getter of every browse name seen since the last call: the nodeset loader calls
2091
+ * it once a load is complete, so that the prototype changes in one batch rather than once per
2092
+ * new name in the middle of node creation.
2093
+ */
2094
+ export function flushSharedChildAccessors(): number {
2095
+ return defineQueuedChildAccessors(BaseNodeImpl.prototype, resolveSharedChildAccessor);
2096
+ }
2097
+
2098
+ /**
2099
+ * Give browse names created at runtime a shared accessor, for an application that builds its
2100
+ * model through the namespace API and wants `parent.<child>` without an accessor on every parent.
2101
+ */
2102
+ export function defineSharedChildAccessors(browseNames: string[]): void {
2103
+ for (const browseName of browseNames) {
2104
+ registerChildName(browseName, true);
2105
+ }
2106
+ flushSharedChildAccessors();
2107
+ }
2108
+
2109
+ /**
2110
+ * Expose `child` as `parentObj.<accessorName>` through an own accessor, unless the name is taken
2111
+ * already: by a shared accessor (which resolves it anyway), by an attribute, a method or a field
2112
+ * of the parent, or by an earlier child of the same name (first installed wins).
2113
+ *
2114
+ * This is the runtime fallback of child_accessors.ts, for names no loaded nodeset declared.
2115
+ */
2116
+ /** the child an own accessor was installed for, kept on the getter itself */
2117
+ const installedFor = Symbol("installedFor");
2118
+ type OwnChildAccessor = { [installedFor]?: BaseNode };
2119
+
2120
+ function install_child_as_object_property(parentObj: BaseNode | null, child: BaseNode | null): void {
2121
+ // the parent may be unresolvable while a nodeset is still loading
2122
+ if (!parentObj || !child) {
2123
+ return;
2124
+ }
2125
+ const name = BaseNode_getPrivate(child)?._accessorName;
2126
+ if (!name || isReservedChildAccessorName(name) || hasSharedChildAccessor(name) || name in parentObj) {
2127
+ return;
2128
+ }
2129
+ doDebug && debugLog(`Installing property ${name}`, " on ", parentObj.browseName.toString());
2130
+ const get: (() => BaseNode | undefined) & OwnChildAccessor = () =>
2131
+ // an own property wins over the prototype: should the name get a shared getter later
2132
+ // (a nodeset loaded afterwards declares it), this accessor answers what the getter
2133
+ // would, through the child index, rather than the child it was installed for
2134
+ hasSharedChildAccessor(name) ? resolveChildAccessor(parentObj, name) : child;
2135
+ get[installedFor] = child;
2136
+ Object.defineProperty(parentObj, name, {
2137
+ configurable: true, // so that uninstall_child_object_property can remove it
2138
+ enumerable: true,
2139
+ get
2140
+ });
2141
+ }
2142
+
2143
+ function uninstall_child_object_property(parentObj: BaseNode, child: BaseNode): void {
2144
+ const name = BaseNode_getPrivate(child)?._accessorName;
2145
+ if (!name) {
2146
+ return;
2147
+ }
2148
+ // only an accessor installed above goes, whether or not the name has a shared getter by now;
2149
+ // a field or a method of the same name stays, and so does an accessor for another child of
2150
+ // the same name. The getter is asked for the child it was installed for, not what it resolves
2151
+ const descriptor = Object.getOwnPropertyDescriptor(parentObj, name);
2152
+ if (!descriptor?.get || !descriptor.configurable || (descriptor.get as OwnChildAccessor)[installedFor] !== child) {
2153
+ return;
2154
+ }
2155
+ delete (parentObj as unknown as Record<string, unknown>)[name];
2156
+ }
2157
+
2158
+ export function getReferenceType(reference: UAReference): UAReferenceType {
2159
+ const r = (reference as ReferenceImpl)._referenceType;
2160
+ // c8 ignore next
2161
+ if (!r) {
2162
+ throw new Error("Internal error : cannot find referenceType");
2163
+ }
2164
+ return r;
2165
+ }