interface EventClientCodec

Codec interface for converting between domain events and wire format.

EventClientCodec provides the serialization/deserialization layer between EventicleEvent (domain representation) and EncodedEvent (wire representation). Different implementations can provide JSON, Avro, Protocol Buffers, or custom encoding schemes.

The codec is responsible for: - Serializing event payloads and metadata - Handling distributed tracing headers - Version compatibility and schema evolution - Compression and encryption (if needed)

Properties

decode

Converts an encoded event back into its domain representation.

Signature
decode: (encoded: EncodedEvent) => Promise<EventicleEvent>;

encode

Converts a domain event into its wire-ready encoded format.

Signature
encode: (event: EventicleEvent) => Promise<EncodedEvent>;