diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3cf54c..8f23d90 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -275,6 +275,9 @@ importers: lucide-react: specifier: ^0.358.0 version: 0.358.0(react@18.2.0) + md5: + specifier: ^2.3.0 + version: 2.3.0 millify: specifier: ^6.1.0 version: 6.1.0 @@ -378,6 +381,9 @@ importers: '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 + '@types/md5': + specifier: ^2.3.5 + version: 2.3.5 '@types/react': specifier: ^18.2.22 version: 18.2.78 diff --git a/src/client/components/feed/FeedChannelEditForm.tsx b/src/client/components/feed/FeedChannelEditForm.tsx index e7312b0..f13d7e8 100644 --- a/src/client/components/feed/FeedChannelEditForm.tsx +++ b/src/client/components/feed/FeedChannelEditForm.tsx @@ -24,9 +24,13 @@ import { SelectValue, } from '../ui/select'; import { NotificationPicker } from '../notification/NotificationPicker'; +import { LuRefreshCcw } from 'react-icons/lu'; +import md5 from 'md5'; +import dayjs from 'dayjs'; const addFormSchema = z.object({ name: z.string(), + webhookSignature: z.string().optional(), notificationIds: z.array(z.string()).default([]), notifyFrequency: z.enum(['none', 'event', 'day', 'week', 'month']), }); @@ -79,6 +83,38 @@ export const FeedChannelEditForm: React.FC = )} /> + ( + + + {t('Webhook Signature')} + + +
+ +
+
+ + {t('Optional, Webhook Signature for Incoming Webhook')} + + +
+ )} + /> + { - const { channelId, workspaceId, name, notifyFrequency, notificationIds } = - input; + const { + channelId, + workspaceId, + name, + webhookSignature, + notifyFrequency, + notificationIds, + } = input; const channel = await prisma.feedChannel.update({ where: { @@ -147,6 +154,7 @@ export const feedRouter = router({ }, data: { name, + webhookSignature, notifyFrequency, notifications: { set: notificationIds.map((id) => ({