mirror of
https://github.com/documenso/documenso.git
synced 2026-08-26 00:02:43 +10:00
feat: add admin email domain management and sync job (#2538)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type JobDefinition } from '../../client/_internal/job';
|
||||
|
||||
const SYNC_EMAIL_DOMAINS_JOB_DEFINITION_ID = 'internal.sync-email-domains';
|
||||
|
||||
const SYNC_EMAIL_DOMAINS_JOB_DEFINITION_SCHEMA = z.object({});
|
||||
|
||||
export type TSyncEmailDomainsJobDefinition = z.infer<
|
||||
typeof SYNC_EMAIL_DOMAINS_JOB_DEFINITION_SCHEMA
|
||||
>;
|
||||
|
||||
export const SYNC_EMAIL_DOMAINS_JOB_DEFINITION = {
|
||||
id: SYNC_EMAIL_DOMAINS_JOB_DEFINITION_ID,
|
||||
name: 'Sync Email Domains',
|
||||
version: '1.0.0',
|
||||
trigger: {
|
||||
name: SYNC_EMAIL_DOMAINS_JOB_DEFINITION_ID,
|
||||
schema: SYNC_EMAIL_DOMAINS_JOB_DEFINITION_SCHEMA,
|
||||
cron: '0 * * * *', // Every hour, on the hour.
|
||||
},
|
||||
handler: async ({ payload, io }) => {
|
||||
const handler = await import('./sync-email-domains.handler');
|
||||
|
||||
await handler.run({ payload, io });
|
||||
},
|
||||
} as const satisfies JobDefinition<
|
||||
typeof SYNC_EMAIL_DOMAINS_JOB_DEFINITION_ID,
|
||||
TSyncEmailDomainsJobDefinition
|
||||
>;
|
||||
Reference in New Issue
Block a user