mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 19:51:32 +10:00
feat: add cron-triggered signing reminder email job and update job definitions
This commit is contained in:
@ -26,16 +26,26 @@ export type TriggerJobOptions<Definitions extends ReadonlyArray<JobDefinition> =
|
||||
};
|
||||
}[number];
|
||||
|
||||
export type CronTrigger<N extends string = string> = {
|
||||
type: 'cron';
|
||||
schedule: string;
|
||||
name: N;
|
||||
};
|
||||
|
||||
export type EventTrigger<N extends string = string> = {
|
||||
type: 'event';
|
||||
name: N;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type JobDefinition<Name extends string = string, Schema = any> = {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
enabled?: boolean;
|
||||
trigger: {
|
||||
name: Name;
|
||||
schema?: z.ZodType<Schema>;
|
||||
};
|
||||
trigger:
|
||||
| (EventTrigger<Name> & { schema?: z.ZodType<Schema> })
|
||||
| (CronTrigger<Name> & { schema?: z.ZodType<Schema> });
|
||||
handler: (options: { payload: Schema; io: JobRunIO }) => Promise<Json | void>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user