feat(api): add versioned REST API with OpenAPI 3.1 spec
Expose /api/v1/* for feed and email management (feeds CRUD, email list/get/delete, stats) so the service can be automated without scraping the admin UI. Built on @hono/zod-openapi; the OpenAPI 3.1 spec is served at /api/openapi.json with a Scalar reference at /api/docs. Auth is token-based (Authorization: Bearer <ADMIN_PASSWORD>) plus the existing reverse-proxy headers — no cookie, no CSRF. Extracted the auth primitives into src/lib/auth.ts and the feed create/update/delete orchestration into src/lib/feed-service.ts so the admin UI and the REST API share a single source of truth. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
7f5b913576
commit
45d2a14a12
14 files changed
+1398
-234
No files matched your search
@@ -51,7 +51,9 @@
|
||||
"wrangler": "4.94.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hono/zod-openapi": "^1.4.0",
|
||||
"@hono/zod-validator": "^0.8.0",
|
||||
"@scalar/hono-api-reference": "^0.10.19",
|
||||
"escape-html": "^1.0.3",
|
||||
"feed": "5.2.1",
|
||||
"hono": "4.12.22",
|
||||
|
||||
Reference in new issue
Block a user