From 8e8a2d3891008b9d7fc9445e087d46bf292a3d17 Mon Sep 17 00:00:00 2001 From: JT Date: Mon, 13 Jan 2025 18:51:13 +0800 Subject: [PATCH] v1.10.0 --- .nuke/build.schema.json | 30 +++++++++++-------- Package.Build.props | 2 +- build/_build.csproj | 2 +- .../DependencyInjectionExtensions.cs | 10 +++++++ src/Clerk.Net.Tests/Clerk.Net.Tests.csproj | 4 +-- src/Clerk.Net/Clerk.Net.csproj | 2 +- src/Clerk.Net/Client/kiota-lock.json | 4 +-- 7 files changed, 35 insertions(+), 19 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index e4e69a9..e358762 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,16 +1,5 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "properties": { - "NugetApiKey": { - "type": "string", - "description": "Nuget Api Key", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - } - }, "definitions": { "Host": { "type": "string", @@ -112,5 +101,22 @@ } } }, - "$ref": "#/definitions/NukeBuild" + "allOf": [ + { + "properties": { + "NugetApiKey": { + "type": "string", + "description": "Nuget Api Key", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + } + } + }, + { + "$ref": "#/definitions/NukeBuild" + } + ] } diff --git a/Package.Build.props b/Package.Build.props index dd011cc..7d429cc 100644 --- a/Package.Build.props +++ b/Package.Build.props @@ -1,6 +1,6 @@ - 1.9.0 + 1.10.0 Hawxy true Apache-2.0 diff --git a/build/_build.csproj b/build/_build.csproj index 6107c68..8e620fb 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Clerk.Net.DependencyInjection/DependencyInjectionExtensions.cs b/src/Clerk.Net.DependencyInjection/DependencyInjectionExtensions.cs index d421f28..6e392b1 100644 --- a/src/Clerk.Net.DependencyInjection/DependencyInjectionExtensions.cs +++ b/src/Clerk.Net.DependencyInjection/DependencyInjectionExtensions.cs @@ -1,6 +1,8 @@ using Clerk.Net.Client; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; +using Microsoft.Kiota.Http.HttpClientLibrary; namespace Clerk.Net.DependencyInjection; @@ -29,6 +31,14 @@ public static IHttpClientBuilder AddClerkApiClient(this IServiceCollection colle }) .SetHandlerLifetime(Timeout.InfiniteTimeSpan); + var types = KiotaClientFactory.GetDefaultHandlerTypes(); + + foreach (var type in types) + { + collection.TryAddTransient(type); + clientBuilder.AddHttpMessageHandler(sp => (DelegatingHandler)sp.GetRequiredService(type)); + } + collection.Configure(options); collection.AddSingleton(x => diff --git a/src/Clerk.Net.Tests/Clerk.Net.Tests.csproj b/src/Clerk.Net.Tests/Clerk.Net.Tests.csproj index 67567b5..9d659e6 100644 --- a/src/Clerk.Net.Tests/Clerk.Net.Tests.csproj +++ b/src/Clerk.Net.Tests/Clerk.Net.Tests.csproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Clerk.Net/Clerk.Net.csproj b/src/Clerk.Net/Clerk.Net.csproj index b513fbb..8c6cea7 100644 --- a/src/Clerk.Net/Clerk.Net.csproj +++ b/src/Clerk.Net/Clerk.Net.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Clerk.Net/Client/kiota-lock.json b/src/Clerk.Net/Client/kiota-lock.json index 4e39346..bc2c012 100644 --- a/src/Clerk.Net/Client/kiota-lock.json +++ b/src/Clerk.Net/Client/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "6C166B14F3040A4607BF09D6FDFFEAC8B81649FF07452EBE4125AB948BAE5A128FE379586708589F8551593757EDF9A2579746582A0EE3CAE195A30EED6F455F", + "descriptionHash": "5D3BE49EB3B1FD51EEB3628A3510A9B8B03FA9143518D22BBBDF7ECA01EF8EBCB0808BCA6AF1A5E7BBBB7742DFBD038FCFF10F78D0F806FD5CB1FE919DCD0762", "descriptionLocation": "../swagger.json", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.21.0", + "kiotaVersion": "1.22.0", "clientClassName": "ClerkApiClient", "typeAccessModifier": "Public", "clientNamespaceName": "Clerk.Net.Client",