@@ -2,15 +2,11 @@ import { createLogger } from '@sim/logger'
22import { keepPreviousData , useMutation , useQuery , useQueryClient } from '@tanstack/react-query'
33import { requestJson } from '@/lib/api/client/request'
44import {
5+ type ContractBodyInput ,
56 createNotificationContract ,
67 deleteNotificationContract ,
78 listNotificationsContract ,
8- type NotificationAlertConfig ,
9- type NotificationLogLevel ,
10- type NotificationSlackConfig ,
119 type NotificationSubscription ,
12- type NotificationType ,
13- type NotificationWebhookConfig ,
1410 testNotificationContract ,
1511 updateNotificationContract ,
1612} from '@/lib/api/contracts'
@@ -32,8 +28,6 @@ export const notificationKeys = {
3228 [ ...notificationKeys . details ( ) , workspaceId , notificationId ] as const ,
3329}
3430
35- type TriggerType = string
36-
3731/**
3832 * Fetch notifications for a workspace
3933 */
@@ -63,21 +57,7 @@ export function useNotifications(workspaceId?: string) {
6357
6458interface CreateNotificationParams {
6559 workspaceId : string
66- data : {
67- notificationType : NotificationType
68- workflowIds : string [ ]
69- allWorkflows : boolean
70- levelFilter : NotificationLogLevel [ ]
71- triggerFilter : TriggerType [ ]
72- includeFinalOutput : boolean
73- includeTraceSpans : boolean
74- includeRateLimits : boolean
75- includeUsageData : boolean
76- alertConfig ?: NotificationAlertConfig | null
77- webhookConfig ?: NotificationWebhookConfig
78- emailRecipients ?: string [ ]
79- slackConfig ?: NotificationSlackConfig
80- }
60+ data : ContractBodyInput < typeof createNotificationContract >
8161}
8262
8363/**
@@ -105,7 +85,7 @@ export function useCreateNotification() {
10585interface UpdateNotificationParams {
10686 workspaceId : string
10787 notificationId : string
108- data : Partial < CreateNotificationParams [ 'data' ] > & { active ?: boolean }
88+ data : ContractBodyInput < typeof updateNotificationContract >
10989}
11090
11191/**
0 commit comments