/** * Payload and causation validation shared by the durable application * primitives (the command mailbox, WFT-84, and the delivery outbox, WFT-85). * * Both primitives carry the same inline-or-reference payload and the same * causal metadata, bound to the same content digest, so the checks are written * once and bound to each primitive's own validation error class. * * @module core/application-primitive-payload */ import { type ApplicationValidationErrorClass } from './application-primitive-guards.ts'; import type { ApplicationCommandCausation, ApplicationCommandPayload } from './mailbox-types.ts'; /** Maximum bytes in a content-addressed payload reference. */ export declare const MAX_APPLICATION_PAYLOAD_REFERENCE_BYTES = 2048; /** A validated payload with its digest. */ export type ValidatedPayload = { readonly payload: ApplicationCommandPayload; readonly digest: string; }; /** The validator set produced by {@link createPayloadValidators}. */ export type PayloadValidators = { readonly validatePayload: (payload: unknown, maxInlinePayloadBytes: number) => Promise; readonly validateCausation: (causation: ApplicationCommandCausation | undefined) => ApplicationCommandCausation | undefined; }; /** * Bind the shared payload validators to one primitive's validation error * class. */ export declare function createPayloadValidators(ValidationError: ApplicationValidationErrorClass): PayloadValidators;