Release v0.1.6

This commit is contained in:
2026-07-07 16:00:38 +02:00
parent a2053518d1
commit 150b720f12
149 changed files with 14311 additions and 8005 deletions

View File

@@ -0,0 +1,27 @@
import { formatDateTime as formatPlatformDateTime } from "../../utils/datetime";
export function adminErrorMessage(error: unknown): string {
if (!(error instanceof Error)) return "The administrative operation failed.";
const message = error.message;
const jsonStart = message.indexOf("{");
if (jsonStart >= 0) {
try {
const parsed = JSON.parse(message.slice(jsonStart)) as { detail?: unknown };
if (typeof parsed.detail === "string") return parsed.detail;
if (Array.isArray(parsed.detail)) {
return parsed.detail.map((item) => typeof item === "object" && item && "msg" in item ? String((item as { msg: unknown }).msg) : String(item)).join("; ");
}
} catch {
// Fall through to the original message.
}
}
return message;
}
export function formatAdminDateTime(value?: string | null): string {
return formatPlatformDateTime(value, { fallback: "Never" });
}
export function joinLabels(values: Array<{ name: string }>): string {
return values.length ? values.map((value) => value.name).join(", ") : "—";
}