mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-17 02:49:18 +02:00
* overhaul the notif inbox * make hook summary abstract --------- Co-authored-by: David <SE.David@protonmail.com> Co-authored-by: david <58231312+davseby@users.noreply.github.com>
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
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
|
|
}
|