diff --git a/analysis_options.yaml b/analysis_options.yaml index 4d228831..2d8c2070 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,8 +5,7 @@ include: package:lint/analysis_options_package.yaml # Adjusted linting rules linter: rules: - always_use_package_imports: false - prefer_relative_imports: true + always_use_package_imports: true prefer_double_quotes: true sort_constructors_first: true unawaited_futures: true diff --git a/lib/core.dart b/lib/core.dart index 26de7463..0caec0e8 100644 --- a/lib/core.dart +++ b/lib/core.dart @@ -13,7 +13,9 @@ export "package:dcaf/dcaf.dart"; export "src/core/augmented_form.dart"; export "src/core/codecs/content_codec.dart"; +export "src/core/content.dart"; export "src/core/content_serdes.dart"; + export "src/core/credentials/ace_credentials.dart"; export "src/core/credentials/apikey_credentials.dart"; export "src/core/credentials/basic_credentials.dart"; @@ -24,7 +26,12 @@ export "src/core/credentials/digest_credentials.dart"; export "src/core/credentials/oauth2_credentials.dart"; export "src/core/credentials/psk_credentials.dart"; +export "src/core/definitions/additional_expected_response.dart"; +export "src/core/definitions/data_schema.dart"; +export "src/core/definitions/expected_response.dart"; export "src/core/definitions/form.dart"; +export "src/core/definitions/interaction_affordances/interaction_affordance.dart"; +export "src/core/definitions/operation_type.dart"; export "src/core/definitions/security/ace_security_scheme.dart"; export "src/core/definitions/security/apikey_security_scheme.dart"; @@ -42,20 +49,13 @@ export "src/core/definitions/thing_model.dart"; export "src/core/definitions/validation/thing_description_schema.dart" show thingDescriptionSchema; +export "src/core/definitions/validation/validation_exception.dart"; +export "src/core/discovery_expection.dart"; + export "src/core/protocol_interfaces/protocol_client.dart"; export "src/core/protocol_interfaces/protocol_client_factory.dart"; export "src/core/protocol_interfaces/protocol_server.dart"; -export "src/core/scripting_api/consumed_thing.dart"; -export "src/core/scripting_api/data_schema_value.dart"; -export "src/core/scripting_api/discovery/discovery_method.dart"; -export "src/core/scripting_api/discovery/thing_discovery.dart"; -export "src/core/scripting_api/discovery/thing_filter.dart"; -export "src/core/scripting_api/exposed_thing.dart"; -export "src/core/scripting_api/interaction_input.dart"; -export "src/core/scripting_api/interaction_output.dart"; -export "src/core/scripting_api/subscription.dart"; -export "src/core/scripting_api/types.dart"; -export "src/core/scripting_api/wot.dart"; +export "src/core/scripting_api.dart"; export "src/core/servient.dart"; diff --git a/lib/src/binding_coap/coap_client.dart b/lib/src/binding_coap/coap_client.dart index 89753e36..89e4b355 100644 --- a/lib/src/binding_coap/coap_client.dart +++ b/lib/src/binding_coap/coap_client.dart @@ -9,21 +9,14 @@ import "dart:typed_data"; import "package:coap/coap.dart" as coap; import "package:coap/config/coap_config_default.dart"; -import "package:dcaf/dcaf.dart"; - -import "../core/augmented_form.dart"; -import "../core/content.dart"; -import "../core/credentials/ace_credentials.dart"; -import "../core/credentials/callbacks.dart"; -import "../core/credentials/psk_credentials.dart"; -import "../core/definitions/operation_type.dart"; -import "../core/protocol_interfaces/protocol_client.dart"; -import "../core/scripting_api/subscription.dart"; -import "coap_binding_exception.dart"; -import "coap_config.dart"; -import "coap_definitions.dart"; -import "coap_extensions.dart"; -import "coap_subscription.dart"; + +import "package:dart_wot/core.dart"; + +import "package:dart_wot/src/binding_coap/coap_binding_exception.dart"; +import "package:dart_wot/src/binding_coap/coap_config.dart"; +import "package:dart_wot/src/binding_coap/coap_definitions.dart"; +import "package:dart_wot/src/binding_coap/coap_extensions.dart"; +import "package:dart_wot/src/binding_coap/coap_subscription.dart"; class _InternalCoapConfig extends CoapConfigDefault { _InternalCoapConfig(CoapConfig coapConfig) diff --git a/lib/src/binding_coap/coap_client_factory.dart b/lib/src/binding_coap/coap_client_factory.dart index 7bb9529f..6d49e542 100644 --- a/lib/src/binding_coap/coap_client_factory.dart +++ b/lib/src/binding_coap/coap_client_factory.dart @@ -4,11 +4,10 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_client.dart"; -import "../core/protocol_interfaces/protocol_client_factory.dart"; -import "coap_client.dart"; -import "coap_config.dart"; +import "package:dart_wot/core.dart"; + +import "package:dart_wot/src/binding_coap/coap_client.dart"; +import "package:dart_wot/src/binding_coap/coap_config.dart"; /// A [ProtocolClientFactory] that produces CoAP clients. final class CoapClientFactory implements ProtocolClientFactory { diff --git a/lib/src/binding_coap/coap_extensions.dart b/lib/src/binding_coap/coap_extensions.dart index d60d0cb3..7bd0464c 100644 --- a/lib/src/binding_coap/coap_extensions.dart +++ b/lib/src/binding_coap/coap_extensions.dart @@ -3,15 +3,17 @@ import "dart:typed_data"; import "package:cbor/cbor.dart"; import "package:coap/coap.dart"; - -import "package:dart_wot/core.dart" hide PskCredentials; +import "package:dart_wot/src/binding_coap/coap_binding_exception.dart"; +import "package:dart_wot/src/binding_coap/coap_definitions.dart"; +import "package:dart_wot/src/core/augmented_form.dart"; import "package:dart_wot/src/core/content.dart"; import "package:dart_wot/src/core/definitions/expected_response.dart"; import "package:dart_wot/src/core/definitions/operation_type.dart"; +import "package:dart_wot/src/core/definitions/security/ace_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/auto_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/psk_security_scheme.dart"; import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; - -import "coap_binding_exception.dart"; -import "coap_definitions.dart"; +import "package:dcaf/dcaf.dart"; /// Extension which makes it easier to handle [Uri]s containing /// [InternetAddress]es. @@ -22,7 +24,7 @@ extension InternetAddressMethods on Uri { } } -/// CoAP-specific extensions for the [Form] class. +/// CoAP-specific extensions for the [AugmentedForm] class. extension CoapFormExtension on AugmentedForm { T? _obtainVocabularyTerm(String vocabularyTerm) { final curieString = coapPrefixMapping.expandCurieString(vocabularyTerm); @@ -35,15 +37,15 @@ extension CoapFormExtension on AugmentedForm { return null; } - /// Determines if this [Form] supports the [PskSecurityScheme]. + /// Determines if this [AugmentedForm] supports the [PskSecurityScheme]. bool get usesPskScheme => securityDefinitions.whereType().isNotEmpty; - /// Determines if this [Form] supports the [AutoSecurityScheme]. + /// Determines if this [AugmentedForm] supports the [AutoSecurityScheme]. bool get usesAutoScheme => securityDefinitions.whereType().isNotEmpty; - /// Get the [CoapSubprotocol] for this [Form], if one is set. + /// Get the [CoapSubprotocol] for this [AugmentedForm], if one is set. CoapSubprotocol? get coapSubprotocol { if (subprotocol == coapPrefixMapping.expandCurieString("observe")) { return CoapSubprotocol.observe; @@ -103,7 +105,7 @@ extension CoapFormExtension on AugmentedForm { BlockSize? get block1Size => _determineBlockSize("block1Size"); // TODO: Consider default method - /// Indicates the [CoapRequestMethod] contained in this [Form]. + /// Indicates the [CoapRequestMethod] contained in this [AugmentedForm]. CoapRequestMethod? get method { final methodDefinition = _obtainVocabularyTerm("method"); diff --git a/lib/src/binding_coap/coap_server.dart b/lib/src/binding_coap/coap_server.dart index 041613b0..823c7808 100644 --- a/lib/src/binding_coap/coap_server.dart +++ b/lib/src/binding_coap/coap_server.dart @@ -4,10 +4,10 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_server.dart"; -import '../core/scripting_api/exposed_thing.dart'; -import "coap_config.dart"; +import "package:dart_wot/src/binding_coap/coap_config.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_server.dart"; +import "package:dart_wot/src/core/scripting_api/exposed_thing.dart"; /// A [ProtocolServer] for the Constrained Application Protocol (CoAP). final class CoapServer implements ProtocolServer { diff --git a/lib/src/binding_coap/coap_subscription.dart b/lib/src/binding_coap/coap_subscription.dart index 3e068cae..58fecbb9 100644 --- a/lib/src/binding_coap/coap_subscription.dart +++ b/lib/src/binding_coap/coap_subscription.dart @@ -6,7 +6,7 @@ import "package:coap/coap.dart"; -import '../core/scripting_api/subscription.dart'; +import "package:dart_wot/src/core/scripting_api/subscription.dart"; /// [Subscription] to a CoAP resource, based on the observe option ([RFC 7641]). /// diff --git a/lib/src/binding_http/http_client.dart b/lib/src/binding_http/http_client.dart index 4602bd39..f4e42c95 100644 --- a/lib/src/binding_http/http_client.dart +++ b/lib/src/binding_http/http_client.dart @@ -8,12 +8,11 @@ import "dart:convert"; import "dart:io"; import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/definitions/operation_type.dart"; -import "package:http/http.dart"; -import "../core/content.dart"; -import "http_request_method.dart"; -import "http_security_exception.dart"; +import "package:dart_wot/src/binding_http/http_request_method.dart"; +import "package:dart_wot/src/binding_http/http_security_exception.dart"; + +import "package:http/http.dart"; const _authorizationHeader = "Authorization"; diff --git a/lib/src/binding_http/http_client_factory.dart b/lib/src/binding_http/http_client_factory.dart index dc05d294..b7308bc7 100644 --- a/lib/src/binding_http/http_client_factory.dart +++ b/lib/src/binding_http/http_client_factory.dart @@ -4,13 +4,13 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../core/credentials/basic_credentials.dart"; -import "../core/credentials/bearer_credentials.dart"; -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_client.dart"; -import "../core/protocol_interfaces/protocol_client_factory.dart"; -import "http_client.dart"; -import "http_config.dart"; +import "package:dart_wot/src/binding_http/http_client.dart"; +import "package:dart_wot/src/binding_http/http_config.dart"; +import "package:dart_wot/src/core/credentials/basic_credentials.dart"; +import "package:dart_wot/src/core/credentials/bearer_credentials.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client_factory.dart"; /// A [ProtocolClientFactory] that produces HTTP and HTTPS clients. final class HttpClientFactory implements ProtocolClientFactory { diff --git a/lib/src/binding_http/http_server.dart b/lib/src/binding_http/http_server.dart index e5dbaad3..31af7bee 100644 --- a/lib/src/binding_http/http_server.dart +++ b/lib/src/binding_http/http_server.dart @@ -4,10 +4,10 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_server.dart"; -import "../core/scripting_api/exposed_thing.dart"; -import "http_config.dart"; +import "package:dart_wot/src/binding_http/http_config.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_server.dart"; +import "package:dart_wot/src/core/scripting_api/exposed_thing.dart"; /// A [ProtocolServer] for the Hypertext Transfer Protocol (HTTP). final class HttpServer implements ProtocolServer { diff --git a/lib/src/binding_mqtt/mqtt_client.dart b/lib/src/binding_mqtt/mqtt_client.dart index 6d96e509..f6151396 100644 --- a/lib/src/binding_mqtt/mqtt_client.dart +++ b/lib/src/binding_mqtt/mqtt_client.dart @@ -6,22 +6,21 @@ import "dart:async"; +import "package:dart_wot/src/binding_mqtt/constants.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_binding_exception.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_config.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_extensions.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_subscription.dart"; +import "package:dart_wot/src/core/augmented_form.dart"; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/credentials/basic_credentials.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; +import "package:dart_wot/src/core/scripting_api/subscription.dart" as scripting_api; import "package:mqtt_client/mqtt_client.dart"; import "package:mqtt_client/mqtt_server_client.dart"; import "package:typed_data/typed_buffers.dart"; -import "../core/augmented_form.dart"; -import "../core/content.dart"; -import "../core/credentials/basic_credentials.dart"; -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_client.dart"; -import "../core/scripting_api/subscription.dart" as scripting_api; -import "constants.dart"; -import "mqtt_binding_exception.dart"; -import "mqtt_config.dart"; -import "mqtt_extensions.dart"; -import "mqtt_subscription.dart"; - /// [ProtocolClient] for supporting the MQTT protocol. /// /// Currently, only MQTT version 3.1.1 is supported. diff --git a/lib/src/binding_mqtt/mqtt_client_factory.dart b/lib/src/binding_mqtt/mqtt_client_factory.dart index 4c30baa9..ed24ff48 100644 --- a/lib/src/binding_mqtt/mqtt_client_factory.dart +++ b/lib/src/binding_mqtt/mqtt_client_factory.dart @@ -4,13 +4,13 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../core/credentials/basic_credentials.dart"; -import "../core/credentials/callbacks.dart"; -import "../core/protocol_interfaces/protocol_client.dart"; -import "../core/protocol_interfaces/protocol_client_factory.dart"; -import "constants.dart"; -import "mqtt_client.dart"; -import "mqtt_config.dart"; +import "package:dart_wot/src/binding_mqtt/constants.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_client.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_config.dart"; +import "package:dart_wot/src/core/credentials/basic_credentials.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client_factory.dart"; /// [ProtocolClientFactory] for creating [MqttClient]s. final class MqttClientFactory implements ProtocolClientFactory { diff --git a/lib/src/binding_mqtt/mqtt_config.dart b/lib/src/binding_mqtt/mqtt_config.dart index 4af38cde..c661ea80 100644 --- a/lib/src/binding_mqtt/mqtt_config.dart +++ b/lib/src/binding_mqtt/mqtt_config.dart @@ -4,11 +4,10 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/binding_mqtt/constants.dart"; import "package:meta/meta.dart"; import "package:mqtt_client/mqtt_client.dart"; -import "constants.dart"; - /// Allows for configuring the behavior of MQTT clients and servers. /// /// The default [QoS] values for the different operation types will be used if diff --git a/lib/src/binding_mqtt/mqtt_extensions.dart b/lib/src/binding_mqtt/mqtt_extensions.dart index 9555e422..63380c15 100644 --- a/lib/src/binding_mqtt/mqtt_extensions.dart +++ b/lib/src/binding_mqtt/mqtt_extensions.dart @@ -5,16 +5,15 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; + +import "package:dart_wot/core.dart"; +import "package:dart_wot/src/binding_mqtt/constants.dart"; +import "package:dart_wot/src/binding_mqtt/mqtt_binding_exception.dart"; + import "package:mqtt_client/mqtt_client.dart"; import "package:mqtt_client/mqtt_server_client.dart"; import "package:uuid/uuid.dart"; -import "../../core.dart"; - -import "constants.dart"; -import "mqtt_binding_exception.dart"; - /// [PrefixMapping] for expanding MQTT Vocabulary terms from compact IRIs. final mqttPrefixMapping = PrefixMapping(defaultPrefixValue: mqttContextUri); diff --git a/lib/src/binding_mqtt/mqtt_subscription.dart b/lib/src/binding_mqtt/mqtt_subscription.dart index 0cea8948..b46521a7 100644 --- a/lib/src/binding_mqtt/mqtt_subscription.dart +++ b/lib/src/binding_mqtt/mqtt_subscription.dart @@ -5,12 +5,11 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:dart_wot/core.dart"; +import "package:dart_wot/src/core/scripting_api/subscription.dart" + as scripting_api; import "package:mqtt_client/mqtt_client.dart"; import "package:mqtt_client/mqtt_server_client.dart"; -import "../core/content.dart"; -import "../core/scripting_api/subscription.dart" as scripting_api; - /// [scripting_api.Subscription] for the MQTT protocol. class MqttSubscription implements scripting_api.Subscription { /// Constructor. diff --git a/lib/src/core/augmented_form.dart b/lib/src/core/augmented_form.dart index 73e4571f..b552f436 100644 --- a/lib/src/core/augmented_form.dart +++ b/lib/src/core/augmented_form.dart @@ -5,19 +5,18 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:collection/collection.dart"; +import "package:dart_wot/src/core/definitions/additional_expected_response.dart"; +import "package:dart_wot/src/core/definitions/expected_response.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/operation_type.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:json_schema/json_schema.dart"; import "package:meta/meta.dart"; import "package:uri/uri.dart"; -import "definitions/additional_expected_response.dart"; -import "definitions/expected_response.dart"; -import "definitions/form.dart"; -import "definitions/interaction_affordances/interaction_affordance.dart"; -import "definitions/operation_type.dart"; -import "definitions/security/security_scheme.dart"; -import "definitions/thing_description.dart"; -import "definitions/validation/validation_exception.dart"; - /// A [Form] augmented with information from its asscociated [_thingDescription] /// and [_interactionAffordance]. @immutable diff --git a/lib/src/core/codecs/cbor_codec.dart b/lib/src/core/codecs/cbor_codec.dart index 69ac3a16..b7dfe8e7 100644 --- a/lib/src/core/codecs/cbor_codec.dart +++ b/lib/src/core/codecs/cbor_codec.dart @@ -5,10 +5,9 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:cbor/cbor.dart" as cbor; - -import "../definitions/data_schema.dart"; -import "../scripting_api/data_schema_value.dart"; -import "content_codec.dart"; +import "package:dart_wot/src/core/codecs/content_codec.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; /// A [ContentCodec] that encodes and decodes CBOR data. class CborCodec extends ContentCodec { diff --git a/lib/src/core/codecs/content_codec.dart b/lib/src/core/codecs/content_codec.dart index 82ca3007..d969cb79 100644 --- a/lib/src/core/codecs/content_codec.dart +++ b/lib/src/core/codecs/content_codec.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/data_schema.dart"; -import "../scripting_api/data_schema_value.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; /// Interface for providing a codec for a specific media type. abstract class ContentCodec { diff --git a/lib/src/core/codecs/json_codec.dart b/lib/src/core/codecs/json_codec.dart index 52d3f3a6..bc45000a 100644 --- a/lib/src/core/codecs/json_codec.dart +++ b/lib/src/core/codecs/json_codec.dart @@ -6,10 +6,9 @@ import "dart:convert"; -import "../definitions/data_schema.dart"; - -import "../scripting_api/data_schema_value.dart"; -import "content_codec.dart"; +import "package:dart_wot/src/core/codecs/content_codec.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; /// A [ContentCodec] that encodes and decodes JSON data. class JsonCodec extends ContentCodec { diff --git a/lib/src/core/codecs/text_codec.dart b/lib/src/core/codecs/text_codec.dart index 0cee2333..068e4fad 100644 --- a/lib/src/core/codecs/text_codec.dart +++ b/lib/src/core/codecs/text_codec.dart @@ -6,10 +6,9 @@ import "dart:convert"; -import "../definitions/data_schema.dart"; - -import "../scripting_api/data_schema_value.dart"; -import "content_codec.dart"; +import "package:dart_wot/src/core/codecs/content_codec.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; const _utf8Coding = "utf-8"; diff --git a/lib/src/core/consumed_thing.dart b/lib/src/core/consumed_thing.dart index d9b05ef2..b5535360 100644 --- a/lib/src/core/consumed_thing.dart +++ b/lib/src/core/consumed_thing.dart @@ -4,22 +4,22 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "augmented_form.dart"; -import "content.dart"; -import "definitions/data_schema.dart"; -import "definitions/form.dart"; -import "definitions/interaction_affordances/interaction_affordance.dart"; -import "definitions/operation_type.dart"; -import "definitions/thing_description.dart"; -import "interaction_output.dart"; -import "protocol_interfaces/protocol_client.dart"; - -import "scripting_api/consumed_thing.dart" as scripting_api; -import "scripting_api/interaction_input.dart"; -import "scripting_api/subscription.dart"; -import "scripting_api/types.dart"; - -import "servient.dart"; +import "package:dart_wot/src/core/augmented_form.dart"; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/operation_type.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/interaction_output.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; + +import "package:dart_wot/src/core/scripting_api/consumed_thing.dart" as scripting_api; +import "package:dart_wot/src/core/scripting_api/interaction_input.dart"; +import "package:dart_wot/src/core/scripting_api/subscription.dart"; +import "package:dart_wot/src/core/scripting_api/types.dart"; + +import "package:dart_wot/src/core/servient.dart"; /// This [Exception] is thrown when the body of a response is encoded /// differently than expected. diff --git a/lib/src/core/content.dart b/lib/src/core/content.dart index ed548681..60528ef7 100644 --- a/lib/src/core/content.dart +++ b/lib/src/core/content.dart @@ -6,12 +6,11 @@ import "dart:typed_data"; +import "package:dart_wot/src/core/content_serdes.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_input.dart"; import "package:typed_data/typed_data.dart"; -import "content_serdes.dart"; -import "definitions/data_schema.dart"; -import "scripting_api/interaction_input.dart"; - /// This class contains binary input or output data and indicates the media /// type this data is encoded in. class Content { diff --git a/lib/src/core/content_serdes.dart b/lib/src/core/content_serdes.dart index 0c69d1a1..16cd7774 100644 --- a/lib/src/core/content_serdes.dart +++ b/lib/src/core/content_serdes.dart @@ -6,18 +6,17 @@ import "dart:io"; +import "package:dart_wot/src/core/codecs/cbor_codec.dart"; +import "package:dart_wot/src/core/codecs/codec_media_type.dart"; +import "package:dart_wot/src/core/codecs/content_codec.dart"; +import "package:dart_wot/src/core/codecs/json_codec.dart"; +import "package:dart_wot/src/core/codecs/text_codec.dart"; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; import "package:http_parser/http_parser.dart"; import "package:json_schema/json_schema.dart"; -import "codecs/cbor_codec.dart"; -import "codecs/codec_media_type.dart"; -import "codecs/content_codec.dart"; -import "codecs/json_codec.dart"; -import "codecs/text_codec.dart"; -import "content.dart"; -import "definitions/data_schema.dart"; -import "scripting_api/data_schema_value.dart"; - /// Defines `application/json` as the default content type. const defaultMediaType = "application/json"; diff --git a/lib/src/core/credentials/ace_credentials.dart b/lib/src/core/credentials/ace_credentials.dart index 40e43eaf..06f07fd8 100644 --- a/lib/src/core/credentials/ace_credentials.dart +++ b/lib/src/core/credentials/ace_credentials.dart @@ -4,11 +4,10 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/ace_security_scheme.dart"; import "package:dcaf/dcaf.dart"; -import "../definitions/security/ace_security_scheme.dart"; -import "credentials.dart"; - /// [Credentials] used for the [AceSecurityScheme]. final class AceCredentials extends Credentials { /// Constructor. diff --git a/lib/src/core/credentials/apikey_credentials.dart b/lib/src/core/credentials/apikey_credentials.dart index fc7d90f4..77efb265 100644 --- a/lib/src/core/credentials/apikey_credentials.dart +++ b/lib/src/core/credentials/apikey_credentials.dart @@ -4,9 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/security/apikey_security_scheme.dart"; - -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/apikey_security_scheme.dart"; /// [Credentials] used for the [ApiKeySecurityScheme]. final class ApiKeyCredentials extends Credentials { diff --git a/lib/src/core/credentials/basic_credentials.dart b/lib/src/core/credentials/basic_credentials.dart index 8133c680..73fb4e9f 100644 --- a/lib/src/core/credentials/basic_credentials.dart +++ b/lib/src/core/credentials/basic_credentials.dart @@ -4,9 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/security/basic_security_scheme.dart"; - -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/basic_security_scheme.dart"; /// [Credentials] used for the [BasicSecurityScheme]. /// diff --git a/lib/src/core/credentials/bearer_credentials.dart b/lib/src/core/credentials/bearer_credentials.dart index e92e0d18..aeb86eff 100644 --- a/lib/src/core/credentials/bearer_credentials.dart +++ b/lib/src/core/credentials/bearer_credentials.dart @@ -4,9 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/security/bearer_security_scheme.dart"; - -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/bearer_security_scheme.dart"; /// [Credentials] used for the [BearerSecurityScheme]. final class BearerCredentials extends Credentials { diff --git a/lib/src/core/credentials/callbacks.dart b/lib/src/core/credentials/callbacks.dart index 194a1789..0f68a3ec 100644 --- a/lib/src/core/credentials/callbacks.dart +++ b/lib/src/core/credentials/callbacks.dart @@ -4,14 +4,13 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/core/augmented_form.dart"; +import "package:dart_wot/src/core/credentials/ace_credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/credentials/psk_credentials.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; import "package:dcaf/dcaf.dart"; -import "../augmented_form.dart"; -import "../definitions/form.dart"; -import "ace_credentials.dart"; -import "credentials.dart"; -import "psk_credentials.dart"; - /// Function signature for a synchronous callback for providing client /// [PskCredentials] at runtime. /// diff --git a/lib/src/core/credentials/digest_credentials.dart b/lib/src/core/credentials/digest_credentials.dart index ee89d798..81a6cdba 100644 --- a/lib/src/core/credentials/digest_credentials.dart +++ b/lib/src/core/credentials/digest_credentials.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/security/digest_security_scheme.dart"; -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/digest_security_scheme.dart"; /// [Credentials] used for the [DigestSecurityScheme]. final class DigestCredentials extends Credentials { diff --git a/lib/src/core/credentials/oauth2_credentials.dart b/lib/src/core/credentials/oauth2_credentials.dart index f5e4c058..ab8e1559 100644 --- a/lib/src/core/credentials/oauth2_credentials.dart +++ b/lib/src/core/credentials/oauth2_credentials.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/security/oauth2_security_scheme.dart"; -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/oauth2_security_scheme.dart"; /// [Credentials] used for the [OAuth2SecurityScheme]. final class OAuth2Credentials extends Credentials { diff --git a/lib/src/core/credentials/psk_credentials.dart b/lib/src/core/credentials/psk_credentials.dart index 32732082..304e390b 100644 --- a/lib/src/core/credentials/psk_credentials.dart +++ b/lib/src/core/credentials/psk_credentials.dart @@ -6,8 +6,8 @@ import "dart:typed_data"; -import "../definitions/security/psk_security_scheme.dart"; -import "credentials.dart"; +import "package:dart_wot/src/core/credentials/credentials.dart"; +import "package:dart_wot/src/core/definitions/security/psk_security_scheme.dart"; /// [Credentials] used for the [PskSecurityScheme]. final class PskCredentials extends Credentials { diff --git a/lib/src/core/definitions/additional_expected_response.dart b/lib/src/core/definitions/additional_expected_response.dart index c8f2c50c..f84eebc1 100644 --- a/lib/src/core/definitions/additional_expected_response.dart +++ b/lib/src/core/definitions/additional_expected_response.dart @@ -6,10 +6,9 @@ import "package:collection/collection.dart"; import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; import "package:meta/meta.dart"; -import "extensions/json_parser.dart"; - /// Communication metadata describing the expected response message for the /// primary response. @immutable diff --git a/lib/src/core/definitions/data_schema.dart b/lib/src/core/definitions/data_schema.dart index d2754704..24e84e26 100644 --- a/lib/src/core/definitions/data_schema.dart +++ b/lib/src/core/definitions/data_schema.dart @@ -5,10 +5,9 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; import "package:meta/meta.dart"; -import "extensions/json_parser.dart"; - /// Metadata that describes the data format used. It can be used for validation. /// /// See W3C WoT Thing Description specification, [section 5.3.2.1][spec link]. diff --git a/lib/src/core/definitions/expected_response.dart b/lib/src/core/definitions/expected_response.dart index 29f8457d..307ccc92 100644 --- a/lib/src/core/definitions/expected_response.dart +++ b/lib/src/core/definitions/expected_response.dart @@ -5,10 +5,9 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; import "package:meta/meta.dart"; -import "extensions/json_parser.dart"; - /// Communication metadata describing the expected response message for the /// primary response. @immutable diff --git a/lib/src/core/definitions/extensions/json_parser.dart b/lib/src/core/definitions/extensions/json_parser.dart index bd1c1391..9e3e2d42 100644 --- a/lib/src/core/definitions/extensions/json_parser.dart +++ b/lib/src/core/definitions/extensions/json_parser.dart @@ -1,27 +1,27 @@ import "package:collection/collection.dart"; import "package:curie/curie.dart"; -import "../additional_expected_response.dart"; -import "../data_schema.dart"; -import "../expected_response.dart"; -import "../form.dart"; -import "../interaction_affordances/interaction_affordance.dart"; -import "../link.dart"; -import "../operation_type.dart"; -import "../security/ace_security_scheme.dart"; -import "../security/apikey_security_scheme.dart"; -import "../security/auto_security_scheme.dart"; -import "../security/basic_security_scheme.dart"; -import "../security/bearer_security_scheme.dart"; -import "../security/combo_security_scheme.dart"; -import "../security/digest_security_scheme.dart"; -import "../security/no_security_scheme.dart"; -import "../security/oauth2_security_scheme.dart"; -import "../security/psk_security_scheme.dart"; -import "../security/security_scheme.dart"; -import "../thing_description.dart"; -import "../validation/validation_exception.dart"; -import "../version_info.dart"; +import "package:dart_wot/src/core/definitions/additional_expected_response.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/expected_response.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/link.dart"; +import "package:dart_wot/src/core/definitions/operation_type.dart"; +import "package:dart_wot/src/core/definitions/security/ace_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/apikey_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/auto_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/basic_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/bearer_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/combo_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/digest_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/no_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/oauth2_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/psk_security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; +import "package:dart_wot/src/core/definitions/version_info.dart"; const _validTdContextValues = [ "https://www.w3.org/2019/wot/td/v1", diff --git a/lib/src/core/definitions/form.dart b/lib/src/core/definitions/form.dart index 137602f7..afcb2e76 100644 --- a/lib/src/core/definitions/form.dart +++ b/lib/src/core/definitions/form.dart @@ -5,13 +5,12 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/additional_expected_response.dart"; +import "package:dart_wot/src/core/definitions/expected_response.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/operation_type.dart"; import "package:meta/meta.dart"; -import "additional_expected_response.dart"; -import "expected_response.dart"; -import "extensions/json_parser.dart"; -import "operation_type.dart"; - /// Contains the information needed for performing interactions with a Thing. @immutable class Form { diff --git a/lib/src/core/definitions/interaction_affordances/interaction_affordance.dart b/lib/src/core/definitions/interaction_affordances/interaction_affordance.dart index e82a0e54..4fc9deb4 100644 --- a/lib/src/core/definitions/interaction_affordances/interaction_affordance.dart +++ b/lib/src/core/definitions/interaction_affordances/interaction_affordance.dart @@ -9,15 +9,14 @@ library interaction_affordance; import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; import "package:meta/meta.dart"; -import "../data_schema.dart"; -import "../extensions/json_parser.dart"; -import "../form.dart"; - part "action.dart"; -part "property.dart"; part "event.dart"; +part "property.dart"; /// Base class for Interaction Affordances (Properties, Actions, and Events). @immutable diff --git a/lib/src/core/definitions/link.dart b/lib/src/core/definitions/link.dart index c12ade1c..bdc0e57e 100644 --- a/lib/src/core/definitions/link.dart +++ b/lib/src/core/definitions/link.dart @@ -5,10 +5,9 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; import "package:meta/meta.dart"; -import "extensions/json_parser.dart"; - /// Represents an element of the `links` array in a Thing Description. /// /// A link can be viewed as a statement of the form "link context has a relation diff --git a/lib/src/core/definitions/operation_type.dart b/lib/src/core/definitions/operation_type.dart index 2d472b8c..ccdffce7 100644 --- a/lib/src/core/definitions/operation_type.dart +++ b/lib/src/core/definitions/operation_type.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "interaction_affordances/interaction_affordance.dart"; -import "validation/validation_exception.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; /// Enumeration for the possible WoT operation types. /// diff --git a/lib/src/core/definitions/security/ace_security_scheme.dart b/lib/src/core/definitions/security/ace_security_scheme.dart index 06c1fab2..3ab09e58 100644 --- a/lib/src/core/definitions/security/ace_security_scheme.dart +++ b/lib/src/core/definitions/security/ace_security_scheme.dart @@ -6,9 +6,9 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [AceSecurityScheme]s. const aceSecuritySchemeName = "ace:ACESecurityScheme"; diff --git a/lib/src/core/definitions/security/apikey_security_scheme.dart b/lib/src/core/definitions/security/apikey_security_scheme.dart index 73abac94..36694f77 100644 --- a/lib/src/core/definitions/security/apikey_security_scheme.dart +++ b/lib/src/core/definitions/security/apikey_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; const _defaultInValue = "query"; diff --git a/lib/src/core/definitions/security/auto_security_scheme.dart b/lib/src/core/definitions/security/auto_security_scheme.dart index dc9b2cd2..ff40bfe6 100644 --- a/lib/src/core/definitions/security/auto_security_scheme.dart +++ b/lib/src/core/definitions/security/auto_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [AutoSecurityScheme]s. const autoSecuritySchemeName = "auto"; diff --git a/lib/src/core/definitions/security/basic_security_scheme.dart b/lib/src/core/definitions/security/basic_security_scheme.dart index 8ac1a641..5a5ac512 100644 --- a/lib/src/core/definitions/security/basic_security_scheme.dart +++ b/lib/src/core/definitions/security/basic_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; const _defaultInValue = "header"; diff --git a/lib/src/core/definitions/security/bearer_security_scheme.dart b/lib/src/core/definitions/security/bearer_security_scheme.dart index 3412fe58..ba7b8154 100644 --- a/lib/src/core/definitions/security/bearer_security_scheme.dart +++ b/lib/src/core/definitions/security/bearer_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; const _defaultInValue = "header"; const _defaultAlgValue = "ES256"; diff --git a/lib/src/core/definitions/security/combo_security_scheme.dart b/lib/src/core/definitions/security/combo_security_scheme.dart index d0aec36d..96606e00 100644 --- a/lib/src/core/definitions/security/combo_security_scheme.dart +++ b/lib/src/core/definitions/security/combo_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [ComboSecurityScheme]s. const comboSecuritySchemeName = "combo"; diff --git a/lib/src/core/definitions/security/digest_security_scheme.dart b/lib/src/core/definitions/security/digest_security_scheme.dart index 78fee8a8..071d20dd 100644 --- a/lib/src/core/definitions/security/digest_security_scheme.dart +++ b/lib/src/core/definitions/security/digest_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [DigestSecurityScheme]s. const digestSecuritySchemeName = "digest"; diff --git a/lib/src/core/definitions/security/no_security_scheme.dart b/lib/src/core/definitions/security/no_security_scheme.dart index f1aa0456..940ec4f8 100644 --- a/lib/src/core/definitions/security/no_security_scheme.dart +++ b/lib/src/core/definitions/security/no_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [NoSecurityScheme]s. const nosecSecuritySchemeName = "nosec"; diff --git a/lib/src/core/definitions/security/oauth2_security_scheme.dart b/lib/src/core/definitions/security/oauth2_security_scheme.dart index fd827e38..cedacbfe 100644 --- a/lib/src/core/definitions/security/oauth2_security_scheme.dart +++ b/lib/src/core/definitions/security/oauth2_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [OAuth2SecurityScheme]s. const oAuth2SecuritySchemeName = "oauth2"; diff --git a/lib/src/core/definitions/security/psk_security_scheme.dart b/lib/src/core/definitions/security/psk_security_scheme.dart index 3f36b330..a33a2254 100644 --- a/lib/src/core/definitions/security/psk_security_scheme.dart +++ b/lib/src/core/definitions/security/psk_security_scheme.dart @@ -6,8 +6,8 @@ import "package:curie/curie.dart"; -import "../extensions/json_parser.dart"; -import "security_scheme.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; /// Indicates the `scheme` value for identifying [PskSecurityScheme]s. const pskSecuritySchemeName = "psk"; diff --git a/lib/src/core/definitions/thing_description.dart b/lib/src/core/definitions/thing_description.dart index 66b3332f..96abde1e 100644 --- a/lib/src/core/definitions/thing_description.dart +++ b/lib/src/core/definitions/thing_description.dart @@ -5,19 +5,18 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:curie/curie.dart"; +import "package:dart_wot/src/core/definitions/additional_expected_response.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/link.dart"; +import "package:dart_wot/src/core/definitions/security/security_scheme.dart"; +import "package:dart_wot/src/core/definitions/thing_model.dart"; +import "package:dart_wot/src/core/definitions/validation/thing_description_schema.dart"; +import "package:dart_wot/src/core/definitions/version_info.dart"; import "package:meta/meta.dart"; -import "additional_expected_response.dart"; -import "data_schema.dart"; -import "extensions/json_parser.dart"; -import "form.dart"; -import "interaction_affordances/interaction_affordance.dart"; -import "link.dart"; -import "security/security_scheme.dart"; -import "thing_model.dart"; -import "validation/thing_description_schema.dart"; -import "version_info.dart"; - /// Type definition for a JSON-LD @context entry. typedef ContextEntry = ({String? key, String value}); diff --git a/lib/src/core/definitions/thing_model.dart b/lib/src/core/definitions/thing_model.dart index e7efa1c9..d35343c1 100644 --- a/lib/src/core/definitions/thing_model.dart +++ b/lib/src/core/definitions/thing_model.dart @@ -4,7 +4,7 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; /// Class representing a WoT Thing Model. /// diff --git a/lib/src/core/definitions/validation/thing_description_schema.dart b/lib/src/core/definitions/validation/thing_description_schema.dart index ae909443..1b1593a8 100644 --- a/lib/src/core/definitions/validation/thing_description_schema.dart +++ b/lib/src/core/definitions/validation/thing_description_schema.dart @@ -4,10 +4,9 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:json_schema/json_schema.dart"; -import "validation_exception.dart"; - /// JSON Schema definition used for validating Thing Descriptions. final thingDescriptionSchema = JsonSchema.create(_rawThingDescriptionSchema); diff --git a/lib/src/core/definitions/version_info.dart b/lib/src/core/definitions/version_info.dart index 1c3550f7..d3bae872 100644 --- a/lib/src/core/definitions/version_info.dart +++ b/lib/src/core/definitions/version_info.dart @@ -1,6 +1,6 @@ import "package:curie/curie.dart"; -import "extensions/json_parser.dart"; +import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; /// Metadata of a Thing that provides version information about the TD document. /// diff --git a/lib/src/core/discovery_expection.dart b/lib/src/core/discovery_expection.dart new file mode 100644 index 00000000..a7d2079a --- /dev/null +++ b/lib/src/core/discovery_expection.dart @@ -0,0 +1,13 @@ +/// Custom [Exception] that is thrown when the discovery process fails. +class DiscoveryException implements Exception { + /// Creates a new [DiscoveryException] with the specified error [message]. + DiscoveryException(this.message); + + /// The error message of this exception. + final String message; + + @override + String toString() { + return "DiscoveryException: $message"; + } +} diff --git a/lib/src/core/exposed_thing.dart b/lib/src/core/exposed_thing.dart index 59f9388c..95550fb6 100644 --- a/lib/src/core/exposed_thing.dart +++ b/lib/src/core/exposed_thing.dart @@ -4,13 +4,12 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/scripting_api/exposed_thing.dart" as scripting_api; import "package:dart_wot/src/core/scripting_api/exposed_thing.dart"; - -import "definitions/interaction_affordances/interaction_affordance.dart"; -import "definitions/thing_description.dart"; -import "scripting_api/exposed_thing.dart" as scripting_api; -import "scripting_api/types.dart"; -import "servient.dart"; +import "package:dart_wot/src/core/scripting_api/types.dart"; +import "package:dart_wot/src/core/servient.dart"; /// Implemention of the [scripting_api.ExposedThing] interface. class ExposedThing implements scripting_api.ExposedThing { diff --git a/lib/src/core/interaction_output.dart b/lib/src/core/interaction_output.dart index eade334a..2d446170 100644 --- a/lib/src/core/interaction_output.dart +++ b/lib/src/core/interaction_output.dart @@ -6,11 +6,11 @@ import "dart:typed_data"; -import "content.dart"; -import "content_serdes.dart"; -import "definitions/data_schema.dart"; -import "definitions/form.dart"; -import "scripting_api/interaction_output.dart" as scripting_api; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/content_serdes.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_output.dart" as scripting_api; /// Implementation of the [scripting_api.InteractionOutput] interface. class InteractionOutput implements scripting_api.InteractionOutput { diff --git a/lib/src/core/protocol_interfaces/protocol_client.dart b/lib/src/core/protocol_interfaces/protocol_client.dart index 1e124c9c..382e18cf 100644 --- a/lib/src/core/protocol_interfaces/protocol_client.dart +++ b/lib/src/core/protocol_interfaces/protocol_client.dart @@ -4,9 +4,9 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../augmented_form.dart"; -import "../content.dart"; -import "../scripting_api/subscription.dart"; +import "package:dart_wot/src/core/augmented_form.dart"; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/scripting_api/subscription.dart"; /// Base class for a Protocol Client. abstract interface class ProtocolClient { diff --git a/lib/src/core/protocol_interfaces/protocol_client_factory.dart b/lib/src/core/protocol_interfaces/protocol_client_factory.dart index fe120073..be1d1ee8 100644 --- a/lib/src/core/protocol_interfaces/protocol_client_factory.dart +++ b/lib/src/core/protocol_interfaces/protocol_client_factory.dart @@ -4,7 +4,7 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "protocol_client.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; /// Base class for a factory that produces [ProtocolClient]s. abstract interface class ProtocolClientFactory { diff --git a/lib/src/core/protocol_interfaces/protocol_server.dart b/lib/src/core/protocol_interfaces/protocol_server.dart index f83b8b39..40ba3475 100644 --- a/lib/src/core/protocol_interfaces/protocol_server.dart +++ b/lib/src/core/protocol_interfaces/protocol_server.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../credentials/callbacks.dart"; -import "../scripting_api/exposed_thing.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/scripting_api/exposed_thing.dart"; /// Base class for a Protocol Server. abstract interface class ProtocolServer { diff --git a/lib/src/core/scripting_api.dart b/lib/src/core/scripting_api.dart new file mode 100644 index 00000000..33f7c8b5 --- /dev/null +++ b/lib/src/core/scripting_api.dart @@ -0,0 +1,10 @@ +export "scripting_api/consumed_thing.dart"; +export "scripting_api/data_schema_value.dart"; +export "scripting_api/discovery/discovery_method.dart"; +export "scripting_api/discovery/thing_discovery.dart"; +export "scripting_api/discovery/thing_filter.dart"; +export "scripting_api/exposed_thing.dart"; +export "scripting_api/interaction_input.dart"; +export "scripting_api/interaction_output.dart"; +export "scripting_api/subscription.dart"; +export "scripting_api/wot.dart"; diff --git a/lib/src/core/scripting_api/consumed_thing.dart b/lib/src/core/scripting_api/consumed_thing.dart index ece54bcb..3f04ce6b 100644 --- a/lib/src/core/scripting_api/consumed_thing.dart +++ b/lib/src/core/scripting_api/consumed_thing.dart @@ -4,11 +4,11 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/thing_description.dart"; -import "interaction_input.dart"; -import "interaction_output.dart"; -import "subscription.dart"; -import "types.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_input.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_output.dart"; +import "package:dart_wot/src/core/scripting_api/subscription.dart"; +import "package:dart_wot/src/core/scripting_api/types.dart"; /// User provided callback that is given an argument of type [InteractionOutput] /// and is used for observing Property changes and handling Event notifications. diff --git a/lib/src/core/scripting_api/discovery/thing_discovery.dart b/lib/src/core/scripting_api/discovery/thing_discovery.dart index 5fde1f43..6f9550a6 100644 --- a/lib/src/core/scripting_api/discovery/thing_discovery.dart +++ b/lib/src/core/scripting_api/discovery/thing_discovery.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../../definitions/thing_description.dart"; -import "thing_filter.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/scripting_api/discovery/thing_filter.dart"; /// Provides the properties and methods controlling the discovery process. /// diff --git a/lib/src/core/scripting_api/exposed_thing.dart b/lib/src/core/scripting_api/exposed_thing.dart index e385a10c..36c06bbb 100644 --- a/lib/src/core/scripting_api/exposed_thing.dart +++ b/lib/src/core/scripting_api/exposed_thing.dart @@ -4,9 +4,9 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/thing_description.dart"; -import "interaction_input.dart"; -import "interaction_output.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_input.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_output.dart"; /// A function that is called when an external request for reading a Property is /// received and defines what to do with such requests. diff --git a/lib/src/core/scripting_api/interaction_input.dart b/lib/src/core/scripting_api/interaction_input.dart index e63f9aaa..cd7b72b4 100644 --- a/lib/src/core/scripting_api/interaction_input.dart +++ b/lib/src/core/scripting_api/interaction_input.dart @@ -4,10 +4,9 @@ // // SPDX-License-Identifier: BSD-3-Clause +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; import "package:meta/meta.dart"; -import "data_schema_value.dart"; - /// The (optional) input for an interaction. /// /// Can be either a [DataSchemaValue] or a byte [Stream]. diff --git a/lib/src/core/scripting_api/interaction_output.dart b/lib/src/core/scripting_api/interaction_output.dart index 48dd16fd..8fa50b4d 100644 --- a/lib/src/core/scripting_api/interaction_output.dart +++ b/lib/src/core/scripting_api/interaction_output.dart @@ -6,8 +6,8 @@ import "dart:typed_data"; -import "../definitions/data_schema.dart"; -import "../definitions/form.dart"; +import "package:dart_wot/src/core/definitions/data_schema.dart"; +import "package:dart_wot/src/core/definitions/form.dart"; /// Exposes the data obtained by Thing interactions. /// diff --git a/lib/src/core/scripting_api/subscription.dart b/lib/src/core/scripting_api/subscription.dart index 40c70356..868d7b71 100644 --- a/lib/src/core/scripting_api/subscription.dart +++ b/lib/src/core/scripting_api/subscription.dart @@ -4,7 +4,7 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/operation_type.dart"; +import "package:dart_wot/src/core/definitions/operation_type.dart"; /// [Exception] that is thrown when error during the unsubscribe process occurs. class UnsubscribeException implements Exception { diff --git a/lib/src/core/scripting_api/types.dart b/lib/src/core/scripting_api/types.dart index b98ca763..175b76b3 100644 --- a/lib/src/core/scripting_api/types.dart +++ b/lib/src/core/scripting_api/types.dart @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "interaction_input.dart"; -import "interaction_output.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_input.dart"; +import "package:dart_wot/src/core/scripting_api/interaction_output.dart"; /// Maps multiple [InteractionOutput]s to property names. /// diff --git a/lib/src/core/scripting_api/wot.dart b/lib/src/core/scripting_api/wot.dart index 19822d4a..28f3ace1 100644 --- a/lib/src/core/scripting_api/wot.dart +++ b/lib/src/core/scripting_api/wot.dart @@ -4,14 +4,14 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "../definitions/thing_description.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; -import "consumed_thing.dart"; -import "discovery/discovery_method.dart"; -import "discovery/thing_discovery.dart"; -import "discovery/thing_filter.dart"; -import "exposed_thing.dart"; -import "types.dart"; +import "package:dart_wot/src/core/scripting_api/consumed_thing.dart"; +import "package:dart_wot/src/core/scripting_api/discovery/discovery_method.dart"; +import "package:dart_wot/src/core/scripting_api/discovery/thing_discovery.dart"; +import "package:dart_wot/src/core/scripting_api/discovery/thing_filter.dart"; +import "package:dart_wot/src/core/scripting_api/exposed_thing.dart"; +import "package:dart_wot/src/core/scripting_api/types.dart"; /// Interface for a [WoT] runtime. /// diff --git a/lib/src/core/servient.dart b/lib/src/core/servient.dart index fd33eca6..33c2a5f4 100644 --- a/lib/src/core/servient.dart +++ b/lib/src/core/servient.dart @@ -4,18 +4,18 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "consumed_thing.dart"; -import "content_serdes.dart"; -import "credentials/callbacks.dart"; -import "definitions/interaction_affordances/interaction_affordance.dart"; -import "definitions/thing_description.dart"; -import "exposed_thing.dart"; -import "protocol_interfaces/protocol_client.dart"; -import "protocol_interfaces/protocol_client_factory.dart"; -import "protocol_interfaces/protocol_server.dart"; -import "scripting_api/data_schema_value.dart"; -import "thing_discovery.dart"; -import "wot.dart"; +import "package:dart_wot/src/core/consumed_thing.dart"; +import "package:dart_wot/src/core/content_serdes.dart"; +import "package:dart_wot/src/core/credentials/callbacks.dart"; +import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/discovery_expection.dart"; +import "package:dart_wot/src/core/exposed_thing.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client_factory.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_server.dart"; +import "package:dart_wot/src/core/scripting_api/data_schema_value.dart"; +import "package:dart_wot/src/core/wot.dart"; /// Exception that is thrown by a [Servient]. class ServientException implements Exception { diff --git a/lib/src/core/thing_discovery.dart b/lib/src/core/thing_discovery.dart index 88861863..858a7742 100644 --- a/lib/src/core/thing_discovery.dart +++ b/lib/src/core/thing_discovery.dart @@ -8,26 +8,14 @@ import "dart:async"; import "package:coap/coap.dart"; import "package:collection/collection.dart"; +import "package:dart_wot/src/core/content.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/discovery_expection.dart"; +import "package:dart_wot/src/core/protocol_interfaces/protocol_client.dart"; +import "package:dart_wot/src/core/scripting_api.dart" as scripting_api; +import "package:dart_wot/src/core/servient.dart"; import "package:multicast_dns/multicast_dns.dart"; -import "../../core.dart"; -import "content.dart"; -import 'scripting_api/discovery/thing_discovery.dart' as scripting_api; - -/// Custom [Exception] that is thrown when the discovery process fails. -class DiscoveryException implements Exception { - /// Creates a new [DiscoveryException] with the specified error [message]. - DiscoveryException(this.message); - - /// The error message of this exception. - final String message; - - @override - String toString() { - return "DiscoveryException: $message"; - } -} - /// Implemention of the [scripting_api.ThingDiscovery] interface. class ThingDiscovery extends Stream implements scripting_api.ThingDiscovery { @@ -36,19 +24,19 @@ class ThingDiscovery extends Stream this._url, this.thingFilter, this._servient, { - required DiscoveryMethod method, + required scripting_api.DiscoveryMethod method, }) : _method = method { _stream = _start(); } /// Represents the discovery type that should be used in the discovery process - final DiscoveryMethod _method; + final scripting_api.DiscoveryMethod _method; /// Represents the URL of the target entity serving the discovery request. /// /// This is, for instance the URL of a Thing Directory (if [_method] is - /// [DiscoveryMethod.directory]), or the URL of a directly targeted Thing (if - /// [_method] is [DiscoveryMethod.direct]). + /// [scripting_api.DiscoveryMethod.directory]), or the URL of a directly + /// targeted Thing (if [_method] is [scripting_api.DiscoveryMethod.direct]). final Uri _url; final Servient _servient; @@ -61,19 +49,19 @@ class ThingDiscovery extends Stream bool get active => _active; @override - final ThingFilter? thingFilter; + final scripting_api.ThingFilter? thingFilter; late final Stream _stream; Stream _start() async* { switch (_method) { - case DiscoveryMethod.direct: + case scripting_api.DiscoveryMethod.direct: yield* _discoverDirectly(_url); - case DiscoveryMethod.coreLinkFormat: + case scripting_api.DiscoveryMethod.coreLinkFormat: yield* _discoverWithCoreLinkFormat(_url); - case DiscoveryMethod.coreResourceDirectory: + case scripting_api.DiscoveryMethod.coreResourceDirectory: yield* _discoverfromCoreResourceDirectory(_url); - case DiscoveryMethod.dnsServiceDiscovery: + case scripting_api.DiscoveryMethod.dnsServiceDiscovery: yield* _discoverUsingDnsServiceDiscovery(_url); default: throw UnimplementedError(); @@ -105,7 +93,8 @@ class ThingDiscovery extends Stream ) async { final dataSchemaValue = await _servient.contentSerdes.contentToValue(content, null); - if (dataSchemaValue is! DataSchemaValue>) { + if (dataSchemaValue + is! scripting_api.DataSchemaValue>) { throw DiscoveryException( "Could not parse Thing Description obtained from ${content.sourceUri}", ); @@ -129,7 +118,7 @@ class ThingDiscovery extends Stream final dataSchemaValue = await _servient.contentSerdes.contentToValue(content, null); - if (dataSchemaValue is! DataSchemaValue) { + if (dataSchemaValue is! scripting_api.DataSchemaValue) { throw DiscoveryException( "Could not parse Thing Description obtained from $sourceUri", ); @@ -401,7 +390,7 @@ class ThingDiscoveryProcess extends Stream Exception? get error => _error; @override - final ThingFilter? thingFilter; + final scripting_api.ThingFilter? thingFilter; @override StreamSubscription listen( diff --git a/lib/src/core/wot.dart b/lib/src/core/wot.dart index d1dc38e5..9bd44b87 100644 --- a/lib/src/core/wot.dart +++ b/lib/src/core/wot.dart @@ -6,21 +6,15 @@ import "dart:async"; +import "package:dart_wot/src/core/consumed_thing.dart"; +import "package:dart_wot/src/core/definitions/thing_description.dart"; +import "package:dart_wot/src/core/discovery_expection.dart"; +import "package:dart_wot/src/core/exposed_thing.dart"; +import "package:dart_wot/src/core/scripting_api.dart" as scripting_api; +import "package:dart_wot/src/core/servient.dart"; +import "package:dart_wot/src/core/thing_discovery.dart"; import "package:uuid/uuid.dart"; -import "consumed_thing.dart"; -import "definitions/thing_description.dart"; -import "exposed_thing.dart"; -import "scripting_api/consumed_thing.dart" as scripting_api_consumed_thing; -import 'scripting_api/discovery/discovery_method.dart'; -import "scripting_api/exposed_thing.dart" as scripting_api_exposed_thing; -import "scripting_api/wot.dart" as scripting_api_wot; -import "scripting_api/discovery/thing_filter.dart" as scripting_api_discovery; -import 'scripting_api/discovery/thing_discovery.dart' as scripting_api; -import "servient.dart"; -import "thing_discovery.dart" - show DiscoveryException, ThingDiscovery, ThingDiscoveryProcess; - /// This [Exception] is thrown if an error during the consumption of a /// [ThingDescription] occurs. class ThingConsumptionException implements Exception { @@ -54,20 +48,20 @@ class ThingProductionException implements Exception { } /// Implementation of the [scripting_api.WoT] runtime interface. -class WoT implements scripting_api_wot.WoT { +class WoT implements scripting_api.WoT { /// Creates a new [WoT] runtime based on a [Servient]. WoT(this._servient); final Servient _servient; - /// Consumes a [ThingDescription] and returns a [scripting_api_consumed_thing.ConsumedThing]. + /// Consumes a [ThingDescription] and returns a [scripting_api.ConsumedThing]. /// /// The returned [ConsumedThing] can then be used to trigger /// interaction affordances exposed by the Thing. /// /// If a [ThingDescription] with the same identifier has already been @override - Future consume( + Future consume( ThingDescription thingDescription, ) async { final newThing = ConsumedThing(_servient, thingDescription); @@ -81,7 +75,7 @@ class WoT implements scripting_api_wot.WoT { /// Exposes a Thing based on a (partial) TD. @override - Future produce( + Future produce( Map init, ) async { const uuid = Uuid(); @@ -103,8 +97,8 @@ class WoT implements scripting_api_wot.WoT { @override ThingDiscovery discover( Uri url, { - scripting_api_discovery.ThingFilter? thingFilter, - DiscoveryMethod method = DiscoveryMethod.direct, + scripting_api.ThingFilter? thingFilter, + scripting_api.DiscoveryMethod method = scripting_api.DiscoveryMethod.direct, }) { return ThingDiscovery(url, thingFilter, _servient, method: method); } @@ -117,7 +111,7 @@ class WoT implements scripting_api_wot.WoT { @override Future exploreDirectory( Uri url, [ - scripting_api_discovery.ThingFilter? filter, + scripting_api.ThingFilter? filter, ]) async { final thingDescription = await requestThingDescription(url); diff --git a/test/binding_coap/coap_vocabulary_test.dart b/test/binding_coap/coap_vocabulary_test.dart index 196044bb..58d751d4 100644 --- a/test/binding_coap/coap_vocabulary_test.dart +++ b/test/binding_coap/coap_vocabulary_test.dart @@ -8,7 +8,6 @@ import "package:coap/coap.dart"; import "package:dart_wot/core.dart"; import "package:dart_wot/src/binding_coap/coap_definitions.dart"; import "package:dart_wot/src/binding_coap/coap_extensions.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:test/test.dart"; void main() { diff --git a/test/binding_mqtt/mqtt_extension_test.dart b/test/binding_mqtt/mqtt_extension_test.dart index 67a29824..99fa4a2f 100644 --- a/test/binding_mqtt/mqtt_extension_test.dart +++ b/test/binding_mqtt/mqtt_extension_test.dart @@ -6,7 +6,6 @@ import "package:dart_wot/core.dart"; import "package:dart_wot/src/binding_mqtt/mqtt_extensions.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:test/test.dart"; void main() { diff --git a/test/core/augmented_form_test.dart b/test/core/augmented_form_test.dart index 13a85c6f..da59293d 100644 --- a/test/core/augmented_form_test.dart +++ b/test/core/augmented_form_test.dart @@ -5,7 +5,6 @@ // SPDX-License-Identifier: BSD-3-Clause import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:test/test.dart"; void main() { diff --git a/test/core/consumed_thing_test.dart b/test/core/consumed_thing_test.dart index f038f5e7..81c17f6c 100644 --- a/test/core/consumed_thing_test.dart +++ b/test/core/consumed_thing_test.dart @@ -6,7 +6,6 @@ import "package:dart_wot/binding_http.dart"; import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:test/test.dart"; void main() { diff --git a/test/core/content_test.dart b/test/core/content_test.dart index af24a435..0cf127a5 100644 --- a/test/core/content_test.dart +++ b/test/core/content_test.dart @@ -7,7 +7,6 @@ import "dart:convert"; import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/content.dart"; import "package:test/test.dart"; void main() { diff --git a/test/core/definitions_test.dart b/test/core/definitions_test.dart index 83a52b1e..01a8d462 100644 --- a/test/core/definitions_test.dart +++ b/test/core/definitions_test.dart @@ -8,13 +8,8 @@ import "dart:convert"; import "package:curie/curie.dart"; import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/definitions/additional_expected_response.dart"; -import "package:dart_wot/src/core/definitions/data_schema.dart"; -import "package:dart_wot/src/core/definitions/expected_response.dart"; import "package:dart_wot/src/core/definitions/extensions/json_parser.dart"; -import "package:dart_wot/src/core/definitions/operation_type.dart"; import "package:dart_wot/src/core/definitions/validation/thing_description_schema.dart"; -import "package:dart_wot/src/core/definitions/validation/validation_exception.dart"; import "package:test/test.dart"; void main() { diff --git a/test/core/discovery_test.dart b/test/core/discovery_test.dart index 6e2471e4..4be01c17 100644 --- a/test/core/discovery_test.dart +++ b/test/core/discovery_test.dart @@ -8,8 +8,6 @@ import "dart:async"; import "dart:convert"; import "package:dart_wot/core.dart"; -import "package:dart_wot/src/core/content.dart"; -import "package:dart_wot/src/core/thing_discovery.dart"; import "package:test/test.dart"; const testUriScheme = "test"; diff --git a/test/core/interaction_output_test.dart b/test/core/interaction_output_test.dart index f305fa25..8261e491 100644 --- a/test/core/interaction_output_test.dart +++ b/test/core/interaction_output_test.dart @@ -6,8 +6,7 @@ import "dart:convert"; -import "package:dart_wot/src/core/content.dart"; -import "package:dart_wot/src/core/content_serdes.dart"; +import "package:dart_wot/core.dart" hide InteractionOutput; import "package:dart_wot/src/core/interaction_output.dart"; import "package:test/test.dart"; diff --git a/test/core/operation_type_test.dart b/test/core/operation_type_test.dart index 58717041..253e831b 100644 --- a/test/core/operation_type_test.dart +++ b/test/core/operation_type_test.dart @@ -4,9 +4,7 @@ // // SPDX-License-Identifier: BSD-3-Clause -import "package:dart_wot/src/core/definitions/data_schema.dart"; -import "package:dart_wot/src/core/definitions/interaction_affordances/interaction_affordance.dart"; -import "package:dart_wot/src/core/definitions/operation_type.dart"; +import "package:dart_wot/core.dart"; import "package:test/test.dart"; void main() {