Merge pull request #523 from opticon454/feat/webhook-notifications

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

# Conflicts:
#	config/test-suites.ts
#	docs/api-reference.md
#	src/web/public/settings-ui.js
#	src/web/routes/index.ts
#	src/web/server.ts
This commit is contained in:
Codeman maintainer
2026-10-04 23:24:39 +02:00
13 changed files with 1280 additions and 22 deletions
+13
View File
@@ -1834,6 +1834,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()