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,9 +1,4 @@
export {
eventsQueue,
cronQueue,
sessionsQueue,
sessionsQueueEvents,
} from './src/queues';
export * from './src/queues';
export type * from './src/queues';
export { findJobByPrefix } from './src/utils';
export type { JobsOptions } from 'bullmq';

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,
},
},
);