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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user