supabaseAuth()(Bearer JWT,用户 ID 取 jwtPayload.sub)。源:src/hono/support/index.ts。
GET /support/hash
为 Front Chat 生成身份验证哈希(identity verification)。响应
userHash=HMAC-SHA256(secret = FRONT_CHAT_SECRET, message = userId)的 hex- email 取自 Supabase auth user
错误
| 状态码 | 含义 |
|---|---|
| 401 | 无 JWT |
| 500 | 取不到 user email / FRONT_CHAT_SECRET 未配置 |
POST /support/delete-account
调度账号删除(30 天倒计时),不立即删。请求体
reason 必填,缺失 → 400。
响应
副作用
- 先查
get_account_deletion_statusRPC,已调度 → 409 - 入队
account_deletionPGMQ(sleep_seconds: 30 * 24 * 3600,30 天后触发硬删 → DELETE /user/) - 入队
account_deletion_reminderPGMQ(sleep_seconds: 27 * 24 * 3600,删除前 3 天提醒) insert deletion_reasons (user_id, reason, reason_text)- fire-and-forget
notify("account_deletion.scheduled", userId)(kira-notify 发确认邮件)
错误
| 状态码 | 含义 |
|---|---|
| 400 | reason 缺失 |
| 401 | 无 JWT |
| 409 | 已有调度中的删除 |
| 500 | PGMQ send 失败 |
GET /support/deletion-status
查询当前用户的删除调度状态。响应
deletionDate 取队列消息的 vt(visible-at 时间,即 30 天后的触发时刻)。
错误
| 状态码 | 含义 |
|---|---|
| 401 | 无 JWT |
| 500 | get_account_deletion_status RPC 失败 |
POST /support/cancel-delete-account
取消已调度的账号删除。响应
副作用
get_account_deletion_status拿到msg_id,无调度 → 404pgmq_public.delete(queue_name: "account_deletion", message_id: msgId)删除主删除消息- 查
get_account_deletion_reminder_status拿 remindermsg_id,pgmq_public.delete删account_deletion_reminder delete deletion_reasons where user_id = userId- fire-and-forget
notify("account_deletion.cancelled", userId)
错误
| 状态码 | 含义 |
|---|---|
| 401 | 无 JWT |
| 404 | 无调度中的删除 |
| 500 | RPC / PGMQ delete 失败 |
源
src/hono/support/index.ts