Skip to content

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

python
def default_webform_schema() -> dict[str, Any]

Return a migration-safe empty v1 form-spec object.

WebformField

python
@dataclass(frozen=True)
class WebformField()

One validated scalar property in a public form spec.

validate

python
def validate(value: Any, *, max_bytes: int) -> str | None

Return one answer error, or None when the scalar is valid.

WebformSpec

python
@dataclass(frozen=True)
class WebformSpec()

The Python validation mirror of a versioned public form spec.

deserialize

python
@classmethod
def deserialize(cls, value: Any, *, version: int) -> WebformSpec

Validate the stored schema and return its scalar field owners.

email_field

python
@property
def email_field() -> WebformField | None

Return the schema-declared email field, if any.

validate_answers

python
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

python
def render_markdown(answers: dict[str, Any]) -> str

Render validated answers in declaration order for the Message body.

validate_submission_id

python
def validate_submission_id(value: Any) -> str

Return the caller's stable opaque receipt id after syntax validation.

Released under the AGPL-3.0 License.