angee.messaging.webforms
Versioned public-webform schema and submission validation.
The stored shape is the serializable @angee/ui form-spec vocabulary: an object schema with named properties and a root required list. Public ingress deliberately accepts only scalar fields; relation, object, array, and any descriptors are rejected so a form answer can never become a record target or another executable instruction.
default_webform_schema
def default_webform_schema() -> dict[str, Any]Return a migration-safe empty v1 form-spec object.
WebformField
@dataclass(frozen=True)
class WebformField()One validated scalar property in a public form spec.
validate
def validate(value: Any, *, max_bytes: int) -> str | NoneReturn one answer error, or None when the scalar is valid.
WebformSpec
@dataclass(frozen=True)
class WebformSpec()The Python validation mirror of a versioned public form spec.
deserialize
@classmethod
def deserialize(cls, value: Any, *, version: int) -> WebformSpecValidate the stored schema and return its scalar field owners.
email_field
@property
def email_field() -> WebformField | NoneReturn the schema-declared email field, if any.
validate_answers
def validate_answers(value: Any, *, max_field_bytes: int) -> dict[str, Any]Reject undeclared/non-scalar answers and return a lossless clean mapping.
render_markdown
def render_markdown(answers: dict[str, Any]) -> strRender validated answers in declaration order for the Message body.
validate_submission_id
def validate_submission_id(value: Any) -> strReturn the caller's stable opaque receipt id after syntax validation.