Type alias OnOrchestrationEventTransformer

OnOrchestrationEventTransformer: ((event) => {
    data: Record<OrchestrationMachineAllowedStringKeys, any>;
})

Middleware function type for processing CloudEvents. This function takes a CloudEvent and returns an object containing the event's type, and optionally, additional event-specific data.

Type declaration

Returns

An object containing the transformed data. This data will upserted into the context.

Example

// Example middleware function for processing CloudEvents.
const onOrchestrationEvent: OnOrchestrationEvent = (event) => {
return { bookId: event.data.bookId };
// For pass through use `return event.data || {}`
};

Generated using TypeDoc