16 Commits

Author SHA1 Message Date
Julien Calixte
8c9ab34565 feat: add optional bearer token support for webhook subscriptions
Token is stored in the DB but never returned in API responses (write-only).
fireWebhooks() sends Authorization: Bearer <token> header when present.
2026-03-14 18:16:28 +01:00
Julien Calixte
06ac3142a8 feat: add POST /notes/feed endpoint for multi-DID filtering 2026-03-10 15:51:10 +01:00
Julien Calixte
373b7a6777 feat: add webhook_subscription table and CRUD endpoints
- Migration: CREATE TABLE webhook_subscription (id, did, method, url) with index on did
- db.ts: addWebhookSubscription and deleteWebhooksByDid helpers
- server.ts: POST /:did/webhooks (201) and DELETE /:did/webhooks (204)
2026-02-25 22:46:45 +01:00
Julien Calixte
c84b4c5f97 robustness: split jetstream into own container, add cursor persistence
Jetstream was running backgrounded in the same container as the API server,
so crashes went undetected and Docker never restarted it. Now each process
runs as a separate docker-compose service with independent restart policies.

Also adds cursor persistence to SQLite (saved every 5s) so restarts resume
from where they left off, moves event destructuring inside try/catch blocks,
and adds global unhandled error/rejection handlers for crash visibility.
2026-02-17 01:17:42 +01:00
Julien Calixte
d1afdd6499 prune: remove unused imports 2026-02-15 13:10:50 +01:00
Julien Calixte
e0e095f7e5 fix: deletion should come from pds events 2026-02-15 09:24:40 +01:00
Julien Calixte
efb78ff14e logs: add ISO timestamp to all log output 2026-02-15 08:59:37 +01:00
Julien Calixte
562a3b061f refacto: no magic numbers 2026-02-14 22:47:48 +01:00
Julien Calixte
a7a90ea075 feat: authenticate DELETE endpoint with AT Protocol identity
Verify the caller owns the DID by resolving their PDS via plc.directory
and validating the session token before allowing note deletion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:38:40 +01:00
Julien Calixte
51ea8a8f17 feat: implement delete note endpoint in server
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:28:30 +01:00
Julien Calixte
c44c2bac3f logs: add logs for jetstream 2026-02-13 20:14:12 +01:00
Julien Calixte
f5f02dbc6d feat: add CORS middleware to allow all origins
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:33:47 +01:00
Julien Calixte
6e22fd2f56 feat: add endpoints to get notes 2026-02-09 14:07:17 +01:00
Julien Calixte
ed157cb4df lint: format and lint 2026-02-09 12:03:27 +01:00
Julien Calixte
55699f0727 feat: add a server for querying notes 2026-02-09 11:53:49 +01:00
Julien Calixte
d677ed24c3 chore: migrate to deno 2026-02-09 10:28:12 +01:00