security/codeql-dependabot-gitleaks
| 1 | import { MedusaModule } from "@medusajs/framework/modules-sdk" |
| 2 | import { IEventBusService } from "@medusajs/framework/types" |
| 3 | import { Modules } from "@medusajs/framework/utils" |
| 4 | |
| 5 | export const initialize = async (): Promise<IEventBusService> => { |
| 6 | const serviceKey = Modules.EVENT_BUS |
| 7 | const loaded = await MedusaModule.bootstrap<IEventBusService>({ |
| 8 | moduleKey: serviceKey, |
| 9 | defaultPath: "@medusajs/event-bus-local", |
| 10 | }) |
| 11 | |
| 12 | return loaded[serviceKey] |
| 13 | } |