mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
fix: make local provider robust to random input
This commit is contained in:
@ -5,16 +5,14 @@ import type { Json } from './json';
|
||||
export const ZTriggerJobOptionsSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string(),
|
||||
payload: z.any().refine((x) => x !== undefined, { message: 'payload is required' }),
|
||||
payload: z.unknown().refine((x) => x !== undefined, { message: 'payload is required' }),
|
||||
timestamp: z.number().optional(),
|
||||
});
|
||||
|
||||
// The Omit is a temporary workaround for a "bug" in the zod library
|
||||
// @see: https://github.com/colinhacks/zod/issues/2966
|
||||
export type TriggerJobOptions = Omit<z.infer<typeof ZTriggerJobOptionsSchema>, 'payload'> & {
|
||||
// Don't tell the feds
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
payload: any;
|
||||
payload: unknown;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
Reference in New Issue
Block a user