Refactor backend folder structure (#4505)
* Refactor backend folder structure Co-authored-by: Charles Bochet <charles@twenty.com> * fix tests * fix * move yoga hooks --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from './message-queue.interface';
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
export interface MessageQueueJob<T extends MessageQueueJobData | undefined> {
|
||||
handle(data: T): Promise<void> | void;
|
||||
}
|
||||
|
||||
export interface MessageQueueCronJobData<
|
||||
T extends MessageQueueJobData | undefined,
|
||||
> {
|
||||
handle(data: T): Promise<void> | void;
|
||||
}
|
||||
|
||||
export interface MessageQueueJobData {
|
||||
[key: string]: any;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
|
||||
|
||||
import { BullMQDriverOptions } from 'src/engine/integrations/message-queue/drivers/bullmq.driver';
|
||||
import { PgBossDriverOptions } from 'src/engine/integrations/message-queue/drivers/pg-boss.driver';
|
||||
|
||||
export enum MessageQueueDriverType {
|
||||
PgBoss = 'pg-boss',
|
||||
BullMQ = 'bull-mq',
|
||||
Sync = 'sync',
|
||||
}
|
||||
|
||||
export interface PgBossDriverFactoryOptions {
|
||||
type: MessageQueueDriverType.PgBoss;
|
||||
options: PgBossDriverOptions;
|
||||
}
|
||||
|
||||
export interface BullMQDriverFactoryOptions {
|
||||
type: MessageQueueDriverType.BullMQ;
|
||||
options: BullMQDriverOptions;
|
||||
}
|
||||
|
||||
export interface SyncDriverFactoryOptions {
|
||||
type: MessageQueueDriverType.Sync;
|
||||
options: Record<string, any>;
|
||||
}
|
||||
|
||||
export type MessageQueueModuleOptions =
|
||||
| PgBossDriverFactoryOptions
|
||||
| BullMQDriverFactoryOptions
|
||||
| SyncDriverFactoryOptions;
|
||||
|
||||
export type MessageQueueModuleAsyncOptions = {
|
||||
useFactory: (
|
||||
...args: any[]
|
||||
) => MessageQueueModuleOptions | Promise<MessageQueueModuleOptions>;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
Pick<FactoryProvider, 'inject'>;
|
||||
Reference in New Issue
Block a user