defineIntegrationEvent<T>(options: { type: string; version: number; topic: string; parse: (value: unknown) => T; }): IntegrationEventDefinition<T>
Defines a versioned integration-event contract and validates it eagerly.
The versioned-topic rollout policy is enforced here rather than documented:
the topic must end with the exact string .v${version} (for example
orders.placed.v2 for version 2), so a version bump that leaves the topic
unchanged is refused at definition time — at module load, loudly — instead
of silently breaking every deployed consumer of the previous version. A
pre-existing topic that predates this policy has no versioned suffix by
design; keep using the raw broker.publish/broker.subscribe surface for
it, which this milestone does not change.
options: { type: string; version: number; topic: string; parse: (value: unknown) => T; }
The contract's four fields
The validated definition, with every field exposed unchanged