admin api packaging

This commit is contained in:
Rory&
2025-12-14 23:18:35 +01:00
parent a4527d166a
commit 4534d4dbf5
124 changed files with 2250 additions and 268 deletions

View File

@@ -2,7 +2,7 @@ using System.Collections.Frozen;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Spacebar.AdminAPI.TestClient.Classes.OpenAPI;
namespace Spacebar.AdminApi.TestClient.Classes.OpenAPI;
public class OpenApiSchema {
[JsonPropertyName("openapi")]

View File

@@ -1,6 +1,6 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Spacebar.AdminAPI.TestClient</a>
<a class="navbar-brand" href="">Spacebar.AdminApi.TestClient</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>

View File

@@ -2,7 +2,7 @@
@using System.Net.Http.Headers
@using System.Reflection
@using Spacebar.AdminApi.Models
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@using ArcaneLibs.Blazor.Components
@using ArcaneLibs.Extensions
@inject Config Config

View File

@@ -1,6 +1,6 @@
@page "/"
@using System.Net.Http.Headers
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@inject Config Config
@inject ILocalStorageService LocalStorage

View File

@@ -1,11 +1,10 @@
@page "/HttpTestClient"
@using System.Collections.Immutable
@using System.Text.Json
@using ArcaneLibs.Blazor.Components
@using ArcaneLibs.Extensions
@using Spacebar.AdminAPI.TestClient.Classes.OpenAPI
@using Spacebar.AdminAPI.TestClient.Pages.HttpTestClientParts
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Classes.OpenAPI
@using Spacebar.AdminApi.TestClient.Pages.HttpTestClientParts
@using Spacebar.AdminApi.TestClient.Services
@inject Config Config
<h3>HttpTestClient</h3>

View File

@@ -1,5 +1,5 @@
@using ArcaneLibs.Extensions
@using Spacebar.AdminAPI.TestClient.Classes.OpenAPI
@using Spacebar.AdminApi.TestClient.Classes.OpenAPI
<span title="@Parameter.ToJson()">@Summary</span>
@if (Parameter.Name != Parameter.Description && !string.IsNullOrWhiteSpace(Parameter.Description)) {
<i> - @Parameter.Description</i>

View File

@@ -1,6 +1,6 @@
@page "/Login"
@using System.Text.Json.Nodes
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@inject ILocalStorageService LocalStorage
@inject Config Config
@inject NavigationManager Navigation

View File

@@ -2,7 +2,7 @@
@using System.Net.Http.Headers
@using System.Reflection
@using Spacebar.AdminApi.Models
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@using ArcaneLibs.Blazor.Components
@inject Config Config
@inject ILocalStorageService LocalStorage

View File

@@ -2,7 +2,7 @@
@using System.Net.Http.Headers
@using System.Reflection
@using Spacebar.AdminApi.Models
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@using ArcaneLibs.Blazor.Components
@using ArcaneLibs.Extensions
@inject Config Config

View File

@@ -4,7 +4,7 @@
@using System.Text.Json.Nodes
@using ArcaneLibs.Extensions
@using Spacebar.AdminApi.Models
@using Spacebar.AdminAPI.TestClient.Services
@using Spacebar.AdminApi.TestClient.Services
@inject Config Config
<h3>UsersDelete - @Id</h3>

View File

@@ -5,8 +5,8 @@ using System.Text.Json.Serialization;
using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Spacebar.AdminAPI.TestClient;
using Spacebar.AdminAPI.TestClient.Services;
using Spacebar.AdminApi.TestClient;
using Spacebar.AdminApi.TestClient.Services;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");

View File

@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
namespace Spacebar.AdminAPI.TestClient.Services;
namespace Spacebar.AdminApi.TestClient.Services;
public class Config {
[JsonPropertyName("api_url")]

View File

@@ -11,7 +11,7 @@ using System.Text.Json.Serialization;
using ArcaneLibs;
using ArcaneLibs.Extensions;
namespace Spacebar.AdminAPI.TestClient.Services;
namespace Spacebar.AdminApi.TestClient.Services;
#if SINGLE_HTTPCLIENT
// TODO: Add URI wrapper for
@@ -83,7 +83,7 @@ public class StreamingHttpClient {
request.RequestUri = new Uri(BaseAddress ?? throw new InvalidOperationException("Relative URI passed, but no BaseAddress is specified!"), request.RequestUri);
swWait.Stop();
var swExec = Stopwatch.StartNew();
foreach (var (key, value) in AdditionalQueryParameters) request.RequestUri = request.RequestUri.AddQuery(key, value);
foreach (var (key, value) in DefaultRequestHeaders) {
if (request.Headers.Contains(key)) continue;
@@ -110,6 +110,7 @@ public class StreamingHttpClient {
else if (!e.ToString().StartsWith("TypeError: NetworkError"))
Console.WriteLine(
$"Failed to send request {request.Method} {BaseAddress}{request.RequestUri} ({Util.BytesToString(request.Content?.Headers.ContentLength ?? 0)}):\n{e}");
throw;
}
#if SYNC_HTTPCLIENT
@@ -148,19 +149,19 @@ public class StreamingHttpClient {
//retry on gateway timeout
// if (responseMessage.StatusCode == HttpStatusCode.GatewayTimeout) {
// request.ResetSendStatus();
// return await SendAsync(request, cancellationToken);
// request.ResetSendStatus();
// return await SendAsync(request, cancellationToken);
// }
//error handling
var content = await responseMessage.Content.ReadAsStringAsync(cancellationToken);
if (content.Length == 0)
throw new DataException("Content was empty");
// throw new MatrixException() {
// ErrorCode = "M_UNKNOWN",
// Error = "Unknown error, server returned no content"
// };
// throw new MatrixException() {
// ErrorCode = "M_UNKNOWN",
// Error = "Unknown error, server returned no content"
// };
// if (!content.StartsWith('{')) throw new InvalidDataException("Encountered invalid data:\n" + content);
if (!content.TrimStart().StartsWith('{')) {
responseMessage.EnsureSuccessStatusCode();
@@ -293,4 +294,4 @@ public class StreamingHttpClient {
return await SendAsync(request);
}
}
#endif
#endif

View File

@@ -14,6 +14,7 @@
<!-- <RunAOTCompilation>true</RunAOTCompilation>-->
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- <RuntimeFrameworkVersion>10.0.2-servicing.25570.103</RuntimeFrameworkVersion>-->
</PropertyGroup>
<ItemGroup>
@@ -24,8 +25,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="10.0.0" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

View File

@@ -7,5 +7,5 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using Spacebar.AdminAPI.TestClient
@using Spacebar.AdminAPI.TestClient.Layout
@using Spacebar.AdminApi.TestClient
@using Spacebar.AdminApi.TestClient.Layout

View File

@@ -0,0 +1,217 @@
[
{
"pname": "ArcaneLibs",
"version": "1.0.0-preview.20251005-232225",
"hash": "sha256-EsYLSiyX5Nj+ZpFb6FOcAYqDsQFSbvgm9NKaarJjK/0="
},
{
"pname": "ArcaneLibs.Blazor.Components",
"version": "1.0.0-preview.20251005-232225",
"hash": "sha256-9rgq/bFNwZf+mpTldzhr7VPwlseLR21nDlJWGgIaGIQ="
},
{
"pname": "Blazored.LocalStorage",
"version": "4.5.0",
"hash": "sha256-0vklTFHEGgNG8V6ivQictuooyiXS2nMn/qLpfYhEBlE="
},
{
"pname": "Microsoft.AspNetCore.App.Internal.Assets",
"version": "10.0.0",
"hash": "sha256-IyY5Ymdkmf9S9qRwYXX9rWpzcU3fuDR+ITeaaeJQ/Dk="
},
{
"pname": "Microsoft.AspNetCore.Authorization",
"version": "10.0.0",
"hash": "sha256-g1MagKFkZF0LttdK5GLdHCXe4d1qOXv57ngz7XnhRrk="
},
{
"pname": "Microsoft.AspNetCore.Components",
"version": "10.0.0",
"hash": "sha256-nrCuCDRbvD5XQyn3ySW/CD4yKYD6coC71JH2ke6xtXI="
},
{
"pname": "Microsoft.AspNetCore.Components",
"version": "9.0.9",
"hash": "sha256-1+lIIRfIwHC3XWt2tMuQ3NxoqIsVRgAR+/l9vttQLd8="
},
{
"pname": "Microsoft.AspNetCore.Components.Analyzers",
"version": "10.0.0",
"hash": "sha256-2mbSRBB/2eT0fYouhDKM5OFRZGQ0Jv8HgcQLvufoHq4="
},
{
"pname": "Microsoft.AspNetCore.Components.Forms",
"version": "10.0.0",
"hash": "sha256-el2T9pvjNexq5lfJhp+7xZYa/1CS6RchIWKmtiKg+vI="
},
{
"pname": "Microsoft.AspNetCore.Components.Forms",
"version": "9.0.9",
"hash": "sha256-oUwcqvDLtychAdga+fAJp70wSEdVheYsV6l5Qnfdq6M="
},
{
"pname": "Microsoft.AspNetCore.Components.Web",
"version": "10.0.0",
"hash": "sha256-xDf1DBNBceAFKu4er2inn6gUKa1T1L8T3ewlFcuxddE="
},
{
"pname": "Microsoft.AspNetCore.Components.Web",
"version": "8.0.0",
"hash": "sha256-dsCb4B6r5iHPbEp8+uFzAfD1txGI5dEIWgwtT9+GgU8="
},
{
"pname": "Microsoft.AspNetCore.Components.Web",
"version": "9.0.9",
"hash": "sha256-mgohB7RwOzE5XPB0Lg3h9pUIBKPXaul2F39uxfU7GD8="
},
{
"pname": "Microsoft.AspNetCore.Components.WebAssembly",
"version": "10.0.0",
"hash": "sha256-YeHralkfEzLmlrBj0jER+ta9hsbXv5skP81178V1ppw="
},
{
"pname": "Microsoft.AspNetCore.Components.WebAssembly.DevServer",
"version": "10.0.0",
"hash": "sha256-akCQI6iHuKIyDmZh5du+hifzPzQoGeMX3Y7ST/TFxRU="
},
{
"pname": "Microsoft.AspNetCore.Metadata",
"version": "10.0.0",
"hash": "sha256-TxyiXUx8sWdWFWacBTWFaPeMa3z2+Zmc4VK/Qgq0YRw="
},
{
"pname": "Microsoft.DotNet.HotReload.WebAssembly.Browser",
"version": "10.0.100",
"hash": "sha256-ppwVl5tBHFFmMZ0EjpKn4OSBYNExf/S6ojeYdefX1+k="
},
{
"pname": "Microsoft.Extensions.Configuration",
"version": "10.0.0",
"hash": "sha256-MsLskVPpkCvov5+DWIaALCt1qfRRX4u228eHxvpE0dg="
},
{
"pname": "Microsoft.Extensions.Configuration.Abstractions",
"version": "10.0.0",
"hash": "sha256-GcgrnTAieCV7AVT13zyOjfwwL86e99iiO/MiMOxPGG0="
},
{
"pname": "Microsoft.Extensions.Configuration.Binder",
"version": "10.0.0",
"hash": "sha256-YSiWoA3VQR22k6+bSEAUqeG7UDzZlJfHWDTubUO5V8U="
},
{
"pname": "Microsoft.Extensions.Configuration.FileExtensions",
"version": "10.0.0",
"hash": "sha256-rN+3rqrHiTaBfHgP+E4dA8Qm2cFJPfbEcd93yKLsqlQ="
},
{
"pname": "Microsoft.Extensions.Configuration.Json",
"version": "10.0.0",
"hash": "sha256-VCFukgsxiQ2MFGE6RDMFTGopBHbcZL2t0ER7ENaFXRY="
},
{
"pname": "Microsoft.Extensions.DependencyInjection",
"version": "10.0.0",
"hash": "sha256-LYm9hVlo/R9c2aAKHsDYJ5vY9U0+3Jvclme3ou3BtvQ="
},
{
"pname": "Microsoft.Extensions.DependencyInjection",
"version": "9.0.9",
"hash": "sha256-UHG/uj9hjCRWmz2LZ4wR721ooZYGtBy4TT+lNeVzyrU="
},
{
"pname": "Microsoft.Extensions.DependencyInjection.Abstractions",
"version": "10.0.0",
"hash": "sha256-9iodXP39YqgxomnOPOxd/mzbG0JfOSXzFoNU3omT2Ps="
},
{
"pname": "Microsoft.Extensions.Diagnostics",
"version": "10.0.0",
"hash": "sha256-o7QkCisEcFIh227qBUfWFci2ns4cgEpLqpX7YvHGToQ="
},
{
"pname": "Microsoft.Extensions.Diagnostics.Abstractions",
"version": "10.0.0",
"hash": "sha256-cix7QxQ/g3sj6reXu3jn0cRv2RijzceaLLkchEGTt5E="
},
{
"pname": "Microsoft.Extensions.FileProviders.Abstractions",
"version": "10.0.0",
"hash": "sha256-CHDs2HCN8QcfuYQpgNVszZ5dfXFe4yS9K2GoQXecc20="
},
{
"pname": "Microsoft.Extensions.FileProviders.Physical",
"version": "10.0.0",
"hash": "sha256-2Rw/cwBO+/A3QY2IjN/c8Y0LhtC1qTBL7VdJiD1J2UQ="
},
{
"pname": "Microsoft.Extensions.FileSystemGlobbing",
"version": "10.0.0",
"hash": "sha256-ETfVTdsdBtp69EggLg/AARTQW4lLQYVdVldXIQrsjZA="
},
{
"pname": "Microsoft.Extensions.Logging",
"version": "10.0.0",
"hash": "sha256-P+zPAadLL63k/GqK34/qChqQjY9aIRxZfxlB9lqsSrs="
},
{
"pname": "Microsoft.Extensions.Logging.Abstractions",
"version": "10.0.0",
"hash": "sha256-BnhgGZc01HwTSxogavq7Ueq4V7iMA3wPnbfRwQ4RhGk="
},
{
"pname": "Microsoft.Extensions.Logging.Configuration",
"version": "10.0.0",
"hash": "sha256-7/TWO1aq8hdgbcTEKDBWIjgSC9KpFN3kRnMX+12bOkU="
},
{
"pname": "Microsoft.Extensions.Options",
"version": "10.0.0",
"hash": "sha256-j5MOqZSKeUtxxzmZjzZMGy0vELHdvPraqwTQQQNVsYA="
},
{
"pname": "Microsoft.Extensions.Options.ConfigurationExtensions",
"version": "10.0.0",
"hash": "sha256-XGAs5DxMvWnmjX8dqRwKY0vsuS40SHvsfJqB1rO4L7k="
},
{
"pname": "Microsoft.Extensions.Primitives",
"version": "10.0.0",
"hash": "sha256-Dup08KcptLjlnpN5t5//+p4n8FUTgRAq4n/w1s6us+I="
},
{
"pname": "Microsoft.Extensions.Primitives",
"version": "9.0.9",
"hash": "sha256-bCd4Bj5uP4kT0hCvs0LZS8IVqEtpOIyhSiay5ijJbBA="
},
{
"pname": "Microsoft.Extensions.Validation",
"version": "10.0.0",
"hash": "sha256-BbmNqKlqNd/37IU5X1wjc3VCxfrBTA1bkVqk1myU+H0="
},
{
"pname": "Microsoft.JSInterop",
"version": "10.0.0",
"hash": "sha256-/y6la0IzcE5N/thRGLDZYsvNEeWPlW2IwEJtIu3sdaE="
},
{
"pname": "Microsoft.JSInterop",
"version": "9.0.9",
"hash": "sha256-fCUkGYS6HKZ0NW1xfuI5aCD2yGqpeIjaWFcS0dBZMWE="
},
{
"pname": "Microsoft.JSInterop.WebAssembly",
"version": "10.0.0",
"hash": "sha256-dJdTHFh4lZOmXI+88mLdJOf6UsKq/80N59+COq/KPpg="
},
{
"pname": "Microsoft.NET.Sdk.WebAssembly.Pack",
"version": "10.0.0",
"hash": "sha256-AWqn+WUvMjdec4KX4RpTW1ZgT4K+fYhpkrcf706Zt/w="
},
{
"pname": "Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
"version": "10.0.0",
"hash": "sha256-1CpAq/TBpFaZncLb+Z3xaq/J7/O8ZTEl3qBidCpQj9M="
}
]

View File

@@ -9,7 +9,7 @@
<link rel="stylesheet" href="lib/jetbrains-mono/jetbrains-mono.css"/>
<link rel="stylesheet" href="css/app.css"/>
<link rel="icon" type="image/png" href="favicon.png"/>
<link href="Spacebar.AdminAPI.TestClient.styles.css" rel="stylesheet"/>
<link href="Spacebar.AdminApi.TestClient.styles.css" rel="stylesheet"/>
</head>
<body>