Skip to content

BeechCMS


BeechCMS / @beechcms/core / ValidateSeedPayloadOptions

Interface: ValidateSeedPayloadOptions ​

Options to configure the validation and sanitization behavior of the seed payload.

Properties ​

allowNull? ​

optional allowNull?: boolean

Whether to allow fields to be explicitly null.

Default ​

ts
false

enforceRequiredFields? ​

optional enforceRequiredFields?: boolean

Whether to enforce validation of required fields (requiredOnCreate or requiredOnUpdate).

Default ​

ts
true

idGenerator? ​

optional idGenerator?: IIdGenerator

Required when the seed has branches of type 'relation'. Must be the same IIdGenerator instance used for id generation so that swapping implementations (e.g. ULIDs) automatically updates validation. Do NOT pass a concrete class — inject via the middleware / factory.


localeConfig? ​

optional localeConfig?: LocaleConfig

Project language configuration. When provided, branches with localized: true accept a plain value (stored under defaultLocale) or a locale dictionary, and validate to a LocalizedPatch. When omitted, localized branches validate exactly like their base type — the pre-localization contract. requiredOnCreate / requiredOnUpdate then check the default locale only.


maxTextLength? ​

optional maxTextLength?: number

The maximum allowed length (in characters/bytes) for text and rich text fields.

Default ​

ts
50000

operation? ​

optional operation?: "create" | "update"

The type of operation being validated, which determines whether requiredOnCreate or requiredOnUpdate branch constraints are applied.

Default ​

ts
'create'

requireAtLeastOneValidField? ​

optional requireAtLeastOneValidField?: boolean

If true, validation will fail if the resulting data payload contains no valid fields.

Default ​

ts
true