mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: per-user notification preference toggles
Add per-namespace notification preferences so users can choose which event types trigger push notifications (permission requests, session ready, task notifications, session completion). Adds the notification_preferences table (schema v20), GET/PUT /api/notification-preferences, POST /api/push/test for test pushes, and a Notifications settings page in the web app with a confirm dialog for disabling permission requests. Defaults keep all event types enabled. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run> Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -176,6 +176,23 @@ export type PushVapidPublicKeyResponse = {
|
||||
publicKey: string
|
||||
}
|
||||
|
||||
export type NotificationPreferences = {
|
||||
namespace: string
|
||||
permissionRequests: number
|
||||
sessionReady: number
|
||||
taskNotifications: number
|
||||
sessionCompletion: number
|
||||
updatedAt: number
|
||||
}
|
||||
|
||||
export type NotificationPreferencesUpdate = Partial<
|
||||
Pick<NotificationPreferences, 'permissionRequests' | 'sessionReady' | 'taskNotifications' | 'sessionCompletion'>
|
||||
>
|
||||
|
||||
export type TestPushResponse =
|
||||
| { ok: true }
|
||||
| { error: string }
|
||||
|
||||
export type CodexDesktopScriptResponse = {
|
||||
success: boolean
|
||||
message?: string
|
||||
|
||||
Reference in New Issue
Block a user