@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 34 lines 1.07 KB
Raw
1 import * as Effect from "effect/Effect";
2 import * as SqlClient from "effect/sql/SqlClient";
3
4 export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6
7 // Kept out of schedule_json so they never decode into the read model.
8 yield* sql`ALTER TABLE scheduled_tasks ADD COLUMN webhook_token TEXT`;
9 yield* sql`ALTER TABLE scheduled_tasks ADD COLUMN webhook_secret TEXT`;
10
11 yield* sql`
12 CREATE TABLE IF NOT EXISTS scheduled_task_webhook_deliveries (
13 delivery_id TEXT PRIMARY KEY,
14 task_id TEXT NOT NULL,
15 received_at TEXT NOT NULL,
16 method TEXT NOT NULL,
17 query TEXT NOT NULL,
18 headers_json TEXT NOT NULL,
19 body TEXT NOT NULL,
20 body_bytes INTEGER NOT NULL,
21 body_truncated INTEGER NOT NULL,
22 outcome TEXT NOT NULL,
23 signature_verified INTEGER NOT NULL,
24 missing_fields_json TEXT NOT NULL,
25 rendered_prompt TEXT,
26 error TEXT
27 )
28 `;
29
30 yield* sql`
31 CREATE INDEX IF NOT EXISTS idx_scheduled_task_webhook_deliveries_task
32 ON scheduled_task_webhook_deliveries(task_id, received_at)
33 `;
34 });