fix(backend): make API types internal

This commit is contained in:
2026-05-07 14:06:37 -04:00
parent d1621ecb36
commit 9022fa7d93
208 changed files with 347 additions and 344 deletions

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.BlobStorage.Configuration;
public sealed class LocalBlobStorageOptions
internal sealed class LocalBlobStorageOptions
{
public const string SectionName = "LocalBlobStorage";

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
public static class CommonFileNames
internal static class CommonFileNames
{
public const string ProfilePicture = "profilePicture";
public const string LogoPicture = "logoPicture";

View File

@@ -2,7 +2,7 @@
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
public static class ContentTypes
internal static class ContentTypes
{
private const string ImagePng = "image/png";
private const string ImageJpeg = "image/jpeg";

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
public interface IBlobStorage
internal interface IBlobStorage
{
/// <summary>
/// Upload a file to blob storage.

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
public static class SubDirectoryNames
internal static class SubDirectoryNames
{
public const string Profile = "profile";
public const string Contents = "contents";

View File

@@ -4,7 +4,7 @@ using Socialize.Api.Infrastructure.BlobStorage.Contracts;
namespace Socialize.Api.Infrastructure.BlobStorage.Services;
public sealed class LocalBlobStorage(
internal sealed class LocalBlobStorage(
IWebHostEnvironment environment,
IHttpContextAccessor httpContextAccessor,
IOptions<LocalBlobStorageOptions> options,

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.Configuration;
public class WebsiteOptions
internal class WebsiteOptions
{
public const string SectionName = "Website";

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.Emailer.Configuration;
public class EmailerOptions
internal class EmailerOptions
{
public const string ConfigurationSection = "Emailer";

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.Emailer.Contracts;
public interface IEmailSender
internal interface IEmailSender
{
Task SendEmailAsync(string email, string subject, string message);
}

View File

@@ -2,7 +2,7 @@ using Socialize.Api.Infrastructure.Emailer.Contracts;
namespace Socialize.Api.Infrastructure.Emailer.Services;
public class LoggerEmailSender(ILogger<IEmailSender> logger)
internal class LoggerEmailSender(ILogger<IEmailSender> logger)
: IEmailSender
{
public Task SendEmailAsync(string email, string subject, string message)

View File

@@ -5,7 +5,7 @@ using PostmarkDotNet;
namespace Socialize.Api.Infrastructure.Emailer.Services;
public class PostmarkEmailSender : IEmailSender
internal class PostmarkEmailSender : IEmailSender
{
private readonly PostmarkClient _client;
private readonly EmailerOptions _options;

View File

@@ -7,7 +7,7 @@ using Microsoft.Extensions.Options;
namespace Socialize.Api.Infrastructure.Emailer.Services;
public class ResendEmailSender : IEmailSender
internal class ResendEmailSender : IEmailSender
{
private static readonly Uri EndpointUri = new("https://api.resend.com/emails");
private readonly HttpClient _httpClient;

View File

@@ -9,7 +9,7 @@ using Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
namespace Socialize.Api.Infrastructure;
public static class InfrastructureRegistration
internal static class InfrastructureRegistration
{
public static WebApplicationBuilder AddInfrastructureModule(
this WebApplicationBuilder builder)

View File

@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
namespace Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
public class StripeOptions
internal class StripeOptions
{
public const string ConfigurationSection = "Stripe";

View File

@@ -4,7 +4,7 @@ using Socialize.Api.Modules.Organizations.Services;
namespace Socialize.Api.Infrastructure.Security;
public sealed class AccessScopeService(
internal sealed class AccessScopeService(
OrganizationAccessService organizationAccessService)
{
public bool IsManager(ClaimsPrincipal user)

View File

@@ -2,7 +2,7 @@
namespace Socialize.Api.Infrastructure.Security;
public static class ClaimsPrincipalExtensions
internal static class ClaimsPrincipalExtensions
{
public static IReadOnlyCollection<Guid> GetScopeIds(this ClaimsPrincipal claims, string key)
{

View File

@@ -5,7 +5,7 @@ using Microsoft.IdentityModel.Tokens;
namespace Socialize.Api.Infrastructure.Security;
public static class JwtTokenHelper
internal static class JwtTokenHelper
{
public static string GenerateJwtToken(
TimeSpan expiresIn,

View File

@@ -1,6 +1,6 @@
namespace Socialize.Api.Infrastructure.Security;
public static class KnownClaims
internal static class KnownClaims
{
public const string Alias = "alias";
public const string PortraitUrl = "portraitUrl";

View File

@@ -1,5 +1,5 @@
namespace Socialize.Api.Infrastructure.Security;
public class MissingClaimException(
internal class MissingClaimException(
string claimName)
: Exception($"Claim '{claimName}' is missing.");

View File

@@ -4,7 +4,7 @@ using System.Text;
namespace Socialize.Api.Infrastructure.Security;
// If we need to add special characters we can alternate between 2 pools.
public static class PasswordGenerator
internal static class PasswordGenerator
{
private const string LowerLetters = "abcdefghijklmnopqrstuvwxyz";
private const string UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

View File

@@ -2,7 +2,7 @@ using System.Security.Cryptography;
namespace Socialize.Api.Infrastructure.Security;
public static class RefreshTokenGenerator
internal static class RefreshTokenGenerator
{
public static string Next()
{

View File

@@ -19,7 +19,7 @@ using Microsoft.AspNetCore.Identity;
namespace Socialize.Api.Infrastructure.TestData;
public static class TestDataSeedExtensions
internal static class TestDataSeedExtensions
{
private static readonly Guid OrganizationId = Guid.Parse("99999999-9999-9999-9999-999999999999");
private static readonly Guid WorkspaceId = Guid.Parse("11111111-1111-1111-1111-111111111111");

View File

@@ -2,7 +2,7 @@ using System.Text.RegularExpressions;
namespace Socialize.Api.Infrastructure.YouTube;
public static class YouTubeUrlHelper
internal static class YouTubeUrlHelper
{
private static readonly Regex VideoIdRegex = new(
@"(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^""&?/\s]{11})",