Merge pull request #3822 from mdiniz97/feat/rocket-chat-notifications
feat: Rocket.Chat notifications
This commit is contained in:
15 files changed
+379
-3
No files matched your search
@@ -46,6 +46,13 @@ function buildDefaults(data: Notification | null): NotificationFormData {
|
||||
address: data.address || "",
|
||||
};
|
||||
}
|
||||
if (data?.type === "rocket_chat") {
|
||||
return {
|
||||
type: "rocket_chat",
|
||||
notificationName: data.notificationName || "",
|
||||
address: data.address || "",
|
||||
};
|
||||
}
|
||||
if (data?.type === "pager_duty") {
|
||||
return {
|
||||
type: "pager_duty",
|
||||
|
||||
@@ -3,6 +3,7 @@ export const NotificationChannels = [
|
||||
"slack",
|
||||
"discord",
|
||||
"webhook",
|
||||
"rocket_chat",
|
||||
"pager_duty",
|
||||
"matrix",
|
||||
"teams",
|
||||
|
||||
@@ -30,6 +30,14 @@ const webhookSchema = baseSchema.extend({
|
||||
address: z.string().min(1, "Webhook URL is required").url("Please enter a valid URL"),
|
||||
});
|
||||
|
||||
const rocketChatSchema = baseSchema.extend({
|
||||
type: z.literal("rocket_chat"),
|
||||
address: z
|
||||
.string()
|
||||
.min(1, "Webhook URL is required")
|
||||
.url({ protocol: /^https?$/, message: "Please enter a valid URL" }),
|
||||
});
|
||||
|
||||
const pagerDutySchema = baseSchema.extend({
|
||||
type: z.literal("pager_duty"),
|
||||
address: z.string().min(1, "Integration key is required"),
|
||||
@@ -81,6 +89,7 @@ export const notificationSchema = z.discriminatedUnion("type", [
|
||||
slackSchema,
|
||||
discordSchema,
|
||||
webhookSchema,
|
||||
rocketChatSchema,
|
||||
pagerDutySchema,
|
||||
matrixSchema,
|
||||
teamsSchema,
|
||||
|
||||
Reference in new issue
Block a user