From 54a3dc67d8035bc986856ad111ab98e4d3469ff9 Mon Sep 17 00:00:00 2001 From: Ricardo Boss Date: Thu, 8 Feb 2024 14:37:23 +0100 Subject: [PATCH] Renamed project from dart_kiota to kiota_abstractions --- README.md | 39 +++++++++---------- ...art_kiota.dart => kiota_abstractions.dart} | 2 +- lib/src/api_client_builder.dart | 2 +- lib/src/api_exception.dart | 2 +- lib/src/base_request_builder.dart | 2 +- lib/src/extensions/map_extensions.dart | 2 +- .../request_information_extensions.dart | 2 +- lib/src/method.dart | 2 +- lib/src/multipart_body.dart | 2 +- lib/src/request_adapter.dart | 2 +- lib/src/request_headers.dart | 2 +- lib/src/request_information.dart | 2 +- lib/src/request_option.dart | 2 +- lib/src/response_handler.dart | 2 +- lib/src/response_handler_option.dart | 2 +- lib/src/serialization/parsable.dart | 2 +- lib/src/serialization/parsable_factory.dart | 2 +- lib/src/serialization/parse_node.dart | 2 +- lib/src/serialization/parse_node_factory.dart | 2 +- .../parse_node_factory_registry.dart | 2 +- .../serialization/serialization_writer.dart | 2 +- .../serialization_writer_factory.dart | 2 +- ...serialization_writer_factory_registry.dart | 2 +- pubspec.yaml | 10 ++++- test/request_information_test.dart | 2 +- test/request_information_test.mocks.dart | 4 +- 26 files changed, 52 insertions(+), 47 deletions(-) rename lib/{dart_kiota.dart => kiota_abstractions.dart} (97%) diff --git a/README.md b/README.md index 70e32fc..6aa2993 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,30 @@ -TODO: Put a short description of the package here that helps potential users -know whether this package might be useful for them. +The Kiota abstractions library for Dart defines the basic constructs Kiota projects need once +a client has been generated from an OpenAPI definition. -## Features - -TODO: List what your package can do. Maybe include images, gifs, or videos. - -## Getting started - -TODO: List prerequisites and provide or point to information on how to -start using the package. +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to the +abstraction package to build and run. ## Usage -TODO: Include short and useful examples for package users. Add longer examples -to `/example` folder. +Install the package in the generated project: -```dart -const like = 'sample'; -``` +> For now, you can add the git repository as a dependency in your `pubspec.yaml` file: +> +> ```yaml +> dependencies: +> kiota_abstractions: +> git: +> url: https://github.com/ricardoboss/dart_kiota_abstractions.git +> ref: main +> ``` -## Additional information +```bash +dart pub add kiota_abstractions +``` -TODO: Tell users more about the package: where to find more information, how to -contribute to the package, how to file issues, what response they can expect -from the package authors, and more. +## Development -## TODO +### TODO From the comment at: https://github.com/microsoft/kiota/issues/2199#issuecomment-1772865549 diff --git a/lib/dart_kiota.dart b/lib/kiota_abstractions.dart similarity index 97% rename from lib/dart_kiota.dart rename to lib/kiota_abstractions.dart index 2795ad4..5ab25cc 100644 --- a/lib/dart_kiota.dart +++ b/lib/kiota_abstractions.dart @@ -1,4 +1,4 @@ -library dart_kiota; +library kiota_abstractions; import 'dart:async'; import 'dart:collection'; diff --git a/lib/src/api_client_builder.dart b/lib/src/api_client_builder.dart index 3b65958..87e2452 100644 --- a/lib/src/api_client_builder.dart +++ b/lib/src/api_client_builder.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Provides a builder for creating an ApiClient and register the default /// serializers/deserializers. diff --git a/lib/src/api_exception.dart b/lib/src/api_exception.dart index 867c697..118325a 100644 --- a/lib/src/api_exception.dart +++ b/lib/src/api_exception.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Parent type for exceptions thrown by the client when receiving failed /// responses to its requests. diff --git a/lib/src/base_request_builder.dart b/lib/src/base_request_builder.dart index 31d1834..af21cc9 100644 --- a/lib/src/base_request_builder.dart +++ b/lib/src/base_request_builder.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Base class for all request builders. abstract class BaseRequestBuilder { diff --git a/lib/src/extensions/map_extensions.dart b/lib/src/extensions/map_extensions.dart index 7c8f742..127ddd0 100644 --- a/lib/src/extensions/map_extensions.dart +++ b/lib/src/extensions/map_extensions.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Extension methods for the [Map] class. extension on Map { diff --git a/lib/src/extensions/request_information_extensions.dart b/lib/src/extensions/request_information_extensions.dart index 67d9e18..babc400 100644 --- a/lib/src/extensions/request_information_extensions.dart +++ b/lib/src/extensions/request_information_extensions.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; extension RequestInformationExtensions on RequestInformation { static const contentTypeHeader = 'Content-Type'; diff --git a/lib/src/method.dart b/lib/src/method.dart index eb7fe03..4ff576d 100644 --- a/lib/src/method.dart +++ b/lib/src/method.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Represents the HTTP method used by a request. enum Method { diff --git a/lib/src/multipart_body.dart b/lib/src/multipart_body.dart index 867e667..b8da187 100644 --- a/lib/src/multipart_body.dart +++ b/lib/src/multipart_body.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Represents a multipart body for a request or a response class MultipartBody implements Parsable { diff --git a/lib/src/request_adapter.dart b/lib/src/request_adapter.dart index 7cb03eb..df88fc0 100644 --- a/lib/src/request_adapter.dart +++ b/lib/src/request_adapter.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Service responsible for translating abstract [RequestInformation] into /// concrete native HTTP requests. diff --git a/lib/src/request_headers.dart b/lib/src/request_headers.dart index 384858b..88c8a0a 100644 --- a/lib/src/request_headers.dart +++ b/lib/src/request_headers.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; class RequestHeaders implements Map { RequestHeaders(); diff --git a/lib/src/request_information.dart b/lib/src/request_information.dart index a065299..a21823d 100644 --- a/lib/src/request_information.dart +++ b/lib/src/request_information.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// This class represents an abstract HTTP request. class RequestInformation { diff --git a/lib/src/request_option.dart b/lib/src/request_option.dart index 073e0d2..3b5e05a 100644 --- a/lib/src/request_option.dart +++ b/lib/src/request_option.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Represents a request option. abstract class RequestOption {} diff --git a/lib/src/response_handler.dart b/lib/src/response_handler.dart index c2c6a90..6321e7b 100644 --- a/lib/src/response_handler.dart +++ b/lib/src/response_handler.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; // ignore: one_member_abstracts abstract class ResponseHandler { diff --git a/lib/src/response_handler_option.dart b/lib/src/response_handler_option.dart index 0713df4..7169874 100644 --- a/lib/src/response_handler_option.dart +++ b/lib/src/response_handler_option.dart @@ -1,4 +1,4 @@ -part of '../dart_kiota.dart'; +part of '../kiota_abstractions.dart'; /// Defines the [RequestOption] for holding a [ResponseHandler]. class ResponseHandlerOption implements RequestOption { diff --git a/lib/src/serialization/parsable.dart b/lib/src/serialization/parsable.dart index 2781a32..805e669 100644 --- a/lib/src/serialization/parsable.dart +++ b/lib/src/serialization/parsable.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Defines a serializable model object abstract class Parsable { diff --git a/lib/src/serialization/parsable_factory.dart b/lib/src/serialization/parsable_factory.dart index 9210a03..d4af705 100644 --- a/lib/src/serialization/parsable_factory.dart +++ b/lib/src/serialization/parsable_factory.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Defines the factory for creating parsable objects. The [node] used to get /// the discriminator value from the payload. diff --git a/lib/src/serialization/parse_node.dart b/lib/src/serialization/parse_node.dart index 6d51e6e..d4dde55 100644 --- a/lib/src/serialization/parse_node.dart +++ b/lib/src/serialization/parse_node.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Interface for a deserialization node in a parse tree. This interface /// provides an abstraction layer over serialization formats, libraries and diff --git a/lib/src/serialization/parse_node_factory.dart b/lib/src/serialization/parse_node_factory.dart index aacfa35..0d3ee2f 100644 --- a/lib/src/serialization/parse_node_factory.dart +++ b/lib/src/serialization/parse_node_factory.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Defines the contract for a factory that creates parse nodes. abstract class ParseNodeFactory { diff --git a/lib/src/serialization/parse_node_factory_registry.dart b/lib/src/serialization/parse_node_factory_registry.dart index 210d7d3..e013064 100644 --- a/lib/src/serialization/parse_node_factory_registry.dart +++ b/lib/src/serialization/parse_node_factory_registry.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// A regex that matches any sequence of characters that are not a forward slash /// followed by a plus sign. diff --git a/lib/src/serialization/serialization_writer.dart b/lib/src/serialization/serialization_writer.dart index e4119e0..05df415 100644 --- a/lib/src/serialization/serialization_writer.dart +++ b/lib/src/serialization/serialization_writer.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; abstract class SerializationWriter { /// Writes the specified string value to the stream with an optional given diff --git a/lib/src/serialization/serialization_writer_factory.dart b/lib/src/serialization/serialization_writer_factory.dart index 5f6da9f..674390a 100644 --- a/lib/src/serialization/serialization_writer_factory.dart +++ b/lib/src/serialization/serialization_writer_factory.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// Defines the contract for a factory that creates [SerializationWriter] /// instances. diff --git a/lib/src/serialization/serialization_writer_factory_registry.dart b/lib/src/serialization/serialization_writer_factory_registry.dart index 57e22c0..3c8ec53 100644 --- a/lib/src/serialization/serialization_writer_factory_registry.dart +++ b/lib/src/serialization/serialization_writer_factory_registry.dart @@ -1,4 +1,4 @@ -part of '../../dart_kiota.dart'; +part of '../../kiota_abstractions.dart'; /// This factory holds a list of all the registered factories for the various /// types of nodes. diff --git a/pubspec.yaml b/pubspec.yaml index 87f1dc7..faa884d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,9 +1,15 @@ -name: dart_kiota +name: kiota_abstractions description: "Kiota abstractions for Dart." version: 0.0.1 -homepage: https://github.com/ricardoboss/dart_kiota +homepage: https://github.com/ricardoboss/dart_kiota_abstractions publish_to: 'none' +topics: + - kiota + - abstractions + - api + - client + environment: sdk: '>=3.2.6 <4.0.0' diff --git a/test/request_information_test.dart b/test/request_information_test.dart index a559485..3180b3d 100644 --- a/test/request_information_test.dart +++ b/test/request_information_test.dart @@ -2,7 +2,7 @@ import 'dart:typed_data'; -import 'package:dart_kiota/dart_kiota.dart'; +import 'package:kiota_abstractions/kiota_abstractions.dart'; import 'package:mockito/annotations.dart'; import 'package:test/test.dart'; diff --git a/test/request_information_test.mocks.dart b/test/request_information_test.mocks.dart index 09c9ea8..31407a5 100644 --- a/test/request_information_test.mocks.dart +++ b/test/request_information_test.mocks.dart @@ -1,9 +1,9 @@ // Mocks generated by Mockito 5.4.4 from annotations -// in dart_kiota/test/request_information_test.dart. +// in kiota_abstractions/test/request_information_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:dart_kiota/dart_kiota.dart' as _i2; +import 'package:kiota_abstractions/kiota_abstractions.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint