feat(infisical-pg): completed audit log moved ee routes to normal routing pattern

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent 6e6a1c87f2
commit 16f0ac6d43
78 changed files with 3178 additions and 445 deletions
+11 -3
View File
@@ -1,12 +1,16 @@
import { Job, JobsOptions, Queue, Worker, WorkerListener } from "bullmq";
import Redis from "ioredis";
import { TCreateAuditLogDTO } from "@app/ee/services/audit-log/audit-log-types";
export enum QueueName {
SecretRotation = "secret-rotation"
SecretRotation = "secret-rotation",
AuditLog = "audit-log"
}
export enum QueueJobs {
SecretRotation = "secret-rotation-job"
SecretRotation = "secret-rotation-job",
AuditLog = "audit-log-job"
}
export type TQueueJobTypes = {
@@ -14,6 +18,10 @@ export type TQueueJobTypes = {
payload: { rotationId: string };
name: QueueJobs.SecretRotation;
};
[QueueName.AuditLog]: {
name: QueueJobs.AuditLog;
payload: TCreateAuditLogDTO;
};
};
export type TQueueServiceFactory = ReturnType<typeof queueServiceFactory>;
@@ -65,7 +73,7 @@ export const queueServiceFactory = (redisUrl: string) => {
name: T,
job: TQueueJobTypes[T]["name"],
data: TQueueJobTypes[T]["payload"],
opts: JobsOptions & { jobId: string }
opts: JobsOptions & { jobId?: string }
) => {
const q = queueContainer[name];
await q.add(job, data, opts);