Skip to main content
Skip to main content

ModulesSdkTypes

internal.internal.ModulesSdkTypes

Enumerations

Interfaces

References

Constructor

Re-exports Constructor


MedusaContainer

Re-exports MedusaContainer


RemoteQueryFunction

Re-exports RemoteQueryFunction

Type Aliases

ExternalModuleDeclaration

ExternalModuleDeclaration: Object

Type declaration

aliasstring
If multiple modules are registered with the same key, the alias can be used to differentiate them
mainboolean
If the module is the main module for the key when multiple ones are registered
optionsRecord<string, unknown>
scopeEXTERNALRequired
serverobject
server.keepAlivebooleanRequired
server.type"http"Required
server.urlstringRequired

InternalModuleDeclaration

InternalModuleDeclaration: Object

Type declaration

aliasstring
If multiple modules are registered with the same key, the alias can be used to differentiate them
dependenciesstring[]
mainboolean
If the module is the main module for the key when multiple ones are registered
optionsRecord<string, unknown>
resolvestring
resourcesMODULE_RESOURCE_TYPERequired
scopeINTERNALRequired

LinkModuleDefinition

LinkModuleDefinition: Object

Type declaration

defaultModuleDeclarationInternalModuleDeclarationRequired
dependenciesstring[]
keystringRequired
labelstringRequired
registrationNamestringRequired

LoadedModule

LoadedModule: unknown & { __definition: ModuleDefinition ; __joinerConfig: ModuleJoinerConfig }


LoaderOptions

LoaderOptions<TOptions>: Object

Type parameters

TOptionsobjectRequired

Type declaration

containerMedusaContainerRequired
loggerLogger
optionsTOptions

LogLevel

LogLevel: "query" | "schema" | "error" | "warn" | "info" | "log" | "migration"


LoggerOptions

LoggerOptions: boolean | "all" | LogLevel[]


ModuleConfig

ModuleConfig: ModuleDeclaration & { definition: ModuleDefinition ; module: string ; path: string }


ModuleDefinition

ModuleDefinition: Object

Type declaration

canOverrideboolean
Deprecated property will be removed in future versions
defaultModuleDeclarationInternalModuleDeclaration | ExternalModuleDeclarationRequired
defaultPackagestring | falseRequired
dependenciesstring[]
isLegacyboolean
isQueryableboolean
isRequiredboolean
Deprecated property will be removed in future versions
keystringRequired
labelstringRequired
registrationNamestringRequired

ModuleExports

ModuleExports: Object

Type declaration

migrationsany[]
modelsConstructor<any>[]
serviceConstructor<any>Required
revertMigration(options: LoaderOptions<Record<string, unknown>>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>
runMigrations(options: LoaderOptions<Record<string, unknown>>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>

ModuleJoinerConfig

ModuleJoinerConfig: Omit<JoinerServiceConfig, "serviceName" | "primaryKeys" | "relationships" | "extends"> & { databaseConfig?: { extraFields?: Record<string, { defaultValue?: string ; nullable?: boolean ; options?: Record<string, unknown> ; type: "date" | "time" | "datetime" | "bigint" | "blob" | "uint8array" | "array" | "enumArray" | "enum" | "json" | "integer" | "smallint" | "tinyint" | "mediumint" | "float" | "double" | "boolean" | "decimal" | "string" | "uuid" | "text" }> ; idPrefix?: string ; tableName?: string } ; extends?: { fieldAlias?: Record<string, string | { forwardArgumentsOnPath: string[] ; path: string }> ; relationship: ModuleJoinerRelationship ; serviceName: string }[] ; isLink?: boolean ; isReadOnlyLink?: boolean ; linkableKeys?: Record<string, string> ; primaryKeys?: string[] ; relationships?: ModuleJoinerRelationship[] ; schema?: string ; serviceName?: string }


ModuleJoinerRelationship

ModuleJoinerRelationship: JoinerRelationship & { deleteCascade?: boolean ; isInternalService?: boolean }


ModuleLoaderFunction

ModuleLoaderFunction: (options: LoaderOptions, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>

Type declaration

(options, moduleDeclaration?): Promise<void>

Parameters
optionsLoaderOptionsRequired
moduleDeclarationInternalModuleDeclaration
Returns

Promise<void>

PromisePromise<void>Required

ModuleResolution

ModuleResolution: Object

Type declaration

definitionModuleDefinitionRequired
dependenciesstring[]
moduleExportsModuleExports
optionsRecord<string, unknown>
resolutionPathstring | falseRequired

ModuleServiceInitializeCustomDataLayerOptions

ModuleServiceInitializeCustomDataLayerOptions: Object

Type declaration

managerany
repositoriesobject

ModulesResponse

ModulesResponse: { module: string ; resolution: string | false }[]

Was this section helpful?