feat(types,modules-sdk): basic module setup for promotions (#5920)

RESOLVES CORE-1580
This commit is contained in:
Riqwan Thamir
2023-12-20 12:21:13 +00:00
committed by GitHub
parent f25ca30b3a
commit 3f6d79961d
46 changed files with 724 additions and 11 deletions
+1
View File
@@ -9,6 +9,7 @@ export * as LoggerTypes from "./logger"
export * as ModulesSdkTypes from "./modules-sdk"
export * as PricingTypes from "./pricing"
export * as ProductTypes from "./product"
export * as PromotionTypes from "./promotion"
export * as RegionTypes from "./region"
export * as SalesChannelTypes from "./sales-channel"
export * as SearchTypes from "./search"
+1
View File
@@ -16,6 +16,7 @@ export * from "./modules-sdk"
export * from "./pricing"
export * from "./product"
export * from "./product-category"
export * from "./promotion"
export * from "./region"
export * from "./sales-channel"
export * from "./search"
+22 -3
View File
@@ -1,8 +1,12 @@
import { JoinerRelationship, JoinerServiceConfig, RemoteJoinerQuery } from "../joiner"
import {
JoinerRelationship,
JoinerServiceConfig,
RemoteJoinerQuery,
} from "../joiner"
import { Logger } from "../logger"
import { MedusaContainer } from "../common"
import { RepositoryService } from "../dal"
import { Logger } from "../logger"
export type Constructor<T> = new (...args: any[]) => T
export * from "../common/medusa-container"
@@ -261,7 +265,22 @@ export type ModuleServiceInitializeCustomDataLayerOptions = {
}
}
export type ModuleBootstrapDeclaration =
| InternalModuleDeclaration
| ExternalModuleDeclaration
// TODO: These should be added back when the chain of types are fixed
// | ModuleServiceInitializeOptions
// | ModuleServiceInitializeCustomDataLayerOptions
export type RemoteQueryFunction = (
query: string | RemoteJoinerQuery | object,
variables?: Record<string, unknown>
) => Promise<any> | null
) => Promise<any> | null
export interface IModuleService {
__joinerConfig?(): ModuleJoinerConfig
__hooks?: {
onApplicationStart?: () => Promise<void>
}
}
+1
View File
@@ -0,0 +1 @@
export * from "./service"
+3
View File
@@ -0,0 +1,3 @@
import { IModuleService } from "../modules-sdk"
export interface IPromotionModuleService extends IModuleService {}