node-opcua-address-space 2.51.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 (598) hide show
  1. package/.mocharc.yml +12 -0
  2. package/LICENSE +20 -0
  3. package/dist/source/address_space_ts.d.ts +122 -0
  4. package/dist/source/address_space_ts.js +18 -0
  5. package/dist/source/address_space_ts.js.map +1 -0
  6. package/dist/source/continuation_points/continuation_point_manager.d.ts +21 -0
  7. package/dist/source/continuation_points/continuation_point_manager.js +100 -0
  8. package/dist/source/continuation_points/continuation_point_manager.js.map +1 -0
  9. package/dist/source/helpers/adjust_browse_direction.d.ts +5 -0
  10. package/dist/source/helpers/adjust_browse_direction.js +12 -0
  11. package/dist/source/helpers/adjust_browse_direction.js.map +1 -0
  12. package/dist/source/helpers/argument_list.d.ts +30 -0
  13. package/dist/source/helpers/argument_list.js +237 -0
  14. package/dist/source/helpers/argument_list.js.map +1 -0
  15. package/dist/source/helpers/call_helpers.d.ts +6 -0
  16. package/dist/source/helpers/call_helpers.js +71 -0
  17. package/dist/source/helpers/call_helpers.js.map +1 -0
  18. package/dist/source/helpers/check_event_clause.d.ts +17 -0
  19. package/dist/source/helpers/check_event_clause.js +53 -0
  20. package/dist/source/helpers/check_event_clause.js.map +1 -0
  21. package/dist/source/helpers/coerce_enum_value.d.ts +6 -0
  22. package/dist/source/helpers/coerce_enum_value.js +34 -0
  23. package/dist/source/helpers/coerce_enum_value.js.map +1 -0
  24. package/dist/source/helpers/dump_tools.d.ts +14 -0
  25. package/dist/source/helpers/dump_tools.js +79 -0
  26. package/dist/source/helpers/dump_tools.js.map +1 -0
  27. package/dist/source/helpers/ensure_secure_access.d.ts +9 -0
  28. package/dist/source/helpers/ensure_secure_access.js +90 -0
  29. package/dist/source/helpers/ensure_secure_access.js.map +1 -0
  30. package/dist/source/helpers/make_optionals_map.d.ts +21 -0
  31. package/dist/source/helpers/make_optionals_map.js +30 -0
  32. package/dist/source/helpers/make_optionals_map.js.map +1 -0
  33. package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -0
  34. package/dist/source/helpers/resolve_opaque_on_address_space.js +37 -0
  35. package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -0
  36. package/dist/source/index.d.ts +39 -0
  37. package/dist/source/index.js +62 -0
  38. package/dist/source/index.js.map +1 -0
  39. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +12 -0
  40. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +3 -0
  41. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
  42. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +1 -0
  43. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +3 -0
  44. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +1 -0
  45. package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +4 -0
  46. package/dist/source/interfaces/data_access/ua_discrete_item.js +3 -0
  47. package/dist/source/interfaces/data_access/ua_discrete_item.js.map +1 -0
  48. package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +25 -0
  49. package/dist/source/interfaces/data_access/ua_multistate_discrete.js +3 -0
  50. package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +1 -0
  51. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -0
  52. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +3 -0
  53. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
  54. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +27 -0
  55. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +3 -0
  56. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +1 -0
  57. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -0
  58. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +3 -0
  59. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
  60. package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +17 -0
  61. package/dist/source/interfaces/data_access/ua_two_state_discrete.js +3 -0
  62. package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +1 -0
  63. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -0
  64. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +3 -0
  65. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
  66. package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +4 -0
  67. package/dist/source/interfaces/data_access/ua_y_array_item.js +3 -0
  68. package/dist/source/interfaces/data_access/ua_y_array_item.js.map +1 -0
  69. package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -0
  70. package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +3 -0
  71. package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
  72. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +11 -0
  73. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +3 -0
  74. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +1 -0
  75. package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +69 -0
  76. package/dist/source/interfaces/state_machine/finite_state_machine.js +3 -0
  77. package/dist/source/interfaces/state_machine/finite_state_machine.js.map +1 -0
  78. package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +74 -0
  79. package/dist/source/interfaces/state_machine/program_finite_state_machine.js +3 -0
  80. package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +1 -0
  81. package/dist/source/interfaces/state_machine/state_machine.d.ts +342 -0
  82. package/dist/source/interfaces/state_machine/state_machine.js +3 -0
  83. package/dist/source/interfaces/state_machine/state_machine.js.map +1 -0
  84. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
  85. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +3 -0
  86. package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
  87. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
  88. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +3 -0
  89. package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
  90. package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +18 -0
  91. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +3 -0
  92. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +1 -0
  93. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
  94. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +3 -0
  95. package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
  96. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -0
  97. package/dist/source/interfaces/state_machine/ua_state_machine_type.js +3 -0
  98. package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
  99. package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +29 -0
  100. package/dist/source/interfaces/state_machine/ua_state_variable.js +3 -0
  101. package/dist/source/interfaces/state_machine/ua_state_variable.js.map +1 -0
  102. package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -0
  103. package/dist/source/interfaces/state_machine/ua_transition_ex.js +3 -0
  104. package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +1 -0
  105. package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +26 -0
  106. package/dist/source/interfaces/state_machine/ua_two_state_variable.js +3 -0
  107. package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +1 -0
  108. package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +41 -0
  109. package/dist/source/interfaces/subscription_diagnostics_variable.js +3 -0
  110. package/dist/source/interfaces/subscription_diagnostics_variable.js.map +1 -0
  111. package/dist/source/interfaces/ua_authorisation_service.d.ts +1 -0
  112. package/dist/source/interfaces/ua_authorisation_service.js +3 -0
  113. package/dist/source/interfaces/ua_authorisation_service.js.map +1 -0
  114. package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -0
  115. package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
  116. package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
  117. package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -0
  118. package/dist/source/loader/generateAddressSpaceRaw.js +59 -0
  119. package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -0
  120. package/dist/source/loader/load_nodeset2.d.ts +13 -0
  121. package/dist/source/loader/load_nodeset2.js +1392 -0
  122. package/dist/source/loader/load_nodeset2.js.map +1 -0
  123. package/dist/source/loader/namespace_post_step.d.ts +6 -0
  124. package/dist/source/loader/namespace_post_step.js +48 -0
  125. package/dist/source/loader/namespace_post_step.js.map +1 -0
  126. package/dist/source/loader/register_node_promoter.d.ts +3 -0
  127. package/dist/source/loader/register_node_promoter.js +10 -0
  128. package/dist/source/loader/register_node_promoter.js.map +1 -0
  129. package/dist/source/namespace.d.ts +6 -0
  130. package/dist/source/namespace.js +3 -0
  131. package/dist/source/namespace.js.map +1 -0
  132. package/dist/source/namespace_alarm_and_condition.d.ts +24 -0
  133. package/dist/source/namespace_alarm_and_condition.js +3 -0
  134. package/dist/source/namespace_alarm_and_condition.js.map +1 -0
  135. package/dist/source/namespace_data_access.d.ts +42 -0
  136. package/dist/source/namespace_data_access.js +3 -0
  137. package/dist/source/namespace_data_access.js.map +1 -0
  138. package/dist/source/namespace_machine_state.d.ts +7 -0
  139. package/dist/source/namespace_machine_state.js +3 -0
  140. package/dist/source/namespace_machine_state.js.map +1 -0
  141. package/dist/source/pseudo_session.d.ts +55 -0
  142. package/dist/source/pseudo_session.js +205 -0
  143. package/dist/source/pseudo_session.js.map +1 -0
  144. package/dist/source/session_context.d.ts +111 -0
  145. package/dist/source/session_context.js +266 -0
  146. package/dist/source/session_context.js.map +1 -0
  147. package/dist/source/set_namespace_meta_data.d.ts +2 -0
  148. package/dist/source/set_namespace_meta_data.js +60 -0
  149. package/dist/source/set_namespace_meta_data.js.map +1 -0
  150. package/dist/source/ua_namespace_meta_data_type.d.ts +71 -0
  151. package/dist/source/ua_namespace_meta_data_type.js +3 -0
  152. package/dist/source/ua_namespace_meta_data_type.js.map +1 -0
  153. package/dist/source/ua_root_folder.d.ts +9 -0
  154. package/dist/source/ua_root_folder.js +3 -0
  155. package/dist/source/ua_root_folder.js.map +1 -0
  156. package/dist/source/ua_two_state_variable_ex.d.ts +23 -0
  157. package/dist/source/ua_two_state_variable_ex.js +3 -0
  158. package/dist/source/ua_two_state_variable_ex.js.map +1 -0
  159. package/dist/source/xml_writer.d.ts +9 -0
  160. package/dist/source/xml_writer.js +3 -0
  161. package/dist/source/xml_writer.js.map +1 -0
  162. package/dist/src/address_space.d.ts +393 -0
  163. package/dist/src/address_space.js +1375 -0
  164. package/dist/src/address_space.js.map +1 -0
  165. package/dist/src/address_space_change_event_tools.d.ts +6 -0
  166. package/dist/src/address_space_change_event_tools.js +150 -0
  167. package/dist/src/address_space_change_event_tools.js.map +1 -0
  168. package/dist/src/address_space_private.d.ts +44 -0
  169. package/dist/src/address_space_private.js +3 -0
  170. package/dist/src/address_space_private.js.map +1 -0
  171. package/dist/src/alarms_and_conditions/base_event_type.d.ts +26 -0
  172. package/dist/src/alarms_and_conditions/base_event_type.js +41 -0
  173. package/dist/src/alarms_and_conditions/base_event_type.js.map +1 -0
  174. package/dist/src/alarms_and_conditions/check_where_clause.d.ts +4 -0
  175. package/dist/src/alarms_and_conditions/check_where_clause.js +110 -0
  176. package/dist/src/alarms_and_conditions/check_where_clause.js.map +1 -0
  177. package/dist/src/alarms_and_conditions/condition.d.ts +5 -0
  178. package/dist/src/alarms_and_conditions/condition.js +81 -0
  179. package/dist/src/alarms_and_conditions/condition.js.map +1 -0
  180. package/dist/src/alarms_and_conditions/condition_info.d.ts +27 -0
  181. package/dist/src/alarms_and_conditions/condition_info.js +55 -0
  182. package/dist/src/alarms_and_conditions/condition_info.js.map +1 -0
  183. package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +232 -0
  184. package/dist/src/alarms_and_conditions/condition_snapshot.js +667 -0
  185. package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -0
  186. package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +21 -0
  187. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +47 -0
  188. package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
  189. package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +10 -0
  190. package/dist/src/alarms_and_conditions/extract_event_fields.js +90 -0
  191. package/dist/src/alarms_and_conditions/extract_event_fields.js.map +1 -0
  192. package/dist/src/alarms_and_conditions/index.d.ts +18 -0
  193. package/dist/src/alarms_and_conditions/index.js +31 -0
  194. package/dist/src/alarms_and_conditions/index.js.map +1 -0
  195. package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +22 -0
  196. package/dist/src/alarms_and_conditions/shelving_state_machine.js +241 -0
  197. package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +1 -0
  198. package/dist/src/alarms_and_conditions/trip_alarm.d.ts +16 -0
  199. package/dist/src/alarms_and_conditions/trip_alarm.js +21 -0
  200. package/dist/src/alarms_and_conditions/trip_alarm.js.map +1 -0
  201. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +54 -0
  202. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +255 -0
  203. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +1 -0
  204. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +62 -0
  205. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
  206. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
  207. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +138 -0
  208. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +460 -0
  209. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +1 -0
  210. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +118 -0
  211. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +417 -0
  212. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
  213. package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +29 -0
  214. package/dist/src/alarms_and_conditions/ua_base_event_impl.js +39 -0
  215. package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
  216. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +35 -0
  217. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +32 -0
  218. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +1 -0
  219. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +21 -0
  220. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +26 -0
  221. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
  222. package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +191 -0
  223. package/dist/src/alarms_and_conditions/ua_condition_base.js +1029 -0
  224. package/dist/src/alarms_and_conditions/ua_condition_base.js.map +1 -0
  225. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +182 -0
  226. package/dist/src/alarms_and_conditions/ua_condition_impl.js +1021 -0
  227. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -0
  228. package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +11 -0
  229. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +58 -0
  230. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +1 -0
  231. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +17 -0
  232. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +58 -0
  233. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
  234. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +24 -0
  235. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +59 -0
  236. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +1 -0
  237. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +27 -0
  238. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +57 -0
  239. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
  240. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +14 -0
  241. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +17 -0
  242. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +1 -0
  243. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +9 -0
  244. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +12 -0
  245. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
  246. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +22 -0
  247. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +87 -0
  248. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +1 -0
  249. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +38 -0
  250. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +87 -0
  251. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
  252. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +6 -0
  253. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +11 -0
  254. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +1 -0
  255. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
  256. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
  257. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
  258. package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +76 -0
  259. package/dist/src/alarms_and_conditions/ua_limit_alarm.js +237 -0
  260. package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +1 -0
  261. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +98 -0
  262. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +233 -0
  263. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
  264. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +27 -0
  265. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +62 -0
  266. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +1 -0
  267. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
  268. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +51 -0
  269. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
  270. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +49 -0
  271. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +176 -0
  272. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +1 -0
  273. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +25 -0
  274. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +163 -0
  275. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
  276. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +47 -0
  277. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +151 -0
  278. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +1 -0
  279. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +39 -0
  280. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +136 -0
  281. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
  282. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +16 -0
  283. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +18 -0
  284. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +1 -0
  285. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +16 -0
  286. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
  287. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
  288. package/dist/src/apply_condition_refresh.d.ts +6 -0
  289. package/dist/src/apply_condition_refresh.js +28 -0
  290. package/dist/src/apply_condition_refresh.js.map +1 -0
  291. package/dist/src/base_node.d.ts +279 -0
  292. package/dist/src/base_node.js +1364 -0
  293. package/dist/src/base_node.js.map +1 -0
  294. package/dist/src/base_node_impl.d.ts +281 -0
  295. package/dist/src/base_node_impl.js +1394 -0
  296. package/dist/src/base_node_impl.js.map +1 -0
  297. package/dist/src/base_node_private.d.ts +61 -0
  298. package/dist/src/base_node_private.js +521 -0
  299. package/dist/src/base_node_private.js.map +1 -0
  300. package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -0
  301. package/dist/src/data_access/add_dataItem_stuff.js +62 -0
  302. package/dist/src/data_access/add_dataItem_stuff.js.map +1 -0
  303. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
  304. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
  305. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
  306. package/dist/src/data_access/ua_analog_item.d.ts +13 -0
  307. package/dist/src/data_access/ua_analog_item.js +37 -0
  308. package/dist/src/data_access/ua_analog_item.js.map +1 -0
  309. package/dist/src/data_access/ua_data_item.d.ts +16 -0
  310. package/dist/src/data_access/ua_data_item.js +66 -0
  311. package/dist/src/data_access/ua_data_item.js.map +1 -0
  312. package/dist/src/data_access/ua_multistate_discrete.d.ts +23 -0
  313. package/dist/src/data_access/ua_multistate_discrete.js +131 -0
  314. package/dist/src/data_access/ua_multistate_discrete.js.map +1 -0
  315. package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -0
  316. package/dist/src/data_access/ua_multistate_discrete_impl.js +131 -0
  317. package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -0
  318. package/dist/src/data_access/ua_multistate_value_discrete.d.ts +51 -0
  319. package/dist/src/data_access/ua_multistate_value_discrete.js +249 -0
  320. package/dist/src/data_access/ua_multistate_value_discrete.js.map +1 -0
  321. package/dist/src/data_access/ua_two_state_discrete.d.ts +25 -0
  322. package/dist/src/data_access/ua_two_state_discrete.js +154 -0
  323. package/dist/src/data_access/ua_two_state_discrete.js.map +1 -0
  324. package/dist/src/event_data.d.ts +29 -0
  325. package/dist/src/event_data.js +96 -0
  326. package/dist/src/event_data.js.map +1 -0
  327. package/dist/src/extension_object_array_node.d.ts +61 -0
  328. package/dist/src/extension_object_array_node.js +266 -0
  329. package/dist/src/extension_object_array_node.js.map +1 -0
  330. package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -0
  331. package/dist/src/historical_access/address_space_historical_data_node.js +662 -0
  332. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -0
  333. package/dist/src/index_current.d.ts +42 -0
  334. package/dist/src/index_current.js +71 -0
  335. package/dist/src/index_current.js.map +1 -0
  336. package/dist/src/namespace.d.ts +475 -0
  337. package/dist/src/namespace.js +1775 -0
  338. package/dist/src/namespace.js.map +1 -0
  339. package/dist/src/namespace_impl.d.ts +463 -0
  340. package/dist/src/namespace_impl.js +1763 -0
  341. package/dist/src/namespace_impl.js.map +1 -0
  342. package/dist/src/namespace_private.d.ts +21 -0
  343. package/dist/src/namespace_private.js +29 -0
  344. package/dist/src/namespace_private.js.map +1 -0
  345. package/dist/src/nodeid_manager.d.ts +36 -0
  346. package/dist/src/nodeid_manager.js +196 -0
  347. package/dist/src/nodeid_manager.js.map +1 -0
  348. package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -0
  349. package/dist/src/nodeset_tools/adjust_namespace_array.js +14 -0
  350. package/dist/src/nodeset_tools/adjust_namespace_array.js.map +1 -0
  351. package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -0
  352. package/dist/src/nodeset_tools/construct_namespace_dependency.js +39 -0
  353. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -0
  354. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -0
  355. package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -0
  356. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -0
  357. package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -0
  358. package/dist/src/nodeset_tools/typedictionary_to_xml.js +147 -0
  359. package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -0
  360. package/dist/src/reference.d.ts +43 -0
  361. package/dist/src/reference.js +138 -0
  362. package/dist/src/reference.js.map +1 -0
  363. package/dist/src/reference_impl.d.ts +43 -0
  364. package/dist/src/reference_impl.js +138 -0
  365. package/dist/src/reference_impl.js.map +1 -0
  366. package/dist/src/role_permissions.d.ts +2 -0
  367. package/dist/src/role_permissions.js +11 -0
  368. package/dist/src/role_permissions.js.map +1 -0
  369. package/dist/src/session_context.d.ts +4 -0
  370. package/dist/src/session_context.js +9 -0
  371. package/dist/src/session_context.js.map +1 -0
  372. package/dist/src/state_machine/finite_state_machine.d.ts +67 -0
  373. package/dist/src/state_machine/finite_state_machine.js +354 -0
  374. package/dist/src/state_machine/finite_state_machine.js.map +1 -0
  375. package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +34 -0
  376. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +244 -0
  377. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
  378. package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -0
  379. package/dist/src/state_machine/ua_two_state_variable.js +332 -0
  380. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -0
  381. package/dist/src/tool_isSupertypeOf.d.ts +17 -0
  382. package/dist/src/tool_isSupertypeOf.js +103 -0
  383. package/dist/src/tool_isSupertypeOf.js.map +1 -0
  384. package/dist/src/ua_condition_type.d.ts +8 -0
  385. package/dist/src/ua_condition_type.js +3 -0
  386. package/dist/src/ua_condition_type.js.map +1 -0
  387. package/dist/src/ua_data_type.d.ts +83 -0
  388. package/dist/src/ua_data_type.js +289 -0
  389. package/dist/src/ua_data_type.js.map +1 -0
  390. package/dist/src/ua_data_type_impl.d.ts +83 -0
  391. package/dist/src/ua_data_type_impl.js +291 -0
  392. package/dist/src/ua_data_type_impl.js.map +1 -0
  393. package/dist/src/ua_method.d.ts +42 -0
  394. package/dist/src/ua_method.js +204 -0
  395. package/dist/src/ua_method.js.map +1 -0
  396. package/dist/src/ua_method_impl.d.ts +40 -0
  397. package/dist/src/ua_method_impl.js +203 -0
  398. package/dist/src/ua_method_impl.js.map +1 -0
  399. package/dist/src/ua_object.d.ts +29 -0
  400. package/dist/src/ua_object.js +153 -0
  401. package/dist/src/ua_object.js.map +1 -0
  402. package/dist/src/ua_object_impl.d.ts +29 -0
  403. package/dist/src/ua_object_impl.js +156 -0
  404. package/dist/src/ua_object_impl.js.map +1 -0
  405. package/dist/src/ua_object_type.d.ts +49 -0
  406. package/dist/src/ua_object_type.js +124 -0
  407. package/dist/src/ua_object_type.js.map +1 -0
  408. package/dist/src/ua_object_type_impl.d.ts +48 -0
  409. package/dist/src/ua_object_type_impl.js +124 -0
  410. package/dist/src/ua_object_type_impl.js.map +1 -0
  411. package/dist/src/ua_reference_type.d.ts +42 -0
  412. package/dist/src/ua_reference_type.js +138 -0
  413. package/dist/src/ua_reference_type.js.map +1 -0
  414. package/dist/src/ua_reference_type_impl.d.ts +43 -0
  415. package/dist/src/ua_reference_type_impl.js +138 -0
  416. package/dist/src/ua_reference_type_impl.js.map +1 -0
  417. package/dist/src/ua_variable.d.ts +346 -0
  418. package/dist/src/ua_variable.js +1721 -0
  419. package/dist/src/ua_variable.js.map +1 -0
  420. package/dist/src/ua_variable_impl.d.ts +353 -0
  421. package/dist/src/ua_variable_impl.js +1719 -0
  422. package/dist/src/ua_variable_impl.js.map +1 -0
  423. package/dist/src/ua_variable_type.d.ts +54 -0
  424. package/dist/src/ua_variable_type.js +555 -0
  425. package/dist/src/ua_variable_type.js.map +1 -0
  426. package/dist/src/ua_variable_type_impl.d.ts +63 -0
  427. package/dist/src/ua_variable_type_impl.js +556 -0
  428. package/dist/src/ua_variable_type_impl.js.map +1 -0
  429. package/dist/src/ua_view.d.ts +16 -0
  430. package/dist/src/ua_view.js +42 -0
  431. package/dist/src/ua_view.js.map +1 -0
  432. package/dist/src/ua_view_impl.d.ts +15 -0
  433. package/dist/src/ua_view_impl.js +37 -0
  434. package/dist/src/ua_view_impl.js.map +1 -0
  435. package/distHelpers/add_event_generator_object.d.ts +3 -0
  436. package/distHelpers/add_event_generator_object.js +66 -0
  437. package/distHelpers/add_event_generator_object.js.map +1 -0
  438. package/distHelpers/alarms_and_conditions_demo.d.ts +10 -0
  439. package/distHelpers/alarms_and_conditions_demo.js +115 -0
  440. package/distHelpers/alarms_and_conditions_demo.js.map +1 -0
  441. package/distHelpers/assertHasMatchingReference.d.ts +19 -0
  442. package/distHelpers/assertHasMatchingReference.js +41 -0
  443. package/distHelpers/assertHasMatchingReference.js.map +1 -0
  444. package/distHelpers/boiler_system.d.ts +113 -0
  445. package/distHelpers/boiler_system.js +397 -0
  446. package/distHelpers/boiler_system.js.map +1 -0
  447. package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -0
  448. package/distHelpers/create_minimalist_address_space_nodeset.js +171 -0
  449. package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -0
  450. package/distHelpers/dump_statemachine.d.ts +6 -0
  451. package/distHelpers/dump_statemachine.js +116 -0
  452. package/distHelpers/dump_statemachine.js.map +1 -0
  453. package/distHelpers/get_address_space_fixture.d.ts +1 -0
  454. package/distHelpers/get_address_space_fixture.js +31 -0
  455. package/distHelpers/get_address_space_fixture.js.map +1 -0
  456. package/distHelpers/get_mini_address_space.d.ts +7 -0
  457. package/distHelpers/get_mini_address_space.js +37 -0
  458. package/distHelpers/get_mini_address_space.js.map +1 -0
  459. package/distHelpers/index.d.ts +11 -0
  460. package/distHelpers/index.js +24 -0
  461. package/distHelpers/index.js.map +1 -0
  462. package/distNodeJS/generate_address_space.d.ts +4 -0
  463. package/distNodeJS/generate_address_space.js +31 -0
  464. package/distNodeJS/generate_address_space.js.map +1 -0
  465. package/distNodeJS/index.d.ts +1 -0
  466. package/distNodeJS/index.js +14 -0
  467. package/distNodeJS/index.js.map +1 -0
  468. package/generate.js +1 -0
  469. package/nodeJS.d.ts +1 -0
  470. package/nodeJS.js +1 -0
  471. package/package.json +87 -0
  472. package/source/address_space_ts.ts +217 -0
  473. package/source/continuation_points/continuation_point_manager.ts +121 -0
  474. package/source/helpers/adjust_browse_direction.ts +15 -0
  475. package/source/helpers/argument_list.ts +286 -0
  476. package/source/helpers/call_helpers.ts +112 -0
  477. package/source/helpers/check_event_clause.ts +62 -0
  478. package/source/helpers/coerce_enum_value.ts +33 -0
  479. package/source/helpers/dump_tools.ts +92 -0
  480. package/source/helpers/ensure_secure_access.ts +88 -0
  481. package/source/helpers/make_optionals_map.ts +49 -0
  482. package/source/helpers/resolve_opaque_on_address_space.ts +23 -0
  483. package/source/index.ts +49 -0
  484. package/source/interfaces/alarms_and_conditions/condition_info_i.ts +13 -0
  485. package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +26 -0
  486. package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +34 -0
  487. package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +14 -0
  488. package/source/interfaces/data_access/ua_y_array_item_ex.ts +10 -0
  489. package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +14 -0
  490. package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
  491. package/source/interfaces/state_machine/ua_program_state_machine_type.ts +13 -0
  492. package/source/interfaces/state_machine/ua_state_machine_type.ts +261 -0
  493. package/source/interfaces/state_machine/ua_transition_ex.ts +7 -0
  494. package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +8 -0
  495. package/source/loader/generateAddressSpaceRaw.ts +79 -0
  496. package/source/loader/load_nodeset2.ts +1600 -0
  497. package/source/loader/namespace_post_step.ts +36 -0
  498. package/source/loader/register_node_promoter.ts +8 -0
  499. package/source/namespace.ts +9 -0
  500. package/source/namespace_alarm_and_condition.ts +47 -0
  501. package/source/namespace_data_access.ts +60 -0
  502. package/source/namespace_machine_state.ts +13 -0
  503. package/source/pseudo_session.ts +288 -0
  504. package/source/session_context.ts +345 -0
  505. package/source/set_namespace_meta_data.ts +68 -0
  506. package/source/ua_root_folder.ts +10 -0
  507. package/source/ua_two_state_variable_ex.ts +35 -0
  508. package/source/xml_writer.ts +15 -0
  509. package/source_nodejs/generate_address_space.ts +36 -0
  510. package/source_nodejs/index.ts +1 -0
  511. package/src/address_space.ts +1575 -0
  512. package/src/address_space_change_event_tools.ts +177 -0
  513. package/src/address_space_private.ts +98 -0
  514. package/src/alarms_and_conditions/check_where_clause.ts +148 -0
  515. package/src/alarms_and_conditions/condition.ts +89 -0
  516. package/src/alarms_and_conditions/condition_info.ts +66 -0
  517. package/src/alarms_and_conditions/condition_snapshot.ts +766 -0
  518. package/src/alarms_and_conditions/deviation_alarm_helper.ts +66 -0
  519. package/src/alarms_and_conditions/extract_event_fields.ts +104 -0
  520. package/src/alarms_and_conditions/index.ts +18 -0
  521. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +339 -0
  522. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +513 -0
  523. package/src/alarms_and_conditions/ua_base_event_impl.ts +55 -0
  524. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +50 -0
  525. package/src/alarms_and_conditions/ua_condition_impl.ts +1298 -0
  526. package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +81 -0
  527. package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +110 -0
  528. package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +19 -0
  529. package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +130 -0
  530. package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +24 -0
  531. package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +305 -0
  532. package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +108 -0
  533. package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +224 -0
  534. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +186 -0
  535. package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +27 -0
  536. package/src/apply_condition_refresh.ts +30 -0
  537. package/src/base_node_impl.ts +1749 -0
  538. package/src/base_node_private.ts +690 -0
  539. package/src/data_access/add_dataItem_stuff.ts +75 -0
  540. package/src/data_access/check_variant_compatibility_ua_analog_item.ts +41 -0
  541. package/src/data_access/ua_multistate_discrete_impl.ts +168 -0
  542. package/src/data_access/ua_multistate_value_discrete.ts +299 -0
  543. package/src/data_access/ua_two_state_discrete.ts +185 -0
  544. package/src/event_data.ts +117 -0
  545. package/src/extension_object_array_node.ts +325 -0
  546. package/src/historical_access/address_space_historical_data_node.ts +828 -0
  547. package/src/index_current.ts +52 -0
  548. package/src/namespace_impl.ts +2181 -0
  549. package/src/namespace_private.ts +60 -0
  550. package/src/nodeid_manager.ts +228 -0
  551. package/src/nodeset_tools/adjust_namespace_array.ts +11 -0
  552. package/src/nodeset_tools/construct_namespace_dependency.ts +40 -0
  553. package/src/nodeset_tools/nodeset_to_xml.ts +1317 -0
  554. package/src/nodeset_tools/typedictionary_to_xml.ts +175 -0
  555. package/src/reference_impl.ts +169 -0
  556. package/src/role_permissions.ts +6 -0
  557. package/src/state_machine/finite_state_machine.ts +428 -0
  558. package/src/state_machine/ua_shelving_state_machine_ex.ts +314 -0
  559. package/src/state_machine/ua_two_state_variable.ts +421 -0
  560. package/src/tool_isSupertypeOf.ts +129 -0
  561. package/src/ua_condition_type.ts +10 -0
  562. package/src/ua_data_type_impl.ts +356 -0
  563. package/src/ua_method_impl.ts +278 -0
  564. package/src/ua_object_impl.ts +203 -0
  565. package/src/ua_object_type_impl.ts +158 -0
  566. package/src/ua_reference_type_impl.ts +174 -0
  567. package/src/ua_variable_impl.ts +2277 -0
  568. package/src/ua_variable_type_impl.ts +741 -0
  569. package/src/ua_view_impl.ts +54 -0
  570. package/testHelpers.d.ts +1 -0
  571. package/testHelpers.js +1 -0
  572. package/test_helpers/add_event_generator_object.ts +71 -0
  573. package/test_helpers/alarms_and_conditions_demo.ts +147 -0
  574. package/test_helpers/assertHasMatchingReference.ts +43 -0
  575. package/test_helpers/boiler_system.ts +618 -0
  576. package/test_helpers/create_minimalist_address_space_nodeset.ts +208 -0
  577. package/test_helpers/dump_statemachine.ts +155 -0
  578. package/test_helpers/get_address_space_fixture.ts +30 -0
  579. package/test_helpers/get_mini_address_space.ts +42 -0
  580. package/test_helpers/index.ts +11 -0
  581. package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -0
  582. package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -0
  583. package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +136 -0
  584. package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -0
  585. package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -0
  586. package/test_helpers/test_fixtures/dataType_with_structures.xml +605 -0
  587. package/test_helpers/test_fixtures/dataType_with_union.xml +1 -0
  588. package/test_helpers/test_fixtures/datatype_as_per_1.04.xml +91 -0
  589. package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -0
  590. package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -0
  591. package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -0
  592. package/test_helpers/test_fixtures/issue_846.xml +3172 -0
  593. package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +33 -0
  594. package/test_helpers/test_fixtures/mini.Node.Set2.xml +4508 -0
  595. package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -0
  596. package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -0
  597. package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -0
  598. package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -0
@@ -0,0 +1,1029 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UAConditionBase = void 0;
4
+ /**
5
+ * @module node-opcua-address-space.AlarmsAndConditions
6
+ */
7
+ const chalk = require("chalk");
8
+ const node_opcua_assert_1 = require("node-opcua-assert");
9
+ const node_opcua_basic_types_1 = require("node-opcua-basic-types");
10
+ const node_opcua_data_model_1 = require("node-opcua-data-model");
11
+ const node_opcua_debug_1 = require("node-opcua-debug");
12
+ const node_opcua_factory_1 = require("node-opcua-factory");
13
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
14
+ const node_opcua_status_code_1 = require("node-opcua-status-code");
15
+ const node_opcua_types_1 = require("node-opcua-types");
16
+ const node_opcua_variant_1 = require("node-opcua-variant");
17
+ const base_node_1 = require("../base_node");
18
+ const ua_object_1 = require("../ua_object");
19
+ const ua_object_type_1 = require("../ua_object_type");
20
+ const ua_two_state_variable_1 = require("../state_machine/ua_two_state_variable");
21
+ const base_event_type_1 = require("./base_event_type");
22
+ const condition_snapshot_1 = require("./condition_snapshot");
23
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
24
+ const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
25
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
26
+ /**
27
+ * @class UAConditionBase
28
+ * @constructor
29
+ * @extends BaseEventType
30
+ *
31
+ *
32
+ * └─ ConditionType
33
+ * ├─ DialogConditionType
34
+ * └─ AcknowledgeableConditionType
35
+ * └─ AlarmConditionType
36
+ * ├─ LimitAlarmType
37
+ * │ ├─ ExclusiveLimitAlarmType
38
+ * │ │ ├─ ExclusiveLevelAlarmType
39
+ * │ │ ├─ ExclusiveDeviationAlarmType
40
+ * │ │ └─ ExclusiveRateOfChangeAlarmType
41
+ * │ └─ NonExclusiveLimitAlarmType
42
+ * │ ├─ NonExclusiveLevelAlarmType
43
+ * │ ├─ NonExclusiveDeviationAlarmType
44
+ * │ └─ NonExclusiveRateOfChangeAlarmType
45
+ * └─ DiscreteAlarmType
46
+ * ├─ OffNormalAlarmType
47
+ * │ ├─ SystemOffNormalAlarmType
48
+ * │ │ └─ CertificateExpirationAlarmType
49
+ * │ └─ TripAlarmType
50
+ *
51
+ */
52
+ class UAConditionBase extends base_event_type_1.BaseEventType {
53
+ constructor() {
54
+ super(...arguments);
55
+ this._branch0 = null;
56
+ this._previousRetainFlag = false;
57
+ this._branches = {};
58
+ }
59
+ static instantiate(namespace, conditionTypeId, options, data) {
60
+ return UAConditionBase_instantiate(namespace, conditionTypeId, options, data);
61
+ }
62
+ static install_condition_refresh_handle(addressSpace) {
63
+ //
64
+ // install ConditionRefresh
65
+ //
66
+ // NOTE:
67
+ // OPCUA doesn't implement the condition refresh method ! yet
68
+ // .5.7 ConditionRefresh Method
69
+ // ConditionRefresh allows a Client to request a Refresh of all Condition instances that currently
70
+ // are in an interesting state (they have the Retain flag set). This includes previous states of a
71
+ // Condition instance for which the Server maintains Branches. A Client would typically invoke
72
+ // this Method when it initially connects to a Server and following any situations, such as
73
+ // communication disruptions, in which it would require resynchronization with the Server. This
74
+ // Method is only available on the ConditionType or its subtypes. To invoke this Method, the call
75
+ // shall pass the well known MethodId of the Method on the ConditionType and the ObjectId
76
+ // shall be the well known ObjectId of the ConditionType Object.
77
+ const conditionType = addressSpace.findEventType("ConditionType");
78
+ (0, node_opcua_assert_1.assert)(conditionType !== null);
79
+ conditionType.disable.bindMethod(_disable_method);
80
+ conditionType.enable.bindMethod(_enable_method);
81
+ conditionType.conditionRefresh.bindMethod(_condition_refresh_method);
82
+ conditionType.conditionRefresh2.bindMethod(_condition_refresh2_method);
83
+ // those methods can be call on the ConditionType or on the ConditionInstance itself...
84
+ conditionType.addComment.bindMethod(_add_comment_method);
85
+ }
86
+ /**
87
+ *
88
+ * Helper method to handle condition methods that takes a branchId and a comment
89
+ *
90
+ */
91
+ static with_condition_method(inputArguments, context, callback, inner_func) {
92
+ const conditionNode = context.object;
93
+ // xx console.log(inputArguments.map(function(a){return a.toString()}));
94
+ if (!(conditionNode instanceof UAConditionBase)) {
95
+ callback(null, {
96
+ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdInvalid
97
+ });
98
+ return;
99
+ }
100
+ if (!conditionNode.getEnabledState()) {
101
+ callback(null, {
102
+ statusCode: node_opcua_status_code_1.StatusCodes.BadConditionDisabled
103
+ });
104
+ return;
105
+ }
106
+ // inputArguments has 2 arguments
107
+ // EventId => ByteString The Identifier of the event to comment
108
+ // Comment => LocalizedText The Comment to add to the condition
109
+ (0, node_opcua_assert_1.assert)(inputArguments.length === 2);
110
+ (0, node_opcua_assert_1.assert)(inputArguments[0].dataType === node_opcua_variant_1.DataType.ByteString);
111
+ (0, node_opcua_assert_1.assert)(inputArguments[1].dataType === node_opcua_variant_1.DataType.LocalizedText);
112
+ const eventId = inputArguments[0].value;
113
+ (0, node_opcua_assert_1.assert)(!eventId || eventId instanceof Buffer);
114
+ const comment = inputArguments[1].value;
115
+ (0, node_opcua_assert_1.assert)(comment instanceof node_opcua_data_model_1.LocalizedText);
116
+ const branch = conditionNode._findBranchForEventId(eventId);
117
+ if (!branch) {
118
+ callback(null, {
119
+ statusCode: node_opcua_status_code_1.StatusCodes.BadEventIdUnknown
120
+ });
121
+ return;
122
+ }
123
+ (0, node_opcua_assert_1.assert)(branch instanceof condition_snapshot_1.ConditionSnapshot);
124
+ const statusCode = inner_func(eventId, comment, branch, conditionNode);
125
+ // record also who did the call
126
+ branch.setClientUserId(context.userIdentity || "<unknown client user id>");
127
+ callback(null, {
128
+ statusCode
129
+ });
130
+ }
131
+ /**
132
+ * @method initialize
133
+ * @private
134
+ */
135
+ initialize() {
136
+ this._branches = {};
137
+ }
138
+ /**
139
+ * @method post_initialize
140
+ * @private
141
+ */
142
+ post_initialize() {
143
+ (0, node_opcua_assert_1.assert)(!this._branch0);
144
+ this._branch0 = new condition_snapshot_1.ConditionSnapshot(this, node_opcua_nodeid_1.NodeId.nullNodeId);
145
+ // the condition OPCUA object alway reflects the default branch states
146
+ // so we set a mechanism that automatically keeps self in sync
147
+ // with the default branch.
148
+ // the implication of this convention is that interacting with the condition variable
149
+ // shall be made by using branch0, any value change made
150
+ // using the standard setValueFromSource mechanism will not be work properly.
151
+ this._branch0.on("value_changed", (node, variant) => {
152
+ (0, node_opcua_assert_1.assert)(node.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
153
+ node.setValueFromSource(variant);
154
+ });
155
+ }
156
+ getBranchCount() {
157
+ return Object.keys(this._branches).length;
158
+ }
159
+ getBranches() {
160
+ return Object.keys(this._branches).map((x) => {
161
+ return this._branches[x];
162
+ });
163
+ }
164
+ getBranchIds() {
165
+ return this.getBranches().map((b) => b.getBranchId());
166
+ }
167
+ /**
168
+ * @method createBranch
169
+ * @return {ConditionSnapshot}
170
+ */
171
+ createBranch() {
172
+ const branchId = _create_new_branch_id();
173
+ const snapshot = new condition_snapshot_1.ConditionSnapshot(this, branchId);
174
+ this._branches[branchId.toString()] = snapshot;
175
+ return snapshot;
176
+ }
177
+ /**
178
+ * @method deleteBranch
179
+ * @param branch {ConditionSnapshot}
180
+ */
181
+ deleteBranch(branch) {
182
+ const key = branch.getBranchId().toString();
183
+ (0, node_opcua_assert_1.assert)(branch.getBranchId() !== node_opcua_nodeid_1.NodeId.nullNodeId, "cannot delete branch zero");
184
+ (0, node_opcua_assert_1.assert)(this._branches.hasOwnProperty(key));
185
+ delete this._branches[key];
186
+ this.emit("branch_deleted", key);
187
+ }
188
+ /**
189
+ * @method getEnabledState
190
+ * @return {Boolean}
191
+ */
192
+ getEnabledState() {
193
+ return this.enabledState.getValue();
194
+ }
195
+ /**
196
+ * @method getEnabledStateAsString
197
+ * @return {String}
198
+ */
199
+ getEnabledStateAsString() {
200
+ return this.enabledState.getValueAsString();
201
+ }
202
+ /**
203
+ * @method _setEnabledState
204
+ * @param requestedEnabledState {Boolean}
205
+ * @return {StatusCode} StatusCodes.Good if successful or BadConditionAlreadyEnabled/BadConditionAlreadyDisabled
206
+ * @private
207
+ */
208
+ _setEnabledState(requestedEnabledState) {
209
+ (0, node_opcua_assert_1.assert)(typeof requestedEnabledState === "boolean");
210
+ const enabledState = this.getEnabledState();
211
+ if (enabledState && requestedEnabledState) {
212
+ return node_opcua_status_code_1.StatusCodes.BadConditionAlreadyEnabled;
213
+ }
214
+ if (!enabledState && !requestedEnabledState) {
215
+ return node_opcua_status_code_1.StatusCodes.BadConditionAlreadyDisabled;
216
+ }
217
+ this._branch0.setEnabledState(requestedEnabledState);
218
+ // conditionNode.enabledState.setValue(requestedEnabledState);
219
+ // xx assert(conditionNode.enabledState.id.readValue().value.value === requestedEnabledState,"sanity check 1");
220
+ // xx assert(conditionNode.currentBranch().getEnabledState() === requestedEnabledState,"sanity check 2");
221
+ if (!requestedEnabledState) {
222
+ // as per Spec 1.0.3 part 9:
223
+ // * When the Condition instance enters the Disabled state, the Retain Property of this
224
+ // Condition shall be set to FALSE by the Server to indicate to the Client that the
225
+ // Condition instance is currently not of interest to Clients.
226
+ // TODO : shall we really set retain to false or artificially expose the retain false as false
227
+ // whist enabled state is false ?
228
+ this._previousRetainFlag = this.currentBranch().getRetain();
229
+ this.currentBranch().setRetain(false);
230
+ // todo: install the mechanism by which all condition values will be return
231
+ // as Null | BadConditionDisabled;
232
+ const statusCode = node_opcua_status_code_1.StatusCodes.BadConditionDisabled;
233
+ // a notification must be send
234
+ this.raiseConditionEvent(this.currentBranch(), true);
235
+ }
236
+ else {
237
+ // * When the Condition instance enters the enabled state, the Condition shall be
238
+ // evaluated and all of its Properties updated to reflect the current values. If this
239
+ // evaluation causes the Retain Property to transition to TRUE for any ConditionBranch,
240
+ // then an Event Notification shall be generated for that ConditionBranch.
241
+ this.evaluateConditionsAfterEnabled();
242
+ // todo evaluate branches
243
+ // conditionNode.evaluateBranches();
244
+ // restore retain flag
245
+ if (this.hasOwnProperty("_previousRetainFlag")) {
246
+ this.currentBranch().setRetain(this._previousRetainFlag);
247
+ }
248
+ // todo send notification for branches with retain = true
249
+ let nb_condition_resent = 0;
250
+ if (this.currentBranch().getRetain()) {
251
+ nb_condition_resent += this._resend_conditionEvents();
252
+ }
253
+ if (nb_condition_resent === 0) {
254
+ // a notification must be send
255
+ this.raiseConditionEvent(this.currentBranch(), true);
256
+ }
257
+ }
258
+ return node_opcua_status_code_1.StatusCodes.Good;
259
+ }
260
+ /**
261
+ *
262
+ * @method setEnabledState
263
+ * @param requestedEnabledState {Boolean}
264
+ * @private
265
+ */
266
+ setEnabledState(requestedEnabledState) {
267
+ return this._setEnabledState(requestedEnabledState);
268
+ }
269
+ /**
270
+ * @method setReceiveTime
271
+ * @param time {Date}
272
+ */
273
+ setReceiveTime(time) {
274
+ return this._branch0.setReceiveTime(time);
275
+ }
276
+ /**
277
+ * @method setLocalTime (optional)
278
+ * @param time
279
+ */
280
+ setLocalTime(time) {
281
+ return this._branch0.setLocalTime(time);
282
+ }
283
+ /**
284
+ * @method setTime
285
+ * @param time {Date}
286
+ */
287
+ setTime(time) {
288
+ return this._branch0.setTime(time);
289
+ }
290
+ _assert_valid() {
291
+ (0, node_opcua_assert_1.assert)(this.receiveTime.readValue().value.dataType === node_opcua_variant_1.DataType.DateTime);
292
+ (0, node_opcua_assert_1.assert)(this.receiveTime.readValue().value.value instanceof Date);
293
+ (0, node_opcua_assert_1.assert)(this.message.readValue().value.dataType === node_opcua_variant_1.DataType.LocalizedText);
294
+ (0, node_opcua_assert_1.assert)(this.severity.readValue().value.dataType === node_opcua_variant_1.DataType.UInt16);
295
+ (0, node_opcua_assert_1.assert)(this.time.readValue().value.dataType === node_opcua_variant_1.DataType.DateTime);
296
+ (0, node_opcua_assert_1.assert)(this.time.readValue().value.value instanceof Date);
297
+ (0, node_opcua_assert_1.assert)(this.quality.readValue().value.dataType === node_opcua_variant_1.DataType.StatusCode);
298
+ (0, node_opcua_assert_1.assert)(this.enabledState.readValue().value.dataType === node_opcua_variant_1.DataType.LocalizedText);
299
+ (0, node_opcua_assert_1.assert)(this.branchId.readValue().value.dataType === node_opcua_variant_1.DataType.NodeId);
300
+ // note localTime has been made optional in 1.04
301
+ (0, node_opcua_assert_1.assert)(!this.localTime || this.localTime.readValue().value.dataType === node_opcua_variant_1.DataType.ExtensionObject);
302
+ }
303
+ /**
304
+ * @method conditionOfNode
305
+ * @return {UAObject}
306
+ */
307
+ conditionOfNode() {
308
+ const refs = this.findReferencesExAsObject("HasCondition", node_opcua_data_model_1.BrowseDirection.Inverse);
309
+ if (refs.length === 0) {
310
+ return null;
311
+ }
312
+ (0, node_opcua_assert_1.assert)(refs.length !== 0, "UAConditionBase must be the condition of some node");
313
+ (0, node_opcua_assert_1.assert)(refs.length === 1, "expecting only one ConditionOf");
314
+ const node = refs[0];
315
+ (0, node_opcua_assert_1.assert)(node.nodeClass === node_opcua_data_model_1.NodeClass.Object || node.nodeClass === node_opcua_data_model_1.NodeClass.Variable, "node for which we are the condition shall be an UAObject or UAVariable");
316
+ return node;
317
+ }
318
+ /**
319
+ * @method raiseConditionEvent
320
+ * Raise a Instance Event
321
+ * (see also UAObject#raiseEvent to raise a transient event)
322
+ * @param branch the condition branch to raise
323
+ * @param renewEventId true if event Id of the condition branch should be renewed
324
+ */
325
+ raiseConditionEvent(branch, renewEventId) {
326
+ (0, node_opcua_assert_1.assert)(arguments.length === 2, "expecting 2 arguments");
327
+ if (renewEventId) {
328
+ branch.renewEventId();
329
+ }
330
+ // xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
331
+ // branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
332
+ (0, node_opcua_assert_1.assert)(branch instanceof condition_snapshot_1.ConditionSnapshot);
333
+ this._assert_valid();
334
+ // In fact the event is raised by the object of which we are the condition
335
+ const conditionOfNode = this.conditionOfNode();
336
+ if (conditionOfNode) {
337
+ const eventData = branch._constructEventData();
338
+ this.emit("event", eventData);
339
+ if (conditionOfNode instanceof ua_object_1.UAObject) {
340
+ // xx assert(conditionOfNode.eventNotifier === 0x01);
341
+ conditionOfNode._bubble_up_event(eventData);
342
+ }
343
+ else {
344
+ (0, node_opcua_assert_1.assert)(conditionOfNode.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
345
+ // in this case
346
+ const eventOfs = conditionOfNode.getEventSourceOfs();
347
+ (0, node_opcua_assert_1.assert)(eventOfs.length === 1);
348
+ const node = eventOfs[0];
349
+ (0, node_opcua_assert_1.assert)(node instanceof ua_object_1.UAObject);
350
+ node._bubble_up_event(eventData);
351
+ }
352
+ }
353
+ // xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
354
+ // branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
355
+ }
356
+ /**
357
+ *
358
+ * @method raiseNewCondition
359
+ * @param conditionInfo {ConditionInfo}
360
+ *
361
+ */
362
+ raiseNewCondition(conditionInfo) {
363
+ if (!this.getEnabledState()) {
364
+ throw new Error("UAConditionBase#raiseNewCondition Condition is not enabled");
365
+ }
366
+ conditionInfo = conditionInfo || {};
367
+ conditionInfo.severity = conditionInfo.hasOwnProperty("severity")
368
+ ? conditionInfo.severity
369
+ : UAConditionBase.defaultSeverity;
370
+ // only valid for ConditionObjects
371
+ // todo check that object is of type ConditionType
372
+ const addressSpace = this.addressSpace;
373
+ const selfConditionType = this.typeDefinitionObj;
374
+ const conditionType = addressSpace.findObjectType("ConditionType");
375
+ (0, node_opcua_assert_1.assert)(selfConditionType.isSupertypeOf(conditionType));
376
+ const branch = this.currentBranch();
377
+ const now = new Date();
378
+ // install the eventTimestamp
379
+ // set the received Time
380
+ branch.setTime(now);
381
+ branch.setReceiveTime(now);
382
+ // note : in 1.04 LocalTime property is optional
383
+ if (this.hasOwnProperty("localTime")) {
384
+ branch.setLocalTime(new node_opcua_types_1.TimeZoneDataType({
385
+ daylightSavingInOffset: false,
386
+ offset: 0
387
+ }));
388
+ }
389
+ if (conditionInfo.hasOwnProperty("message") && conditionInfo.message) {
390
+ branch.setMessage(conditionInfo.message);
391
+ }
392
+ // todo receive time : when the server received the event from the underlying system.
393
+ // self.receiveTime.setValueFromSource();
394
+ if (conditionInfo.hasOwnProperty("severity") && conditionInfo.severity !== null) {
395
+ (0, node_opcua_assert_1.assert)(isFinite(conditionInfo.severity));
396
+ branch.setSeverity(conditionInfo.severity);
397
+ }
398
+ if (conditionInfo.hasOwnProperty("quality") && conditionInfo.quality !== null) {
399
+ (0, node_opcua_assert_1.assert)(conditionInfo.quality instanceof node_opcua_status_code_1.StatusCode);
400
+ branch.setQuality(conditionInfo.quality);
401
+ }
402
+ if (conditionInfo.hasOwnProperty("retain") && conditionInfo.retain !== null) {
403
+ (0, node_opcua_assert_1.assert)(typeof conditionInfo.retain === "boolean");
404
+ branch.setRetain(!!conditionInfo.retain);
405
+ }
406
+ this.raiseConditionEvent(branch, true);
407
+ }
408
+ raiseNewBranchState(branch) {
409
+ this.raiseConditionEvent(branch, true);
410
+ if (branch.getBranchId() !== node_opcua_nodeid_1.NodeId.nullNodeId && !branch.getRetain()) {
411
+ // xx console.log(" Deleting not longer needed branch ", branch.getBranchId().toString());
412
+ // branch can be deleted
413
+ this.deleteBranch(branch);
414
+ }
415
+ }
416
+ /**
417
+ * @method currentBranch
418
+ * @return {ConditionSnapshot}
419
+ */
420
+ currentBranch() {
421
+ return this._branch0;
422
+ }
423
+ _resend_conditionEvents() {
424
+ // for the time being , only current branch
425
+ const currentBranch = this.currentBranch();
426
+ if (currentBranch.getRetain()) {
427
+ debugLog(" resending condition event for " + this.browseName.toString());
428
+ this.raiseConditionEvent(currentBranch, false);
429
+ return 1;
430
+ }
431
+ return 0;
432
+ }
433
+ // ------------------------------------------------------------------------------------
434
+ // Acknowledgeable
435
+ // ------------------------------------------------------------------------------------
436
+ /**
437
+ * @method _raiseAuditConditionCommentEvent
438
+ * @param sourceName {string}
439
+ * @param conditionEventId {Buffer}
440
+ * @param comment {LocalizedText}
441
+ * @private
442
+ */
443
+ _raiseAuditConditionCommentEvent(sourceName, conditionEventId, comment) {
444
+ (0, node_opcua_assert_1.assert)(conditionEventId === null || conditionEventId instanceof Buffer);
445
+ (0, node_opcua_assert_1.assert)(comment instanceof node_opcua_data_model_1.LocalizedText);
446
+ const server = this.addressSpace.rootFolder.objects.server;
447
+ const now = new Date();
448
+ // xx if (true || server.isAuditing) {
449
+ // ----------------------------------------------------------------------------------------------------
450
+ server.raiseEvent("AuditConditionCommentEventType", {
451
+ // AuditEventType
452
+ /* part 5 - 6.4.3 AuditEventType */
453
+ actionTimeStamp: {
454
+ dataType: "DateTime",
455
+ value: now
456
+ },
457
+ status: {
458
+ dataType: "Boolean",
459
+ value: true
460
+ },
461
+ serverId: {
462
+ dataType: "String",
463
+ value: ""
464
+ },
465
+ // ClientAuditEntryId contains the human-readable AuditEntryId defined in Part 3.
466
+ clientAuditEntryId: {
467
+ dataType: "String",
468
+ value: ""
469
+ },
470
+ // The ClientUserId identifies the user of the client requesting an action. The ClientUserId can be
471
+ // obtained from the UserIdentityToken passed in the ActivateSession call.
472
+ clientUserId: {
473
+ dataType: "String",
474
+ value: ""
475
+ },
476
+ sourceName: {
477
+ dataType: "String",
478
+ value: sourceName
479
+ },
480
+ // AuditUpdateMethodEventType
481
+ methodId: {
482
+ dataType: "Null"
483
+ },
484
+ inputArguments: {
485
+ dataType: "Null"
486
+ },
487
+ // AuditConditionCommentEventType
488
+ conditionEventId: {
489
+ dataType: "ByteString",
490
+ value: conditionEventId
491
+ },
492
+ comment: {
493
+ dataType: "LocalizedText",
494
+ value: comment
495
+ }
496
+ });
497
+ // xx }
498
+ }
499
+ _findBranchForEventId(eventId) {
500
+ const conditionNode = this;
501
+ if (sameBuffer(conditionNode.eventId.readValue().value.value, eventId)) {
502
+ return conditionNode.currentBranch();
503
+ }
504
+ const e = Object.values(conditionNode._branches).filter((branch) => sameBuffer(branch.getEventId(), eventId));
505
+ if (e.length === 1) {
506
+ return e[0];
507
+ }
508
+ (0, node_opcua_assert_1.assert)(e.length === 0, "cannot have 2 branches with same eventId");
509
+ return null; // not found
510
+ }
511
+ evaluateConditionsAfterEnabled() {
512
+ (0, node_opcua_assert_1.assert)(this.getEnabledState() === true);
513
+ throw new Error("Unimplemented , please override");
514
+ }
515
+ }
516
+ exports.UAConditionBase = UAConditionBase;
517
+ UAConditionBase.defaultSeverity = 250;
518
+ UAConditionBase.typeDefinition = (0, node_opcua_nodeid_1.resolveNodeId)("ConditionType");
519
+ /**
520
+ * instantiate a Condition.
521
+ * this will create the unique EventId and will set eventType
522
+ * @method instantiate
523
+ * @param namespace {Namespace}
524
+ * @param conditionTypeId {String|NodeId} the EventType to instantiate
525
+ * @param options {object}
526
+ * @param options.browseName {String|QualifiedName}
527
+ * @param options.componentOf {NodeId|UAObject}
528
+ * @param options.conditionOf {NodeId|UAObject} Mandatory
529
+ * @param options.organizedBy {NodeId|UAObject} ( only provide componentOf or organizedBy but not both)
530
+ * @param [options.conditionClass =BaseConditionClassType] {NodeId|UAObject}
531
+ * The condition Class nodeId or object used to set the ConditionClassId and
532
+ * ConditionClassName properties of the condition.
533
+ *
534
+ * @param options.conditionSource {NodeId|UAObject} the condition source node.
535
+ * this node must be marked a EventSource.
536
+ * the conditionSource is used to populate the sourceNode and
537
+ * sourceName variables defined by BaseEventType
538
+ * @param options.conditionName {String} the condition Name
539
+ * @param [options.optionals] [Array<String>] an Array of optionals fields
540
+ *
541
+ * @param data a object containing the value to set
542
+ * @param data.eventId {String|NodeId} the EventType Identifier to instantiate (type cannot be abstract)
543
+ * @return a instantiated UAConditionBase
544
+ */
545
+ function UAConditionBase_instantiate(namespace, conditionTypeId, options, data) {
546
+ /* eslint max-statements: ["error", 100] */
547
+ const addressSpace = namespace.addressSpace;
548
+ const conditionType = addressSpace.findEventType(conditionTypeId);
549
+ /* istanbul ignore next */
550
+ if (!conditionType) {
551
+ throw new Error(" cannot find Condition Type for " + conditionTypeId);
552
+ }
553
+ // reminder : abstract event type cannot be instantiated directly !
554
+ (0, node_opcua_assert_1.assert)(!conditionType.isAbstract, "Cannot instantiate abstract conditionType");
555
+ const baseConditionEventType = addressSpace.findEventType("ConditionType");
556
+ /* istanbul ignore next */
557
+ if (!baseConditionEventType) {
558
+ throw new Error("cannot find ConditionType");
559
+ }
560
+ (0, node_opcua_assert_1.assert)(conditionType.isSupertypeOf(baseConditionEventType));
561
+ // assert((typeof options.browseName === "string"));
562
+ options.browseName = options.browseName || "??? instantiateCondition - missing browseName";
563
+ options.optionals = options.optionals || [];
564
+ // now optionals in 1.04
565
+ options.optionals.push("EventType");
566
+ options.optionals.push("BranchId");
567
+ //
568
+ options.optionals.push("Comment");
569
+ options.optionals.push("Comment.SourceTimestamp");
570
+ options.optionals.push("EnabledState.TrueState");
571
+ options.optionals.push("EnabledState.TrueState");
572
+ options.optionals.push("EnabledState.FalseState");
573
+ options.optionals.push("EnabledState.TransitionTime");
574
+ options.optionals.push("EnabledState.EffectiveTransitionTime");
575
+ options.optionals.push("EnabledState.EffectiveDisplayName");
576
+ const conditionNode = conditionType.instantiate(options);
577
+ Object.setPrototypeOf(conditionNode, UAConditionBase.prototype);
578
+ conditionNode.initialize();
579
+ (0, node_opcua_assert_1.assert)(options.hasOwnProperty("conditionSource"), "must specify a condition source either as null or as a UAObject");
580
+ if (!options.conditionOf) {
581
+ options.conditionOf = options.conditionSource;
582
+ }
583
+ if (options.conditionOf) {
584
+ (0, node_opcua_assert_1.assert)(options.hasOwnProperty("conditionOf")); // must provide a conditionOf
585
+ options.conditionOf = addressSpace._coerceNode(options.conditionOf);
586
+ // HasCondition References can be used in the Type definition of an Object or a Variable.
587
+ (0, node_opcua_assert_1.assert)(options.conditionOf.nodeClass === node_opcua_data_model_1.NodeClass.Object || options.conditionOf.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
588
+ conditionNode.addReference({
589
+ isForward: false,
590
+ nodeId: options.conditionOf,
591
+ referenceType: "HasCondition"
592
+ });
593
+ (0, node_opcua_assert_1.assert)(conditionNode.conditionOfNode().nodeId === options.conditionOf.nodeId);
594
+ }
595
+ // the constant property of this condition
596
+ conditionNode.eventType.setValueFromSource({
597
+ dataType: node_opcua_variant_1.DataType.NodeId,
598
+ value: conditionType.nodeId
599
+ });
600
+ data = data || {};
601
+ // install initial branch ID (null NodeId);
602
+ conditionNode.branchId.setValueFromSource({
603
+ dataType: node_opcua_variant_1.DataType.NodeId,
604
+ value: node_opcua_nodeid_1.NodeId.nullNodeId
605
+ });
606
+ // install 'Comment' condition variable
607
+ _install_condition_variable_type(conditionNode.comment);
608
+ // install 'Quality' condition variable
609
+ _install_condition_variable_type(conditionNode.quality);
610
+ // xx conditionNode.quality.setValueFromSource({dataType: DataType.StatusCode,value: StatusCodes.Good });
611
+ // install 'LastSeverity' condition variable
612
+ _install_condition_variable_type(conditionNode.lastSeverity);
613
+ // xx conditionNode.severity.setValueFromSource({dataType: DataType.UInt16,value: 0 });
614
+ // xx conditionNode.lastSeverity.setValueFromSource({dataType: DataType.UInt16,value: 0 });
615
+ // install 'EnabledState' TwoStateVariable
616
+ /**
617
+ * @property enabledState
618
+ * @type {UATwoStateVariable}
619
+ */
620
+ // -------------- fixing missing EnabledState.EffectiveDisplayName
621
+ if (!conditionNode.enabledState.effectiveDisplayName) {
622
+ namespace.addVariable({
623
+ browseName: new node_opcua_data_model_1.QualifiedName({ namespaceIndex: 0, name: "EffectiveDisplayName" }),
624
+ dataType: "LocalizedText",
625
+ propertyOf: conditionNode.enabledState
626
+ });
627
+ }
628
+ (0, ua_two_state_variable_1._install_TwoStateVariable_machinery)(conditionNode.enabledState, {
629
+ falseState: "Disabled",
630
+ trueState: "Enabled"
631
+ });
632
+ // installing sourceName and sourceNode
633
+ conditionNode.enabledState.setValue(true);
634
+ // set properties to in initial values
635
+ Object.keys(data).forEach((key) => {
636
+ const varNode = _getCompositeKey(conditionNode, key);
637
+ (0, node_opcua_assert_1.assert)(varNode.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
638
+ const variant = new node_opcua_variant_1.Variant(data[key]);
639
+ // check that Variant DataType is compatible with the UAVariable dataType
640
+ // xx var nodeDataType = addressSpace.findNode(varNode.dataType).browseName;
641
+ /* istanbul ignore next */
642
+ if (!varNode._validate_DataType(variant.dataType)) {
643
+ throw new Error(" Invalid variant dataType " + variant + " " + varNode.browseName.toString());
644
+ }
645
+ const value = new node_opcua_variant_1.Variant(data[key]);
646
+ varNode.setValueFromSource(value);
647
+ });
648
+ // bind condition methods -
649
+ /**
650
+ * @property enable
651
+ * @type {UAMethod}
652
+ */
653
+ conditionNode.enable.bindMethod(_enable_method);
654
+ /**
655
+ * @property disable
656
+ * @type {UAMethod}
657
+ */
658
+ conditionNode.disable.bindMethod(_disable_method);
659
+ // bind condition methods - AddComment
660
+ /**
661
+ * @property addComment
662
+ * @type {UAMethod}
663
+ */
664
+ conditionNode.addComment.bindMethod(_add_comment_method);
665
+ (0, node_opcua_assert_1.assert)(conditionNode instanceof UAConditionBase);
666
+ // ConditionSource => cf SourceNode
667
+ // As per spec OPCUA 1.03 part 9 page 54:
668
+ // The ConditionType inherits all Properties of the BaseEventType. Their semantic is defined in
669
+ // Part 5. SourceNode identifies the ConditionSource.
670
+ // The SourceNode is the Node which the condition is associated with, it may be the same as the
671
+ // InputNode for an alarm, but it may be a separate node. For example a motor, which is a
672
+ // variable with a value that is an RPM, may be the ConditionSource for Conditions that are
673
+ // related to the motor as well as a temperature sensor associated with the motor. In the former
674
+ // the InputNode for the High RPM alarm is the value of the Motor RPM, while in the later the
675
+ // InputNode of the High Alarm would be the value of the temperature sensor that is associated
676
+ // with the motor.
677
+ if (options.conditionSource) {
678
+ options.conditionSource = addressSpace._coerceNode(options.conditionSource);
679
+ if (options.conditionSource.nodeClass !== node_opcua_data_model_1.NodeClass.Object && options.conditionSource.nodeClass !== node_opcua_data_model_1.NodeClass.Variable) {
680
+ // tslint:disable:no-console
681
+ console.log(options.conditionSource);
682
+ throw new Error("Expecting condition source to be NodeClass.Object or Variable");
683
+ }
684
+ const conditionSourceNode = addressSpace.findNode(options.conditionSource.nodeId);
685
+ if (conditionSourceNode) {
686
+ conditionNode.sourceNode.setValueFromSource({
687
+ dataType: node_opcua_variant_1.DataType.NodeId,
688
+ value: conditionSourceNode.nodeId
689
+ });
690
+ // conditionSourceNode node must be registered as a EventSource of an other node.
691
+ // As per spec OPCUA 1.03 part 9 page 54:
692
+ // HasNotifier and HasEventSource References are used to expose the hierarchical organization
693
+ // of Event notifying Objects and ConditionSources. An Event notifying Object represents
694
+ // typically an area of Operator responsibility. The definition of such an area configuration is
695
+ // outside the scope of this standard. If areas are available they shall be linked together and
696
+ // with the included ConditionSources using the HasNotifier and the HasEventSource Reference
697
+ // Types. The Server Object shall be the root of this hierarchy.
698
+ if (!(0, node_opcua_nodeid_1.sameNodeId)(conditionSourceNode.nodeId, (0, node_opcua_nodeid_1.coerceNodeId)("ns=0;i=2253"))) {
699
+ // server object
700
+ /* istanbul ignore next */
701
+ if (conditionSourceNode.getEventSourceOfs().length === 0) {
702
+ errorLog("conditionSourceNode = ", conditionSourceNode.browseName.toString());
703
+ errorLog("conditionSourceNode = ", conditionSourceNode.nodeId.toString());
704
+ throw new Error("conditionSourceNode must be an event source " +
705
+ conditionSourceNode.browseName.toString() +
706
+ conditionSourceNode.nodeId.toString());
707
+ }
708
+ }
709
+ // set source Node (defined in UABaseEventType)
710
+ conditionNode.sourceNode.setValueFromSource(conditionSourceNode.readAttribute(null, node_opcua_data_model_1.AttributeIds.NodeId).value);
711
+ // set source Name (defined in UABaseEventType)
712
+ conditionNode.sourceName.setValueFromSource(conditionSourceNode.readAttribute(null, node_opcua_data_model_1.AttributeIds.DisplayName).value);
713
+ }
714
+ }
715
+ conditionNode.eventType.setValueFromSource({
716
+ dataType: node_opcua_variant_1.DataType.NodeId,
717
+ value: conditionType.nodeId
718
+ });
719
+ // as per spec:
720
+ /**
721
+ *
722
+ * dataType: DataType.NodeId
723
+ *
724
+ * As per spec OPCUA 1.03 part 9:
725
+ * ConditionClassId specifies in which domain this Condition is used. It is the NodeId of the
726
+ * corresponding ConditionClassType. See 5.9 for the definition of ConditionClass and a set of
727
+ * ConditionClasses defined in this standard. When using this Property for filtering, Clients have
728
+ * to specify all individual ConditionClassType NodeIds. The OfType operator cannot be applied.
729
+ * BaseConditionClassType is used as class whenever a Condition cannot be assigned to a
730
+ * more concrete class.
731
+ *
732
+ * BaseConditionClassType
733
+ * |
734
+ * +---------------------------+----------------------------+
735
+ * | | |
736
+ * ProcessConditionClassType MaintenanceConditionClassType SystemConditionClassType
737
+ *
738
+ * @property conditionName
739
+ * @type {UAVariable}
740
+ */
741
+ const baseConditionClassType = addressSpace.findObjectType("ProcessConditionClassType");
742
+ // assert(baseConditionClassType,"Expecting BaseConditionClassType to be in addressSpace");
743
+ let conditionClassId = baseConditionClassType ? baseConditionClassType.nodeId : node_opcua_nodeid_1.NodeId.nullNodeId;
744
+ let conditionClassName = baseConditionClassType ? baseConditionClassType.displayName[0] : "";
745
+ if (options.conditionClass) {
746
+ if (typeof options.conditionClass === "string") {
747
+ options.conditionClass = addressSpace.findObjectType(options.conditionClass);
748
+ }
749
+ const conditionClassNode = addressSpace._coerceNode(options.conditionClass);
750
+ if (!conditionClassNode) {
751
+ throw new Error("cannot find condition class " + options.conditionClass.toString());
752
+ }
753
+ conditionClassId = conditionClassNode.nodeId;
754
+ conditionClassName = conditionClassNode.displayName[0];
755
+ }
756
+ conditionNode.conditionClassId.setValueFromSource({
757
+ dataType: node_opcua_variant_1.DataType.NodeId,
758
+ value: conditionClassId
759
+ });
760
+ // as per spec:
761
+ // ConditionClassName provides the display name of the ConditionClassType.
762
+ conditionNode.conditionClassName.setValueFromSource({
763
+ dataType: node_opcua_variant_1.DataType.LocalizedText,
764
+ value: (0, node_opcua_data_model_1.coerceLocalizedText)(conditionClassName)
765
+ });
766
+ // as per spec:
767
+ /**
768
+ *
769
+ * dataType: DataType.String
770
+ *
771
+ * As per spec OPCUA 1.03 part 9:
772
+ * ConditionName identifies the Condition instance that the Event originated from. It can be used
773
+ * together with the SourceName in a user display to distinguish between different Condition
774
+ * instances. If a ConditionSource has only one instance of a ConditionType, and the Server has
775
+ * no instance name, the Server shall supply the ConditionType browse name.
776
+ * @property conditionName
777
+ * @type {UAVariable}
778
+ */
779
+ const conditionName = options.conditionName || "Unset Condition Name";
780
+ (0, node_opcua_assert_1.assert)(typeof conditionName === "string");
781
+ conditionNode.conditionName.setValueFromSource({
782
+ dataType: node_opcua_variant_1.DataType.String,
783
+ value: conditionName
784
+ });
785
+ // set SourceNode and SourceName based on HasCondition node
786
+ const sourceNodes = conditionNode.findReferencesAsObject("HasCondition", false);
787
+ if (sourceNodes.length) {
788
+ (0, node_opcua_assert_1.assert)(sourceNodes.length === 1);
789
+ conditionNode.setSourceNode(sourceNodes[0].nodeId);
790
+ conditionNode.setSourceName(sourceNodes[0].browseName.toString());
791
+ }
792
+ conditionNode.post_initialize();
793
+ const branch0 = conditionNode.currentBranch();
794
+ branch0.setRetain(false);
795
+ branch0.setComment("");
796
+ branch0.setQuality(node_opcua_status_code_1.StatusCodes.Good);
797
+ branch0.setSeverity(0);
798
+ branch0.setLocalTime(new node_opcua_types_1.TimeZoneDataType({
799
+ daylightSavingInOffset: false,
800
+ offset: 0
801
+ }));
802
+ branch0.setMessage("");
803
+ branch0.setReceiveTime(node_opcua_factory_1.minDate);
804
+ branch0.setTime(node_opcua_factory_1.minDate);
805
+ // UAConditionBase
806
+ return conditionNode;
807
+ }
808
+ function _disable_method(inputArguments, context, callback) {
809
+ (0, node_opcua_assert_1.assert)(inputArguments.length === 0);
810
+ const conditionNode = context.object;
811
+ (0, node_opcua_assert_1.assert)(conditionNode);
812
+ // istanbul ignore next
813
+ if (!(conditionNode instanceof UAConditionBase)) {
814
+ console.log("conditionNode is not a UAConditionBase ", conditionNode.toString());
815
+ return callback(null, {
816
+ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdInvalid
817
+ });
818
+ }
819
+ const statusCode = conditionNode._setEnabledState(false);
820
+ return callback(null, {
821
+ statusCode
822
+ });
823
+ }
824
+ function _enable_method(inputArguments, context, callback) {
825
+ (0, node_opcua_assert_1.assert)(inputArguments.length === 0);
826
+ const conditionNode = context.object;
827
+ (0, node_opcua_assert_1.assert)(conditionNode);
828
+ if (!(conditionNode instanceof UAConditionBase)) {
829
+ return callback(null, {
830
+ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdInvalid
831
+ });
832
+ }
833
+ const statusCode = conditionNode._setEnabledState(true);
834
+ return callback(null, {
835
+ statusCode
836
+ });
837
+ }
838
+ function _condition_refresh_method(inputArguments, context, callback) {
839
+ // arguments : IntegerId SubscriptionId
840
+ (0, node_opcua_assert_1.assert)(inputArguments.length === 1);
841
+ const addressSpace = context.object.addressSpace;
842
+ if (doDebug) {
843
+ debugLog(chalk.red(" ConditionType.ConditionRefresh ! subscriptionId ="), inputArguments[0].toString());
844
+ }
845
+ const subscriptionId = inputArguments[0].value;
846
+ let statusCode = _check_subscription_id_is_valid(subscriptionId, context);
847
+ if (statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
848
+ return statusCode;
849
+ }
850
+ statusCode = _perform_condition_refresh(addressSpace, inputArguments, context);
851
+ return callback(null, {
852
+ statusCode
853
+ });
854
+ }
855
+ function _perform_condition_refresh(addressSpace, inputArguments, context) {
856
+ // --- possible StatusCodes:
857
+ //
858
+ // Bad_SubscriptionIdInvalid See Part 4 for the description of this result code
859
+ // Bad_RefreshInProgress See Table 74 for the description of this result code
860
+ // Bad_UserAccessDenied The Method was not called in the context of the Session
861
+ // that owns the Subscription
862
+ //
863
+ // istanbul ignore next
864
+ if (addressSpace._condition_refresh_in_progress) {
865
+ // a refresh operation is already in progress....
866
+ return node_opcua_status_code_1.StatusCodes.BadRefreshInProgress;
867
+ }
868
+ addressSpace._condition_refresh_in_progress = true;
869
+ const server = context.object.addressSpace.rootFolder.objects.server;
870
+ (0, node_opcua_assert_1.assert)(server instanceof ua_object_1.UAObject);
871
+ const refreshStartEventType = addressSpace.findEventType("RefreshStartEventType");
872
+ const refreshEndEventType = addressSpace.findEventType("RefreshEndEventType");
873
+ (0, node_opcua_assert_1.assert)(refreshStartEventType instanceof ua_object_type_1.UAObjectType);
874
+ (0, node_opcua_assert_1.assert)(refreshEndEventType instanceof ua_object_type_1.UAObjectType);
875
+ server.raiseEvent(refreshStartEventType, {});
876
+ // todo : resend retained conditions
877
+ // starting from server object ..
878
+ // evaluated all --> hasNotifier/hasEventSource -> node
879
+ server._conditionRefresh();
880
+ server.raiseEvent(refreshEndEventType, {});
881
+ addressSpace._condition_refresh_in_progress = false;
882
+ return node_opcua_status_code_1.StatusCodes.Good;
883
+ }
884
+ function _condition_refresh2_method(inputArguments, context, callback) {
885
+ // arguments : IntegerId SubscriptionId
886
+ // arguments : IntegerId MonitoredItemId
887
+ (0, node_opcua_assert_1.assert)(inputArguments.length === 2);
888
+ const addressSpace = context.object.addressSpace;
889
+ // istanbul ignore next
890
+ if (doDebug) {
891
+ debugLog(chalk.cyan.bgWhite(" ConditionType.conditionRefresh2 !"));
892
+ }
893
+ // xx var subscriptionId = inputArguments[0].value;
894
+ // xx var monitoredItemId = inputArguments[1].value;
895
+ const statusCode = _perform_condition_refresh(addressSpace, inputArguments, context);
896
+ return callback(null, {
897
+ statusCode
898
+ });
899
+ }
900
+ function _add_comment_method(inputArguments, context, callback) {
901
+ //
902
+ // The AddComment Method is used to apply a comment to a specific state of a Condition
903
+ // instance. Normally, the NodeId of the object instance as the ObjectId is passed to the Call
904
+ // Service. However, some Servers do not expose Condition instances in the IAddressSpace.
905
+ // Therefore all Servers shall also allow Clients to call the AddComment Method by specifying
906
+ // ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the
907
+ // ConditionType Node.
908
+ // Signature
909
+ // - EventId EventId identifying a particular Event Notification where a state was reported for a
910
+ // Condition.
911
+ // - Comment A localized text to be applied to the Condition.
912
+ //
913
+ // AlwaysGeneratesEvent AuditConditionCommentEventType
914
+ //
915
+ UAConditionBase.with_condition_method(inputArguments, context, callback, (conditionEventId, comment, branch, conditionNode) => {
916
+ (0, node_opcua_assert_1.assert)(inputArguments instanceof Array);
917
+ (0, node_opcua_assert_1.assert)(conditionEventId instanceof Buffer || conditionEventId === null);
918
+ (0, node_opcua_assert_1.assert)(branch instanceof condition_snapshot_1.ConditionSnapshot);
919
+ branch.setComment(comment);
920
+ const sourceName = "Method/AddComment";
921
+ conditionNode._raiseAuditConditionCommentEvent(sourceName, conditionEventId, comment);
922
+ // raise new event
923
+ conditionNode.raiseConditionEvent(branch, true);
924
+ /**
925
+ * raised when the branch has been added a comment
926
+ * @event addComment
927
+ * @param conditionEventId NodeId|null
928
+ * @param comment {LocalizedText}
929
+ * @param branch {ConditionSnapshot}
930
+ */
931
+ conditionNode.emit("addComment", conditionEventId, comment, branch);
932
+ return node_opcua_status_code_1.StatusCodes.Good;
933
+ });
934
+ }
935
+ function sameBuffer(b1, b2) {
936
+ if (!b1 && !b2) {
937
+ return true;
938
+ }
939
+ if (b1 && !b2) {
940
+ return false;
941
+ }
942
+ if (!b1 && b2) {
943
+ return false;
944
+ }
945
+ (0, node_opcua_assert_1.assert)(b1 instanceof Buffer);
946
+ (0, node_opcua_assert_1.assert)(b2 instanceof Buffer);
947
+ if (b1.length !== b2.length) {
948
+ return false;
949
+ }
950
+ /*
951
+ var bb1 = (Buffer.from(b1)).toString("hex");
952
+ var bb2 = (Buffer.from(b2)).toString("hex");
953
+ return bb1 === bb2;
954
+ */
955
+ const n = b1.length;
956
+ for (let i = 0; i < n; i++) {
957
+ if (b1[i] !== b2[i]) {
958
+ return false;
959
+ }
960
+ }
961
+ return true;
962
+ }
963
+ function _create_new_branch_id() {
964
+ return (0, node_opcua_nodeid_1.makeNodeId)((0, node_opcua_basic_types_1.randomGuid)(), 1);
965
+ }
966
+ function _update_sourceTimestamp(dataValue /*, indexRange*/) {
967
+ this.sourceTimestamp.setValueFromSource({
968
+ dataType: node_opcua_variant_1.DataType.DateTime,
969
+ value: dataValue.sourceTimestamp
970
+ });
971
+ }
972
+ // tslint:disable:no-console
973
+ function _install_condition_variable_type(node) {
974
+ (0, node_opcua_assert_1.assert)(node instanceof base_node_1.BaseNode);
975
+ // from spec 1.03 : 5.3 condition variables
976
+ // However, a change in their value is considered important and supposed to trigger
977
+ // an Event Notification. These information elements are called ConditionVariables.
978
+ if (node.sourceTimestamp) {
979
+ node.sourceTimestamp.accessLevel = (0, node_opcua_data_model_1.makeAccessLevelFlag)("CurrentRead");
980
+ }
981
+ else {
982
+ console.warn("cannot find node.sourceTimestamp", node.browseName.toString());
983
+ }
984
+ node.accessLevel = (0, node_opcua_data_model_1.makeAccessLevelFlag)("CurrentRead");
985
+ // from spec 1.03 : 5.3 condition variables
986
+ // a condition VariableType has a sourceTimeStamp exposed property
987
+ // SourceTimestamp indicates the time of the last change of the Value of this ConditionVariable.
988
+ // It shall be the same time that would be returned from the Read Service inside the DataValue
989
+ // structure for the ConditionVariable Value Attribute.
990
+ (0, node_opcua_assert_1.assert)(node.typeDefinitionObj.browseName.toString() === "ConditionVariableType");
991
+ (0, node_opcua_assert_1.assert)(node.sourceTimestamp.browseName.toString() === "SourceTimestamp");
992
+ node.on("value_changed", _update_sourceTimestamp);
993
+ }
994
+ /**
995
+ * @method _getCompositeKey
996
+ * @param node {BaseNode}
997
+ * @param key {String}
998
+ * @return {BaseNode}
999
+ * @private
1000
+ *
1001
+ * @example
1002
+ *
1003
+ * var node = _getComposite(node,"enabledState.id");
1004
+ *
1005
+ */
1006
+ function _getCompositeKey(node, key) {
1007
+ let cur = node;
1008
+ const elements = key.split(".");
1009
+ for (const e of elements) {
1010
+ // istanbul ignore next
1011
+ if (!cur.hasOwnProperty(e)) {
1012
+ throw new Error(" cannot extract '" + key + "' from " + node.browseName.toString());
1013
+ }
1014
+ cur = cur[e];
1015
+ }
1016
+ return cur;
1017
+ }
1018
+ /**
1019
+ * verify that the subscription id belongs to the session that make the call.
1020
+ * @method _check_subscription_id_is_valid
1021
+ * @param subscriptionId {Number}
1022
+ * @param context {Object}
1023
+ * @private
1024
+ */
1025
+ function _check_subscription_id_is_valid(subscriptionId, context) {
1026
+ /// todo: return StatusCodes.BadSubscriptionIdInvalid; if subscriptionId doesn't belong to session...
1027
+ return node_opcua_status_code_1.StatusCodes.Good;
1028
+ }
1029
+ //# sourceMappingURL=ua_condition_base.js.map