feature(dashboard): add integrations and notifications

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-02 22:12:05 +02:00
parent d920f6951c
commit f65a633403
94 changed files with 3692 additions and 127 deletions

View File

@@ -1,6 +1,6 @@
import { Queue, QueueEvents } from 'bullmq';
import type { IServiceEvent } from '@openpanel/db';
import type { IServiceEvent, Notification } from '@openpanel/db';
import { getRedisQueue } from '@openpanel/redis';
import type { TrackPayload } from '@openpanel/sdk';
@@ -90,3 +90,20 @@ export const cronQueue = new Queue<CronQueuePayload>('cron', {
removeOnComplete: 10,
},
});
export type NotificationQueuePayload = {
type: 'sendNotification';
payload: {
notification: Notification;
};
};
export const notificationQueue = new Queue<NotificationQueuePayload>(
'notification',
{
connection: getRedisQueue(),
defaultJobOptions: {
removeOnComplete: 10,
},
},
);