Merge branch 'main' into feat/add-pdf-image-renderer

This commit is contained in:
David Nguyen
2026-02-04 12:50:40 +11:00
committed by GitHub
125 changed files with 7880 additions and 938 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
import { msg } from '@lingui/core/macro';
import { FieldType } from '@prisma/client';
import { z } from 'zod';
@@ -88,7 +87,7 @@ export const ZTextFieldMeta = ZBaseFieldMeta.extend({
type: z.literal('text'),
text: z.string().optional(),
characterLimit: z.coerce
.number({ invalid_type_error: msg`Value must be a number`.id })
.number({ invalid_type_error: 'Value must be a number' })
.min(0)
.optional(),
textAlign: ZFieldTextAlignSchema.optional(),
+83
View File
@@ -0,0 +1,83 @@
import { z } from 'zod';
/**
* Note: Keep this in sync with the Documenso License Server schemas.
*/
export const ZLicenseClaimSchema = z.object({
emailDomains: z.boolean().optional(),
embedAuthoring: z.boolean().optional(),
embedAuthoringWhiteLabel: z.boolean().optional(),
cfr21: z.boolean().optional(),
authenticationPortal: z.boolean().optional(),
billing: z.boolean().optional(),
});
/**
* Note: Keep this in sync with the Documenso License Server schemas.
*/
export const ZLicenseRequestSchema = z.object({
license: z.string().min(1, 'License key is required'),
});
/**
* Note: Keep this in sync with the Documenso License Server schemas.
*/
export const ZLicenseResponseSchema = z.object({
success: z.boolean(),
// Note that this is nullable, null means license was not found.
data: z
.object({
status: z.enum(['ACTIVE', 'EXPIRED', 'PAST_DUE']),
createdAt: z.coerce.date(),
name: z.string(),
periodEnd: z.coerce.date(),
cancelAtPeriodEnd: z.boolean(),
licenseKey: z.string(),
flags: ZLicenseClaimSchema,
})
.nullable(),
});
export type TLicenseClaim = z.infer<typeof ZLicenseClaimSchema>;
export type TLicenseRequest = z.infer<typeof ZLicenseRequestSchema>;
export type TLicenseResponse = z.infer<typeof ZLicenseResponseSchema>;
/**
* Schema for the cached license data stored in the file.
*/
export const ZCachedLicenseSchema = z.object({
/**
* The last time the license was synced.
*/
lastChecked: z.string(),
/**
* The raw license response from the license server.
*/
license: ZLicenseResponseSchema.shape.data,
/**
* The license key that is currently stored on the system environment variable.
*/
requestedLicenseKey: z.string().optional(),
/**
* Whether the current license has unauthorized flag usage.
*/
unauthorizedFlagUsage: z.boolean(),
/**
* The derived status of the license. This is calculated based on the license response and the unauthorized flag usage.
*/
derivedStatus: z.enum([
'UNAUTHORIZED', // Unauthorized flag usage detected, overrides everything except PAST_DUE since that's a grace period.
'ACTIVE', // License is active and everything is good.
'EXPIRED', // License is expired and there is no unauthorized flag usage.
'PAST_DUE', // License is past due.
'NOT_FOUND', // Requested license key is not found.
]),
});
export type TCachedLicense = z.infer<typeof ZCachedLicenseSchema>;
export const LICENSE_FILE_NAME = '.documenso-license.json';
+6
View File
@@ -42,6 +42,7 @@ export const SUBSCRIPTION_CLAIM_FEATURE_FLAGS: Record<
{
label: string;
key: keyof TClaimFlags;
isEnterprise?: boolean;
}
> = {
unlimitedDocuments: {
@@ -59,10 +60,12 @@ export const SUBSCRIPTION_CLAIM_FEATURE_FLAGS: Record<
emailDomains: {
key: 'emailDomains',
label: 'Email domains',
isEnterprise: true,
},
embedAuthoring: {
key: 'embedAuthoring',
label: 'Embed authoring',
isEnterprise: true,
},
embedSigning: {
key: 'embedSigning',
@@ -71,6 +74,7 @@ export const SUBSCRIPTION_CLAIM_FEATURE_FLAGS: Record<
embedAuthoringWhiteLabel: {
key: 'embedAuthoringWhiteLabel',
label: 'White label for embed authoring',
isEnterprise: true,
},
embedSigningWhiteLabel: {
key: 'embedSigningWhiteLabel',
@@ -79,10 +83,12 @@ export const SUBSCRIPTION_CLAIM_FEATURE_FLAGS: Record<
cfr21: {
key: 'cfr21',
label: '21 CFR',
isEnterprise: true,
},
authenticationPortal: {
key: 'authenticationPortal',
label: 'Authentication portal',
isEnterprise: true,
},
allowLegacyEnvelopes: {
key: 'allowLegacyEnvelopes',