mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08:24 +00:00
Add the admin page (phase 3)
services/admin is a client of the content service's HTTP API, served on the tailnet only. It renders on the server with plain forms and no client scripts, and holds the admin token so the browser never sees it. - Review queue: reasons, line diff against the live version, accept, reject, and reject with the live version put back into Obsidian - Notes and drafts: search, preview, fields, backlinks, publish toggle - History with compare and roll back - Quick capture for a status or a Library item (optionally both) - Store: orders open or closed per category, open slots and stock - Overview: counts, last scan and error, scan now, sync job health - Same-origin check on every post, strict CSP, sanitized previews The content service gains /api/status, sync run reports (/api/syncs) and lookup of a note by name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
This commit is contained in:
@@ -66,6 +66,17 @@ describe("HTTP API", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("sync reports", () => {
|
||||
it("records a run and shows it in the status", async () => {
|
||||
expect((await post_("/api/syncs", T.agent, { job: "personalreader", ok: true, counts: { updated: 3 } })).status).toBe(200);
|
||||
expect((await post_("/api/syncs", T.agent, { job: "Bad Name", ok: true })).status).toBe(400);
|
||||
const status = (await (await get("/api/status", T.admin)).json()) as { syncs: { job: string; lastOkAt: string }[] };
|
||||
expect(status.syncs[0]).toMatchObject({ job: "personalreader" });
|
||||
expect(status.syncs[0]!.lastOkAt).toBeTruthy();
|
||||
expect((await get("/api/status", T.reader)).status).toBe(403);
|
||||
});
|
||||
});
|
||||
|
||||
describe("MCP server", () => {
|
||||
it("lets an agent search, post a status and draft a post, but not publish it", async () => {
|
||||
const client = new Client({ name: "test", version: "1.0.0" });
|
||||
|
||||
Reference in New Issue
Block a user