Back to Medusa

modules-sdk

www/apps/resources/references/modules/modules_sdk/page.mdx

2.14.280.7 KB
Original Source

import { TypeList } from "docs-ui"

modules-sdk

Classes

Enumerations

Functions

Type Aliases

Variables


Functions

convertRecordsToLinkDefinition

Parameters

<TypeList types={[{"name":"links","type":"object[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"JoinerServiceConfigAlias \| JoinerServiceConfigAlias[]","description":"Property name to use as entrypoint to the service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fieldAlias","type":"Record<string, string \\| object>","description":"alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\_price\_set.amount' })","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"Record<string, any>","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="convertRecordsToLinkDefinition"/>

Returns

<TypeList types={[{"name":"LinkDefinition[]","type":"LinkDefinition[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="convertRecordsToLinkDefinition"/>

createQuery

API wrapper around the remoteQuery with backward compatibility support

Parameters

<TypeList types={[{"name":"remoteQuery","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"remoteQuery","type":"RemoteQuery","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"traceFetchRemoteData","type":"(fetcher: () => Promise<any>, serviceName: string, method: string, options: { select?: string[] ; relations: string[] }) => Promise<any>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"indexModule","type":"IIndexService","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createQuery"/>

Returns

<TypeList types={[{"name":"Omit","type":"Omit<RemoteQueryFunction, symbol>","optional":false,"defaultValue":"","description":"API wrapper around the remoteQuery with backward compatibility support","expandable":false,"children":[{"name":"RemoteQueryFunction","type":"RemoteQueryFunction","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"graph","type":"QueryGraphFunction","description":"Graph function uses the remoteQuery under the hood and\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"index","type":"QueryIndexFunction","description":"Index function uses the index module to query and remoteQuery to hydrate the data\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gql","type":"(query: string, variables?: Record<string, unknown>, options?: RemoteJoinerOptions) => Promise<any>","description":"Query wrapper to provide specific GraphQL like API around remoteQuery.query","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"symbol","type":"symbol","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createQuery"/>

linkingErrorMessage

Parameters

<TypeList types={[{"name":"input","type":"LinkingErrorMessageInput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkingErrorMessage"/>

Returns

<TypeList types={[{"name":"string","type":"string","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkingErrorMessage"/>

loadModuleProvider

Parameters

<TypeList types={[{"name":"container","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"ModuleProvider","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolve","type":"string \| ModuleProviderExports<any>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"services","type":"Constructor<Service>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleProviderLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"registerServiceFn","type":"(klass: any, container: any, moduleDetails: any) => Promise<void>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModuleProvider"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<undefined \| any[]>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"undefined \| any[]","type":"undefined \| any[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModuleProvider"/>

loadModules

Parameters

<TypeList types={[{"name":"args","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"migrationOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"workerMode","type":"\"server\" \| \"shared\" \| \"worker\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModules"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"any","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModules"/>

MedusaApp

Parameters

<TypeList types={[{"name":"options","type":"MedusaAppOptions","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"LoadedModule[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"ModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"medusaConfigPath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"RegisterModuleJoinerConfig \| RegisterModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"RemoteFetchDataCallback","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"any","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => void","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs and run their loaders.\nUseful for migrations.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs without running loaders.\nUseful for type generation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaApp"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<MedusaAppOutput>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"modules","type":"Record<string, [LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx) \\| [LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"link","type":"Link \| undefined","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"RemoteQueryFunction","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"graph","type":"QueryGraphFunction","description":"Graph function uses the remoteQuery under the hood and\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"index","type":"QueryIndexFunction","description":"Index function uses the index module to query and remoteQuery to hydrate the data\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gql","type":"(query: string, variables?: Record<string, unknown>, options?: RemoteJoinerOptions) => Promise<any>","description":"Query wrapper to provide specific GraphQL like API around remoteQuery.query","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"runMigrations","type":"RunMigrationFn","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revertMigrations","type":"RevertMigrationFn","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"generateMigrations","type":"GenerateMigrations","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"linkMigrationExecutionPlanner","type":"GetLinkExecutionPlanner","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationShutdown","type":"() => Promise<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationPrepareShutdown","type":"() => Promise<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStart","type":"() => Promise<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entitiesMap","type":"Record<string, any>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"gqlSchema","type":"GraphQLUtils.GraphQLSchema","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"notFound","type":"Record<string, Record&#60;string, string&#62;>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaApp"/>

MedusaAppGetLinksExecutionPlanner

Parameters

<TypeList types={[{"name":"options","type":"MedusaAppOptions","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"LoadedModule[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"ModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"medusaConfigPath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"RegisterModuleJoinerConfig \| RegisterModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"RemoteFetchDataCallback","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"any","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => void","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs and run their loaders.\nUseful for migrations.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs without running loaders.\nUseful for type generation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppGetLinksExecutionPlanner"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<ILinkMigrationsPlanner>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"createPlan","type":"() => Promise<LinkMigrationsPlannerAction[]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"executePlan","type":"(actions: LinkMigrationsPlannerAction[]) => Promise<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppGetLinksExecutionPlanner"/>

MedusaAppMigrateDown

Parameters

<TypeList types={[{"name":"moduleNames","type":"string[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"MedusaAppOptions","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"LoadedModule[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"ModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"medusaConfigPath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"RegisterModuleJoinerConfig \| RegisterModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"RemoteFetchDataCallback","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"any","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => void","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs and run their loaders.\nUseful for migrations.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs without running loaders.\nUseful for type generation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateDown"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateDown"/>

MedusaAppMigrateGenerate

Parameters

<TypeList types={[{"name":"moduleNames","type":"string[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"MedusaAppOptions","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"LoadedModule[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"ModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"medusaConfigPath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"RegisterModuleJoinerConfig \| RegisterModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"RemoteFetchDataCallback","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"any","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => void","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs and run their loaders.\nUseful for migrations.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs without running loaders.\nUseful for type generation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateGenerate"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateGenerate"/>

MedusaAppMigrateUp

Parameters

<TypeList types={[{"name":"options","type":"MedusaAppOptions & object","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"SharedResources","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"ModuleServiceInitializeOptions[\"database\"] & object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"LoadedModule[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"ModuleJoinerConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"ModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"string","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idPrefixToEntityName","type":"Record<string, string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"ModuleJoinerRelationship[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"object[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"boolean","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"Record<string, string>","description":"Keys that can be used to link to other modules. e.g { product\_id: "Product" } "Product" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"boolean","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"string[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"medusaConfigPath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"MedusaModuleConfig","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"RegisterModuleJoinerConfig \| RegisterModuleJoinerConfig[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"RemoteFetchDataCallback","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"any","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => void","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs and run their loaders.\nUseful for migrations.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"Only partially load modules to retrieve their module joiner configs without running loaders.\nUseful for type generation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allOrNothing","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateUp"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateUp"/>

moduleLoader

Parameters

<TypeList types={[{"name":"__namedParameters","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"container","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleResolutions","type":"Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolutionPath","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleExports","type":"ModuleExports \| ModuleProviderExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"logger","type":"Logger","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"migrationOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schemaOnly","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleLoader"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleLoader"/>

moduleProviderLoader

Parameters

<TypeList types={[{"name":"__namedParameters","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"container","type":"MedusaContainer","description":"The Medusa Container extends Awilix to\nprovide dependency injection functionalities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"ModuleProvider[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolve","type":"string \| ModuleProviderExports<any>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"registerServiceFn","type":"(klass: any, container: MedusaContainer, moduleDetails: any) => Promise<void>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleProviderLoader"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleProviderLoader"/>

registerMedusaLinkModule

Parameters

<TypeList types={[{"name":"definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"\"internal\"","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"CustomModuleDefinition","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"string \| ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"string","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"boolean","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resolvePath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleDeclaration","type":"Partial<InternalModuleDeclaration>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"\"internal\"","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"CustomModuleDefinition","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resolve","type":"string \| ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"string","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"boolean","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cwd","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleExports","type":"ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaLinkModule"/>

Returns

<TypeList types={[{"name":"Record","type":"Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"string","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"ModuleResolution","type":"ModuleResolution","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"resolutionPath","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"\"internal\"","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"CustomModuleDefinition","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"string \| ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"string","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"boolean","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleExports","type":"ModuleExports \| ModuleProviderExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"services","type":"Constructor<Service>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaLinkModule"/>

registerMedusaModule

Parameters

<TypeList types={[{"name":"__namedParameters","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"moduleKey","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"string \| false \| Partial<InternalModuleDeclaration \| ExternalModuleDeclaration>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleExports","type":"ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"definition","type":"ModuleDefinition","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cwd","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaModule"/>

Returns

<TypeList types={[{"name":"Record","type":"Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"string","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"ModuleResolution","type":"ModuleResolution","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"resolutionPath","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"ModuleDefinition","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"string \| false","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"boolean","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"InternalModuleDeclaration \| ExternalModuleDeclaration","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"\"internal\"","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"string[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"CustomModuleDefinition","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"string \| ModuleExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"Record<string, unknown>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"string","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"boolean","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"\"shared\" \| \"worker\" \| \"server\"","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"object","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleExports","type":"ModuleExports \| ModuleProviderExports","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"services","type":"Constructor<Service>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"ModuleLoaderFunction[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"string","description":"Explicitly set the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"string","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaModule"/>


Variables

MedusaModule

Const MedusaModule: typeof MedusaModule

MODULE_DEFINITIONS

Const MODULE_DEFINITIONS: ModuleDefinition[]

ModulesDefinition

Const ModulesDefinition: object