feat: make jobs client type safe

This commit is contained in:
Mythie
2024-05-22 21:57:05 +10:00
parent 002dc0fdae
commit f28334bff7
11 changed files with 252 additions and 172 deletions

View File

@@ -1,6 +1,12 @@
import { JobClient } from './client/client';
import { registerJobs } from './definitions';
import { SEND_CONFIRMATION_EMAIL_JOB_DEFINITION } from './definitions/send-confirmation-email';
import { SEND_SIGNING_EMAIL_JOB_DEFINITION } from './definitions/send-signing-email';
export const jobsClient = JobClient.getInstance();
registerJobs(jobsClient);
/**
* The `as const` assertion is load bearing as it provides the correct level of type inference for
* triggering jobs.
*/
export const jobsClient = new JobClient([
SEND_CONFIRMATION_EMAIL_JOB_DEFINITION,
SEND_SIGNING_EMAIL_JOB_DEFINITION,
] as const);