interface IntegrationEventEnvelope
Since 0.6.0

The wire shape of a published integration event.

occurredAt is an ISO-8601 string, not a Date: the in-memory broker's JsonSerializer round-trips payloads through JSON.parse, so a Date would arrive at the consumer as a string regardless of what the producer put in — declaring the field a string is the honest type on every transport. It is named occurredAt (not occurredOn, the Date-typed field the events-plugin DomainEvent carries) so the two cannot be conflated.

Unknown extra top-level fields are allowed by the consumer's structural check, so an additive envelope change on a later framework version is not a breaking deployment.

Type Parameters

T = unknown

The payload type the consuming definition's parser produces

Properties

readonly
id: string

Producer-assigned event identity (runtime.uuid()).

readonly
type: string

The definition's semantic event name.

readonly
version: number

The definition's contract version.

readonly
occurredAt: string

Publish time as an ISO-8601 string (new Date(runtime.now()).toISOString()).

readonly
data: T

The event payload, as the producer published it.

readonly
optional
correlationId: string

ID of the chain root this event descends from, when propagated.

readonly
optional
causationId: string

ID of the event that directly caused this one, when propagated.

readonly
optional
aggregateId: string

ID of the aggregate the event concerns, when supplied.

readonly
optional
aggregateVersion: number

Version of the aggregate the event concerns, when supplied.

Usage

import { type IntegrationEventEnvelope } from "messaging-plugin/src/index.ts";