Consume Wino.Mail.Contracts package

This commit is contained in:
Burak Kaan Köse
2026-03-16 12:12:13 +01:00
parent 0ee3a0c3bc
commit 59d9cf4eea
15 changed files with 18 additions and 106 deletions
+10
View File
@@ -8,6 +8,10 @@ on:
- reopened - reopened
- ready_for_review - ready_for_review
permissions:
contents: read
packages: read
jobs: jobs:
build-winui: build-winui:
name: Build project (${{ matrix.platform }}) name: Build project (${{ matrix.platform }})
@@ -33,6 +37,9 @@ jobs:
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 10.0.x dotnet-version: 10.0.x
source-url: https://nuget.pkg.github.com/bkaankose/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore WinUI project dependencies - name: Restore WinUI project dependencies
run: dotnet restore Wino.Mail.WinUI/Wino.Mail.WinUI.csproj --configfile nuget.config -p:Platform=${{ matrix.platform }} -p:RuntimeIdentifier=${{ matrix.rid }} run: dotnet restore Wino.Mail.WinUI/Wino.Mail.WinUI.csproj --configfile nuget.config -p:Platform=${{ matrix.platform }} -p:RuntimeIdentifier=${{ matrix.rid }}
@@ -54,6 +61,9 @@ jobs:
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 10.0.x dotnet-version: 10.0.x
source-url: https://nuget.pkg.github.com/bkaankose/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore Core test projects - name: Restore Core test projects
shell: pwsh shell: pwsh
+1
View File
@@ -33,6 +33,7 @@
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.82.1" /> <PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.82.1" />
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" /> <PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.1" /> <PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.1" />
<PackageVersion Include="Wino.Mail.Contracts" Version="1.0.0" />
<PackageVersion Include="MimeKit" Version="4.15.1" /> <PackageVersion Include="MimeKit" Version="4.15.1" />
<PackageVersion Include="morelinq" Version="4.4.0" /> <PackageVersion Include="morelinq" Version="4.4.0" />
<PackageVersion Include="Nito.AsyncEx" Version="5.1.2" /> <PackageVersion Include="Nito.AsyncEx" Version="5.1.2" />
+1 -3
View File
@@ -60,9 +60,7 @@
<PackageReference Include="MailKit" /> <PackageReference Include="MailKit" />
<PackageReference Include="sqlite-net-pcl" /> <PackageReference Include="sqlite-net-pcl" />
<PackageReference Include="TimePeriodLibrary.NET" /> <PackageReference Include="TimePeriodLibrary.NET" />
</ItemGroup> <PackageReference Include="Wino.Mail.Contracts" />
<ItemGroup>
<ProjectReference Include="..\Wino.Mail.Contracts\Wino.Mail.Contracts.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" /> <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
@@ -1,5 +0,0 @@
namespace Wino.Mail.Api.Contracts.Admin;
public sealed record ModerateUserRequest(string ReasonCode, string? ReasonNote);
public sealed record AdminUserResultDto(Guid UserId, string Email, string AccountStatus, DateTimeOffset CreatedUtc);
public sealed record ModerationActionResultDto(string Action, string ReasonCode, string? ReasonNote, Guid? ActorUserId, DateTimeOffset CreatedUtc);
-7
View File
@@ -1,7 +0,0 @@
namespace Wino.Mail.Api.Contracts.Ai;
public sealed record SummarizeRequest(string Html);
public sealed record TranslateRequest(string Html, string TargetLanguage);
public sealed record RewriteRequest(string Html, string Instruction);
public sealed record AiTextResultDto(string Text);
public sealed record AiStatusResultDto(bool HasAiPack, string EntitlementStatus, DateTimeOffset? CurrentPeriodStartUtc, DateTimeOffset? CurrentPeriodEndUtc, int? MonthlyLimit, int? Used, int? Remaining);
-11
View File
@@ -1,11 +0,0 @@
namespace Wino.Mail.Api.Contracts.Auth;
public sealed record RegisterRequest(string Email, string Password);
public sealed record LoginRequest(string Email, string Password);
public sealed record CompleteExternalAuthRequest(string Code);
public sealed record RefreshRequest(string RefreshToken);
public sealed record LogoutRequest(string RefreshToken);
public sealed record ForgotPasswordRequest(string Email);
public sealed record ResetPasswordRequest(string Email, string ResetToken, string NewPassword);
public sealed record AuthUserDto(Guid UserId, string Email, string AccountStatus, bool HasPassword, bool HasGoogleLogin, bool HasFacebookLogin);
public sealed record AuthResultDto(AuthUserDto User, string AccessToken, DateTimeOffset AccessTokenExpiresAtUtc, string RefreshToken, DateTimeOffset RefreshTokenExpiresAtUtc);
@@ -1,4 +0,0 @@
namespace Wino.Mail.Api.Contracts.Billing;
public sealed record CheckoutSessionResultDto(string Url);
public sealed record CustomerPortalResultDto(string Url);
-25
View File
@@ -1,25 +0,0 @@
namespace Wino.Mail.Api.Contracts.Common;
public sealed class ApiEnvelope<T>
{
public bool IsSuccess { get; init; }
public string? ErrorCode { get; init; }
public T? Result { get; init; }
public QuotaInfoDto? Quota { get; init; }
public static ApiEnvelope<T> Success(T result, QuotaInfoDto? quota = null)
=> new()
{
IsSuccess = true,
Result = result,
Quota = quota,
};
public static ApiEnvelope<T> Failure(string errorCode, QuotaInfoDto? quota = null)
=> new()
{
IsSuccess = false,
ErrorCode = errorCode,
Quota = quota,
};
}
@@ -1,27 +0,0 @@
namespace Wino.Mail.Api.Contracts.Common;
public static class ApiErrorCodes
{
public const string InvalidCredentials = "INVALID_CREDENTIALS";
public const string AccountLocked = "ACCOUNT_LOCKED";
public const string AccountBanned = "ACCOUNT_BANNED";
public const string AccountSuspended = "ACCOUNT_SUSPENDED";
public const string RefreshTokenInvalid = "REFRESH_TOKEN_INVALID";
public const string EmailAlreadyRegistered = "EMAIL_ALREADY_REGISTERED";
public const string ExternalLoginEmailRequired = "EXTERNAL_LOGIN_EMAIL_REQUIRED";
public const string ExternalLoginInvalid = "EXTERNAL_LOGIN_INVALID";
public const string ExternalAuthStateInvalid = "EXTERNAL_AUTH_STATE_INVALID";
public const string ExternalAuthCodeInvalid = "EXTERNAL_AUTH_CODE_INVALID";
public const string AiPackRequired = "AI_PACK_REQUIRED";
public const string AiQuotaExceeded = "AI_QUOTA_EXCEEDED";
public const string AiHtmlEmpty = "AI_HTML_EMPTY";
public const string AiHtmlTooLarge = "AI_HTML_TOO_LARGE";
public const string AiUnsupportedLanguage = "AI_UNSUPPORTED_LANGUAGE";
public const string AiSanitizationFailed = "AI_SANITIZATION_FAILED";
public const string AiProviderUnavailable = "AI_PROVIDER_UNAVAILABLE";
public const string AiRequestBlocked = "AI_REQUEST_BLOCKED";
public const string AiInternalError = "AI_INTERNAL_ERROR";
public const string PaddleWebhookInvalid = "PADDLE_WEBHOOK_INVALID";
public const string Forbidden = "FORBIDDEN";
public const string ValidationFailed = "VALIDATION_FAILED";
}
@@ -1,10 +0,0 @@
namespace Wino.Mail.Api.Contracts.Common;
public sealed record QuotaInfoDto(
bool HasAiPack,
string EntitlementStatus,
DateTimeOffset? CurrentPeriodStartUtc,
DateTimeOffset? CurrentPeriodEndUtc,
int? MonthlyLimit,
int? Used,
int? Remaining);
@@ -1,7 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -223,10 +223,10 @@
<PackageReference Include="System.Drawing.Common" /> <PackageReference Include="System.Drawing.Common" />
<PackageReference Include="WinUIEx" /> <PackageReference Include="WinUIEx" />
<PackageReference Include="H.NotifyIcon.WinUI" /> <PackageReference Include="H.NotifyIcon.WinUI" />
<PackageReference Include="Wino.Mail.Contracts" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Wino.Calendar.ViewModels\Wino.Calendar.ViewModels.csproj" /> <ProjectReference Include="..\Wino.Calendar.ViewModels\Wino.Calendar.ViewModels.csproj" />
<ProjectReference Include="..\Wino.Mail.Contracts\Wino.Mail.Contracts.csproj" />
<ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj" /> <ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj" />
<ProjectReference Include="..\Wino.Core.ViewModels\Wino.Core.ViewModels.csproj" /> <ProjectReference Include="..\Wino.Core.ViewModels\Wino.Core.ViewModels.csproj" />
<ProjectReference Include="..\Wino.Mail.ViewModels\Wino.Mail.ViewModels.csproj" /> <ProjectReference Include="..\Wino.Mail.ViewModels\Wino.Mail.ViewModels.csproj" />
+1 -1
View File
@@ -22,10 +22,10 @@
<PackageReference Include="Serilog.Sinks.Debug" /> <PackageReference Include="Serilog.Sinks.Debug" />
<PackageReference Include="Serilog.Sinks.File" /> <PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Exceptions" /> <PackageReference Include="Serilog.Exceptions" />
<PackageReference Include="Wino.Mail.Contracts" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj" /> <ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj" />
<ProjectReference Include="..\Wino.Mail.Contracts\Wino.Mail.Contracts.csproj" />
<ProjectReference Include="..\Wino.Messages\Wino.Messaging.csproj" /> <ProjectReference Include="..\Wino.Messages\Wino.Messaging.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
-5
View File
@@ -44,11 +44,6 @@
<Platform Solution="*|x64" Project="x64" /> <Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" /> <Platform Solution="*|x86" Project="x86" />
</Project> </Project>
<Project Path="Wino.Mail.Contracts/Wino.Mail.Contracts.csproj">
<Platform Solution="*|arm64" Project="Any CPU" />
<Platform Solution="*|x64" Project="Any CPU" />
<Platform Solution="*|x86" Project="Any CPU" />
</Project>
<Project Path="Wino.Messages/Wino.Messaging.csproj"> <Project Path="Wino.Messages/Wino.Messaging.csproj">
<Platform Solution="*|arm64" Project="arm64" /> <Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" /> <Platform Solution="*|x64" Project="x64" />
+4
View File
@@ -3,6 +3,7 @@
<packageSources> <packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below --> <!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear /> <clear />
<add key="github" value="https://nuget.pkg.github.com/bkaankose/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" /> <add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="labsFeed" value="https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json" protocolVersion="3" /> <add key="labsFeed" value="https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json" protocolVersion="3" />
</packageSources> </packageSources>
@@ -12,6 +13,9 @@
everything else from nuget.org. --> everything else from nuget.org. -->
<packageSourceMapping> <packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element --> <!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="github">
<package pattern="Wino.Mail.Contracts" />
</packageSource>
<packageSource key="nuget"> <packageSource key="nuget">
<package pattern="*" /> <package pattern="*" />
<package pattern="CommunityToolkit.Common" /> <package pattern="CommunityToolkit.Common" />