feat(notifications): ntfy/Slack/Discord/generic webhook for the push events

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Devvyn
2026-10-02 22:06:29 +08:00
co-authored by Claude Sonnet 5.5
parent 9240493c43
commit 0ff57ce304
11 changed files with 1257 additions and 22 deletions
+13
View File
@@ -1827,6 +1827,19 @@ export const RespawnEnableSchema = z.object({
// ========== Web Push ==========
/** POST /api/push/subscribe */
/**
* PUT /api/webhook. `.strict()` like every settings-shaped schema; `url` is optional so a change of
* kind or scope never needs the secret re-sent, and an empty string clears it.
*/
export const WebhookUpdateSchema = z
.object({
enabled: z.boolean().optional(),
kind: z.enum(['ntfy', 'slack', 'discord', 'generic']).optional(),
scope: z.enum(['attention', 'all']).optional(),
url: z.string().max(2048).optional(),
})
.strict();
export const PushSubscribeSchema = z.object({
endpoint: z
.string()