implement CalDAV MCP server v1 with streamable HTTP tools

This commit is contained in:
2026-03-20 15:47:06 +01:00
parent c92bf5c912
commit 4735b9ccf2
20 changed files with 4505 additions and 2 deletions

17
tests/ics.test.ts Normal file
View File

@@ -0,0 +1,17 @@
import { describe, expect, it } from "vitest";
import { ensureUid, validateIcsEvent } from "../src/ics.js";
import { ValidationError } from "../src/errors.js";
describe("ics helpers", () => {
it("adds UID when missing", () => {
const ics = `BEGIN:VCALENDAR\nBEGIN:VEVENT\nDTSTART:20260101T100000Z\nDTEND:20260101T110000Z\nEND:VEVENT\nEND:VCALENDAR`;
const output = ensureUid(ics);
expect(output.uid).toBeTruthy();
expect(output.ics).toContain(`UID:${output.uid}`);
});
it("rejects DTEND before DTSTART", () => {
const ics = `BEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:abc\nDTSTART:20260102T100000Z\nDTEND:20260101T100000Z\nEND:VEVENT\nEND:VCALENDAR`;
expect(() => validateIcsEvent(ics)).toThrow(ValidationError);
});
});