feat: restructure events payload (#8143)
* refactor: restructure events payload Breaking change: This PR changes the event payload accepted by the event listeners * refactor: fix failing tests and implement feedback * add integration tests * fix timeout --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ export const emitEventStep = createStep(
|
||||
const data_ =
|
||||
typeof input.data === "function" ? await input.data(context) : input.data
|
||||
|
||||
const metadata: EventBusTypes.MessageBody["metadata"] = {
|
||||
const metadata: EventBusTypes.Event["metadata"] = {
|
||||
...input.metadata,
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ export const emitEventStep = createStep(
|
||||
metadata.eventGroupId = context.eventGroupId
|
||||
}
|
||||
|
||||
const message = {
|
||||
eventName: input.eventName,
|
||||
const message: EventBusTypes.Message = {
|
||||
name: input.eventName,
|
||||
data: data_,
|
||||
options: input.options,
|
||||
metadata,
|
||||
|
||||
Reference in New Issue
Block a user