Notifications refactor (#5151

* Ongoing

* refactor

* test

* Add cleanup task

* refactor
This commit is contained in:
Tom Moor
2023-04-08 09:22:49 -04:00
committed by GitHub
parent c97110e72b
commit 9c9ceef8ee
28 changed files with 1122 additions and 901 deletions

View File

@@ -76,7 +76,7 @@ export type AttachmentEvent = BaseEvent &
modelId: string;
data: {
name: string;
source: string;
source?: "import";
};
}
| {
@@ -215,10 +215,15 @@ export type CollectionEvent = BaseEvent &
| CollectionUserEvent
| CollectionGroupEvent
| {
name:
| "collections.create"
| "collections.update"
| "collections.delete";
name: "collections.create";
collectionId: string;
data: {
name: string;
source?: "import";
};
}
| {
name: "collections.update" | "collections.delete";
collectionId: string;
data: {
name: string;
@@ -352,6 +357,14 @@ export type WebhookSubscriptionEvent = BaseEvent & {
};
};
export type NotificationEvent = BaseEvent & {
name: "notifications.create";
modelId: string;
teamId: string;
userId: string;
documentId?: string;
};
export type Event =
| ApiKeyEvent
| AttachmentEvent
@@ -370,7 +383,8 @@ export type Event =
| TeamEvent
| UserEvent
| ViewEvent
| WebhookSubscriptionEvent;
| WebhookSubscriptionEvent
| NotificationEvent;
export type NotificationMetadata = {
notificationId?: string;