Setu-TS
    Preparing search index...

    Interface IntegrationEventDefinition<T>

    A named, versioned cross-service event contract.

    Produced by defineIntegrationEvent; read by publishIntegrationEvent and onIntegrationEvent.

    0.6.0

    interface IntegrationEventDefinition<T> {
        parse: (value: unknown) => T;
        topic: string;
        type: string;
        version: number;
        orderingKey?(envelope: IntegrationEventEnvelope<T>): string | undefined;
    }

    Type Parameters

    • T

      The event payload type the contract's parser produces

    Index
    parse: (value: unknown) => T

    Narrows the delivered payload for the application handler. Runs on the consumer side only — never on publish.

    topic: string

    The transport topic the event is published to and consumed from.

    type: string

    The event's semantic name, carried in the envelope's type field.

    version: number

    The contract version. A bump is a breaking payload change.

    • Opt-in ordering selector (M106 §3.7): returns the key that PLACES the event, or undefined for no key. Read only when the caller passes no orderingKey; a selector that throws, or returns a value §3.4 refuses, makes the publish reject.

      Declared in METHOD syntax deliberately: a property-style function member would make IntegrationEventDefinition<T> invariant in T under strictFunctionTypes, so an IntegrationEventDefinition<OrderPlaced> would no longer assign to the IntegrationEventDefinition<unknown> a consumer takes — a breaking change §4 forbids.

      Parameters

      Returns string | undefined