mirror of
https://github.com/docmost/docmost.git
synced 2026-05-15 13:14:11 +08:00
feat: notifications (#1947)
* feat: notifications * feat: watchers * improvements * handle page move for watchers * make watchers non-blocking * more
This commit is contained in:
@@ -7,6 +7,7 @@ export enum QueueName {
|
||||
SEARCH_QUEUE = '{search-queue}',
|
||||
AI_QUEUE = '{ai-queue}',
|
||||
HISTORY_QUEUE = '{history-queue}',
|
||||
NOTIFICATION_QUEUE = '{notification-queue}',
|
||||
}
|
||||
|
||||
export enum QueueJob {
|
||||
@@ -19,6 +20,7 @@ export enum QueueJob {
|
||||
DELETE_USER_AVATARS = 'delete-user-avatars',
|
||||
|
||||
PAGE_BACKLINKS = 'page-backlinks',
|
||||
ADD_PAGE_WATCHERS = 'add-page-watchers',
|
||||
|
||||
STRIPE_SEATS_SYNC = 'sync-stripe-seats',
|
||||
TRIAL_ENDED = 'trial-ended',
|
||||
@@ -61,4 +63,8 @@ export enum QueueJob {
|
||||
DELETE_PAGE_EMBEDDINGS = 'delete-page-embeddings',
|
||||
|
||||
PAGE_HISTORY = 'page-history',
|
||||
|
||||
COMMENT_NOTIFICATION = 'comment-notification',
|
||||
COMMENT_RESOLVED_NOTIFICATION = 'comment-resolved-notification',
|
||||
PAGE_MENTION_NOTIFICATION = 'page-mention-notification',
|
||||
}
|
||||
|
||||
@@ -7,10 +7,56 @@ export interface IPageBacklinkJob {
|
||||
mentions: MentionNode[];
|
||||
}
|
||||
|
||||
export interface IAddPageWatchersJob {
|
||||
userIds: string[];
|
||||
pageId: string;
|
||||
spaceId: string;
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
export interface IStripeSeatsSyncJob {
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
export interface IPageHistoryJob {
|
||||
pageId: string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface INotificationCreateJob {
|
||||
userId: string;
|
||||
workspaceId: string;
|
||||
type: string;
|
||||
actorId?: string;
|
||||
pageId?: string;
|
||||
spaceId?: string;
|
||||
commentId?: string;
|
||||
data?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ICommentNotificationJob {
|
||||
commentId: string;
|
||||
parentCommentId?: string;
|
||||
pageId: string;
|
||||
spaceId: string;
|
||||
workspaceId: string;
|
||||
actorId: string;
|
||||
mentionedUserIds: string[];
|
||||
notifyWatchers: boolean;
|
||||
}
|
||||
|
||||
export interface ICommentResolvedNotificationJob {
|
||||
commentId: string;
|
||||
commentCreatorId: string;
|
||||
pageId: string;
|
||||
spaceId: string;
|
||||
workspaceId: string;
|
||||
actorId: string;
|
||||
}
|
||||
|
||||
export interface IPageMentionNotificationJob {
|
||||
userMentions: { userId: string; mentionId: string; creatorId: string }[];
|
||||
oldMentionedUserIds: string[];
|
||||
pageId: string;
|
||||
spaceId: string;
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user