diff --git a/.gitignore b/.gitignore index dfcfd56f4..e39382a14 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,4 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ +/Apizr/.idea/.idea.Apizr/.idea diff --git a/Apizr/Samples/Apizr.Sample.MAUI/Apizr - Backup.Sample.MAUI.csproj b/Apizr/Samples/Apizr.Sample.MAUI/Apizr - Backup.Sample.MAUI.csproj deleted file mode 100644 index d129a2e65..000000000 --- a/Apizr/Samples/Apizr.Sample.MAUI/Apizr - Backup.Sample.MAUI.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - net6.0-android;net6.0-ios;net6.0-maccatalyst - $(TargetFrameworks);net6.0-windows10.0.19041 - Exe - Apizr.Sample.MAUI - true - true - enable - true - - - Apizr.Sample.MAUI - - - com.companyname.apizr.sample.maui - - - 1 - - - True - - 14.2 - 14.0 - 21.0 - 10.0.17763.0 - 10.0.17763.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WinExe - win10-x64 - - - diff --git a/Apizr/Samples/Apizr.Sample.MAUI/Apizr.Sample.MAUI.csproj b/Apizr/Samples/Apizr.Sample.MAUI/Apizr.Sample.MAUI.csproj index c68f8c657..e98a16813 100644 --- a/Apizr/Samples/Apizr.Sample.MAUI/Apizr.Sample.MAUI.csproj +++ b/Apizr/Samples/Apizr.Sample.MAUI/Apizr.Sample.MAUI.csproj @@ -26,6 +26,9 @@ Apple Development: Created via API (Z887M6WDP6) VS: WildCard Development + + SdkOnly + @@ -53,7 +56,7 @@ - + diff --git a/Apizr/Samples/Apizr.Sample.MAUI/Infrastructure/TestRequestHandler.cs b/Apizr/Samples/Apizr.Sample.MAUI/Infrastructure/TestRequestHandler.cs new file mode 100644 index 000000000..d0ea1dfb9 --- /dev/null +++ b/Apizr/Samples/Apizr.Sample.MAUI/Infrastructure/TestRequestHandler.cs @@ -0,0 +1,24 @@ +namespace Apizr.Sample.MAUI.Infrastructure +{ + public class TestRequestHandler : DelegatingHandler + { + private readonly ISecureStorage _secureStorage; + + public TestRequestHandler(ISecureStorage secureStorage) + { + _secureStorage = secureStorage; + } + + /// + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + var identityKey = await _secureStorage.GetAsync("IdentityKey"); + if (!string.IsNullOrWhiteSpace(identityKey)) + { + request.Headers.Add("X-Identity-Key", identityKey); + } + + return await base.SendAsync(request, cancellationToken); + } + } +} diff --git a/Apizr/Samples/Apizr.Sample.MAUI/MauiProgram.cs b/Apizr/Samples/Apizr.Sample.MAUI/MauiProgram.cs index 6ac2c8ee1..482909e89 100644 --- a/Apizr/Samples/Apizr.Sample.MAUI/MauiProgram.cs +++ b/Apizr/Samples/Apizr.Sample.MAUI/MauiProgram.cs @@ -48,6 +48,9 @@ public static MauiApp CreateMauiApp() // Navigation services.RegisterForNavigation(); + // Plugins + services.AddSingleton(_ => SecureStorage.Default); + // Polly services.AddResiliencePipeline("TransientHttpError", pipelineBuilder => pipelineBuilder.AddRetry( @@ -73,6 +76,7 @@ public static MauiApp CreateMauiApp() .AddCrudManagerFor(typeof(User).Assembly), config => config + .WithDelegatingHandler(serviceProvider => new TestRequestHandler(serviceProvider.GetRequiredService())) .WithAkavacheCacheHandler() .WithLogging() //.WithConnectivityHandler(connectivity => connectivity.NetworkAccess == NetworkAccess.Internet) diff --git a/Apizr/Samples/Apizr.Sample.MAUI/ViewModels/MainPageViewModel.cs b/Apizr/Samples/Apizr.Sample.MAUI/ViewModels/MainPageViewModel.cs index 5e4ecdce0..ed7414d28 100644 --- a/Apizr/Samples/Apizr.Sample.MAUI/ViewModels/MainPageViewModel.cs +++ b/Apizr/Samples/Apizr.Sample.MAUI/ViewModels/MainPageViewModel.cs @@ -72,6 +72,8 @@ private async Task GetUsersAsync() IList? users = null; try { + await SecureStorage.SetAsync("IdentityKey", "123456789"); + // This is a manually defined web api call into IReqResService (classic actually) var userList = await _reqResManager.ExecuteAsync(api => api.GetUsersAsync()); users = userList?.Data; diff --git a/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj b/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj index ec26d1ead..7d01c6147 100644 --- a/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj +++ b/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj @@ -8,7 +8,7 @@ apizr Apizr.Tools.NSwag - 6.0.0-preview.3 + 6.0.0-preview.4 An Apizr .NET Tool to generate models, interfaces and registration methods from a swagger url Respawnsive Refit Web Api Generator CLI diff --git a/nuget/Apizr.Extensions.Microsoft.Caching.nuspec b/nuget/Apizr.Extensions.Microsoft.Caching.nuspec index 7705c6085..4fea8ad4a 100644 --- a/nuget/Apizr.Extensions.Microsoft.Caching.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.Caching.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.Caching - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Extensions.Microsoft.Caching Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Cache Web Api Extensions - + diff --git a/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec b/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec index a7674256f..60a8e9fb7 100644 --- a/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.DependencyInjection - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Extensions.Microsoft.DependencyInjection Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Polly Fusillade HttpTracer Web Api Extensions - + diff --git a/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec b/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec index d2e6f364e..6c5ae1f7f 100644 --- a/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.FileTransfer - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Extensions.Microsoft.FileTransfer Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http File Transfer Download Upload - - + + diff --git a/nuget/Apizr.Integrations.Akavache.nuspec b/nuget/Apizr.Integrations.Akavache.nuspec index e514cabed..717a51293 100644 --- a/nuget/Apizr.Integrations.Akavache.nuspec +++ b/nuget/Apizr.Integrations.Akavache.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Akavache - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.Akavache Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Polly Fusillade HttpTracer Web Api Akavache - + diff --git a/nuget/Apizr.Integrations.AutoMapper.nuspec b/nuget/Apizr.Integrations.AutoMapper.nuspec index 643905546..b2ef22a30 100644 --- a/nuget/Apizr.Integrations.AutoMapper.nuspec +++ b/nuget/Apizr.Integrations.AutoMapper.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.AutoMapper - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.AutoMapper Respawnsive Respawnsive @@ -17,19 +17,19 @@ - + - + - + - + diff --git a/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec b/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec index 9cc6bf019..b61488866 100644 --- a/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer.MediatR - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.FileTransfer.MediatR Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - - + + diff --git a/nuget/Apizr.Integrations.FileTransfer.Optiona.nuspec b/nuget/Apizr.Integrations.FileTransfer.Optiona.nuspec new file mode 100644 index 000000000..1790801bd --- /dev/null +++ b/nuget/Apizr.Integrations.FileTransfer.Optiona.nuspec @@ -0,0 +1,31 @@ + + + + Apizr.Integrations.FileTransfer.Optional + 6.0.0-preview.4 + Apizr.Integrations.FileTransfer.Optional + Respawnsive + Respawnsive + false + https://raw.githubusercontent.com/Respawnsive/Apizr/master/LICENSE + README.md + https://www.apizr.net/ + https://raw.githubusercontent.com/Respawnsive/Apizr/master/logo.png + Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority...) + https://www.apizr.net/changelog.html + Refit Web Api Http Transfer + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec b/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec index f8a137d5a..1790801bd 100644 --- a/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer.Optional - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.FileTransfer.Optional Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - - + + diff --git a/nuget/Apizr.Integrations.FileTransfer.nuspec b/nuget/Apizr.Integrations.FileTransfer.nuspec index 4ccf8b40e..07cbc6a34 100644 --- a/nuget/Apizr.Integrations.FileTransfer.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.FileTransfer Respawnsive Respawnsive @@ -15,7 +15,7 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - + diff --git a/nuget/Apizr.Integrations.Fusillade.nuspec b/nuget/Apizr.Integrations.Fusillade.nuspec index 300e46226..572c24312 100644 --- a/nuget/Apizr.Integrations.Fusillade.nuspec +++ b/nuget/Apizr.Integrations.Fusillade.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Fusillade - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.Fusillade Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Fusillade Web Api Akavache - + diff --git a/nuget/Apizr.Integrations.Mapster.nuspec b/nuget/Apizr.Integrations.Mapster.nuspec index bb58052fe..a05e07ea7 100644 --- a/nuget/Apizr.Integrations.Mapster.nuspec +++ b/nuget/Apizr.Integrations.Mapster.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Mapster - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.Mapster Respawnsive Respawnsive @@ -17,23 +17,23 @@ - + - + - + - + - + diff --git a/nuget/Apizr.Integrations.MediatR.nuspec b/nuget/Apizr.Integrations.MediatR.nuspec index a2516ffe4..957149c4c 100644 --- a/nuget/Apizr.Integrations.MediatR.nuspec +++ b/nuget/Apizr.Integrations.MediatR.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.MediatR - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.MediatR Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Web Api MediatR - + diff --git a/nuget/Apizr.Integrations.MonkeyCache.nuspec b/nuget/Apizr.Integrations.MonkeyCache.nuspec index f11bb2b35..352da7d44 100644 --- a/nuget/Apizr.Integrations.MonkeyCache.nuspec +++ b/nuget/Apizr.Integrations.MonkeyCache.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.MonkeyCache - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.MonkeyCache Respawnsive Respawnsive @@ -17,23 +17,23 @@ - + - + - + - + - + diff --git a/nuget/Apizr.Integrations.Optional.nuspec b/nuget/Apizr.Integrations.Optional.nuspec index 101ae04d0..2408ef1da 100644 --- a/nuget/Apizr.Integrations.Optional.nuspec +++ b/nuget/Apizr.Integrations.Optional.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Optional - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr.Integrations.Optional Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Web Api Optional - + diff --git a/nuget/Apizr.Tools.NSwag.nuspec b/nuget/Apizr.Tools.NSwag.nuspec index 91dde6a11..342a9f8af 100644 --- a/nuget/Apizr.Tools.NSwag.nuspec +++ b/nuget/Apizr.Tools.NSwag.nuspec @@ -2,7 +2,7 @@ Apizr.Tools.NSwag - 6.0.0-preview.3 + 6.0.0-preview.4 Respawnsive false @@ -13,7 +13,7 @@ - + diff --git a/nuget/Apizr.nuspec b/nuget/Apizr.nuspec index 381302237..b1b8076d3 100644 --- a/nuget/Apizr.nuspec +++ b/nuget/Apizr.nuspec @@ -2,7 +2,7 @@ Apizr - 6.0.0-preview.3 + 6.0.0-preview.4 Apizr Respawnsive Respawnsive