feat: write the mairie status back to Nextcloud over CalDAV

REPORT by UID gives href + ETag + calendar-data, then PUT with If-Match: the
resource URL is never guessed and a concurrent edit yields 412 instead of an
overwrite. URL_COLLECTION is derived from URL_CALENDRIER.
This commit is contained in:
Pierre Martin
2026-08-13 16:50:16 +02:00
parent 3248b28e1f
commit 058229dce3
4 changed files with 460 additions and 0 deletions
+9
View File
@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test";
import {
URL_CALENDRIER,
URL_COLLECTION,
recupererFluxCalendrier,
} from "./extension/nextcloud.js";
@@ -64,3 +65,11 @@ describe("recupererFluxCalendrier", () => {
expect(optionsVues).toEqual({ credentials: "include" });
});
});
describe("URL_COLLECTION", () => {
test("= URL_CALENDRIER sans ?export, et se termine par /", () => {
expect(URL_COLLECTION).toBe(URL_CALENDRIER.replace("?export", ""));
expect(URL_COLLECTION.endsWith("/")).toBe(true);
expect(URL_COLLECTION).not.toContain("?export");
});
});