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.
This commit is contained in:
ephraimduncan
2026-05-12 11:46:11 +00:00
parent 9194884fbe
commit 138d663c25
1959 changed files with 93488 additions and 47038 deletions
+18 -21
View File
@@ -1,5 +1,3 @@
import { EnvelopeType } from '@prisma/client';
import { createEnvelopeFields } from '@documenso/lib/server-only/field/create-envelope-fields';
import { deleteDocumentField } from '@documenso/lib/server-only/field/delete-document-field';
import { deleteTemplateField } from '@documenso/lib/server-only/field/delete-template-field';
@@ -9,6 +7,7 @@ import { setFieldsForDocument } from '@documenso/lib/server-only/field/set-field
import { setFieldsForTemplate } from '@documenso/lib/server-only/field/set-fields-for-template';
import { signFieldWithToken } from '@documenso/lib/server-only/field/sign-field-with-token';
import { updateEnvelopeFields } from '@documenso/lib/server-only/field/update-envelope-fields';
import { EnvelopeType } from '@prisma/client';
import { ZGenericSuccessResponse, ZSuccessResponseSchema } from '../schema';
import { authenticatedProcedure, procedure, router } from '../trpc';
@@ -589,27 +588,25 @@ export const fieldRouter = router({
/**
* @private
*/
signFieldWithToken: procedure
.input(ZSignFieldWithTokenMutationSchema)
.mutation(async ({ input, ctx }) => {
const { token, fieldId, value, isBase64, authOptions } = input;
signFieldWithToken: procedure.input(ZSignFieldWithTokenMutationSchema).mutation(async ({ input, ctx }) => {
const { token, fieldId, value, isBase64, authOptions } = input;
ctx.logger.info({
input: {
fieldId,
},
});
return await signFieldWithToken({
token,
ctx.logger.info({
input: {
fieldId,
value: value ?? '',
isBase64,
userId: ctx.user?.id,
authOptions,
requestMetadata: ctx.metadata.requestMetadata,
});
}),
},
});
return await signFieldWithToken({
token,
fieldId,
value: value ?? '',
isBase64,
userId: ctx.user?.id,
authOptions,
requestMetadata: ctx.metadata.requestMetadata,
});
}),
/**
* @private
+3 -6
View File
@@ -1,6 +1,3 @@
import { FieldType } from '@prisma/client';
import { z } from 'zod';
import { ZRecipientActionAuthSchema } from '@documenso/lib/types/document-auth';
import {
ZFieldHeightSchema,
@@ -11,6 +8,8 @@ import {
ZFieldWidthSchema,
} from '@documenso/lib/types/field';
import { ZFieldAndMetaSchema, ZFieldMetaSchema } from '@documenso/lib/types/field-meta';
import { FieldType } from '@prisma/client';
import { z } from 'zod';
const ZCreateFieldSchema = ZFieldAndMetaSchema.and(
z.object({
@@ -165,9 +164,7 @@ export const ZRemovedSignedFieldWithTokenMutationSchema = z.object({
fieldId: z.number(),
});
export type TRemovedSignedFieldWithTokenMutationSchema = z.infer<
typeof ZRemovedSignedFieldWithTokenMutationSchema
>;
export type TRemovedSignedFieldWithTokenMutationSchema = z.infer<typeof ZRemovedSignedFieldWithTokenMutationSchema>;
export const ZGetFieldRequestSchema = z.object({
fieldId: z.number(),