add teams
This commit is contained in:
1 parent
26db2b3a41
commit
33201096b7
10 files changed
+517
-2
No files matched your search
@@ -5,6 +5,7 @@ export const NotificationChannels = [
|
||||
"webhook",
|
||||
"pager_duty",
|
||||
"matrix",
|
||||
"teams",
|
||||
] as const;
|
||||
export type NotificationChannel = (typeof NotificationChannels)[number];
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@ const matrixSchema = baseSchema.extend({
|
||||
accessToken: z.string().min(1, "Access token is required"),
|
||||
});
|
||||
|
||||
const teamsSchema = baseSchema.extend({
|
||||
type: z.literal("teams"),
|
||||
address: z.string().min(1, "Webhook URL is required").url("Please enter a valid URL"),
|
||||
});
|
||||
|
||||
export const notificationSchema = z.discriminatedUnion("type", [
|
||||
emailSchema,
|
||||
slackSchema,
|
||||
@@ -52,6 +57,7 @@ export const notificationSchema = z.discriminatedUnion("type", [
|
||||
webhookSchema,
|
||||
pagerDutySchema,
|
||||
matrixSchema,
|
||||
teamsSchema,
|
||||
]);
|
||||
|
||||
export type NotificationFormData = z.infer<typeof notificationSchema>;
|
||||
Reference in new issue
Block a user