export const WS_NOTIFICATION_CREATION_TOPIC = "creation@notifications" export interface NotificationsParams { limit: number } export interface NotificationsCountParams { read: boolean } export interface Notification { id: string userId: string organizationId: string code: NotificationCode metadata: NotificationMetadata read: boolean createdAt: Date | string } export enum NotificationCode { DocumentReviewRequest = "notification.document.review_request", DocumentHookTriggered = "notification.document.hook_triggered", DocumentHookNeedsAttention = "notification.document.hook_needs_attention", DocumentNewComment = "notification.document.new_comment", DocumentNewCommentReply = "notification.document.new_comment_reply", DocumentCommentResolved = "notification.document.comment_resolved", } export type NotificationMetadata = | NotificationMetadataDocumentReviewRequest | NotificationMetadataDocumentHookTriggered | NotificationMetadataDocumentNewComment | NotificationMetadataDocumentNewCommentReply export interface NotificationMetadataDocumentReviewRequest { userId: string documentId: string branchId: string } export interface NotificationMetadataDocumentHookTriggered { documentId: string branchId: string blockId: string | null type: DocumentHookType hookSettings?: DocumentHookSettings | null status?: DocumentHookStatus hookSummary?: DocumentHookSummary | null } export interface NotificationMetadataDocumentNewComment { userId: string documentId: string branchId: string commentId: string anchorBlockId: string | null commentExcerpt?: string } export interface NotificationMetadataDocumentNewCommentReply { userId: string documentId: string branchId: string commentId: string commentReplyId: string anchorBlockId: string | null commentExcerpt?: string } export interface NotificationsResponse { notifications: Notification[] pageCount: number } export interface MarkNotificationsReadRequest { ids: string[] // empty means mark all as read }