Add PocketBase client with contracts and sharp build tooling

This commit is contained in:
tleininger committed 2026-09-22 19:32:32 +02:00
1 parent 56922707ea
commit 251f2d818b
24 files changed
+578 -20

No files matched your search

@@ -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) =>