Skip to content

Commit

Permalink
feat: remove Notification Templates as part of the API as it is now o…
Browse files Browse the repository at this point in the history
…bsolete #59
  • Loading branch information
todd authored and wh1337 committed Aug 28, 2023
1 parent cfd21f0 commit 6af9ec9
Show file tree
Hide file tree
Showing 16 changed files with 10 additions and 269 deletions.
4 changes: 1 addition & 3 deletions src/Novu.Extensions/IocNovuRegistrationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Novu.Interfaces;
using Novu.NotificationTemplates;
using Refit;

namespace Novu.Extensions;
Expand All @@ -19,7 +18,6 @@ public static IServiceCollection RegisterNovuClients(
RefitSettings refitSettings = null)
{
var novuConfiguration = configuration.GetNovuClientConfiguration();
services.AddTransient<INovuClientConfiguration>(_ => novuConfiguration);

Action<HttpClient> configureClient = c =>
{
Expand All @@ -42,7 +40,6 @@ public static IServiceCollection RegisterNovuClients(
services.AddRefitClient<IEventClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<ITopicClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<IWorkflowGroupClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<INotificationTemplatesClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<IWorkflowClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<ILayoutClient>(settings).ConfigureHttpClient(configureClient);
services.AddRefitClient<IIntegrationClient>(settings).ConfigureHttpClient(configureClient);
Expand All @@ -51,6 +48,7 @@ public static IServiceCollection RegisterNovuClients(
services.AddRefitClient<IExecutionDetailsClient>(settings).ConfigureHttpClient(configureClient);

return services
.AddTransient<INovuClientConfiguration>(_ => novuConfiguration)
.AddTransient<INovuClient, NovuClient>();
}
}
2 changes: 0 additions & 2 deletions src/Novu.Tests/IntegrationTests/BaseIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using Novu.Models.Subscribers;
using Novu.Models.Workflows;
using Novu.Models.Workflows.Step.Message;
using Novu.NotificationTemplates;
using Novu.Sync;
using ParkSquare.Testing.Generators;
using Refit;
Expand Down Expand Up @@ -62,7 +61,6 @@ protected BaseIntegrationTest(ITestOutputHelper output)
protected IEventClient Event => Get<IEventClient>();
protected ITopicClient Topic => Get<ITopicClient>();
protected IWorkflowGroupClient WorkflowGroup => Get<IWorkflowGroupClient>();
protected INotificationTemplatesClient NotificationTemplates => Get<INotificationTemplatesClient>();
protected IWorkflowClient Workflow => Get<IWorkflowClient>();
protected ILayoutClient Layout => Get<ILayoutClient>();
protected IIntegrationClient Integration => Get<IIntegrationClient>();
Expand Down
38 changes: 0 additions & 38 deletions src/Novu.Tests/IntegrationTests/NotificationTemplatesTests.cs

This file was deleted.

15 changes: 5 additions & 10 deletions src/Novu/Interfaces/INovuClient.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using Novu.NotificationTemplates;

namespace Novu.Interfaces;
namespace Novu.Interfaces;

public interface INovuClient
{
public ISubscriberClient Subscriber { get; }

public IEventClient Event { get; }

public ITopicClient Topic { get; }
public INotificationTemplatesClient NotificationTemplates { get; }
public IWorkflowGroupClient WorkflowGroup { get; }
ISubscriberClient Subscriber { get; }
IEventClient Event { get; }
ITopicClient Topic { get; }
IWorkflowGroupClient WorkflowGroup { get; }
IWorkflowClient Workflow { get; }
ILayoutClient Layout { get; }
IIntegrationClient Integration { get; }
Expand Down
14 changes: 0 additions & 14 deletions src/Novu/NotificationTemplates/Child.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Novu/NotificationTemplates/Filter.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/Novu/NotificationTemplates/INotificationTemplatesClient.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/Novu/NotificationTemplates/NotificationGroup.cs

This file was deleted.

44 changes: 0 additions & 44 deletions src/Novu/NotificationTemplates/NotificationTemplate.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/Novu/NotificationTemplates/PreferenceSettings.cs

This file was deleted.

26 changes: 0 additions & 26 deletions src/Novu/NotificationTemplates/Step.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Novu/NotificationTemplates/Trigger.cs

This file was deleted.

8 changes: 0 additions & 8 deletions src/Novu/NotificationTemplates/UpdateTemplateStatusRequest.cs

This file was deleted.

8 changes: 0 additions & 8 deletions src/Novu/NotificationTemplates/Variable.cs

This file was deleted.

4 changes: 4 additions & 0 deletions src/Novu/Novu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
</ItemGroup>
<ItemGroup>
<Compile Remove="JsonConverters\EnumMemberExtensions.cs" />
<Compile Remove="NotificationTemplates\Child.cs" />
<Compile Remove="NotificationTemplates\Filter.cs" />
<Compile Remove="NotificationTemplates\Step.cs" />
<Compile Remove="NotificationTemplates\Trigger.cs" />
</ItemGroup>

</Project>
31 changes: 0 additions & 31 deletions src/Novu/NovuClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Novu.Interfaces;
using Novu.NotificationTemplates;
using Refit;

namespace Novu;
Expand All @@ -24,34 +23,6 @@ public class NovuClient : INovuClient
},
};

public NovuClient(INovuClientConfiguration configuration) : this(configuration, default)
{
}

public NovuClient(
ISubscriberClient subscriber,
IEventClient @event,
ITopicClient topic,
INotificationTemplatesClient notificationTemplates,
IWorkflowClient workflow,
IWorkflowGroupClient workflowGroup,
IIntegrationClient integration,
INotificationsClient notifications,
IMessageClient message,
ILayoutClient layout)
{
Subscriber = subscriber;
Event = @event;
Topic = topic;
NotificationTemplates = notificationTemplates;
Workflow = workflow;
WorkflowGroup = workflowGroup;
Integration = integration;
Notifications = notifications;
Message = message;
Layout = layout;
}

public NovuClient(
INovuClientConfiguration configuration,
HttpClient? client = default,
Expand All @@ -69,7 +40,6 @@ public NovuClient(
Subscriber = RestService.For<ISubscriberClient>(httpClient, refitSettings);
Event = RestService.For<IEventClient>(httpClient, refitSettings);
Topic = RestService.For<ITopicClient>(httpClient, refitSettings);
NotificationTemplates = RestService.For<INotificationTemplatesClient>(httpClient, refitSettings);
WorkflowGroup = RestService.For<IWorkflowGroupClient>(httpClient, refitSettings);
Workflow = RestService.For<IWorkflowClient>(httpClient, refitSettings);
Layout = RestService.For<ILayoutClient>(httpClient, refitSettings);
Expand All @@ -89,6 +59,5 @@ public NovuClient(
public ISubscriberClient Subscriber { get; }
public IEventClient Event { get; }
public ITopicClient Topic { get; }
public INotificationTemplatesClient NotificationTemplates { get; }
public IWorkflowGroupClient WorkflowGroup { get; }
}

0 comments on commit 6af9ec9

Please sign in to comment.