mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 09:25:08 +10:00
138d663c25
Merge origin/main into feat/external-2fa-codes. Resolve formatting conflicts caused by biome rollout; preserve both feature streams: PR's external 2FA token + signing-session 2FA proof additions plus main's RateLimit/RecipientExpired/signingReminders/date-auto-insert. In complete-document-with-token.ts, drop the duplicate early field-fetching block introduced when main moved that logic later with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH check using derivedRecipientActionAuth.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
import { ZRequestMetadataSchema } from '../../../universal/extract-request-metadata';
|
|
import type { JobDefinition } from '../../client/_internal/job';
|
|
|
|
const BULK_SEND_TEMPLATE_JOB_DEFINITION_ID = 'internal.bulk-send-template';
|
|
|
|
const BULK_SEND_TEMPLATE_JOB_DEFINITION_SCHEMA = z.object({
|
|
userId: z.number(),
|
|
teamId: z.number(),
|
|
templateId: z.number(),
|
|
csvContent: z.string(),
|
|
sendImmediately: z.boolean(),
|
|
requestMetadata: ZRequestMetadataSchema.optional(),
|
|
});
|
|
|
|
export type TBulkSendTemplateJobDefinition = z.infer<typeof BULK_SEND_TEMPLATE_JOB_DEFINITION_SCHEMA>;
|
|
|
|
export const BULK_SEND_TEMPLATE_JOB_DEFINITION = {
|
|
id: BULK_SEND_TEMPLATE_JOB_DEFINITION_ID,
|
|
name: 'Bulk Send Template',
|
|
version: '1.0.0',
|
|
trigger: {
|
|
name: BULK_SEND_TEMPLATE_JOB_DEFINITION_ID,
|
|
schema: BULK_SEND_TEMPLATE_JOB_DEFINITION_SCHEMA,
|
|
},
|
|
handler: async ({ payload, io }) => {
|
|
const handler = await import('./bulk-send-template.handler');
|
|
|
|
await handler.run({ payload, io });
|
|
},
|
|
} as const satisfies JobDefinition<typeof BULK_SEND_TEMPLATE_JOB_DEFINITION_ID, TBulkSendTemplateJobDefinition>;
|