chore: Ensure the events are emitted with the same shape all accross (#8063)
* chore: Ensure the events are emitted with the same shape all accross * fixes: * rm unsues type * types * fix tests
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { Context } from "../shared-context"
|
||||
|
||||
export type Subscriber<TData = unknown> = (
|
||||
data: TData,
|
||||
eventName: string
|
||||
data: MessageBody<TData>
|
||||
) => Promise<void>
|
||||
|
||||
export type SubscriberContext = {
|
||||
@@ -14,11 +13,6 @@ export type SubscriberDescriptor = {
|
||||
subscriber: Subscriber
|
||||
}
|
||||
|
||||
export type EventHandler<TData = unknown> = (
|
||||
data: TData,
|
||||
eventName: string
|
||||
) => Promise<void>
|
||||
|
||||
export type EventMetadata = Record<string, unknown> & {
|
||||
eventGroupId?: string
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@ export function MedusaService<
|
||||
data: isString(primaryKeyValue)
|
||||
? { id: primaryKeyValue }
|
||||
: primaryKeyValue,
|
||||
metadata: { source: "", action: "", object: "" },
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user