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.
- package/.mocharc.yml +12 -0
- package/LICENSE +20 -0
- package/dist/source/address_space_ts.d.ts +122 -0
- package/dist/source/address_space_ts.js +18 -0
- package/dist/source/address_space_ts.js.map +1 -0
- package/dist/source/continuation_points/continuation_point_manager.d.ts +21 -0
- package/dist/source/continuation_points/continuation_point_manager.js +100 -0
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -0
- package/dist/source/helpers/adjust_browse_direction.d.ts +5 -0
- package/dist/source/helpers/adjust_browse_direction.js +12 -0
- package/dist/source/helpers/adjust_browse_direction.js.map +1 -0
- package/dist/source/helpers/argument_list.d.ts +30 -0
- package/dist/source/helpers/argument_list.js +237 -0
- package/dist/source/helpers/argument_list.js.map +1 -0
- package/dist/source/helpers/call_helpers.d.ts +6 -0
- package/dist/source/helpers/call_helpers.js +71 -0
- package/dist/source/helpers/call_helpers.js.map +1 -0
- package/dist/source/helpers/check_event_clause.d.ts +17 -0
- package/dist/source/helpers/check_event_clause.js +53 -0
- package/dist/source/helpers/check_event_clause.js.map +1 -0
- package/dist/source/helpers/coerce_enum_value.d.ts +6 -0
- package/dist/source/helpers/coerce_enum_value.js +34 -0
- package/dist/source/helpers/coerce_enum_value.js.map +1 -0
- package/dist/source/helpers/dump_tools.d.ts +14 -0
- package/dist/source/helpers/dump_tools.js +79 -0
- package/dist/source/helpers/dump_tools.js.map +1 -0
- package/dist/source/helpers/ensure_secure_access.d.ts +9 -0
- package/dist/source/helpers/ensure_secure_access.js +90 -0
- package/dist/source/helpers/ensure_secure_access.js.map +1 -0
- package/dist/source/helpers/make_optionals_map.d.ts +21 -0
- package/dist/source/helpers/make_optionals_map.js +30 -0
- package/dist/source/helpers/make_optionals_map.js.map +1 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js +37 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -0
- package/dist/source/index.d.ts +39 -0
- package/dist/source/index.js +62 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +12 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +25 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +27 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +17 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +11 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +69 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +74 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/state_machine.d.ts +342 -0
- package/dist/source/interfaces/state_machine/state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +18 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +29 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +26 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +41 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js +3 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js.map +1 -0
- package/dist/source/interfaces/ua_authorisation_service.d.ts +1 -0
- package/dist/source/interfaces/ua_authorisation_service.js +3 -0
- package/dist/source/interfaces/ua_authorisation_service.js.map +1 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -0
- package/dist/source/loader/generateAddressSpaceRaw.js +59 -0
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -0
- package/dist/source/loader/load_nodeset2.d.ts +13 -0
- package/dist/source/loader/load_nodeset2.js +1392 -0
- package/dist/source/loader/load_nodeset2.js.map +1 -0
- package/dist/source/loader/namespace_post_step.d.ts +6 -0
- package/dist/source/loader/namespace_post_step.js +48 -0
- package/dist/source/loader/namespace_post_step.js.map +1 -0
- package/dist/source/loader/register_node_promoter.d.ts +3 -0
- package/dist/source/loader/register_node_promoter.js +10 -0
- package/dist/source/loader/register_node_promoter.js.map +1 -0
- package/dist/source/namespace.d.ts +6 -0
- package/dist/source/namespace.js +3 -0
- package/dist/source/namespace.js.map +1 -0
- package/dist/source/namespace_alarm_and_condition.d.ts +24 -0
- package/dist/source/namespace_alarm_and_condition.js +3 -0
- package/dist/source/namespace_alarm_and_condition.js.map +1 -0
- package/dist/source/namespace_data_access.d.ts +42 -0
- package/dist/source/namespace_data_access.js +3 -0
- package/dist/source/namespace_data_access.js.map +1 -0
- package/dist/source/namespace_machine_state.d.ts +7 -0
- package/dist/source/namespace_machine_state.js +3 -0
- package/dist/source/namespace_machine_state.js.map +1 -0
- package/dist/source/pseudo_session.d.ts +55 -0
- package/dist/source/pseudo_session.js +205 -0
- package/dist/source/pseudo_session.js.map +1 -0
- package/dist/source/session_context.d.ts +111 -0
- package/dist/source/session_context.js +266 -0
- package/dist/source/session_context.js.map +1 -0
- package/dist/source/set_namespace_meta_data.d.ts +2 -0
- package/dist/source/set_namespace_meta_data.js +60 -0
- package/dist/source/set_namespace_meta_data.js.map +1 -0
- package/dist/source/ua_namespace_meta_data_type.d.ts +71 -0
- package/dist/source/ua_namespace_meta_data_type.js +3 -0
- package/dist/source/ua_namespace_meta_data_type.js.map +1 -0
- package/dist/source/ua_root_folder.d.ts +9 -0
- package/dist/source/ua_root_folder.js +3 -0
- package/dist/source/ua_root_folder.js.map +1 -0
- package/dist/source/ua_two_state_variable_ex.d.ts +23 -0
- package/dist/source/ua_two_state_variable_ex.js +3 -0
- package/dist/source/ua_two_state_variable_ex.js.map +1 -0
- package/dist/source/xml_writer.d.ts +9 -0
- package/dist/source/xml_writer.js +3 -0
- package/dist/source/xml_writer.js.map +1 -0
- package/dist/src/address_space.d.ts +393 -0
- package/dist/src/address_space.js +1375 -0
- package/dist/src/address_space.js.map +1 -0
- package/dist/src/address_space_change_event_tools.d.ts +6 -0
- package/dist/src/address_space_change_event_tools.js +150 -0
- package/dist/src/address_space_change_event_tools.js.map +1 -0
- package/dist/src/address_space_private.d.ts +44 -0
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -0
- package/dist/src/alarms_and_conditions/base_event_type.d.ts +26 -0
- package/dist/src/alarms_and_conditions/base_event_type.js +41 -0
- package/dist/src/alarms_and_conditions/base_event_type.js.map +1 -0
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +4 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js +110 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition.d.ts +5 -0
- package/dist/src/alarms_and_conditions/condition.js +81 -0
- package/dist/src/alarms_and_conditions/condition.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_info.d.ts +27 -0
- package/dist/src/alarms_and_conditions/condition_info.js +55 -0
- package/dist/src/alarms_and_conditions/condition_info.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +232 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js +667 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +21 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +47 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +10 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js +90 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +1 -0
- package/dist/src/alarms_and_conditions/index.d.ts +18 -0
- package/dist/src/alarms_and_conditions/index.js +31 -0
- package/dist/src/alarms_and_conditions/index.js.map +1 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +22 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js +241 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +1 -0
- package/dist/src/alarms_and_conditions/trip_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js +21 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +54 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +255 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +62 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +138 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +460 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +118 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +417 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +29 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +39 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +35 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +32 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +21 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +26 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +191 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js +1029 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +182 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1021 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +11 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +17 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +24 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +59 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +57 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +14 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +17 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +9 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +12 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +22 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +38 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +6 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +11 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +76 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js +237 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +98 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +233 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +62 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +51 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +49 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +176 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +25 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +163 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +47 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +151 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +39 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +136 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/apply_condition_refresh.d.ts +6 -0
- package/dist/src/apply_condition_refresh.js +28 -0
- package/dist/src/apply_condition_refresh.js.map +1 -0
- package/dist/src/base_node.d.ts +279 -0
- package/dist/src/base_node.js +1364 -0
- package/dist/src/base_node.js.map +1 -0
- package/dist/src/base_node_impl.d.ts +281 -0
- package/dist/src/base_node_impl.js +1394 -0
- package/dist/src/base_node_impl.js.map +1 -0
- package/dist/src/base_node_private.d.ts +61 -0
- package/dist/src/base_node_private.js +521 -0
- package/dist/src/base_node_private.js.map +1 -0
- package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -0
- package/dist/src/data_access/add_dataItem_stuff.js +62 -0
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_analog_item.d.ts +13 -0
- package/dist/src/data_access/ua_analog_item.js +37 -0
- package/dist/src/data_access/ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_data_item.d.ts +16 -0
- package/dist/src/data_access/ua_data_item.js +66 -0
- package/dist/src/data_access/ua_data_item.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete.d.ts +23 -0
- package/dist/src/data_access/ua_multistate_discrete.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -0
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +51 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js +249 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/src/data_access/ua_two_state_discrete.d.ts +25 -0
- package/dist/src/data_access/ua_two_state_discrete.js +154 -0
- package/dist/src/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/src/event_data.d.ts +29 -0
- package/dist/src/event_data.js +96 -0
- package/dist/src/event_data.js.map +1 -0
- package/dist/src/extension_object_array_node.d.ts +61 -0
- package/dist/src/extension_object_array_node.js +266 -0
- package/dist/src/extension_object_array_node.js.map +1 -0
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -0
- package/dist/src/historical_access/address_space_historical_data_node.js +662 -0
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -0
- package/dist/src/index_current.d.ts +42 -0
- package/dist/src/index_current.js +71 -0
- package/dist/src/index_current.js.map +1 -0
- package/dist/src/namespace.d.ts +475 -0
- package/dist/src/namespace.js +1775 -0
- package/dist/src/namespace.js.map +1 -0
- package/dist/src/namespace_impl.d.ts +463 -0
- package/dist/src/namespace_impl.js +1763 -0
- package/dist/src/namespace_impl.js.map +1 -0
- package/dist/src/namespace_private.d.ts +21 -0
- package/dist/src/namespace_private.js +29 -0
- package/dist/src/namespace_private.js.map +1 -0
- package/dist/src/nodeid_manager.d.ts +36 -0
- package/dist/src/nodeid_manager.js +196 -0
- package/dist/src/nodeid_manager.js.map +1 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js +14 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +1 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +39 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js +147 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -0
- package/dist/src/reference.d.ts +43 -0
- package/dist/src/reference.js +138 -0
- package/dist/src/reference.js.map +1 -0
- package/dist/src/reference_impl.d.ts +43 -0
- package/dist/src/reference_impl.js +138 -0
- package/dist/src/reference_impl.js.map +1 -0
- package/dist/src/role_permissions.d.ts +2 -0
- package/dist/src/role_permissions.js +11 -0
- package/dist/src/role_permissions.js.map +1 -0
- package/dist/src/session_context.d.ts +4 -0
- package/dist/src/session_context.js +9 -0
- package/dist/src/session_context.js.map +1 -0
- package/dist/src/state_machine/finite_state_machine.d.ts +67 -0
- package/dist/src/state_machine/finite_state_machine.js +354 -0
- package/dist/src/state_machine/finite_state_machine.js.map +1 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +34 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +244 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
- package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -0
- package/dist/src/state_machine/ua_two_state_variable.js +332 -0
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/src/tool_isSupertypeOf.d.ts +17 -0
- package/dist/src/tool_isSupertypeOf.js +103 -0
- package/dist/src/tool_isSupertypeOf.js.map +1 -0
- package/dist/src/ua_condition_type.d.ts +8 -0
- package/dist/src/ua_condition_type.js +3 -0
- package/dist/src/ua_condition_type.js.map +1 -0
- package/dist/src/ua_data_type.d.ts +83 -0
- package/dist/src/ua_data_type.js +289 -0
- package/dist/src/ua_data_type.js.map +1 -0
- package/dist/src/ua_data_type_impl.d.ts +83 -0
- package/dist/src/ua_data_type_impl.js +291 -0
- package/dist/src/ua_data_type_impl.js.map +1 -0
- package/dist/src/ua_method.d.ts +42 -0
- package/dist/src/ua_method.js +204 -0
- package/dist/src/ua_method.js.map +1 -0
- package/dist/src/ua_method_impl.d.ts +40 -0
- package/dist/src/ua_method_impl.js +203 -0
- package/dist/src/ua_method_impl.js.map +1 -0
- package/dist/src/ua_object.d.ts +29 -0
- package/dist/src/ua_object.js +153 -0
- package/dist/src/ua_object.js.map +1 -0
- package/dist/src/ua_object_impl.d.ts +29 -0
- package/dist/src/ua_object_impl.js +156 -0
- package/dist/src/ua_object_impl.js.map +1 -0
- package/dist/src/ua_object_type.d.ts +49 -0
- package/dist/src/ua_object_type.js +124 -0
- package/dist/src/ua_object_type.js.map +1 -0
- package/dist/src/ua_object_type_impl.d.ts +48 -0
- package/dist/src/ua_object_type_impl.js +124 -0
- package/dist/src/ua_object_type_impl.js.map +1 -0
- package/dist/src/ua_reference_type.d.ts +42 -0
- package/dist/src/ua_reference_type.js +138 -0
- package/dist/src/ua_reference_type.js.map +1 -0
- package/dist/src/ua_reference_type_impl.d.ts +43 -0
- package/dist/src/ua_reference_type_impl.js +138 -0
- package/dist/src/ua_reference_type_impl.js.map +1 -0
- package/dist/src/ua_variable.d.ts +346 -0
- package/dist/src/ua_variable.js +1721 -0
- package/dist/src/ua_variable.js.map +1 -0
- package/dist/src/ua_variable_impl.d.ts +353 -0
- package/dist/src/ua_variable_impl.js +1719 -0
- package/dist/src/ua_variable_impl.js.map +1 -0
- package/dist/src/ua_variable_type.d.ts +54 -0
- package/dist/src/ua_variable_type.js +555 -0
- package/dist/src/ua_variable_type.js.map +1 -0
- package/dist/src/ua_variable_type_impl.d.ts +63 -0
- package/dist/src/ua_variable_type_impl.js +556 -0
- package/dist/src/ua_variable_type_impl.js.map +1 -0
- package/dist/src/ua_view.d.ts +16 -0
- package/dist/src/ua_view.js +42 -0
- package/dist/src/ua_view.js.map +1 -0
- package/dist/src/ua_view_impl.d.ts +15 -0
- package/dist/src/ua_view_impl.js +37 -0
- package/dist/src/ua_view_impl.js.map +1 -0
- package/distHelpers/add_event_generator_object.d.ts +3 -0
- package/distHelpers/add_event_generator_object.js +66 -0
- package/distHelpers/add_event_generator_object.js.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts +10 -0
- package/distHelpers/alarms_and_conditions_demo.js +115 -0
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -0
- package/distHelpers/assertHasMatchingReference.d.ts +19 -0
- package/distHelpers/assertHasMatchingReference.js +41 -0
- package/distHelpers/assertHasMatchingReference.js.map +1 -0
- package/distHelpers/boiler_system.d.ts +113 -0
- package/distHelpers/boiler_system.js +397 -0
- package/distHelpers/boiler_system.js.map +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js +171 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -0
- package/distHelpers/dump_statemachine.d.ts +6 -0
- package/distHelpers/dump_statemachine.js +116 -0
- package/distHelpers/dump_statemachine.js.map +1 -0
- package/distHelpers/get_address_space_fixture.d.ts +1 -0
- package/distHelpers/get_address_space_fixture.js +31 -0
- package/distHelpers/get_address_space_fixture.js.map +1 -0
- package/distHelpers/get_mini_address_space.d.ts +7 -0
- package/distHelpers/get_mini_address_space.js +37 -0
- package/distHelpers/get_mini_address_space.js.map +1 -0
- package/distHelpers/index.d.ts +11 -0
- package/distHelpers/index.js +24 -0
- package/distHelpers/index.js.map +1 -0
- package/distNodeJS/generate_address_space.d.ts +4 -0
- package/distNodeJS/generate_address_space.js +31 -0
- package/distNodeJS/generate_address_space.js.map +1 -0
- package/distNodeJS/index.d.ts +1 -0
- package/distNodeJS/index.js +14 -0
- package/distNodeJS/index.js.map +1 -0
- package/generate.js +1 -0
- package/nodeJS.d.ts +1 -0
- package/nodeJS.js +1 -0
- package/package.json +87 -0
- package/source/address_space_ts.ts +217 -0
- package/source/continuation_points/continuation_point_manager.ts +121 -0
- package/source/helpers/adjust_browse_direction.ts +15 -0
- package/source/helpers/argument_list.ts +286 -0
- package/source/helpers/call_helpers.ts +112 -0
- package/source/helpers/check_event_clause.ts +62 -0
- package/source/helpers/coerce_enum_value.ts +33 -0
- package/source/helpers/dump_tools.ts +92 -0
- package/source/helpers/ensure_secure_access.ts +88 -0
- package/source/helpers/make_optionals_map.ts +49 -0
- package/source/helpers/resolve_opaque_on_address_space.ts +23 -0
- package/source/index.ts +49 -0
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +13 -0
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +26 -0
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +34 -0
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +14 -0
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +10 -0
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +14 -0
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +13 -0
- package/source/interfaces/state_machine/ua_state_machine_type.ts +261 -0
- package/source/interfaces/state_machine/ua_transition_ex.ts +7 -0
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +8 -0
- package/source/loader/generateAddressSpaceRaw.ts +79 -0
- package/source/loader/load_nodeset2.ts +1600 -0
- package/source/loader/namespace_post_step.ts +36 -0
- package/source/loader/register_node_promoter.ts +8 -0
- package/source/namespace.ts +9 -0
- package/source/namespace_alarm_and_condition.ts +47 -0
- package/source/namespace_data_access.ts +60 -0
- package/source/namespace_machine_state.ts +13 -0
- package/source/pseudo_session.ts +288 -0
- package/source/session_context.ts +345 -0
- package/source/set_namespace_meta_data.ts +68 -0
- package/source/ua_root_folder.ts +10 -0
- package/source/ua_two_state_variable_ex.ts +35 -0
- package/source/xml_writer.ts +15 -0
- package/source_nodejs/generate_address_space.ts +36 -0
- package/source_nodejs/index.ts +1 -0
- package/src/address_space.ts +1575 -0
- package/src/address_space_change_event_tools.ts +177 -0
- package/src/address_space_private.ts +98 -0
- package/src/alarms_and_conditions/check_where_clause.ts +148 -0
- package/src/alarms_and_conditions/condition.ts +89 -0
- package/src/alarms_and_conditions/condition_info.ts +66 -0
- package/src/alarms_and_conditions/condition_snapshot.ts +766 -0
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +66 -0
- package/src/alarms_and_conditions/extract_event_fields.ts +104 -0
- package/src/alarms_and_conditions/index.ts +18 -0
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +339 -0
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +513 -0
- package/src/alarms_and_conditions/ua_base_event_impl.ts +55 -0
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +50 -0
- package/src/alarms_and_conditions/ua_condition_impl.ts +1298 -0
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +81 -0
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +110 -0
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +19 -0
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +130 -0
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +24 -0
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +305 -0
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +108 -0
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +224 -0
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +186 -0
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +27 -0
- package/src/apply_condition_refresh.ts +30 -0
- package/src/base_node_impl.ts +1749 -0
- package/src/base_node_private.ts +690 -0
- package/src/data_access/add_dataItem_stuff.ts +75 -0
- package/src/data_access/check_variant_compatibility_ua_analog_item.ts +41 -0
- package/src/data_access/ua_multistate_discrete_impl.ts +168 -0
- package/src/data_access/ua_multistate_value_discrete.ts +299 -0
- package/src/data_access/ua_two_state_discrete.ts +185 -0
- package/src/event_data.ts +117 -0
- package/src/extension_object_array_node.ts +325 -0
- package/src/historical_access/address_space_historical_data_node.ts +828 -0
- package/src/index_current.ts +52 -0
- package/src/namespace_impl.ts +2181 -0
- package/src/namespace_private.ts +60 -0
- package/src/nodeid_manager.ts +228 -0
- package/src/nodeset_tools/adjust_namespace_array.ts +11 -0
- package/src/nodeset_tools/construct_namespace_dependency.ts +40 -0
- package/src/nodeset_tools/nodeset_to_xml.ts +1317 -0
- package/src/nodeset_tools/typedictionary_to_xml.ts +175 -0
- package/src/reference_impl.ts +169 -0
- package/src/role_permissions.ts +6 -0
- package/src/state_machine/finite_state_machine.ts +428 -0
- package/src/state_machine/ua_shelving_state_machine_ex.ts +314 -0
- package/src/state_machine/ua_two_state_variable.ts +421 -0
- package/src/tool_isSupertypeOf.ts +129 -0
- package/src/ua_condition_type.ts +10 -0
- package/src/ua_data_type_impl.ts +356 -0
- package/src/ua_method_impl.ts +278 -0
- package/src/ua_object_impl.ts +203 -0
- package/src/ua_object_type_impl.ts +158 -0
- package/src/ua_reference_type_impl.ts +174 -0
- package/src/ua_variable_impl.ts +2277 -0
- package/src/ua_variable_type_impl.ts +741 -0
- package/src/ua_view_impl.ts +54 -0
- package/testHelpers.d.ts +1 -0
- package/testHelpers.js +1 -0
- package/test_helpers/add_event_generator_object.ts +71 -0
- package/test_helpers/alarms_and_conditions_demo.ts +147 -0
- package/test_helpers/assertHasMatchingReference.ts +43 -0
- package/test_helpers/boiler_system.ts +618 -0
- package/test_helpers/create_minimalist_address_space_nodeset.ts +208 -0
- package/test_helpers/dump_statemachine.ts +155 -0
- package/test_helpers/get_address_space_fixture.ts +30 -0
- package/test_helpers/get_mini_address_space.ts +42 -0
- package/test_helpers/index.ts +11 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +136 -0
- package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -0
- package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -0
- package/test_helpers/test_fixtures/dataType_with_structures.xml +605 -0
- package/test_helpers/test_fixtures/dataType_with_union.xml +1 -0
- package/test_helpers/test_fixtures/datatype_as_per_1.04.xml +91 -0
- package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -0
- package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -0
- package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -0
- package/test_helpers/test_fixtures/issue_846.xml +3172 -0
- package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +33 -0
- package/test_helpers/test_fixtures/mini.Node.Set2.xml +4508 -0
- package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -0
- package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-server
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
6
|
+
import { BrowseResultOptions, ReferenceDescription } from "node-opcua-types";
|
|
7
|
+
import { ContinuationPoint } from "node-opcua-address-space-base";
|
|
8
|
+
|
|
9
|
+
let counter = 0;
|
|
10
|
+
|
|
11
|
+
function make_key() {
|
|
12
|
+
// return crypto.randomBytes(32);
|
|
13
|
+
counter += 1;
|
|
14
|
+
return Buffer.from(counter.toString(), "ascii");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ContinuationPointInfo extends BrowseResultOptions {
|
|
18
|
+
continuationPoint?: ContinuationPoint;
|
|
19
|
+
references?: ReferenceDescription[];
|
|
20
|
+
statusCode: StatusCode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class ContinuationPointManager {
|
|
24
|
+
private readonly _map: any;
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
this._map = {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* returns true if the current number of active continuation point has reach the limit
|
|
32
|
+
* specified in maxBrowseContinuationPoint
|
|
33
|
+
* @param maxBrowseContinuationPoint
|
|
34
|
+
*/
|
|
35
|
+
public hasReachMaximum(maxBrowseContinuationPoint: number): boolean {
|
|
36
|
+
if (maxBrowseContinuationPoint === 0) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const nbContinuationPoints = Object.keys(this._map).length;
|
|
40
|
+
return nbContinuationPoints >= maxBrowseContinuationPoint;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public register(maxElements: number, values: ReferenceDescription[]): ContinuationPointInfo {
|
|
44
|
+
maxElements = maxElements || values.length;
|
|
45
|
+
if (maxElements >= values.length) {
|
|
46
|
+
return {
|
|
47
|
+
continuationPoint: undefined,
|
|
48
|
+
references: values,
|
|
49
|
+
statusCode: StatusCodes.Good
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const key = make_key();
|
|
54
|
+
const keyHash = key.toString("ascii");
|
|
55
|
+
|
|
56
|
+
// split the array in two ( values)
|
|
57
|
+
const current_block = values.splice(0, maxElements);
|
|
58
|
+
|
|
59
|
+
const result = {
|
|
60
|
+
continuationPoint: key,
|
|
61
|
+
references: current_block,
|
|
62
|
+
statusCode: StatusCodes.Good
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// create
|
|
66
|
+
const data = {
|
|
67
|
+
maxElements,
|
|
68
|
+
remainingElements: values
|
|
69
|
+
};
|
|
70
|
+
this._map[keyHash] = data;
|
|
71
|
+
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public getNext(continuationPoint: ContinuationPoint): ContinuationPointInfo {
|
|
76
|
+
if (!continuationPoint) {
|
|
77
|
+
return { statusCode: StatusCodes.BadContinuationPointInvalid };
|
|
78
|
+
}
|
|
79
|
+
const keyHash = continuationPoint.toString("ascii");
|
|
80
|
+
|
|
81
|
+
const data = this._map[keyHash];
|
|
82
|
+
if (!data) {
|
|
83
|
+
return { statusCode: StatusCodes.BadContinuationPointInvalid };
|
|
84
|
+
}
|
|
85
|
+
assert(data.maxElements > 0);
|
|
86
|
+
// split the array in two ( values)
|
|
87
|
+
const current_block = data.remainingElements.splice(0, data.maxElements);
|
|
88
|
+
|
|
89
|
+
const result = {
|
|
90
|
+
continuationPoint: data.remainingElements.length ? continuationPoint : undefined,
|
|
91
|
+
references: current_block,
|
|
92
|
+
statusCode: StatusCodes.Good
|
|
93
|
+
};
|
|
94
|
+
if (data.remainingElements.length === 0) {
|
|
95
|
+
// we are done
|
|
96
|
+
delete this._map[keyHash];
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public cancel(continuationPoint: ContinuationPoint): ContinuationPointInfo {
|
|
102
|
+
if (!continuationPoint) {
|
|
103
|
+
return { statusCode: StatusCodes.BadContinuationPointInvalid };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const keyHash = continuationPoint.toString("ascii");
|
|
107
|
+
|
|
108
|
+
const data = this._map[keyHash];
|
|
109
|
+
if (!data) {
|
|
110
|
+
return {
|
|
111
|
+
continuationPoint: undefined, // nullBuffer,
|
|
112
|
+
references: [],
|
|
113
|
+
statusCode: StatusCodes.BadContinuationPointInvalid
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
delete this._map[keyHash];
|
|
117
|
+
return {
|
|
118
|
+
statusCode: StatusCodes.Good
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import { BrowseDirection } from "node-opcua-data-model";
|
|
5
|
+
|
|
6
|
+
export function adjustBrowseDirection(
|
|
7
|
+
browseDirection: BrowseDirection | null | undefined,
|
|
8
|
+
defaultValue: BrowseDirection
|
|
9
|
+
):BrowseDirection {
|
|
10
|
+
// istanbul ignore next
|
|
11
|
+
if (browseDirection === null || browseDirection === undefined) {
|
|
12
|
+
return defaultValue;
|
|
13
|
+
}
|
|
14
|
+
return browseDirection;
|
|
15
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import * as ec from "node-opcua-basic-types";
|
|
6
|
+
import { BinaryStream, BinaryStreamSizeCalculator, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
7
|
+
import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
8
|
+
import * as factories from "node-opcua-factory";
|
|
9
|
+
import { NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
10
|
+
import { Argument } from "node-opcua-service-call";
|
|
11
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
12
|
+
import { Variant } from "node-opcua-variant";
|
|
13
|
+
import { DataType } from "node-opcua-variant";
|
|
14
|
+
import { VariantArrayType } from "node-opcua-variant";
|
|
15
|
+
|
|
16
|
+
import { NodeClass } from "node-opcua-data-model";
|
|
17
|
+
import { IAddressSpace, UAMethod, UAObject } from "node-opcua-address-space-base";
|
|
18
|
+
|
|
19
|
+
const debugLog = make_debugLog(__filename);
|
|
20
|
+
const warningLog = make_warningLog(__filename);
|
|
21
|
+
const doDebug = checkDebugFlag(__filename);
|
|
22
|
+
|
|
23
|
+
function myfindBuiltInType(dataType: DataType): any {
|
|
24
|
+
return factories.findBuiltInType(DataType[dataType]);
|
|
25
|
+
}
|
|
26
|
+
export interface ArgumentDef {
|
|
27
|
+
dataType: DataType
|
|
28
|
+
valueRank?: undefined | number;
|
|
29
|
+
}
|
|
30
|
+
export function encode_ArgumentList(definition: ArgumentDef[], args: any[], stream: OutputBinaryStream): void {
|
|
31
|
+
assert(definition.length === args.length);
|
|
32
|
+
|
|
33
|
+
assert(Array.isArray(definition));
|
|
34
|
+
assert(Array.isArray(args));
|
|
35
|
+
assert(definition.length === args.length);
|
|
36
|
+
assert(definition.length >= 0);
|
|
37
|
+
|
|
38
|
+
// we only encode arguments by following the definition
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < definition.length; i++) {
|
|
41
|
+
const def = definition[i];
|
|
42
|
+
const value = args[i];
|
|
43
|
+
|
|
44
|
+
const encodeFunc = myfindBuiltInType(def.dataType).encode;
|
|
45
|
+
// assert((def.valueRank === -1) || (def.valueRank === 0));
|
|
46
|
+
|
|
47
|
+
// todo : handle -3 -2
|
|
48
|
+
const isArray = def.valueRank && (def.valueRank === 1 || def.valueRank !== -1);
|
|
49
|
+
|
|
50
|
+
if (isArray) {
|
|
51
|
+
ec.encodeArray(value, stream, encodeFunc);
|
|
52
|
+
} else {
|
|
53
|
+
encodeFunc(value, stream);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function decode_ArgumentList(definition: ArgumentDef[], stream: BinaryStream): any[] {
|
|
59
|
+
if (!Array.isArray(definition)) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
"This BaseDataType cannot be decoded because it has no definition.\n" +
|
|
62
|
+
"Please construct a BaseDataType({definition : [{dataType: DataType.UInt32 }]});"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const args: any[] = [];
|
|
67
|
+
let value;
|
|
68
|
+
|
|
69
|
+
for (const def of definition) {
|
|
70
|
+
const decodeFunc = myfindBuiltInType(def.dataType).decode;
|
|
71
|
+
|
|
72
|
+
// xx assert(def.valueRank === -1 || def.valueRank==0);
|
|
73
|
+
const isArray = def.valueRank === 1 || def.valueRank === -1;
|
|
74
|
+
|
|
75
|
+
if (isArray) {
|
|
76
|
+
value = ec.decodeArray(stream, decodeFunc);
|
|
77
|
+
} else {
|
|
78
|
+
value = decodeFunc(stream);
|
|
79
|
+
}
|
|
80
|
+
args.push(value);
|
|
81
|
+
}
|
|
82
|
+
return args;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function binaryStoreSize_ArgumentList(description: ArgumentDef[], args: any[]): number {
|
|
86
|
+
assert(Array.isArray(description));
|
|
87
|
+
assert(Array.isArray(args));
|
|
88
|
+
assert(args.length === description.length);
|
|
89
|
+
|
|
90
|
+
const stream = new BinaryStreamSizeCalculator();
|
|
91
|
+
encode_ArgumentList(description, args, stream);
|
|
92
|
+
return stream.length;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function getMethodDeclaration_ArgumentList(
|
|
96
|
+
addressSpace: IAddressSpace,
|
|
97
|
+
objectId: NodeId,
|
|
98
|
+
methodId: NodeId
|
|
99
|
+
): { statusCode: StatusCode; methodDeclaration?: UAMethod } {
|
|
100
|
+
// find object in address space
|
|
101
|
+
const obj = addressSpace.findNode(objectId) as UAObject;
|
|
102
|
+
if (!obj) {
|
|
103
|
+
// istanbul ignore next
|
|
104
|
+
if (doDebug) {
|
|
105
|
+
debugLog("cannot find node ", objectId.toString());
|
|
106
|
+
}
|
|
107
|
+
return { statusCode: StatusCodes.BadNodeIdUnknown };
|
|
108
|
+
}
|
|
109
|
+
let objectMethod = obj.getMethodById(methodId) as UAMethod;
|
|
110
|
+
if (!objectMethod) {
|
|
111
|
+
// the method doesn't belong to the object, nevertheless
|
|
112
|
+
// the method can be called
|
|
113
|
+
objectMethod = addressSpace.findNode(methodId) as UAMethod;
|
|
114
|
+
if (!objectMethod || objectMethod.nodeClass !== NodeClass.Method) {
|
|
115
|
+
warningLog("cannot find method with id", methodId.toString(), "object Id = ", objectId.toString());
|
|
116
|
+
return { statusCode: StatusCodes.BadMethodInvalid };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const methodDeclarationId = objectMethod.methodDeclarationId;
|
|
121
|
+
const methodDeclaration = addressSpace.findNode(methodDeclarationId) as UAMethod;
|
|
122
|
+
if (!methodDeclaration) {
|
|
123
|
+
// return {statusCode: StatusCodes.BadMethodInvalid};
|
|
124
|
+
return { statusCode: StatusCodes.Good, methodDeclaration: objectMethod };
|
|
125
|
+
}
|
|
126
|
+
// istanbul ignore next
|
|
127
|
+
if (methodDeclaration.nodeClass !== NodeClass.Method) {
|
|
128
|
+
throw new Error("Expecting a Method here");
|
|
129
|
+
}
|
|
130
|
+
return { statusCode: StatusCodes.Good, methodDeclaration };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @private
|
|
135
|
+
*/
|
|
136
|
+
function isArgumentValid(addressSpace: IAddressSpace, argDefinition: Argument, arg: Variant): boolean {
|
|
137
|
+
assert(Object.prototype.hasOwnProperty.call(argDefinition, "dataType"));
|
|
138
|
+
assert(Object.prototype.hasOwnProperty.call(argDefinition, "valueRank"));
|
|
139
|
+
|
|
140
|
+
const argDefDataType = addressSpace.findDataType(argDefinition.dataType);
|
|
141
|
+
const argDataType = addressSpace.findDataType(resolveNodeId(arg.dataType));
|
|
142
|
+
|
|
143
|
+
// istanbul ignore next
|
|
144
|
+
if (!argDefDataType) {
|
|
145
|
+
debugLog("dataType ", argDefinition.dataType.toString(), "doesn't exist");
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (argDefinition.valueRank > 0 && arg.dataType === DataType.Null) {
|
|
150
|
+
// this is valid to receive an empty array ith DataType.Null;
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// istanbul ignore next
|
|
155
|
+
if (!argDataType) {
|
|
156
|
+
debugLog(" cannot find dataType ", arg.dataType, resolveNodeId(arg.dataType));
|
|
157
|
+
debugLog(" arg = ", arg.toString());
|
|
158
|
+
debugLog(" def =", argDefinition.toString());
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// istanbul ignore next
|
|
163
|
+
if (doDebug) {
|
|
164
|
+
debugLog(" checking argDefDataType ", argDefDataType.toString());
|
|
165
|
+
debugLog(" checking argDataType ", argDataType.toString());
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const isArray = arg.arrayType === VariantArrayType.Array;
|
|
169
|
+
|
|
170
|
+
if (argDefinition.valueRank > 0) {
|
|
171
|
+
return isArray;
|
|
172
|
+
} else if (argDefinition.valueRank === -1) {
|
|
173
|
+
// SCALAR
|
|
174
|
+
if (isArray) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (argDataType.nodeId.value === argDefDataType!.nodeId.value) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// check that dataType is of the same type (derived )
|
|
184
|
+
return argDefDataType.isSupertypeOf(argDataType);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @method verifyArguments_ArgumentList
|
|
189
|
+
* @param addressSpace
|
|
190
|
+
* @param methodInputArguments
|
|
191
|
+
* @param inputArguments
|
|
192
|
+
* @return statusCode,inputArgumentResults
|
|
193
|
+
*/
|
|
194
|
+
export function verifyArguments_ArgumentList(
|
|
195
|
+
addressSpace: IAddressSpace,
|
|
196
|
+
methodInputArguments: Argument[],
|
|
197
|
+
inputArguments?: Variant[]
|
|
198
|
+
): {
|
|
199
|
+
inputArgumentResults?: StatusCode[];
|
|
200
|
+
statusCode: StatusCode;
|
|
201
|
+
} {
|
|
202
|
+
if (!inputArguments) {
|
|
203
|
+
// it is possible to not provide inputArguments when method has no arguments
|
|
204
|
+
return methodInputArguments.length === 0
|
|
205
|
+
? { statusCode: StatusCodes.Good }
|
|
206
|
+
: { statusCode: StatusCodes.BadArgumentsMissing };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const inputArgumentResults: StatusCode[] = methodInputArguments.map((methodInputArgument, index) => {
|
|
210
|
+
const argument = inputArguments![index];
|
|
211
|
+
if (!argument) {
|
|
212
|
+
return StatusCodes.BadNoData;
|
|
213
|
+
} else if (!isArgumentValid(addressSpace, methodInputArgument, argument)) {
|
|
214
|
+
return StatusCodes.BadTypeMismatch;
|
|
215
|
+
} else {
|
|
216
|
+
return StatusCodes.Good;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
if (methodInputArguments.length > inputArguments.length) {
|
|
221
|
+
// istanbul ignore next
|
|
222
|
+
if (doDebug) {
|
|
223
|
+
debugLog(
|
|
224
|
+
"verifyArguments_ArgumentList " +
|
|
225
|
+
"\n The client did specify too many input arguments for the method. " +
|
|
226
|
+
"\n expected : " +
|
|
227
|
+
methodInputArguments.length +
|
|
228
|
+
"" +
|
|
229
|
+
"\n actual : " +
|
|
230
|
+
inputArguments.length
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
return { inputArgumentResults, statusCode: StatusCodes.BadArgumentsMissing };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (methodInputArguments.length < inputArguments.length) {
|
|
237
|
+
// istanbul ignore next
|
|
238
|
+
if (doDebug) {
|
|
239
|
+
debugLog(
|
|
240
|
+
" verifyArguments_ArgumentList " +
|
|
241
|
+
"\n The client did not specify all of the input arguments for the method. " +
|
|
242
|
+
"\n expected : " +
|
|
243
|
+
methodInputArguments.length +
|
|
244
|
+
"" +
|
|
245
|
+
"\n actual : " +
|
|
246
|
+
inputArguments.length
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
return { inputArgumentResults, statusCode: StatusCodes.BadTooManyArguments };
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return {
|
|
253
|
+
inputArgumentResults,
|
|
254
|
+
statusCode:
|
|
255
|
+
inputArgumentResults.includes(StatusCodes.BadTypeMismatch) || inputArgumentResults.includes(StatusCodes.BadOutOfRange)
|
|
256
|
+
? StatusCodes.BadInvalidArgument
|
|
257
|
+
: StatusCodes.Good
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function build_retrieveInputArgumentsDefinition(
|
|
262
|
+
addressSpace: IAddressSpace
|
|
263
|
+
): (objectId: NodeId, methodId: NodeId) => Argument[] {
|
|
264
|
+
const the_address_space = addressSpace;
|
|
265
|
+
return (objectId: NodeId, methodId: NodeId) => {
|
|
266
|
+
const response = getMethodDeclaration_ArgumentList(the_address_space, objectId, methodId);
|
|
267
|
+
|
|
268
|
+
/* istanbul ignore next */
|
|
269
|
+
if (response.statusCode !== StatusCodes.Good) {
|
|
270
|
+
debugLog(" StatusCode = " + response.statusCode.toString());
|
|
271
|
+
throw new Error(
|
|
272
|
+
"Invalid Method " +
|
|
273
|
+
response.statusCode.toString() +
|
|
274
|
+
" ObjectId= " +
|
|
275
|
+
objectId.toString() +
|
|
276
|
+
"Method Id =" +
|
|
277
|
+
methodId.toString()
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
const methodDeclaration = response.methodDeclaration!;
|
|
281
|
+
// verify input Parameters
|
|
282
|
+
const methodInputArguments = methodDeclaration.getInputArguments();
|
|
283
|
+
assert(Array.isArray(methodInputArguments));
|
|
284
|
+
return methodInputArguments;
|
|
285
|
+
};
|
|
286
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { NodeClass } from "node-opcua-data-model";
|
|
6
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
7
|
+
import { CallMethodRequest } from "node-opcua-service-call";
|
|
8
|
+
import { StatusCodes } from "node-opcua-status-code";
|
|
9
|
+
import { CallMethodResultOptions } from "node-opcua-types";
|
|
10
|
+
import { Variant } from "node-opcua-variant";
|
|
11
|
+
import { ISessionContext, IAddressSpace, UAMethod, UAObject } from "node-opcua-address-space-base";
|
|
12
|
+
|
|
13
|
+
import { getMethodDeclaration_ArgumentList, verifyArguments_ArgumentList } from "./argument_list";
|
|
14
|
+
import { resolveOpaqueOnAddressSpace } from "./resolve_opaque_on_address_space";
|
|
15
|
+
|
|
16
|
+
// Symbolic Id Description
|
|
17
|
+
// ---------------------------- -----------------------------------------------------------------------------
|
|
18
|
+
// BadNodeIdInvalid Used to indicate that the specified object is not valid.
|
|
19
|
+
//
|
|
20
|
+
// BadNodeIdUnknown Used to indicate that the specified object is not valid.
|
|
21
|
+
//
|
|
22
|
+
// BadArgumentsMissing The client did not specify all of the input arguments for the method.
|
|
23
|
+
// BadUserAccessDenied
|
|
24
|
+
//
|
|
25
|
+
// BadMethodInvalid The method id does not refer to a method for the specified object.
|
|
26
|
+
// BadOutOfRange Used to indicate that an input argument is outside the acceptable range.
|
|
27
|
+
// BadTypeMismatch Used to indicate that an input argument does not have the correct data type.
|
|
28
|
+
// A ByteString is structurally the same as a one dimensional array of Byte.
|
|
29
|
+
// A server shall accept a ByteString if an array of Byte is expected.
|
|
30
|
+
// BadNoCommunication
|
|
31
|
+
type ResponseCallback<T> = (err: Error | null, result?: T) => void;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export function callMethodHelper(
|
|
35
|
+
context: ISessionContext,
|
|
36
|
+
addressSpace: IAddressSpace,
|
|
37
|
+
callMethodRequest: CallMethodRequest,
|
|
38
|
+
callback: ResponseCallback<CallMethodResultOptions>
|
|
39
|
+
): void {
|
|
40
|
+
const objectId = callMethodRequest.objectId;
|
|
41
|
+
const methodId = callMethodRequest.methodId;
|
|
42
|
+
const inputArguments = callMethodRequest.inputArguments || [];
|
|
43
|
+
|
|
44
|
+
assert(objectId instanceof NodeId);
|
|
45
|
+
assert(methodId instanceof NodeId);
|
|
46
|
+
|
|
47
|
+
const object = addressSpace.findNode(objectId) as UAObject;
|
|
48
|
+
if (!object) {
|
|
49
|
+
return callback(null, { statusCode: StatusCodes.BadNodeIdUnknown });
|
|
50
|
+
}
|
|
51
|
+
if (object.nodeClass !== NodeClass.Object && object.nodeClass !== NodeClass.ObjectType) {
|
|
52
|
+
return callback(null, { statusCode: StatusCodes.BadNodeIdInvalid });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const methodObj = addressSpace.findNode(methodId) as UAMethod;
|
|
56
|
+
if (!methodObj) {
|
|
57
|
+
return callback(null, { statusCode: StatusCodes.BadNodeIdUnknown });
|
|
58
|
+
}
|
|
59
|
+
if (methodObj.nodeClass !== NodeClass.Method) {
|
|
60
|
+
return callback(null, { statusCode: StatusCodes.BadNodeIdInvalid });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const response1 = getMethodDeclaration_ArgumentList(addressSpace, objectId, methodId);
|
|
64
|
+
|
|
65
|
+
if (response1.statusCode !== StatusCodes.Good) {
|
|
66
|
+
return callback(null, { statusCode: response1.statusCode });
|
|
67
|
+
}
|
|
68
|
+
const methodDeclaration = response1.methodDeclaration!;
|
|
69
|
+
|
|
70
|
+
// verify input Parameters
|
|
71
|
+
const methodInputArguments = methodDeclaration.getInputArguments();
|
|
72
|
+
|
|
73
|
+
const response = verifyArguments_ArgumentList(addressSpace, methodInputArguments, inputArguments);
|
|
74
|
+
if (response.statusCode !== StatusCodes.Good) {
|
|
75
|
+
return callback(null, response);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
resolveOpaqueOnAddressSpace(addressSpace, inputArguments)
|
|
79
|
+
.then(() => {
|
|
80
|
+
methodObj.execute(
|
|
81
|
+
object,
|
|
82
|
+
inputArguments,
|
|
83
|
+
context,
|
|
84
|
+
(err: Error | null, callMethodResponse?: CallMethodResultOptions) => {
|
|
85
|
+
/* istanbul ignore next */
|
|
86
|
+
if (err) {
|
|
87
|
+
return callback(err);
|
|
88
|
+
}
|
|
89
|
+
if (!callMethodResponse) {
|
|
90
|
+
return callback(new Error("internal Error"));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
callMethodResponse.inputArgumentResults =
|
|
94
|
+
callMethodResponse.inputArgumentResults || response.inputArgumentResults || [];
|
|
95
|
+
assert(callMethodResponse.statusCode);
|
|
96
|
+
|
|
97
|
+
if (callMethodResponse.statusCode === StatusCodes.Good) {
|
|
98
|
+
assert(Array.isArray(callMethodResponse.outputArguments));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
assert(Array.isArray(callMethodResponse.inputArgumentResults));
|
|
102
|
+
assert(callMethodResponse.inputArgumentResults!.length === methodInputArguments.length);
|
|
103
|
+
|
|
104
|
+
const outputArguments = callMethodResponse.outputArguments || [];
|
|
105
|
+
resolveOpaqueOnAddressSpace(addressSpace, outputArguments as Variant[])
|
|
106
|
+
.then(() => callback(null, callMethodResponse))
|
|
107
|
+
.catch(callback);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
})
|
|
111
|
+
.catch((err) => callback(err));
|
|
112
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
// tslint:disable:no-console
|
|
5
|
+
import { NodeClass } from "node-opcua-data-model";
|
|
6
|
+
import { SimpleAttributeOperand } from "node-opcua-service-filter";
|
|
7
|
+
import { constructBrowsePathFromQualifiedName } from "node-opcua-service-translate-browse-path";
|
|
8
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
9
|
+
import { BaseNode, UAObjectType } from "node-opcua-address-space-base";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @method checkSelectClause
|
|
13
|
+
* @param parentNode
|
|
14
|
+
* @param selectClause
|
|
15
|
+
* @return {Array<StatusCode>}
|
|
16
|
+
*/
|
|
17
|
+
export function checkSelectClause(
|
|
18
|
+
parentNode: BaseNode,
|
|
19
|
+
selectClause: SimpleAttributeOperand
|
|
20
|
+
): StatusCode {
|
|
21
|
+
//
|
|
22
|
+
const addressSpace = parentNode.addressSpace;
|
|
23
|
+
|
|
24
|
+
// istanbul ignore next
|
|
25
|
+
if (selectClause.typeDefinitionId.isEmpty()) {
|
|
26
|
+
return StatusCodes.Good;
|
|
27
|
+
}
|
|
28
|
+
const eventTypeNode = addressSpace.findEventType(selectClause.typeDefinitionId)!;
|
|
29
|
+
|
|
30
|
+
if (!eventTypeNode || !(eventTypeNode.nodeClass === NodeClass.ObjectType)) {
|
|
31
|
+
// xx console.log("eventTypeNode = ",selectClause.typeDefinitionId.toString());
|
|
32
|
+
// xx console.log("eventTypeNode = ",eventTypeNode);
|
|
33
|
+
// istanbul ignore next
|
|
34
|
+
if (eventTypeNode) {
|
|
35
|
+
console.log(eventTypeNode.toString());
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// istanbul ignore next
|
|
40
|
+
if (eventTypeNode.nodeClass !== NodeClass.ObjectType) {
|
|
41
|
+
throw new Error("Expecting a ObjectType");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// navigate to the innerNode specified by the browsePath [ QualifiedName]
|
|
45
|
+
const browsePath = constructBrowsePathFromQualifiedName(eventTypeNode, selectClause.browsePath);
|
|
46
|
+
const browsePathResult = addressSpace.browsePath(browsePath);
|
|
47
|
+
return browsePathResult.statusCode;
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @method checkSelectClauses
|
|
53
|
+
* @param eventTypeNode
|
|
54
|
+
* @param selectClauses
|
|
55
|
+
* @return an array of StatusCode
|
|
56
|
+
*/
|
|
57
|
+
export function checkSelectClauses(
|
|
58
|
+
eventTypeNode: UAObjectType,
|
|
59
|
+
selectClauses: SimpleAttributeOperand[]
|
|
60
|
+
): StatusCode[] {
|
|
61
|
+
return selectClauses.map(checkSelectClause.bind(null, eventTypeNode));
|
|
62
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { Int64 } from "node-opcua-basic-types";
|
|
6
|
+
import { coerceLocalizedText } from "node-opcua-data-model";
|
|
7
|
+
import { EnumValueType } from "node-opcua-types";
|
|
8
|
+
import { EnumValueTypeOptionsLike } from "../address_space_ts";
|
|
9
|
+
|
|
10
|
+
export function coerceEnumValues(enumValues: EnumValueTypeOptionsLike[] | { [key: string]: number| Int64 }): EnumValueType[] {
|
|
11
|
+
if (Array.isArray(enumValues)) {
|
|
12
|
+
//
|
|
13
|
+
return enumValues.map((en: any) => {
|
|
14
|
+
assert(Object.prototype.hasOwnProperty.call(en,"value"));
|
|
15
|
+
assert(Object.prototype.hasOwnProperty.call(en,"displayName"));
|
|
16
|
+
return new EnumValueType({
|
|
17
|
+
displayName: coerceLocalizedText(en.displayName),
|
|
18
|
+
value: en.value
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
return coerceEnumValues(
|
|
23
|
+
Object.entries(enumValues as { [key: string]: Int64 }).map((entrie: [string, Int64]) => {
|
|
24
|
+
const [key, value] = entrie;
|
|
25
|
+
return new EnumValueType({
|
|
26
|
+
description: coerceLocalizedText(key),
|
|
27
|
+
displayName: coerceLocalizedText(key),
|
|
28
|
+
value
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|