node-opcua-address-space 2.169.0 → 2.172.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/dist/source/address_space_ts.d.ts +13 -13
- package/dist/source/address_space_ts.js +4 -0
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/continuation_points/continuation_point_manager.d.ts +6 -3
- package/dist/source/continuation_points/continuation_point_manager.js +4 -4
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/source/helpers/adjust_browse_direction.d.ts +1 -1
- package/dist/source/helpers/argument_list.d.ts +13 -11
- package/dist/source/helpers/argument_list.js +24 -15
- package/dist/source/helpers/argument_list.js.map +1 -1
- package/dist/source/helpers/call_helpers.d.ts +6 -3
- package/dist/source/helpers/call_helpers.js +5 -6
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +2 -2
- package/dist/source/helpers/coerce_enum_value.js +2 -2
- package/dist/source/helpers/coerce_enum_value.js.map +1 -1
- package/dist/source/helpers/dump_tools.d.ts +3 -3
- package/dist/source/helpers/dump_tools.js +2 -2
- package/dist/source/helpers/dump_tools.js.map +1 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +1 -1
- package/dist/source/helpers/ensure_secure_access.js +1 -1
- package/dist/source/helpers/ensure_secure_access.js.map +1 -1
- package/dist/source/helpers/make_optionals_map.js +0 -5
- package/dist/source/helpers/make_optionals_map.js.map +1 -1
- package/dist/source/helpers/multiform_func.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -1
- package/dist/source/index.d.ts +38 -38
- package/dist/source/index.js +53 -54
- package/dist/source/index.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +6 -6
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +4 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +10 -13
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +11 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +21 -29
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +3 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +8 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +4 -6
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +7 -7
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +5 -8
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +5 -5
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +3 -3
- package/dist/source/interfaces/extension_object_constructor.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +2 -2
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +6 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +7 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +4 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +4 -4
- package/dist/source/loader/decode_xml_extension_object.js +3 -3
- package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.d.ts +2 -2
- package/dist/source/loader/ensure_datatype_extracted.js +5 -5
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +3 -3
- package/dist/source/loader/generateAddressSpaceRaw.js +6 -6
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +2 -2
- package/dist/source/loader/make_xml_extension_object_parser.js +19 -19
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.d.ts +1 -1
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/loader/parsers/extension_object_parser.d.ts +4 -4
- package/dist/source/loader/parsers/extension_object_parser.js +22 -23
- package/dist/source/loader/parsers/extension_object_parser.js.map +1 -1
- package/dist/source/loader/parsers/localized_text_parser.d.ts +2 -2
- package/dist/source/loader/parsers/localized_text_parser.js.map +1 -1
- package/dist/source/loader/parsers/nodeid_parser.d.ts +1 -1
- package/dist/source/loader/parsers/nodeid_parser.js.map +1 -1
- package/dist/source/loader/parsers/qualified_name_parser.d.ts +3 -3
- package/dist/source/loader/parsers/qualified_name_parser.js.map +1 -1
- package/dist/source/loader/parsers/variant_parser.d.ts +5 -5
- package/dist/source/loader/parsers/variant_parser.js +13 -13
- package/dist/source/loader/parsers/variant_parser.js.map +1 -1
- package/dist/source/loader/register_node_promoter.d.ts +1 -1
- package/dist/source/loader/register_node_promoter.js.map +1 -1
- package/dist/source/namespace.d.ts +4 -4
- package/dist/source/namespace_alarm_and_condition.d.ts +22 -21
- package/dist/source/namespace_data_access.d.ts +11 -11
- package/dist/source/namespace_machine_state.d.ts +4 -4
- package/dist/source/pseudo_session.d.ts +8 -5
- package/dist/source/pseudo_session.js +28 -28
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.js +1 -1
- package/dist/source/session_context.js.map +1 -1
- package/dist/source/set_namespace_meta_data.d.ts +1 -1
- package/dist/source/set_namespace_meta_data.js +1 -1
- package/dist/source/set_namespace_meta_data.js.map +1 -1
- package/dist/source/ua_addin.d.ts +3 -3
- package/dist/source/ua_addin.js +1 -1
- package/dist/source/ua_addin.js.map +1 -1
- package/dist/source/ua_interface.d.ts +2 -3
- package/dist/source/ua_interface.js +13 -33
- package/dist/source/ua_interface.js.map +1 -1
- package/dist/source/ua_root_folder.d.ts +1 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +5 -5
- package/dist/src/_instantiate_helpers.d.ts +1 -1
- package/dist/src/_instantiate_helpers.js +32 -9
- package/dist/src/_instantiate_helpers.js.map +1 -1
- package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +2 -2
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +9 -10
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/src/address_space.d.ts +2 -2
- package/dist/src/address_space.js +13 -15
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_change_event_tools.d.ts +3 -3
- package/dist/src/address_space_change_event_tools.js +8 -10
- package/dist/src/address_space_change_event_tools.js.map +1 -1
- package/dist/src/address_space_private.d.ts +11 -11
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +6 -6
- package/dist/src/alarms_and_conditions/condition_info_impl.js +6 -15
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +10 -10
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +77 -48
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +8 -5
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +15 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/index.d.ts +3 -3
- package/dist/src/alarms_and_conditions/index.js +3 -3
- package/dist/src/alarms_and_conditions/index.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +21 -14
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +26 -21
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +6 -7
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +30 -28
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +9 -11
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +10 -10
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +3 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +6 -5
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +16 -42
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +100 -82
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +12 -7
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +9 -8
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +18 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +16 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +2 -2
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +10 -9
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +20 -19
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +2 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +12 -38
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +50 -65
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +15 -17
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +15 -11
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +22 -15
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +35 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +15 -16
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +19 -14
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/apply_condition_refresh.d.ts +4 -4
- package/dist/src/apply_condition_refresh.js +1 -1
- package/dist/src/apply_condition_refresh.js.map +1 -1
- package/dist/src/base_node_impl.d.ts +5 -7
- package/dist/src/base_node_impl.js +3 -3
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.d.ts +10 -7
- package/dist/src/base_node_private.js +73 -50
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/check_value_rank_compatibility.js +11 -7
- package/dist/src/check_value_rank_compatibility.js.map +1 -1
- package/dist/src/data_access/add_dataItem_stuff.d.ts +1 -1
- package/dist/src/data_access/add_dataItem_stuff.js +2 -22
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -1
- package/dist/src/data_access/adjust_datavalue_status_code.d.ts +6 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js +3 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js.map +1 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +13 -11
- package/dist/src/data_access/ua_multistate_discrete_impl.js +28 -23
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +19 -23
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +31 -31
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +10 -16
- package/dist/src/data_access/ua_two_state_discrete_impl.js +18 -14
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +1 -1
- package/dist/src/event_data.d.ts +8 -21
- package/dist/src/event_data.js +24 -19
- package/dist/src/event_data.js.map +1 -1
- package/dist/src/extension_object_array_node.d.ts +5 -2
- package/dist/src/extension_object_array_node.js +21 -24
- package/dist/src/extension_object_array_node.js.map +1 -1
- package/dist/src/get_basic_datatype.d.ts +2 -2
- package/dist/src/get_basic_datatype.js.map +1 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +3 -3
- package/dist/src/historical_access/address_space_historical_data_node.js +24 -17
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/idx_iterator.js +1 -1
- package/dist/src/idx_iterator.js.map +1 -1
- package/dist/src/index_current.d.ts +31 -31
- package/dist/src/index_current.js +45 -45
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +4 -3
- package/dist/src/namespace_impl.js +17 -14
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +3 -3
- package/dist/src/nodeid_manager.js +19 -16
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +1 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -2
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +7 -7
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js +15 -11
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +5 -3
- package/dist/src/nodeset_tools/nodeset_to_xml.js +64 -67
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/private_namespace.d.ts +2 -2
- package/dist/src/private_namespace.js.map +1 -1
- package/dist/src/reference_impl.d.ts +2 -2
- package/dist/src/reference_impl.js +9 -11
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/role_permissions.d.ts +1 -1
- package/dist/src/role_permissions.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +11 -14
- package/dist/src/state_machine/finite_state_machine.js +36 -30
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +8 -6
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +16 -18
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +12 -11
- package/dist/src/state_machine/ua_two_state_variable.js +24 -29
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSubtypeOf.d.ts +5 -5
- package/dist/src/tool_isSubtypeOf.js +21 -18
- package/dist/src/tool_isSubtypeOf.js.map +1 -1
- package/dist/src/ua_condition_type.d.ts +1 -1
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.d.ts +9 -5
- package/dist/src/ua_method_impl.js +1 -1
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.d.ts +10 -7
- package/dist/src/ua_object_impl.js +43 -15
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.d.ts +7 -5
- package/dist/src/ua_object_type_impl.js +6 -7
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +6 -8
- package/dist/src/ua_reference_type_impl.js +16 -14
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +44 -45
- package/dist/src/ua_variable_impl.js +177 -83
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +3 -3
- package/dist/src/ua_variable_impl_ext_obj.js +37 -29
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/src/ua_variable_type_impl.d.ts +11 -11
- package/dist/src/ua_variable_type_impl.js +13 -21
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/src/ua_view_impl.d.ts +3 -4
- package/dist/src/ua_view_impl.js +5 -6
- package/dist/src/ua_view_impl.js.map +1 -1
- package/dist/src/validate_data_type_correctness.d.ts +2 -2
- package/dist/src/validate_data_type_correctness.js +12 -3
- package/dist/src/validate_data_type_correctness.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/add_event_generator_object.d.ts +5 -2
- package/distHelpers/add_event_generator_object.js +2 -2
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
- package/distHelpers/alarms_and_conditions_demo.js +4 -6
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- package/distHelpers/assertHasMatchingReference.d.ts +1 -1
- package/distHelpers/assertHasMatchingReference.js +2 -2
- package/distHelpers/assertHasMatchingReference.js.map +1 -1
- package/distHelpers/boiler_system.d.ts +6 -3
- package/distHelpers/boiler_system.js +44 -42
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.js +25 -27
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/distHelpers/get_address_space_fixture.js +15 -15
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/distHelpers/index.d.ts +2 -2
- package/distHelpers/index.js +2 -2
- package/distHelpers/index.js.map +1 -1
- package/distHelpers/mock_session.d.ts +7 -7
- package/distHelpers/mock_session.js +4 -4
- package/distHelpers/mock_session.js.map +1 -1
- package/distNodeJS/generate_address_space.d.ts +2 -2
- package/distNodeJS/generate_address_space.js +2 -2
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/package.json +36 -36
- package/source/address_space_ts.ts +29 -30
- package/source/continuation_points/continuation_point_manager.ts +8 -7
- package/source/helpers/adjust_browse_direction.ts +1 -1
- package/source/helpers/argument_list.ts +37 -25
- package/source/helpers/call_helpers.ts +10 -15
- package/source/helpers/coerce_enum_value.ts +4 -4
- package/source/helpers/dump_tools.ts +6 -11
- package/source/helpers/ensure_secure_access.ts +2 -2
- package/source/helpers/make_optionals_map.ts +3 -10
- package/source/helpers/multiform_func.ts +1 -1
- package/source/helpers/resolve_opaque_on_address_space.ts +2 -2
- package/source/index.ts +44 -54
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +3 -4
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +13 -13
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +8 -10
- package/source/interfaces/alarms_and_conditions/install_setpoint_options.ts +4 -5
- package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +4 -6
- package/source/interfaces/alarms_and_conditions/instantiate_condition_options.ts +3 -3
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +6 -3
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +11 -11
- package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +11 -25
- package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +16 -13
- package/source/interfaces/alarms_and_conditions/ua_base_event_ex.ts +12 -0
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +5 -5
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +30 -54
- package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +3 -34
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +18 -22
- package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +8 -15
- package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +4 -7
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +5 -6
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +3 -3
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +9 -16
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +5 -8
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +5 -5
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +3 -3
- package/source/interfaces/extension_object_constructor.ts +3 -4
- package/source/interfaces/i_condition_variable_type_setter_options.ts +1 -3
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +3 -3
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +2 -2
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +3 -3
- package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +10 -7
- package/source/interfaces/state_machine/ua_state_machine_type.ts +11 -8
- package/source/interfaces/state_machine/ua_transition_ex.ts +2 -2
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +3 -2
- package/source/loader/decode_xml_extension_object.ts +7 -7
- package/source/loader/ensure_datatype_extracted.ts +14 -19
- package/source/loader/generateAddressSpaceRaw.ts +12 -13
- package/source/loader/load_nodeset2.ts +3 -3
- package/source/loader/make_xml_extension_object_parser.ts +55 -39
- package/source/loader/namespace_post_step.ts +3 -4
- package/source/loader/parsers/extension_object_parser.ts +63 -62
- package/source/loader/parsers/localized_text_parser.ts +3 -3
- package/source/loader/parsers/nodeid_parser.ts +2 -3
- package/source/loader/parsers/qualified_name_parser.ts +6 -7
- package/source/loader/parsers/variant_parser.ts +48 -55
- package/source/loader/register_node_promoter.ts +2 -2
- package/source/namespace.ts +4 -4
- package/source/namespace_alarm_and_condition.ts +22 -22
- package/source/namespace_data_access.ts +12 -13
- package/source/namespace_machine_state.ts +10 -5
- package/source/pseudo_session.ts +53 -50
- package/source/session_context.ts +1 -1
- package/source/set_namespace_meta_data.ts +3 -3
- package/source/ua_addin.ts +10 -11
- package/source/ua_interface.ts +27 -38
- package/source/ua_root_folder.ts +1 -1
- package/source/ua_two_state_variable_ex.ts +5 -5
- package/source_nodejs/generate_address_space.ts +5 -9
- package/src/_instantiate_helpers.ts +78 -25
- package/src/_mandatory_child_or_requested_optional_filter.ts +20 -19
- package/src/address_space.ts +36 -45
- package/src/address_space_change_event_tools.ts +25 -30
- package/src/address_space_private.ts +20 -21
- package/src/alarms_and_conditions/condition.ts +0 -2
- package/src/alarms_and_conditions/condition_info_impl.ts +11 -19
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +109 -85
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +20 -15
- package/src/alarms_and_conditions/index.ts +3 -3
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +44 -32
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +35 -34
- package/src/alarms_and_conditions/ua_base_event_impl.ts +15 -19
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +6 -2
- package/src/alarms_and_conditions/ua_condition_impl.ts +140 -130
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +20 -12
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +40 -43
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +7 -7
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +28 -30
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +3 -6
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +59 -90
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +57 -36
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +6 -6
- package/src/apply_condition_refresh.ts +7 -8
- package/src/base_node_impl.ts +64 -45
- package/src/base_node_private.ts +171 -139
- package/src/check_value_rank_compatibility.ts +19 -15
- package/src/data_access/add_dataItem_stuff.ts +3 -4
- package/src/data_access/adjust_datavalue_status_code.ts +7 -7
- package/src/data_access/ua_multistate_discrete_impl.ts +44 -28
- package/src/data_access/ua_multistate_value_discrete_impl.ts +77 -66
- package/src/data_access/ua_two_state_discrete_impl.ts +29 -36
- package/src/event_data.ts +29 -26
- package/src/extension_object_array_node.ts +27 -28
- package/src/get_basic_datatype.ts +4 -5
- package/src/historical_access/address_space_historical_data_node.ts +65 -50
- package/src/idx_iterator.ts +4 -12
- package/src/index_current.ts +33 -45
- package/src/namespace_impl.ts +75 -62
- package/src/namespace_private.ts +2 -8
- package/src/nodeid_manager.ts +30 -27
- package/src/nodeset_tools/adjust_namespace_array.ts +1 -1
- package/src/nodeset_tools/construct_namespace_dependency.ts +15 -16
- package/src/nodeset_tools/dump_to_bsd.ts +27 -22
- package/src/nodeset_tools/nodeset_to_xml.ts +95 -114
- package/src/private_namespace.ts +3 -6
- package/src/reference_impl.ts +11 -14
- package/src/role_permissions.ts +1 -1
- package/src/state_machine/finite_state_machine.ts +60 -61
- package/src/state_machine/ua_shelving_state_machine_ex.ts +23 -23
- package/src/state_machine/ua_two_state_variable.ts +34 -31
- package/src/tool_isSubtypeOf.ts +48 -33
- package/src/ua_condition_type.ts +1 -1
- package/src/ua_data_type_impl.ts +12 -13
- package/src/ua_method_impl.ts +17 -12
- package/src/ua_object_impl.ts +73 -39
- package/src/ua_object_type_impl.ts +25 -25
- package/src/ua_reference_type_impl.ts +19 -19
- package/src/ua_variable_impl.ts +316 -219
- package/src/ua_variable_impl_ext_obj.ts +63 -50
- package/src/ua_variable_type_impl.ts +43 -49
- package/src/ua_view_impl.ts +5 -5
- package/src/validate_data_type_correctness.ts +17 -8
package/src/tool_isSubtypeOf.ts
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import type {
|
|
6
|
+
BaseNode,
|
|
7
|
+
BaseNodeEvents,
|
|
8
|
+
UADataType,
|
|
9
|
+
UAObjectType,
|
|
10
|
+
UAReference,
|
|
11
|
+
UAReferenceType,
|
|
12
|
+
UAVariableType
|
|
13
|
+
} from "node-opcua-address-space-base";
|
|
5
14
|
import { assert } from "node-opcua-assert";
|
|
6
|
-
import { NodeId, NodeIdLike, resolveNodeId } from "node-opcua-nodeid";
|
|
7
|
-
import { sameNodeId } from "node-opcua-nodeid";
|
|
8
15
|
import { NodeClass } from "node-opcua-data-model";
|
|
9
|
-
import {
|
|
10
|
-
|
|
16
|
+
import { type NodeId, type NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
17
|
+
import type { BaseNodeImpl } from "./base_node_impl";
|
|
11
18
|
import { BaseNode_getCache } from "./base_node_private";
|
|
12
19
|
import { ReferenceImpl } from "./reference_impl";
|
|
13
|
-
import { BaseNodeImpl } from "./base_node_impl";
|
|
14
20
|
|
|
15
21
|
const HasSubTypeNodeId = resolveNodeId("HasSubtype");
|
|
16
22
|
|
|
@@ -20,7 +26,11 @@ function _filterSubType(reference: UAReference) {
|
|
|
20
26
|
|
|
21
27
|
export type BaseNodeConstructor<T extends BaseNode> = new () => T;
|
|
22
28
|
|
|
23
|
-
function _slow_isSubtypeOf<T extends UAType>(
|
|
29
|
+
function _slow_isSubtypeOf<T extends UAType>(
|
|
30
|
+
this: T,
|
|
31
|
+
Class: typeof BaseNodeImpl,
|
|
32
|
+
baseType: T | NodeIdLike
|
|
33
|
+
): boolean {
|
|
24
34
|
if (!(baseType instanceof Class)) {
|
|
25
35
|
const node = this.addressSpace.findNode(baseType as NodeIdLike);
|
|
26
36
|
if (!node || !(node instanceof Class)) {
|
|
@@ -42,10 +52,10 @@ function _slow_isSubtypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl
|
|
|
42
52
|
|
|
43
53
|
for (const subType1 of subTypes) {
|
|
44
54
|
const subTypeId = subType1.nodeId;
|
|
45
|
-
const subTypeNode = this.addressSpace.findNode(subTypeId) as
|
|
55
|
+
const subTypeNode = this.addressSpace.findNode(subTypeId) as unknown as T;
|
|
46
56
|
// c8 ignore next
|
|
47
57
|
if (!subTypeNode) {
|
|
48
|
-
throw new Error(
|
|
58
|
+
throw new Error(`Cannot find object with nodeId ${subTypeId.toString()}`);
|
|
49
59
|
}
|
|
50
60
|
if (sameNodeId(subTypeNode.nodeId, baseType.nodeId)) {
|
|
51
61
|
return true;
|
|
@@ -60,10 +70,9 @@ function _slow_isSubtypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl
|
|
|
60
70
|
|
|
61
71
|
export type MemberFuncValue<T, P, R> = (this: T, param: P) => R;
|
|
62
72
|
|
|
73
|
+
const g_WeakMap = new WeakMap<object, Map<string, unknown>>();
|
|
63
74
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export function wipeMemorizedStuff(node: Object) {
|
|
75
|
+
export function wipeMemorizedStuff(node: object) {
|
|
67
76
|
if (g_WeakMap.has(node)) {
|
|
68
77
|
g_WeakMap.delete(node);
|
|
69
78
|
}
|
|
@@ -71,40 +80,46 @@ export function wipeMemorizedStuff(node: Object) {
|
|
|
71
80
|
|
|
72
81
|
// http://jsperf.com/underscore-js-memoize-refactor-test
|
|
73
82
|
// http://addyosmani.com/blog/faster-javascript-memoization/
|
|
74
|
-
function wrap_memoize<T, P, R>(
|
|
83
|
+
function wrap_memoize<T extends object, P, R>(
|
|
75
84
|
func: MemberFuncValue<T, P, R>,
|
|
76
|
-
hashFunc?: (this: T, param:
|
|
85
|
+
hashFunc?: (this: T, param: P) => string
|
|
77
86
|
): MemberFuncValue<T, P, R> {
|
|
78
|
-
|
|
79
|
-
hashFunc
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
const effectiveHashFunc: (this: T, param: P) => string =
|
|
88
|
+
hashFunc ??
|
|
89
|
+
function (this: T, param: P) {
|
|
90
|
+
return (param as unknown as object).toString();
|
|
91
|
+
};
|
|
92
|
+
return function memoize(this: T, param: P): R {
|
|
93
|
+
let memoMap = g_WeakMap.get(this) as Map<string, R> | undefined;
|
|
94
|
+
if (!memoMap) {
|
|
95
|
+
memoMap = new Map<string, R>();
|
|
96
|
+
g_WeakMap.set(this, memoMap as Map<string, unknown>);
|
|
85
97
|
}
|
|
86
|
-
const memoMap = g_WeakMap.get(self)!;
|
|
87
98
|
|
|
88
|
-
const hash =
|
|
99
|
+
const hash = effectiveHashFunc.call(this, param);
|
|
89
100
|
if (memoMap.has(hash)) {
|
|
90
101
|
return memoMap.get(hash) as R;
|
|
91
102
|
}
|
|
92
103
|
const cache_value = func.call(this, param);
|
|
93
|
-
memoMap.set(hash,cache_value);
|
|
94
|
-
return cache_value
|
|
104
|
+
memoMap.set(hash, cache_value);
|
|
105
|
+
return cache_value;
|
|
95
106
|
};
|
|
96
107
|
}
|
|
97
108
|
|
|
98
|
-
function hashBaseNode(e: BaseNode): string {
|
|
99
|
-
|
|
109
|
+
function hashBaseNode(e: BaseNode | NodeIdLike): string {
|
|
110
|
+
if (e && typeof e === "object" && "nodeId" in e) {
|
|
111
|
+
return (e as BaseNode).nodeId.toString();
|
|
112
|
+
}
|
|
113
|
+
return resolveNodeId(e as NodeIdLike).toString();
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
export type IsSubtypeOfFunc<T extends UAType> = (this: T, baseType: T) => boolean;
|
|
103
117
|
|
|
104
118
|
export type UAType = UAReferenceType | UADataType | UAObjectType | UAVariableType;
|
|
105
119
|
|
|
106
|
-
export function construct_isSubtypeOf<T extends UAType>(
|
|
107
|
-
|
|
120
|
+
export function construct_isSubtypeOf<T extends UAType>(
|
|
121
|
+
Class: typeof BaseNodeImpl
|
|
122
|
+
): IsSubtypeOfFunc<T> {
|
|
108
123
|
return wrap_memoize(function (this: T, baseType: T | NodeIdLike): boolean {
|
|
109
124
|
if (!(baseType instanceof Class)) {
|
|
110
125
|
throw new Error(
|
|
@@ -117,7 +132,7 @@ export function construct_isSubtypeOf<T extends UAType>(Class: typeof BaseNodeIm
|
|
|
117
132
|
);
|
|
118
133
|
}
|
|
119
134
|
if (!(this instanceof Class)) {
|
|
120
|
-
throw new Error(
|
|
135
|
+
throw new Error(`expecting this to be ${Class.name} but got ${baseType.toString()}`);
|
|
121
136
|
}
|
|
122
137
|
return _slow_isSubtypeOf.call(this, Class, baseType as T);
|
|
123
138
|
}, hashBaseNode);
|
|
@@ -137,16 +152,16 @@ export function get_subtypeOf<T extends BaseNode>(this: T): NodeId | null {
|
|
|
137
152
|
return s ? s.nodeId : null;
|
|
138
153
|
}
|
|
139
154
|
|
|
140
|
-
export function get_subtypeOfObj(this:
|
|
155
|
+
export function get_subtypeOfObj<T extends BaseNode>(this: T): T | null {
|
|
141
156
|
const _cache = BaseNode_getCache(this);
|
|
142
157
|
|
|
143
|
-
if (_cache._subtypeOfObj
|
|
158
|
+
if (_cache._subtypeOfObj === undefined) {
|
|
144
159
|
const is_subtype_of_ref = this.findReference("HasSubtype", false);
|
|
145
|
-
if (is_subtype_of_ref
|
|
160
|
+
if (is_subtype_of_ref) {
|
|
146
161
|
_cache._subtypeOfObj = ReferenceImpl.resolveReferenceNode(this.addressSpace, is_subtype_of_ref);
|
|
147
162
|
} else {
|
|
148
163
|
_cache._subtypeOfObj = null;
|
|
149
164
|
}
|
|
150
165
|
}
|
|
151
|
-
return _cache._subtypeOfObj;
|
|
166
|
+
return (_cache._subtypeOfObj as T) || null;
|
|
152
167
|
}
|
package/src/ua_condition_type.ts
CHANGED
package/src/ua_data_type_impl.ts
CHANGED
|
@@ -37,7 +37,6 @@ import { construct_isSubtypeOf, get_subtypeOf, get_subtypeOfObj } from "./tool_i
|
|
|
37
37
|
const debugLog = make_debugLog("DATA_TYPE");
|
|
38
38
|
const doDebug = checkDebugFlag("DATA_TYPE");
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
export interface StructureFieldOptionsEx extends StructureFieldOptions {
|
|
42
41
|
allowSubTypes: boolean;
|
|
43
42
|
}
|
|
@@ -374,24 +373,24 @@ export function DataType_toString(this: UADataTypeImpl, options: ToStringOption)
|
|
|
374
373
|
|
|
375
374
|
options.add(
|
|
376
375
|
options.padding +
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
chalk.yellow(" binaryEncodingNodeId: ") +
|
|
377
|
+
(this.binaryEncodingNodeId ? this.binaryEncodingNodeId.toString() : "<none>")
|
|
379
378
|
);
|
|
380
379
|
options.add(
|
|
381
380
|
options.padding +
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
chalk.yellow(" xmlEncodingNodeId : ") +
|
|
382
|
+
(this.xmlEncodingNodeId ? this.xmlEncodingNodeId.toString() : "<none>")
|
|
384
383
|
);
|
|
385
384
|
options.add(
|
|
386
385
|
options.padding +
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
chalk.yellow(" jsonEncodingNodeId : ") +
|
|
387
|
+
(this.jsonEncodingNodeId ? this.jsonEncodingNodeId.toString() : "<none>")
|
|
389
388
|
);
|
|
390
389
|
if (this.subtypeOfObj) {
|
|
391
390
|
options.add(
|
|
392
391
|
options.padding +
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
chalk.yellow(" subtypeOfObj : ") +
|
|
393
|
+
(this.subtypeOfObj ? this.subtypeOfObj.browseName.toString() : "")
|
|
395
394
|
);
|
|
396
395
|
}
|
|
397
396
|
// references
|
|
@@ -435,10 +434,10 @@ function makeStructureDefinition(
|
|
|
435
434
|
? StructureType.UnionWithSubtypedValues
|
|
436
435
|
: StructureType.Union
|
|
437
436
|
: hasOptionalFields
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
? StructureType.StructureWithOptionalFields
|
|
438
|
+
: hasSubtypedFields
|
|
439
|
+
? StructureType.StructureWithSubtypedValues
|
|
440
|
+
: StructureType.Structure;
|
|
442
441
|
|
|
443
442
|
// note: https://reference.opcfoundation.org/Core/Part3/v105/docs/8.51
|
|
444
443
|
// field.isOptional has a special behavior depending on the structure type
|
package/src/ua_method_impl.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
type MethodFunctorC,
|
|
16
16
|
makeDefaultCloneExtraInfo,
|
|
17
17
|
type UAMethod,
|
|
18
|
+
type UAMethodEvents,
|
|
18
19
|
type UAObject,
|
|
19
20
|
type UAObjectType,
|
|
20
21
|
type UAVariable
|
|
@@ -31,7 +32,7 @@ import { type CallMethodResultOptions, PermissionType } from "node-opcua-types";
|
|
|
31
32
|
import { DataType, Variant, type VariantLike } from "node-opcua-variant";
|
|
32
33
|
import type { SessionContext } from "../source/session_context";
|
|
33
34
|
import type { AddressSpacePrivate } from "./address_space_private";
|
|
34
|
-
import { BaseNodeImpl } from "./base_node_impl";
|
|
35
|
+
import { BaseNodeImpl, type InternalBaseNodeOptions } from "./base_node_impl";
|
|
35
36
|
import { _clone } from "./base_node_private";
|
|
36
37
|
import { _handle_hierarchy_parent } from "./namespace_impl";
|
|
37
38
|
|
|
@@ -40,10 +41,14 @@ const debugLog = make_debugLog(__filename);
|
|
|
40
41
|
const errorLog = make_errorLog(__filename);
|
|
41
42
|
|
|
42
43
|
function default_check_valid_argument(arg: unknown): boolean {
|
|
43
|
-
return (arg as
|
|
44
|
+
return (arg as object) instanceof Argument;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
export
|
|
47
|
+
export interface IMethodOptons extends InternalBaseNodeOptions {
|
|
48
|
+
value: unknown;
|
|
49
|
+
methodDeclarationId: NodeId;
|
|
50
|
+
}
|
|
51
|
+
export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMethod {
|
|
47
52
|
public static checkValidArgument(args: unknown): boolean {
|
|
48
53
|
return default_check_valid_argument(args);
|
|
49
54
|
}
|
|
@@ -58,13 +63,13 @@ export class UAMethodImpl extends BaseNodeImpl implements UAMethod {
|
|
|
58
63
|
return super.parent as UAObject;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
public value?:
|
|
66
|
+
public value?: unknown;
|
|
62
67
|
public methodDeclarationId: NodeId;
|
|
63
68
|
public _getExecutableFlag?: (this: UAMethod, context: ISessionContext | null) => boolean;
|
|
64
69
|
|
|
65
70
|
public _asyncExecutionFunction?: MethodFunctor;
|
|
66
71
|
|
|
67
|
-
constructor(options:
|
|
72
|
+
constructor(options: IMethodOptons) {
|
|
68
73
|
super(options);
|
|
69
74
|
this.value = options.value;
|
|
70
75
|
this.methodDeclarationId = options.methodDeclarationId;
|
|
@@ -175,11 +180,11 @@ export class UAMethodImpl extends BaseNodeImpl implements UAMethod {
|
|
|
175
180
|
if (object.nodeClass !== NodeClass.Object && object.nodeClass !== NodeClass.ObjectType) {
|
|
176
181
|
warningLog(
|
|
177
182
|
"Method " +
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
this.nodeId.toString() +
|
|
184
|
+
" " +
|
|
185
|
+
this.browseName.toString() +
|
|
186
|
+
" called for a node that is not a Object/ObjectType but " +
|
|
187
|
+
NodeClass[context.object?.nodeClass as number]
|
|
183
188
|
);
|
|
184
189
|
return callback(null, { statusCode: StatusCodes.BadNodeIdInvalid });
|
|
185
190
|
}
|
|
@@ -264,7 +269,7 @@ export class UAMethodImpl extends BaseNodeImpl implements UAMethod {
|
|
|
264
269
|
|
|
265
270
|
// ── afterCall event ──
|
|
266
271
|
try {
|
|
267
|
-
this.emit("afterCall", context, coercedInputArguments, callMethodResult);
|
|
272
|
+
(this as UAMethod).emit("afterCall", context, coercedInputArguments, callMethodResult);
|
|
268
273
|
} catch (afterCallErr) {
|
|
269
274
|
if (afterCallErr instanceof Error) {
|
|
270
275
|
warningLog(chalk.red("ERR in afterCall listener"), afterCallErr.message);
|
|
@@ -314,7 +319,7 @@ export class UAMethodImpl extends BaseNodeImpl implements UAMethod {
|
|
|
314
319
|
clonedMethod._getExecutableFlag = this._getExecutableFlag;
|
|
315
320
|
|
|
316
321
|
if (options.componentOf) {
|
|
317
|
-
const m = options.componentOf.getMethodByName(clonedMethod.browseName.name
|
|
322
|
+
const m = options.componentOf.getMethodByName(clonedMethod.browseName.name || "");
|
|
318
323
|
assert(m);
|
|
319
324
|
}
|
|
320
325
|
return clonedMethod as UAMethod;
|
package/src/ua_object_impl.ts
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
|
-
import chalk from "chalk";
|
|
5
4
|
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import {
|
|
7
|
+
type BaseNode,
|
|
8
|
+
type CloneExtraInfo,
|
|
9
|
+
type CloneFilter,
|
|
10
|
+
type CloneOptions,
|
|
11
|
+
defaultCloneFilter,
|
|
12
|
+
EventNotifierFlags,
|
|
13
|
+
type EventTypeLike,
|
|
14
|
+
type IEventData,
|
|
15
|
+
type ISessionContext,
|
|
16
|
+
type ListenerSignature,
|
|
17
|
+
makeDefaultCloneExtraInfo,
|
|
18
|
+
type RaiseEventData,
|
|
19
|
+
type UAEventType,
|
|
20
|
+
type UAMethod,
|
|
21
|
+
type UAObject,
|
|
22
|
+
type UAObjectEvents,
|
|
23
|
+
type UAObjectType
|
|
24
|
+
} from "node-opcua-address-space-base";
|
|
6
25
|
import { assert } from "node-opcua-assert";
|
|
7
26
|
import { isValidByte } from "node-opcua-basic-types";
|
|
8
|
-
import { NodeClass, QualifiedNameLike, QualifiedNameOptions } from "node-opcua-data-model";
|
|
9
|
-
import {
|
|
10
|
-
import { DataValue, DataValueLike } from "node-opcua-data-value";
|
|
27
|
+
import { AttributeIds, NodeClass, type QualifiedNameLike, type QualifiedNameOptions } from "node-opcua-data-model";
|
|
28
|
+
import { DataValue, type DataValueLike } from "node-opcua-data-value";
|
|
11
29
|
import { getCurrentClock } from "node-opcua-date-time";
|
|
30
|
+
import { make_errorLog } from "node-opcua-debug";
|
|
12
31
|
import { NodeId } from "node-opcua-nodeid";
|
|
13
|
-
import { NumericRange } from "node-opcua-numeric-range";
|
|
32
|
+
import type { NumericRange } from "node-opcua-numeric-range";
|
|
14
33
|
import { StatusCodes } from "node-opcua-status-code";
|
|
15
34
|
import { DataType } from "node-opcua-variant";
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
RaiseEventData,
|
|
19
|
-
ISessionContext,
|
|
20
|
-
UAMethod,
|
|
21
|
-
UAObject,
|
|
22
|
-
UAObjectType,
|
|
23
|
-
CloneOptions,
|
|
24
|
-
CloneFilter,
|
|
25
|
-
CloneExtraInfo,
|
|
26
|
-
BaseNode,
|
|
27
|
-
UAEventType,
|
|
28
|
-
IEventData,
|
|
29
|
-
defaultCloneFilter,
|
|
30
|
-
makeDefaultCloneExtraInfo,
|
|
31
|
-
EventNotifierFlags
|
|
32
|
-
} from "node-opcua-address-space-base";
|
|
33
|
-
import { make_errorLog } from "node-opcua-debug";
|
|
34
|
-
|
|
35
|
-
import { BaseNodeImpl, InternalBaseNodeOptions } from "./base_node_impl";
|
|
35
|
+
import { apply_condition_refresh, type ConditionRefreshCache } from "./apply_condition_refresh";
|
|
36
|
+
import { BaseNodeImpl, type InternalBaseNodeOptions } from "./base_node_impl";
|
|
36
37
|
import { _clone, ToStringBuilder, UAObject_toString } from "./base_node_private";
|
|
37
|
-
import { apply_condition_refresh, ConditionRefreshCache } from "./apply_condition_refresh";
|
|
38
38
|
|
|
39
39
|
const errorLog = make_errorLog(__filename);
|
|
40
40
|
|
|
41
|
-
export class UAObjectImpl extends
|
|
41
|
+
export class UAObjectImpl<T extends UAObjectEvents & ListenerSignature<T> = UAObjectEvents>
|
|
42
|
+
extends BaseNodeImpl<T>
|
|
43
|
+
implements UAObject<T>
|
|
44
|
+
{
|
|
42
45
|
private _eventNotifier: EventNotifierFlags;
|
|
43
46
|
public readonly nodeClass = NodeClass.Object;
|
|
44
47
|
public get eventNotifier(): EventNotifierFlags {
|
|
45
|
-
|
|
46
48
|
// ensure eventNotifier is set if the node has some event
|
|
47
49
|
|
|
48
50
|
if (!this._eventNotifier) {
|
|
@@ -105,12 +107,12 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
105
107
|
options = {
|
|
106
108
|
eventNotifier: this.eventNotifier,
|
|
107
109
|
symbolicName: this.symbolicName || undefined,
|
|
108
|
-
...options
|
|
110
|
+
...options
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
const cloneObject = _clone(
|
|
112
114
|
this,
|
|
113
|
-
UAObjectImpl
|
|
115
|
+
UAObjectImpl<T>,
|
|
114
116
|
options,
|
|
115
117
|
optionalFilter || defaultCloneFilter,
|
|
116
118
|
extraInfo || makeDefaultCloneExtraInfo(this)
|
|
@@ -130,7 +132,7 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
130
132
|
public getMethodByName(methodName: QualifiedNameOptions): UAMethod | null;
|
|
131
133
|
public getMethodByName(methodName: string, namespaceIndex?: number): UAMethod | null;
|
|
132
134
|
public getMethodByName(methodName: QualifiedNameLike, namespaceIndex?: number): UAMethod | null {
|
|
133
|
-
return super.getMethodByName(methodName as
|
|
135
|
+
return super.getMethodByName(methodName as string, namespaceIndex);
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
public getMethods(): UAMethod[] {
|
|
@@ -150,7 +152,7 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
150
152
|
if (typeof eventType === "string") {
|
|
151
153
|
const eventTypeFound = addressSpace.findEventType(eventType);
|
|
152
154
|
if (!eventTypeFound) {
|
|
153
|
-
throw new Error(
|
|
155
|
+
throw new Error(`raiseEvent: eventType cannot find event Type ${eventType.toString()}`);
|
|
154
156
|
}
|
|
155
157
|
eventType = eventTypeFound;
|
|
156
158
|
if (!eventType || eventType.nodeClass !== NodeClass.ObjectType) {
|
|
@@ -159,11 +161,11 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
159
161
|
} else if (eventType instanceof NodeId) {
|
|
160
162
|
const eventTypeFound = addressSpace.findNode(eventType) as BaseNode;
|
|
161
163
|
if (!eventTypeFound) {
|
|
162
|
-
throw new Error(
|
|
164
|
+
throw new Error(`raiseEvent: eventType cannot find event Type ${eventType.toString()}`);
|
|
163
165
|
}
|
|
164
|
-
eventType = eventTypeFound
|
|
166
|
+
eventType = eventTypeFound;
|
|
165
167
|
if (!eventType || eventType.nodeClass !== NodeClass.ObjectType) {
|
|
166
|
-
throw new Error(
|
|
168
|
+
throw new Error(`eventType must exist and be an UAObjectType: ${eventType.toString()}`);
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
|
|
@@ -172,12 +174,12 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
172
174
|
let eventTypeNode: UAEventType = eventType as UAEventType;
|
|
173
175
|
// c8 ignore next
|
|
174
176
|
if (!eventTypeNode) {
|
|
175
|
-
throw new Error(
|
|
177
|
+
throw new Error(`UAObject#raiseEventType : Cannot find event type : ${eventType.toString()}`);
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
// coerce EventType
|
|
179
181
|
eventTypeNode = addressSpace.findEventType(eventType as UAEventType) as UAEventType;
|
|
180
|
-
const
|
|
182
|
+
const _baseEventType = addressSpace.findEventType("BaseEventType");
|
|
181
183
|
|
|
182
184
|
data.$eventDataSource = eventTypeNode;
|
|
183
185
|
data.sourceNode = data.sourceNode || { dataType: DataType.NodeId, value: this.nodeId };
|
|
@@ -190,9 +192,9 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
190
192
|
public _bubble_up_event(eventData: IEventData): void {
|
|
191
193
|
const addressSpace = this.addressSpace;
|
|
192
194
|
|
|
193
|
-
const queue:
|
|
195
|
+
const queue: BaseNode[] = [];
|
|
194
196
|
// walk up the hasNotify / hasEventSource chain
|
|
195
|
-
const m:
|
|
197
|
+
const m: Record<string, BaseNode> = {};
|
|
196
198
|
|
|
197
199
|
// all events are notified to the server object
|
|
198
200
|
// emit on server object
|
|
@@ -222,6 +224,9 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
222
224
|
|
|
223
225
|
while (queue.length) {
|
|
224
226
|
const obj = queue.pop();
|
|
227
|
+
if (!obj) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
225
230
|
// emit on object
|
|
226
231
|
obj.emit("event", eventData);
|
|
227
232
|
|
|
@@ -241,4 +246,33 @@ export class UAObjectImpl extends BaseNodeImpl implements UAObject {
|
|
|
241
246
|
UAObject_toString.call(this, options);
|
|
242
247
|
return options.toString();
|
|
243
248
|
}
|
|
249
|
+
|
|
250
|
+
public toJSON(): Record<string, unknown> {
|
|
251
|
+
return {
|
|
252
|
+
...super.toJSON(),
|
|
253
|
+
typeDefinition: this.typeDefinitionObj ? this.typeDefinitionObj.browseName.toString() : undefined,
|
|
254
|
+
eventNotifier: this._eventNotifier
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
public [Symbol.for("nodejs.util.inspect.custom")](depth: number | null, inspectOptions: { colors?: boolean }): string {
|
|
259
|
+
const c = inspectOptions?.colors === false ? plainChalk : chalk;
|
|
260
|
+
const typeName = this.typeDefinitionObj?.browseName.toString() ?? "?";
|
|
261
|
+
const displayName = this.displayName.length ? this.displayName.map((d) => d.text).join(" | ") : "";
|
|
262
|
+
if (depth !== null && depth <= 0) {
|
|
263
|
+
return `${c.cyan("UAObject<")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}${c.cyan(">")}`;
|
|
264
|
+
}
|
|
265
|
+
const lines = [
|
|
266
|
+
`${c.cyan("UAObject ")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}`,
|
|
267
|
+
c.yellow(" typeDefinition : ") + typeName,
|
|
268
|
+
c.yellow(" displayName : ") + displayName,
|
|
269
|
+
c.yellow(" eventNotifier : ") + this._eventNotifier
|
|
270
|
+
];
|
|
271
|
+
if (this.description?.text) {
|
|
272
|
+
lines.push(c.yellow(" description : ") + this.description.text);
|
|
273
|
+
}
|
|
274
|
+
return lines.join("\n");
|
|
275
|
+
}
|
|
244
276
|
}
|
|
277
|
+
|
|
278
|
+
const plainChalk = new Proxy(chalk, { get: () => (s: string) => s }) as typeof chalk;
|
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { AttributeIds } from "node-opcua-data-model";
|
|
7
|
-
import { DataValue, DataValueLike } from "node-opcua-data-value";
|
|
8
|
-
import { NodeId } from "node-opcua-nodeid";
|
|
9
|
-
import { StatusCodes } from "node-opcua-status-code";
|
|
10
|
-
import { isNullOrUndefined } from "node-opcua-utils";
|
|
11
|
-
import { DataType } from "node-opcua-variant";
|
|
12
|
-
import {
|
|
4
|
+
|
|
5
|
+
import type {
|
|
13
6
|
AddObjectOptions,
|
|
7
|
+
BaseNodeEvents,
|
|
14
8
|
InstantiateObjectOptions,
|
|
15
9
|
ISessionContext,
|
|
16
10
|
UAObject,
|
|
17
11
|
UAObjectType,
|
|
18
12
|
UAReference
|
|
19
13
|
} from "node-opcua-address-space-base";
|
|
14
|
+
import { assert } from "node-opcua-assert";
|
|
15
|
+
import { AttributeIds, NodeClass } from "node-opcua-data-model";
|
|
16
|
+
import { DataValue, type DataValueLike } from "node-opcua-data-value";
|
|
17
|
+
import type { NodeId } from "node-opcua-nodeid";
|
|
18
|
+
import { StatusCodes } from "node-opcua-status-code";
|
|
19
|
+
import { isNullOrUndefined } from "node-opcua-utils";
|
|
20
|
+
import { DataType } from "node-opcua-variant";
|
|
20
21
|
|
|
21
22
|
import { SessionContext } from "../source/session_context";
|
|
23
|
+
import { initialize_properties_and_components } from "./_instantiate_helpers";
|
|
24
|
+
import type { AddressSpacePrivate } from "./address_space_private";
|
|
22
25
|
import { BaseNodeImpl } from "./base_node_impl";
|
|
23
26
|
import { ToStringBuilder, UAObjectType_toString } from "./base_node_private";
|
|
24
27
|
import { construct_isSubtypeOf, get_subtypeOf, get_subtypeOfObj } from "./tool_isSubtypeOf";
|
|
25
|
-
import { } from "./
|
|
26
|
-
import {
|
|
27
|
-
assertUnusedChildBrowseName,
|
|
28
|
-
topMostParentIsObjectTypeOrVariableType
|
|
29
|
-
} from "./ua_variable_type_impl";
|
|
30
|
-
import { AddressSpacePrivate } from "./address_space_private";
|
|
31
|
-
import { initialize_properties_and_components } from "./_instantiate_helpers";
|
|
28
|
+
import { assertUnusedChildBrowseName, topMostParentIsObjectTypeOrVariableType } from "./ua_variable_type_impl";
|
|
32
29
|
|
|
33
|
-
export class UAObjectTypeImpl extends BaseNodeImpl implements UAObjectType {
|
|
30
|
+
export class UAObjectTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements UAObjectType {
|
|
34
31
|
public readonly nodeClass = NodeClass.ObjectType;
|
|
35
32
|
public readonly isAbstract: boolean;
|
|
36
33
|
/**
|
|
@@ -43,12 +40,10 @@ export class UAObjectTypeImpl extends BaseNodeImpl implements UAObjectType {
|
|
|
43
40
|
return get_subtypeOf.call(this);
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
|
|
47
43
|
public get subtypeOfObj(): UAObjectType | null {
|
|
48
|
-
return get_subtypeOfObj.call(this) as
|
|
44
|
+
return get_subtypeOfObj.call(this) as unknown as UAObjectType;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
|
|
52
47
|
public isSubtypeOf = construct_isSubtypeOf<UAObjectType>(UAObjectTypeImpl);
|
|
53
48
|
/** @deprecated - use isSubtypeOf instead */
|
|
54
49
|
public isSupertypeOf = construct_isSubtypeOf<UAObjectType>(UAObjectTypeImpl);
|
|
@@ -112,12 +107,12 @@ export class UAObjectTypeImpl extends BaseNodeImpl implements UAObjectType {
|
|
|
112
107
|
"expecting a browse name"
|
|
113
108
|
);
|
|
114
109
|
|
|
115
|
-
assert(!Object.
|
|
116
|
-
assert(!Object.
|
|
110
|
+
assert(!Object.hasOwn(options, "propertyOf"), "an Object shall not be a PropertyOf an other object");
|
|
111
|
+
assert(!Object.hasOwn(options, "optional"), "do you mean optionals ?");
|
|
117
112
|
|
|
118
113
|
assertUnusedChildBrowseName(addressSpace, options);
|
|
119
114
|
|
|
120
|
-
const baseObjectType = addressSpace.findObjectType("BaseObjectType")
|
|
115
|
+
const baseObjectType = addressSpace.findObjectType("BaseObjectType") as UAObjectType;
|
|
121
116
|
assert(baseObjectType, "BaseObjectType must be defined in the address space");
|
|
122
117
|
|
|
123
118
|
const references: UAReference[] = [];
|
|
@@ -151,8 +146,13 @@ export class UAObjectTypeImpl extends BaseNodeImpl implements UAObjectType {
|
|
|
151
146
|
|
|
152
147
|
const copyAlsoAllOptionals = options.copyAlsoAllOptionals || false;
|
|
153
148
|
initialize_properties_and_components(
|
|
154
|
-
instance,
|
|
155
|
-
|
|
149
|
+
instance,
|
|
150
|
+
baseObjectType,
|
|
151
|
+
this,
|
|
152
|
+
copyAlsoModellingRules,
|
|
153
|
+
copyAlsoAllOptionals,
|
|
154
|
+
options.optionals
|
|
155
|
+
);
|
|
156
156
|
|
|
157
157
|
assert(instance.typeDefinition.toString() === this.nodeId.toString());
|
|
158
158
|
|