import crypto from "node:crypto"; import type { WebhookConfig } from "../config.js"; import type { PromptSession } from "./prompt.js"; export async function configureGenericWebhook(prompt: PromptSession, existing: WebhookConfig): Promise { const answer = await prompt.askSecret("Webhook secret (leave blank to generate)", Boolean(existing.secret)); return { type: "webhook", secret: answer || existing.secret || crypto.randomBytes(24).toString("hex") }; }