2024-04-18 01:44:37 +02:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using Serilog.Core;
|
2024-11-20 01:45:48 +01:00
|
|
|
|
using Wino.Authentication;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
using Wino.Core.Domain.Interfaces;
|
|
|
|
|
|
using Wino.Core.Integration.Processors;
|
|
|
|
|
|
using Wino.Core.Services;
|
2025-04-26 10:49:55 +02:00
|
|
|
|
using Wino.Core.Synchronizers.Errors.Outlook;
|
2025-02-15 12:53:32 +01:00
|
|
|
|
using Wino.Core.Synchronizers.ImapSync;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
namespace Wino.Core;
|
|
|
|
|
|
|
|
|
|
|
|
public static class CoreContainerSetup
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
public static void RegisterCoreServices(this IServiceCollection services)
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
var loggerLevelSwitcher = new LoggingLevelSwitch();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
services.AddSingleton(loggerLevelSwitcher);
|
|
|
|
|
|
services.AddSingleton<ISynchronizerFactory, SynchronizerFactory>();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
services.AddTransient<IGmailChangeProcessor, GmailChangeProcessor>();
|
|
|
|
|
|
services.AddTransient<IImapChangeProcessor, ImapChangeProcessor>();
|
|
|
|
|
|
services.AddTransient<IOutlookChangeProcessor, OutlookChangeProcessor>();
|
|
|
|
|
|
services.AddTransient<IWinoRequestProcessor, WinoRequestProcessor>();
|
|
|
|
|
|
services.AddTransient<IWinoRequestDelegator, WinoRequestDelegator>();
|
|
|
|
|
|
services.AddTransient<IImapTestService, ImapTestService>();
|
|
|
|
|
|
services.AddTransient<IAuthenticationProvider, AuthenticationProvider>();
|
|
|
|
|
|
services.AddTransient<IAutoDiscoveryService, AutoDiscoveryService>();
|
|
|
|
|
|
services.AddTransient<IFontService, FontService>();
|
|
|
|
|
|
services.AddTransient<IUnsubscriptionService, UnsubscriptionService>();
|
|
|
|
|
|
services.AddTransient<IOutlookAuthenticator, OutlookAuthenticator>();
|
|
|
|
|
|
services.AddTransient<IGmailAuthenticator, GmailAuthenticator>();
|
2025-02-15 12:53:32 +01:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
services.AddTransient<IImapSynchronizationStrategyProvider, ImapSynchronizationStrategyProvider>();
|
|
|
|
|
|
services.AddTransient<CondstoreSynchronizer>();
|
|
|
|
|
|
services.AddTransient<QResyncSynchronizer>();
|
|
|
|
|
|
services.AddTransient<UidBasedSynchronizer>();
|
2025-04-26 10:49:55 +02:00
|
|
|
|
|
|
|
|
|
|
// Register error factory handlers
|
|
|
|
|
|
services.AddTransient<ObjectCannotBeDeletedHandler>();
|
|
|
|
|
|
|
|
|
|
|
|
services.AddTransient<IOutlookSynchronizerErrorHandlerFactory, OutlookSynchronizerErrorHandlingFactory>();
|
|
|
|
|
|
services.AddTransient<IGmailSynchronizerErrorHandlerFactory, GmailSynchronizerErrorHandlingFactory>();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|