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
6 changes: 3 additions & 3 deletions InvvardDev.Ifttt.Service.Api.sln → InvvardDev.Ifttt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvvardDev.Ifttt.Service.Api.Core", "src\InvvardDev.Ifttt.Service.Api.Core\InvvardDev.Ifttt.Service.Api.Core.csproj", "{2A300429-5FD8-40E3-BECD-6CDBE16F2CD6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvvardDev.Ifttt.Core", "src\InvvardDev.Ifttt.Core\InvvardDev.Ifttt.Core.csproj", "{2A300429-5FD8-40E3-BECD-6CDBE16F2CD6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvvardDev.Ifttt.Service.Api.Trigger", "src\InvvardDev.Ifttt.Service.Api.Trigger\InvvardDev.Ifttt.Service.Api.Trigger.csproj", "{7A94E577-6B7C-4AC5-A602-01FC41ED4D84}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvvardDev.Ifttt.Trigger", "src\InvvardDev.Ifttt.Trigger\InvvardDev.Ifttt.Trigger.csproj", "{7A94E577-6B7C-4AC5-A602-01FC41ED4D84}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8217D2BC-C98F-444C-B8D7-47CB074F6A66}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{D3D189E6-DB32-4E25-ACEE-A253B03C7281}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Trigger.UpdatedNuget", "sample\InvvardDev.Ifttt.Trigger.UpdatedNuget\InvvardDev.Ifttt.Trigger.UpdatedNuget.csproj", "{15680BDC-86C0-4810-87A4-02200D01CFC4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Service.Api.Trigger.Tests", "tests\InvvardDev.Ifttt.Service.Api.Trigger.Tests\InvvardDev.Ifttt.Service.Api.Trigger.Tests.csproj", "{F94D7981-BB31-467B-AA87-8924964CA186}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Trigger.Tests", "tests\InvvardDev.Ifttt.Trigger.Tests\InvvardDev.Ifttt.Trigger.Tests.csproj", "{F94D7981-BB31-467B-AA87-8924964CA186}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\InvvardDev.Ifttt.Service.Api.Trigger\InvvardDev.Ifttt.Service.Api.Trigger.csproj" />
<ProjectReference Include="..\..\src\InvvardDev.Ifttt.Trigger\InvvardDev.Ifttt.Trigger.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Trigger.Attributes;
using InvvardDev.Ifttt.Trigger.Models;
using InvvardDev.Ifttt.Trigger.UpdatedNuget.Triggers;

namespace InvvardDev.Ifttt.Trigger.UpdatedNuget.Models;
Expand All @@ -8,10 +8,10 @@ namespace InvvardDev.Ifttt.Trigger.UpdatedNuget.Models;
public class WatchedNugetTriggerFields : TriggerFieldsBase
{
[TriggerField("nuget_package_name")]
public string NugetPackageName { get; init; }
public string NugetPackageName { get; init; } = default!;

[TriggerField("updated_version")]
public string UpdatedVersion { get; init; }
public string UpdatedVersion { get; init; } = default!;

[TriggerField("updated_date")]
public DateTime UpdatedDate { get; init; }
Expand Down
2 changes: 1 addition & 1 deletion sample/InvvardDev.Ifttt.Trigger.UpdatedNuget/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using InvvardDev.Ifttt.Service.Api.Trigger;
using InvvardDev.Ifttt.Trigger;

var builder = WebApplication.CreateBuilder(args);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using InvvardDev.Ifttt.Service.Api.Trigger;
using InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
using InvvardDev.Ifttt.Service.Api.Trigger.Contracts;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Trigger.Attributes;
using InvvardDev.Ifttt.Trigger.Contracts;
using InvvardDev.Ifttt.Trigger.Models;
using InvvardDev.Ifttt.Trigger.UpdatedNuget.Models;

namespace InvvardDev.Ifttt.Trigger.UpdatedNuget.Triggers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Core.Configuration;
using Microsoft.Extensions.Options;

namespace InvvardDev.Ifttt.Service.Api.Core.Authentication;
namespace InvvardDev.Ifttt.Core.Authentication;

public class ServiceKeyMiddleware(RequestDelegate next, IOptions<IftttOptions> options)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Core.Configuration;
namespace InvvardDev.Ifttt.Core.Configuration;

public static class IftttConstants
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

namespace InvvardDev.Ifttt.Service.Api.Core.Configuration;
namespace InvvardDev.Ifttt.Core.Configuration;

public class IftttOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Core.Configuration;
using Microsoft.AspNetCore.Mvc;

namespace InvvardDev.Ifttt.Service.Api.Core.Controllers;
namespace InvvardDev.Ifttt.Core.Controllers;

[ApiController]
[Route(IftttConstants.StatusApiPath)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Core.Configuration;
using Microsoft.AspNetCore.Mvc;

namespace InvvardDev.Ifttt.Service.Api.Core.Controllers;
namespace InvvardDev.Ifttt.Core.Controllers;

[ApiController]
[Route(IftttConstants.TestingApiPath)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using InvvardDev.Ifttt.Service.Api.Core.Authentication;
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Core.Authentication;
using InvvardDev.Ifttt.Core.Configuration;
using Microsoft.Extensions.Options;

namespace InvvardDev.Ifttt.Service.Api.Core;
namespace InvvardDev.Ifttt.Core;

public static class ServiceCollectionExtensions
{
Expand All @@ -11,7 +11,7 @@ public static IServiceCollection AddIftttApiClient(this IServiceCollection servi
services.AddOptions<IftttOptions>()
.BindConfiguration(IftttOptions.DefaultSectionName)
.ValidateDataAnnotations();

return services;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
3 changes: 3 additions & 0 deletions src/InvvardDev.Ifttt.Core/Models/Source.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace InvvardDev.Ifttt.Core.Models;

public record Source(string? Id, string? Url);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace InvvardDev.Ifttt.Service.Api.Core.Models;
namespace InvvardDev.Ifttt.Core.Models;

public class TopLevelBaseModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json;

namespace InvvardDev.Ifttt.Service.Api.Core.Models;
namespace InvvardDev.Ifttt.Core.Models;

public class TopLevelErrorModel(IList<ErrorMessage> Errors) : TopLevelBaseModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json;

namespace InvvardDev.Ifttt.Service.Api.Core.Models;
namespace InvvardDev.Ifttt.Core.Models;

public class TopLevelMessageModel<T>(T data) : TopLevelBaseModel
where T : class, new()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace InvvardDev.Ifttt.Service.Api.Core.Models;
namespace InvvardDev.Ifttt.Core.Models;

public record User(string Timezone = "America/Toronto");
3 changes: 0 additions & 3 deletions src/InvvardDev.Ifttt.Service.Api.Core/Models/Source.cs

This file was deleted.

4 changes: 0 additions & 4 deletions src/InvvardDev.Ifttt.Service.Api.Trigger/GlobalUsings.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection;
using InvvardDev.Ifttt.Trigger.Contracts;
using Microsoft.Extensions.DependencyModel;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
namespace InvvardDev.Ifttt.Trigger.Attributes;

internal abstract class AttributeLookup : IAttributeLookup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
[AttributeUsage(AttributeTargets.Class)]
namespace InvvardDev.Ifttt.Trigger.Attributes;

[AttributeUsage(AttributeTargets.Class)]
public class TriggerAttribute(string slug) : TriggerAttributeBase(slug);
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
public class TriggerAttributeBase : Attribute
{
public string Slug { get; }
protected TriggerAttributeBase(string slug)
{
if (string.IsNullOrWhiteSpace(slug))
{
throw new ArgumentException("Trigger slug cannot be null or whitespace.", nameof(slug));
}
Slug = slug;
}
namespace InvvardDev.Ifttt.Trigger.Attributes;

public class TriggerAttributeBase : Attribute
{
public string Slug { get; }

protected TriggerAttributeBase(string slug)
{
if (string.IsNullOrWhiteSpace(slug))
{
throw new ArgumentException("Trigger slug cannot be null or whitespace.", nameof(slug));
}

Slug = slug;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
using InvvardDev.Ifttt.Trigger.Contracts;

namespace InvvardDev.Ifttt.Trigger.Attributes;

internal class TriggerAttributeLookup : AttributeLookup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
namespace InvvardDev.Ifttt.Trigger.Attributes;

[AttributeUsage(AttributeTargets.Property)]
public class TriggerFieldAttribute(string slug) : TriggerAttributeBase(slug);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
namespace InvvardDev.Ifttt.Trigger.Attributes;

[AttributeUsage(AttributeTargets.Class)]
public class TriggerFieldsAttribute(string slug) : TriggerAttributeBase (slug);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
namespace InvvardDev.Ifttt.Trigger.Attributes;

internal class TriggerFieldsAttributeLookup : AttributeLookup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Contracts;
namespace InvvardDev.Ifttt.Trigger.Contracts;

public interface IAttributeLookup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Trigger.Models;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Contracts;
namespace InvvardDev.Ifttt.Trigger.Contracts;

public interface ITrigger
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Net;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Trigger.Models;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Contracts;
namespace InvvardDev.Ifttt.Trigger.Contracts;

public interface ITriggerHook
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InvvardDev.Ifttt.Service.Api.Trigger.Contracts;
namespace InvvardDev.Ifttt.Trigger.Contracts;

public interface ITriggerRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Core.Configuration;
using InvvardDev.Ifttt.Trigger.Contracts;
using InvvardDev.Ifttt.Trigger.Models;
using Microsoft.AspNetCore.Mvc;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Controllers;
namespace InvvardDev.Ifttt.Trigger.Controllers;

[ApiController]
[Route(IftttConstants.BaseTriggersApiPath)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System.Reflection;
using InvvardDev.Ifttt.Service.Api.Core;
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
using InvvardDev.Ifttt.Service.Api.Trigger.Hooks;
using InvvardDev.Ifttt.Service.Api.Trigger.Repositories;
using InvvardDev.Ifttt.Core;
using InvvardDev.Ifttt.Core.Configuration;
using InvvardDev.Ifttt.Trigger.Attributes;
using InvvardDev.Ifttt.Trigger.Contracts;
using InvvardDev.Ifttt.Trigger.Hooks;
using InvvardDev.Ifttt.Trigger.Repositories;
using Microsoft.Extensions.Options;

namespace InvvardDev.Ifttt.Service.Api.Trigger;
namespace InvvardDev.Ifttt.Trigger;

public static class ServiceCollectionExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.ComponentModel;
using System.Reflection;
using InvvardDev.Ifttt.Service.Api.Trigger.Attributes;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Trigger.Attributes;
using InvvardDev.Ifttt.Trigger.Models;

namespace InvvardDev.Ifttt.Service.Api.Trigger;
namespace InvvardDev.Ifttt.Trigger;

public static class TriggerFieldsMapper
{
Expand Down
3 changes: 3 additions & 0 deletions src/InvvardDev.Ifttt.Trigger/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Global using directives

global using System;
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Net;
using System.Net.Mime;
using System.Text;
using InvvardDev.Ifttt.Service.Api.Core.Configuration;
using InvvardDev.Ifttt.Service.Api.Core.Models;
using InvvardDev.Ifttt.Service.Api.Trigger.Models;
using InvvardDev.Ifttt.Core.Configuration;
using InvvardDev.Ifttt.Core.Models;
using InvvardDev.Ifttt.Trigger.Contracts;
using InvvardDev.Ifttt.Trigger.Models;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Hooks;
namespace InvvardDev.Ifttt.Trigger.Hooks;

public class RealTimeNotificationWebHook : ITriggerHook
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\InvvardDev.Ifttt.Service.Api.Core\InvvardDev.Ifttt.Service.Api.Core.csproj"/>
<ProjectReference Include="..\InvvardDev.Ifttt.Core\InvvardDev.Ifttt.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json.Serialization;

namespace InvvardDev.Ifttt.Service.Api.Trigger.Models;
namespace InvvardDev.Ifttt.Trigger.Models;

public class RealTimeNotificationModel
{
Expand Down
Loading