stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
// Copyright (c) StellaOps. All rights reserved.
|
||||
// Licensed under BUSL-1.1. See LICENSE in the project root.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace StellaOps.Platform.WebService.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// Environment settings response served at <c>/platform/envsettings.json</c>.
|
||||
/// Schema matches the Angular <c>AppConfig</c> interface so the frontend can
|
||||
/// consume the payload without transformation.
|
||||
/// </summary>
|
||||
public sealed class EnvironmentSettingsResponse
|
||||
{
|
||||
[JsonPropertyName("authority")]
|
||||
public required EnvironmentAuthoritySettings Authority { get; init; }
|
||||
|
||||
[JsonPropertyName("apiBaseUrls")]
|
||||
public required Dictionary<string, string> ApiBaseUrls { get; init; }
|
||||
|
||||
[JsonPropertyName("telemetry")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public EnvironmentTelemetrySettings? Telemetry { get; init; }
|
||||
|
||||
[JsonPropertyName("welcome")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public EnvironmentWelcomeSettings? Welcome { get; init; }
|
||||
|
||||
[JsonPropertyName("doctor")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public EnvironmentDoctorSettings? Doctor { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Setup state indicator for the frontend setup wizard.
|
||||
/// <list type="bullet">
|
||||
/// <item><c>null</c> (absent from JSON) — setup required (fresh install or no DB)</item>
|
||||
/// <item><c>"complete"</c> — setup done, proceed normally</item>
|
||||
/// <item>Any other value — a <c>SetupStepId</c> indicating setup in progress; resume at that step</item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
[JsonPropertyName("setup")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Setup { get; init; }
|
||||
}
|
||||
|
||||
public sealed class EnvironmentAuthoritySettings
|
||||
{
|
||||
[JsonPropertyName("issuer")]
|
||||
public required string Issuer { get; init; }
|
||||
|
||||
[JsonPropertyName("clientId")]
|
||||
public required string ClientId { get; init; }
|
||||
|
||||
[JsonPropertyName("authorizeEndpoint")]
|
||||
public required string AuthorizeEndpoint { get; init; }
|
||||
|
||||
[JsonPropertyName("tokenEndpoint")]
|
||||
public required string TokenEndpoint { get; init; }
|
||||
|
||||
[JsonPropertyName("logoutEndpoint")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? LogoutEndpoint { get; init; }
|
||||
|
||||
[JsonPropertyName("redirectUri")]
|
||||
public required string RedirectUri { get; init; }
|
||||
|
||||
[JsonPropertyName("postLogoutRedirectUri")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? PostLogoutRedirectUri { get; init; }
|
||||
|
||||
[JsonPropertyName("scope")]
|
||||
public required string Scope { get; init; }
|
||||
|
||||
[JsonPropertyName("audience")]
|
||||
public required string Audience { get; init; }
|
||||
|
||||
[JsonPropertyName("dpopAlgorithms")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public IReadOnlyList<string>? DpopAlgorithms { get; init; }
|
||||
|
||||
[JsonPropertyName("refreshLeewaySeconds")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public int RefreshLeewaySeconds { get; init; }
|
||||
}
|
||||
|
||||
public sealed class EnvironmentTelemetrySettings
|
||||
{
|
||||
[JsonPropertyName("otlpEndpoint")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? OtlpEndpoint { get; init; }
|
||||
|
||||
[JsonPropertyName("sampleRate")]
|
||||
public double SampleRate { get; init; }
|
||||
}
|
||||
|
||||
public sealed class EnvironmentWelcomeSettings
|
||||
{
|
||||
[JsonPropertyName("title")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Title { get; init; }
|
||||
|
||||
[JsonPropertyName("message")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Message { get; init; }
|
||||
|
||||
[JsonPropertyName("docsUrl")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? DocsUrl { get; init; }
|
||||
}
|
||||
|
||||
public sealed class EnvironmentDoctorSettings
|
||||
{
|
||||
[JsonPropertyName("fixEnabled")]
|
||||
public bool FixEnabled { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user