Skip to main content

Interface: EventPublication<K>

Defined in: packages/messaging/src/events.ts:33

What EventPublisher.publish is given.

Type Parameters​

K​

K extends EventKey

Properties​

actor​

readonly actor: { kind: "tenant"; roles: string[]; scopePath: string; subjectId: string; tenant: string; } | { kind: "platform"; roles: string[]; scopePath: "/"; subjectId: "00000000-0000-0000-0000-000000000000"; tenant: "platform"; }

Defined in: packages/messaging/src/events.ts:39

The actor whose request caused the event, propagated unchanged.


body​

readonly body: StaticType<[]>

Defined in: packages/messaging/src/events.ts:37

The event body. Validated strictly before it leaves.


causationId?​

readonly optional causationId?: string

Defined in: packages/messaging/src/events.ts:52

The id of the message that caused this one. Defaults to the id of the message being handled (ambient), then to the correlation id.


correlationId?​

readonly optional correlationId?: string

Defined in: packages/messaging/src/events.ts:47

Defaults to the ambient correlation id, else a new one.


msgId?​

readonly optional msgId?: string

Defined in: packages/messaging/src/events.ts:45

Nats-Msg-Id: what JetStream de-duplicates on inside the stream's window. For an audit record it is the record id, so an outbox relay that publishes twice stores once.


tenant​

readonly tenant: string

Defined in: packages/messaging/src/events.ts:35

The tenant token of the subject: the tenant the event concerns, or platform.