Files
documenso/packages/lib/server-only/ai/envelope/detect-recipients/schema.ts
T
ephraimduncan 138d663c25 chore: merge main, resolve biome formatting conflicts
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.
2026-05-12 11:46:11 +00:00

23 lines
922 B
TypeScript

import { RecipientRole } from '@prisma/client';
import { z } from 'zod';
export const ZDetectedRecipientSchema = z.object({
name: z.string().describe('The detected recipient name, leave blank if unknown'),
email: z.string().describe('The detected recipient email, leave blank if unknown'),
role: z
.nativeEnum(RecipientRole)
.optional()
.default(RecipientRole.SIGNER)
.describe(
'The detected recipient role. Use SIGNER for people who need to sign, APPROVER for approvers, CC for people who should receive a copy, VIEWER for view-only recipients',
),
});
export type TDetectedRecipientSchema = z.infer<typeof ZDetectedRecipientSchema>;
export const ZDetectedRecipientsSchema = z.object({
recipients: z.array(ZDetectedRecipientSchema).describe('The list of detected recipients from the document'),
});
export type TDetectedRecipientsSchema = z.infer<typeof ZDetectedRecipientsSchema>;