Add PocketBase client with contracts and sharp build tooling
This commit is contained in:
1 parent
56922707ea
commit
251f2d818b
24 files changed
+578
-20
No files matched your search
@@ -18,8 +18,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Markdig" Version="0.38.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="16.2.1" />
|
||||
<PackageReference Include="Markdig" />
|
||||
<PackageReference Include="YamlDotNet" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Content ships as files inside the image, not in a volume. Copy it to
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Elternbeirat.Web.Services;
|
||||
namespace Elternbeirat.Web.Features.Events;
|
||||
|
||||
/// <summary>
|
||||
/// A single calendar entry (parents' evening, meeting, deadline). Read from
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Globalization;
|
||||
using Elternbeirat.Web.Services;
|
||||
using YamlDotNet.Serialization;
|
||||
using YamlDotNet.Serialization.NamingConventions;
|
||||
|
||||
namespace Elternbeirat.Web.Services;
|
||||
namespace Elternbeirat.Web.Features.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Reads the calendar entries from <c>Content/events.yml</c> once at startup and
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Globalization;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Elternbeirat.Web.Services;
|
||||
|
||||
namespace Elternbeirat.Web.Services;
|
||||
namespace Elternbeirat.Web.Features.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Builds an iCalendar (RFC 5545) document from the events so visitors can
|
||||
@@ -82,7 +83,7 @@ public static class IcsCalendar
|
||||
{
|
||||
var seed = $"{ev.Title}|{ev.Start:O}";
|
||||
var hash = SHA256.HashData(Encoding.UTF8.GetBytes(seed));
|
||||
return $"{Convert.ToHexString(hash)[..16].ToLowerInvariant()}@elternbeirat-igmh";
|
||||
return $"{Convert.ToHexString(hash)[..16]}@elternbeirat-igmh";
|
||||
}
|
||||
|
||||
private static string Local(DateTime value) =>
|
||||
@@ -93,11 +94,11 @@ public static class IcsCalendar
|
||||
|
||||
/// <summary>Escapes the characters that are special in an ICS text value.</summary>
|
||||
private static string Escape(string value) => value
|
||||
.Replace("\\", "\\\\")
|
||||
.Replace(";", "\\;")
|
||||
.Replace(",", "\\,")
|
||||
.Replace("\r\n", "\\n")
|
||||
.Replace("\n", "\\n");
|
||||
.Replace("\\", "\\\\", StringComparison.Ordinal)
|
||||
.Replace(";", "\\;", StringComparison.Ordinal)
|
||||
.Replace(",", "\\,", StringComparison.Ordinal)
|
||||
.Replace("\r\n", "\\n", StringComparison.Ordinal)
|
||||
.Replace("\n", "\\n", StringComparison.Ordinal);
|
||||
|
||||
// ICS lines are terminated with CRLF regardless of platform.
|
||||
private static void AppendLine(StringBuilder sb, string line) =>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Elternbeirat.Web.Components;
|
||||
using Elternbeirat.Web.Features.Events;
|
||||
using Elternbeirat.Web.Services;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
|
||||
Reference in new issue
Block a user