calternal_api::events
Draft webhook contracts from the shared action registry (DESIGN §55).
Versioned MCP webhook event contracts (#491, DESIGN §55). Payloads use explicit allowlists. Mail content never includes a body or snippet; Money amounts are integer minor units. The authenticated producer supplies the User ID separately, so payloads cannot choose a recipient.
Source: crates/calternal-api/src/events.rs
Structs
Section titled “Structs”EventDefinition
Section titled “EventDefinition”pub struct EventDefinitionRegistry declaration of a supported webhook event and its filter fields.
Fields
pub name: Stringpub description: Stringpub plugin: Stringpub filters: Vec<String>pub fields: Vec<String>
Implements: Debug, Clone, Deserialize, Serialize
EventDefinition::descriptor
Section titled “EventDefinition::descriptor”pub fn descriptor(&self) -> ValueBuild draft descriptors from registry declarations, never a second list.
EventDefinition::valid_arguments
Section titled “EventDefinition::valid_arguments”pub fn valid_arguments(&self, arguments: &Value) -> boolReject undeclared filters and unbounded strings before any outbound work.
EventDefinition::payload
Section titled “EventDefinition::payload”pub fn payload(&self, data: &Value, arguments: &Value) -> Option<Value>Project trusted producer data to the declared fields; match exact filters. Numeric Money amounts stay exact. Unknown and nested values never leave.
Source: crates/calternal-api/src/events.rs:11
Functions
Section titled “Functions”registry
Section titled “registry”pub fn registry() -> Vec<&'static EventDefinition>Deduplicate declarations while retaining the action registry as the source.