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)
This commit is contained in:
Julien Calixte
2026-02-25 22:46:45 +01:00
parent 6cc7866080
commit 373b7a6777
3 changed files with 65 additions and 1 deletions

View File

@@ -18,4 +18,18 @@ db.exec(`
);
`);
db.exec(`
CREATE TABLE IF NOT EXISTS webhook_subscription (
id INTEGER PRIMARY KEY,
did TEXT NOT NULL,
method TEXT NOT NULL,
url TEXT NOT NULL
);
`);
db.exec(`
CREATE INDEX IF NOT EXISTS idx_webhook_subscription_did
ON webhook_subscription(did);
`);
db.close();