Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Gml.Common/Gml.Common/Gml.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
<ProjectReference Include="..\..\Gml.Interfaces\Gml.Interfaces.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Gml.Core/Gml.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<ItemGroup>
<PackageReference Include="CurseForge.APIClient" Version="3.0.0" />
<PackageReference Include="Gml.Web.Api.Domains" Version="2025.2.3.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Spectre.Console" Version="0.50.0" />
Expand All @@ -24,7 +23,7 @@
<ProjectReference Include="..\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge.csproj"/>
<ProjectReference Include="..\CmlLib.Core.Installer.NeoForge\CmlLib.Core.Installer.NeoForge\CmlLib.Core.Installer.NeoForge.csproj" />
<ProjectReference Include="..\Gml.Common\Gml.Common\Gml.Common.csproj" />
<ProjectReference Include="..\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
<ProjectReference Include="..\Gml.Interfaces\Gml.Interfaces.csproj" />
<ProjectReference Include="..\Modrinth.Api\src\Modrinth.Api\Modrinth.Api.csproj" />
<ProjectReference Include="..\Pingo\Pingo\Pingo.csproj" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions src/Gml.Domains/Auth/ApplicationPermission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Gml.Domains.Auth;

public class ApplicationPermission
{
public Guid ApplicationId { get; set; }
public ExternalApplication Application { get; set; } = null!;

public int PermissionId { get; set; }
public Permission Permission { get; set; } = null!;
}
15 changes: 15 additions & 0 deletions src/Gml.Domains/Auth/ExternalApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;

namespace Gml.Domains.Auth;

public class ExternalApplication
{
public Guid Id { get; set; } = Guid.NewGuid();
public int UserId { get; set; }
public string Name { get; set; } = null!;
public string TokenHash { get; set; } = null!;
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;

public ICollection<ApplicationPermission> ApplicationPermissions { get; set; } = new List<ApplicationPermission>();
}
12 changes: 12 additions & 0 deletions src/Gml.Domains/Auth/Permission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;

namespace Gml.Domains.Auth;

public class Permission
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string? Description { get; set; }
public bool IsSystem { get; set; }
public ICollection<RolePermission> RolePermissions { get; set; } = new List<RolePermission>();
}
15 changes: 15 additions & 0 deletions src/Gml.Domains/Auth/RefreshToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace Gml.Domains.Auth;

public class RefreshToken
{
public Guid Id { get; set; } = Guid.NewGuid();
public int UserId { get; set; }
public string TokenHash { get; set; } = null!;
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime ExpiresAtUtc { get; set; }
public DateTime? RevokedAtUtc { get; set; }

public bool IsActive => RevokedAtUtc == null && DateTime.UtcNow < ExpiresAtUtc;
}
13 changes: 13 additions & 0 deletions src/Gml.Domains/Auth/Role.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace Gml.Domains.Auth;

public class Role
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string? Description { get; set; }

public ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
public ICollection<RolePermission> RolePermissions { get; set; } = new List<RolePermission>();
}
10 changes: 10 additions & 0 deletions src/Gml.Domains/Auth/RolePermission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Gml.Domains.Auth;

public class RolePermission
{
public int RoleId { get; set; }
public Role Role { get; set; } = null!;

public int PermissionId { get; set; }
public Permission Permission { get; set; } = null!;
}
10 changes: 10 additions & 0 deletions src/Gml.Domains/Auth/UserRole.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Gml.Domains.Auth;

public class UserRole
{
public int UserId { get; set; }
public User.DbUser DbUser { get; set; } = null!;

public int RoleId { get; set; }
public Role Role { get; set; } = null!;
}
7 changes: 7 additions & 0 deletions src/Gml.Domains/Exceptions/UserAlreadyException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;

namespace Gml.Domains.Exceptions;

public class UserAlreadyException : Exception
{
}
30 changes: 30 additions & 0 deletions src/Gml.Domains/Gml.Domains.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<Version>2025.2.3.2</Version>
<Title>Gml.Domains</Title>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Gml.Core\src\Gml.Interfaces\Gml.Interfaces.csproj" />
<ProjectReference Include="..\Gml.Interfaces\Gml.Interfaces.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<Compile Update="Integrations\AzuriomAuthResult.cs">
<DependentUpon>AuthResult.cs</DependentUpon>
</Compile>
<Compile Update="Integrations\UnicoreAuthResult.cs">
<DependentUpon>AuthResult.cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions src/Gml.Domains/Integrations/AuthCustomResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Gml.Domains.Integrations;

public class AuthCustomResponse
{
public string Login { get; set; }

public string UserUuid { get; set; }
public string Message { get; set; }
}
14 changes: 14 additions & 0 deletions src/Gml.Domains/Integrations/AuthResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#nullable enable
namespace Gml.Domains.Integrations;

public class AuthResult
{
public bool IsSuccess { get; set; }
public string? Login { get; set; }
public string? Uuid { get; set; }
public string? Message { get; set; }
public bool IsSlim { get; set; }
public bool TwoFactorEnabled { get; set; }
public string? TwoFactorSecret { get; set; }
public string? TwoFactorSecretTemp { get; set; }
}
36 changes: 36 additions & 0 deletions src/Gml.Domains/Integrations/AzuriomAuthResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using Newtonsoft.Json;

namespace Gml.Domains.Integrations;

public class AzuriomAuthResult
{
[JsonProperty("id")]
public int Id { get; set; }

[JsonProperty("username")]
public string Username { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

[JsonProperty("email_verified")]
public bool EmailVerified { get; set; }

[JsonProperty("money")]
public decimal Money { get; set; }

[JsonProperty("banned")]
public bool Banned { get; set; }

[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("access_token")]
public string AccessToken { get; set; }

[JsonProperty("created_at")]
public DateTime CreatedAt { get; set; }
[JsonProperty("skin")]
public SkinInfo Skin { get; set; }
}
13 changes: 13 additions & 0 deletions src/Gml.Domains/Integrations/DiscordRpcClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using GmlCore.Interfaces.Integrations;

namespace Gml.Domains.Integrations;

public class DiscordRpcClient : IDiscordRpcClient
{
public string ClientId { get; set; }
public string Details { get; set; }
public string LargeImageKey { get; set; }
public string LargeImageText { get; set; }
public string SmallImageKey { get; set; }
public string SmallImageText { get; set; }
}
9 changes: 9 additions & 0 deletions src/Gml.Domains/Integrations/SkinInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Newtonsoft.Json;

namespace Gml.Domains.Integrations;

public class SkinInfo
{
[JsonProperty("slim")]
public bool Slim { get; set; }
}
84 changes: 84 additions & 0 deletions src/Gml.Domains/Integrations/UnicoreAuthResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using Newtonsoft.Json;

namespace Gml.Domains.Integrations;

public class UnicoreAuthResult
{
[JsonProperty("user")]
public User User { get; set; }

[JsonProperty("accessToken")]
public string AccessToken { get; set; }

[JsonProperty("refreshToken")]
public string RefreshToken { get; set; }
}

public class Ban
{
[JsonProperty("reason")]
public string Reason { get; set; }

[JsonProperty("expires")]
public object Expires { get; set; }

[JsonProperty("created")]
public DateTime Created { get; set; }
}

public class User
{
[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("username")]
public string Username { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

[JsonProperty("password")]
public string Password { get; set; }

[JsonProperty("activated")]
public bool Activated { get; set; }

[JsonProperty("accessToken")]
public object AccessToken { get; set; }

[JsonProperty("serverId")]
public object ServerId { get; set; }

[JsonProperty("two_factor_enabled")]
public object TwoFactorEnabled { get; set; }

[JsonProperty("two_factor_secret")]
public object TwoFactorSecret { get; set; }

[JsonProperty("two_factor_secret_temp")]
public string TwoFactorSecretTemp { get; set; }

[JsonProperty("real")]
public decimal Real { get; set; }

[JsonProperty("virtual")]
public decimal Virtual { get; set; }

[JsonProperty("perms")]
public object Perms { get; set; }

[JsonProperty("created")]
public DateTime Created { get; set; }

[JsonProperty("updated")]
public DateTime Updated { get; set; }

[JsonProperty("cloak")]
public object Cloak { get; set; }

[JsonProperty("ban")]
public Ban Ban { get; set; }
[JsonProperty("skin")]
public SkinInfo Skin { get; set; }
}
21 changes: 21 additions & 0 deletions src/Gml.Domains/Launcher/LauncherVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using GmlCore.Interfaces.Storage;

namespace Gml.Domains.Launcher;

public struct LauncherVersion : IVersionFile
{
public string Version { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Guid { get; set; }
public object Clone()
{
return new LauncherVersion
{
Version = Version,
Title = Title,
Description = Description,
Guid = Guid,
};
}
}
12 changes: 12 additions & 0 deletions src/Gml.Domains/LauncherDto/CreateLauncherProject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Gml.Domains.LauncherDto;

public class CreateLauncherProject
{
public string GitHubVersions { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Host { get; set; }
public string SecretKey { get; set; }
public string Version { get; set; }
public string[] SkinDomains { get; set; }
}
6 changes: 6 additions & 0 deletions src/Gml.Domains/LauncherDto/LauncherVersionReadDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Gml.Domains.LauncherDto;

public class LauncherVersionReadDto
{
public string Version { get; set; }
}
7 changes: 7 additions & 0 deletions src/Gml.Domains/Plugins/PluginVersionReadDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Gml.Domains.Plugins;

public class PluginVersionReadDto
{
public string Name { get; set; }
public string Version { get; set; }
}
8 changes: 8 additions & 0 deletions src/Gml.Domains/Plugins/RecloudPluginCreateDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace Gml.Domains.Plugins;

public class RecloudPluginCreateDto
{
public Guid Id { get; set; }
};
Loading