feat(medusa,event-bus-local,event-bus-redis): Event Bus modules (#2599)

This commit is contained in:
Oliver Windall Juhl
2023-03-22 10:26:21 +01:00
committed by GitHub
parent 7408111d11
commit ef5ef9f5a2
114 changed files with 2423 additions and 1669 deletions
@@ -1,15 +1,16 @@
import { IEventBusService, IStockLocationService } from "@medusajs/medusa"
import { IStockLocationService } from "@medusajs/medusa"
import {
ExternalModuleDeclaration,
InternalModuleDeclaration,
MedusaModule,
MedusaModule
} from "@medusajs/modules-sdk"
import { EventBusTypes } from "@medusajs/types"
import { StockLocationServiceInitializeOptions } from "../types"
export const initialize = async (
options?: StockLocationServiceInitializeOptions | ExternalModuleDeclaration,
injectedDependencies?: {
eventBusService: IEventBusService
eventBusService: EventBusTypes.IEventBusService
}
): Promise<IStockLocationService> => {
const serviceKey = "stockLocationService"
@@ -3,13 +3,12 @@ import {
CreateStockLocationInput,
FilterableStockLocationProps,
FindConfig,
IEventBusService,
setMetadata,
StockLocationAddressInput,
UpdateStockLocationInput,
UpdateStockLocationInput
} from "@medusajs/medusa"
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import { SharedContext } from "@medusajs/types"
import { EventBusTypes, SharedContext } from "@medusajs/types"
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
import { isDefined, MedusaError } from "medusa-core-utils"
import { EntityManager } from "typeorm"
@@ -17,7 +16,7 @@ import { StockLocation, StockLocationAddress } from "../models"
type InjectedDependencies = {
manager: EntityManager
eventBusService: IEventBusService
eventBusService: EventBusTypes.IEventBusService
}
/**
@@ -32,7 +31,7 @@ export default class StockLocationService {
}
protected readonly manager_: EntityManager
protected readonly eventBusService_: IEventBusService
protected readonly eventBusService_: EventBusTypes.IEventBusService
constructor(
{ eventBusService, manager }: InjectedDependencies,