Update language on /outline help text

Update Slack hooks to use zod validation

closes #5768
This commit is contained in:
Tom Moor
2023-09-04 10:40:46 -04:00
parent 02cced078f
commit 1df7a42868
4 changed files with 392 additions and 315 deletions

View File

@@ -0,0 +1,44 @@
import { z } from "zod";
export const HooksUnfurlSchema = z.object({
body: z
.object({
challenge: z.string(),
})
.or(
z.object({
token: z.string(),
event: z.object({
channel: z.string(),
message_ts: z.string(),
links: z.array(
z.object({
url: z.string(),
})
),
user: z.string(),
}),
})
),
});
export type HooksUnfurlReq = z.infer<typeof HooksUnfurlSchema>;
export const HooksSlackCommandSchema = z.object({
body: z.object({
token: z.string(),
team_id: z.string(),
user_id: z.string(),
text: z.string().optional().default(""),
}),
});
export type HooksSlackCommandReq = z.infer<typeof HooksSlackCommandSchema>;
export const HooksInteractiveSchema = z.object({
body: z.object({
payload: z.string(),
}),
});
export type HooksInteractiveReq = z.infer<typeof HooksInteractiveSchema>;