feat: deprecate remote link (#10768)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
8
.changeset/metal-weeks-retire.md
Normal file
8
.changeset/metal-weeks-retire.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"@medusajs/core-flows": patch
|
||||
"@medusajs/framework": patch
|
||||
"@medusajs/modules-sdk": patch
|
||||
"@medusajs/utils": patch
|
||||
---
|
||||
|
||||
Refactor/deprecate remote link
|
||||
@@ -13,7 +13,7 @@ export const linkSalesChannelsToApiKeyStepId = "link-sales-channels-to-api-key"
|
||||
export const linkSalesChannelsToApiKeyStep = createStep(
|
||||
linkSalesChannelsToApiKeyStepId,
|
||||
async (input: LinkWorkflowInput, { container }) => {
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
if (!input || (!input.add?.length && !input.remove?.length)) {
|
||||
return
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export const linkSalesChannelsToApiKeyStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
if (prevData.linksToCreate.length) {
|
||||
await remoteLink.dismiss(prevData.linksToCreate)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const updateCartPromotionsStep = createStep(
|
||||
updateCartPromotionsStepId,
|
||||
async (data: UpdateCartPromotionStepInput, { container }) => {
|
||||
const { promo_codes = [], id, action = PromotionActions.ADD } = data
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
const remoteQuery = container.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
@@ -94,7 +94,7 @@ export const updateCartPromotionsStep = createStep(
|
||||
})
|
||||
},
|
||||
async (revertData, { container }) => {
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
if (revertData?.dismissedLinks?.length) {
|
||||
await remoteLink.create(revertData.dismissedLinks)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import { LinkDefinition } from "@medusajs/framework/types"
|
||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
@@ -37,9 +37,7 @@ export const createLinksStepId = "create-remote-links"
|
||||
export const createRemoteLinkStep = createStep(
|
||||
createLinksStepId,
|
||||
async (data: LinkDefinition[], { container }) => {
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
if (!data.length) {
|
||||
return new StepResponse([], [])
|
||||
@@ -54,9 +52,7 @@ export const createRemoteLinkStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
await link.dismiss(createdLinks)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import { LinkDefinition } from "@medusajs/framework/types"
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
|
||||
@@ -47,9 +47,7 @@ export const dismissRemoteLinkStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
// Our current revert strategy for dismissed links are to recreate it again.
|
||||
// This works when its just the primary keys, but when you have additional data
|
||||
@@ -67,9 +65,7 @@ export const dismissRemoteLinkStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await link.create(dataBeforeDismiss)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DeleteEntityInput, RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { DeleteEntityInput, Link } from "@medusajs/framework/modules-sdk"
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
|
||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||
@@ -62,9 +62,7 @@ export const removeRemoteLinkStep = createStep(
|
||||
}
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
await link.delete(grouped)
|
||||
|
||||
return new StepResponse(grouped, grouped)
|
||||
@@ -74,9 +72,7 @@ export const removeRemoteLinkStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
await link.restore(removedLinks)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import { LinkDefinition } from "@medusajs/framework/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
@@ -14,9 +14,7 @@ export const updateRemoteLinksStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
// Fetch all existing links and throw an error if any weren't found
|
||||
const dataBeforeUpdate = (await link.list(data, {
|
||||
@@ -43,9 +41,7 @@ export const updateRemoteLinksStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const link = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const link = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await link.create(dataBeforeUpdate)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import { RemoteQueryFunction } from "@medusajs/framework/types"
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
@@ -70,9 +70,7 @@ export const setShippingOptionsPriceSetsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const remoteLink = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
const remoteQuery = container.resolve<RemoteQueryFunction>(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
@@ -152,9 +150,7 @@ export const setShippingOptionsPriceSetsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const remoteLink = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const promises: Promise<unknown[]>[] = []
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export const attachInventoryItemToVariants = createStep(
|
||||
}[],
|
||||
{ container }
|
||||
) => {
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const linkDefinitions = input
|
||||
.filter(({ tag }) => !!tag)
|
||||
@@ -38,7 +38,7 @@ export const attachInventoryItemToVariants = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await remoteLink.dismiss(linkDefinitions)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export const validateInventoryItemsForCreate = createStep(
|
||||
}[],
|
||||
{ container }
|
||||
) => {
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const linkService = remoteLink.getLinkModule(
|
||||
Modules.PRODUCT,
|
||||
|
||||
@@ -15,7 +15,7 @@ export const createVariantPricingLinkStepId = "create-variant-pricing-link"
|
||||
export const createVariantPricingLinkStep = createStep(
|
||||
createVariantPricingLinkStepId,
|
||||
async (data: CreateVariantPricingLinkStepInput, { container }) => {
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
await remoteLink.create(
|
||||
data.links.map((entry) => ({
|
||||
[Modules.PRODUCT]: {
|
||||
@@ -34,7 +34,7 @@ export const createVariantPricingLinkStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
const links = data.links.map((entry) => ({
|
||||
[Modules.PRODUCT]: {
|
||||
variant_id: entry.variant_id,
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getVariantPricingLinkStep = createStep(
|
||||
return new StepResponse([])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const linkService = remoteLink.getLinkModule(
|
||||
Modules.PRODUCT,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import {
|
||||
IPaymentModuleService,
|
||||
RemoteQueryFunction,
|
||||
@@ -107,9 +107,7 @@ export const setRegionsPaymentProvidersStep = createStep(
|
||||
const paymentService = container.resolve<IPaymentModuleService>(
|
||||
Modules.PAYMENT
|
||||
)
|
||||
const remoteLink = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const remoteLink = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
const remoteQuery = container.resolve<RemoteQueryFunction>(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
@@ -199,9 +197,7 @@ export const setRegionsPaymentProvidersStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const remoteLink = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const promises: Promise<unknown[]>[] = []
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export const associateLocationsWithSalesChannelsStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
const links = data.links.map((link) => {
|
||||
return {
|
||||
[Modules.SALES_CHANNEL]: {
|
||||
@@ -41,7 +41,7 @@ export const associateLocationsWithSalesChannelsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
await remoteLink.dismiss(links)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ export const associateProductsWithSalesChannelsStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
const links = input.links.map((link) => {
|
||||
return {
|
||||
[Modules.PRODUCT]: {
|
||||
@@ -40,7 +40,7 @@ export const associateProductsWithSalesChannelsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await remoteLink.dismiss(links)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||
import { Link } from "@medusajs/framework/modules-sdk"
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
|
||||
import { ContainerRegistrationKeys, Modules } from "@medusajs/framework/utils"
|
||||
@@ -22,9 +22,7 @@ export const detachLocationsFromSalesChannelsStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve<RemoteLink>(
|
||||
ContainerRegistrationKeys.REMOTE_LINK
|
||||
)
|
||||
const remoteLink = container.resolve<Link>(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const links = data.links.map((link) => {
|
||||
return {
|
||||
@@ -45,7 +43,7 @@ export const detachLocationsFromSalesChannelsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
await remoteLink.create(links)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ export const detachProductsFromSalesChannelsStep = createStep(
|
||||
return new StepResponse(void 0, [])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
const links = input.links.map((link) => {
|
||||
return {
|
||||
[Modules.PRODUCT]: {
|
||||
@@ -41,7 +41,7 @@ export const detachProductsFromSalesChannelsStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await remoteLink.create(links)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const associateFulfillmentSetsWithLocationStep = createStep(
|
||||
return new StepResponse([], [])
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
const links = data.input
|
||||
.map((link) => {
|
||||
@@ -49,7 +49,7 @@ export const associateFulfillmentSetsWithLocationStep = createStep(
|
||||
return
|
||||
}
|
||||
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
|
||||
const remoteLink = container.resolve(ContainerRegistrationKeys.LINK)
|
||||
|
||||
await remoteLink.dismiss(links)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
} from "@medusajs/utils"
|
||||
import { pgConnectionLoader } from "./database"
|
||||
|
||||
import { asValue } from "awilix"
|
||||
import { aliasTo, asValue } from "awilix"
|
||||
import { configManager } from "./config"
|
||||
import {
|
||||
container,
|
||||
@@ -236,9 +236,10 @@ export class MedusaAppLoader {
|
||||
ContainerRegistrationKeys.QUERY,
|
||||
asValue(undefined)
|
||||
)
|
||||
this.#container.register(ContainerRegistrationKeys.LINK, asValue(undefined))
|
||||
this.#container.register(
|
||||
ContainerRegistrationKeys.REMOTE_LINK,
|
||||
asValue(undefined)
|
||||
aliasTo(ContainerRegistrationKeys.LINK)
|
||||
)
|
||||
|
||||
const configModules = this.mergeDefaultModules(configModule.modules)
|
||||
@@ -257,9 +258,13 @@ export class MedusaAppLoader {
|
||||
}
|
||||
|
||||
this.#container.register(
|
||||
ContainerRegistrationKeys.REMOTE_LINK,
|
||||
ContainerRegistrationKeys.LINK,
|
||||
asValue(medusaApp.link)
|
||||
)
|
||||
this.#container.register(
|
||||
ContainerRegistrationKeys.REMOTE_LINK,
|
||||
aliasTo(ContainerRegistrationKeys.LINK)
|
||||
)
|
||||
this.#container.register(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY,
|
||||
asValue(medusaApp.query)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RemoteLink } from "@medusajs/modules-sdk"
|
||||
import { Link } from "@medusajs/modules-sdk"
|
||||
import {
|
||||
ConfigModule,
|
||||
IApiKeyModuleService,
|
||||
@@ -35,7 +35,11 @@ import { AwilixContainer, ResolveOptions } from "awilix"
|
||||
|
||||
declare module "@medusajs/types" {
|
||||
export interface ModuleImplementations {
|
||||
[ContainerRegistrationKeys.REMOTE_LINK]: RemoteLink
|
||||
/**
|
||||
* @deprecated. Instead use "link"
|
||||
*/
|
||||
[ContainerRegistrationKeys.REMOTE_LINK]: Link
|
||||
[ContainerRegistrationKeys.LINK]: Link
|
||||
[ContainerRegistrationKeys.CONFIG_MODULE]: ConfigModule
|
||||
[ContainerRegistrationKeys.PG_CONNECTION]: Knex<any>
|
||||
[ContainerRegistrationKeys.REMOTE_QUERY]: RemoteQueryFunction
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ProductInventoryLinkModule } from "../__mocks__/product-inventory-link"
|
||||
import { ProductModule } from "../__mocks__/product-module"
|
||||
import { StockLocationModule } from "../__mocks__/stock-location-module"
|
||||
|
||||
import { RemoteLink } from "../remote-link"
|
||||
import { Link } from "../link"
|
||||
|
||||
const allModules = [
|
||||
// modules
|
||||
@@ -17,7 +17,7 @@ const allModules = [
|
||||
]
|
||||
describe("Remote Link", function () {
|
||||
it("Should get all loaded modules and compose their relationships", async function () {
|
||||
const remoteLink = new RemoteLink(allModules as any)
|
||||
const remoteLink = new Link(allModules as any)
|
||||
|
||||
const relations = remoteLink.getRelationships()
|
||||
|
||||
@@ -84,7 +84,7 @@ describe("Remote Link", function () {
|
||||
})
|
||||
|
||||
it("Should call the correct link module to create relation between 2 keys", async function () {
|
||||
const remoteLink = new RemoteLink(allModules as any)
|
||||
const remoteLink = new Link(allModules as any)
|
||||
|
||||
await remoteLink.create([
|
||||
{
|
||||
@@ -123,7 +123,7 @@ describe("Remote Link", function () {
|
||||
})
|
||||
|
||||
it("Should call delete in cascade all the modules involved in the link", async function () {
|
||||
const remoteLink = new RemoteLink(allModules as any)
|
||||
const remoteLink = new Link(allModules as any)
|
||||
|
||||
ProductInventoryLinkModule.softDelete.mockImplementation(() => {
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,7 @@ export * from "./definitions"
|
||||
export * from "./loaders"
|
||||
export * from "./medusa-app"
|
||||
export * from "./medusa-module"
|
||||
export * from "./remote-link"
|
||||
export * from "./link"
|
||||
export * from "./remote-query"
|
||||
export * from "./types"
|
||||
export * from "./utils"
|
||||
|
||||
@@ -48,7 +48,7 @@ type LinkDataConfig = {
|
||||
moduleBKey: string
|
||||
}
|
||||
|
||||
export class RemoteLink {
|
||||
export class Link {
|
||||
private modulesMap: Map<string, LoadedLinkModule> = new Map()
|
||||
private relationsPairs: Map<string, LoadedLinkModule> = new Map()
|
||||
private relations: Map<string, Map<string, RemoteRelationship[]>> = new Map()
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
ModuleBootstrapOptions,
|
||||
RegisterModuleJoinerConfig,
|
||||
} from "./medusa-module"
|
||||
import { RemoteLink } from "./remote-link"
|
||||
import { Link } from "./link"
|
||||
import { createQuery, RemoteQuery } from "./remote-query"
|
||||
import { MODULE_SCOPE } from "./types"
|
||||
|
||||
@@ -210,7 +210,7 @@ async function initializeLinks({
|
||||
)
|
||||
|
||||
return {
|
||||
remoteLink: new RemoteLink(),
|
||||
remoteLink: new Link(),
|
||||
linkResolution,
|
||||
getMigrationPlanner,
|
||||
}
|
||||
@@ -261,7 +261,7 @@ function registerCustomJoinerConfigs(servicesConfig: ModuleJoinerConfig[]) {
|
||||
|
||||
export type MedusaAppOutput = {
|
||||
modules: Record<string, LoadedModule | LoadedModule[]>
|
||||
link: RemoteLink | undefined
|
||||
link: Link | undefined
|
||||
query: RemoteQueryFunction
|
||||
entitiesMap?: Record<string, any>
|
||||
gqlSchema?: GraphQLUtils.GraphQLSchema
|
||||
|
||||
@@ -5,6 +5,10 @@ export const ContainerRegistrationKeys = {
|
||||
LOGGER: "logger",
|
||||
REMOTE_QUERY: "remoteQuery",
|
||||
QUERY: "query",
|
||||
/**
|
||||
* @deprecated. Instead use "ContainerRegistrationKeys.LINK"
|
||||
*/
|
||||
REMOTE_LINK: "remoteLink",
|
||||
LINK: "link",
|
||||
FEATURE_FLAG_ROUTER: "featureFlagRouter",
|
||||
} as const
|
||||
|
||||
Reference in New Issue
Block a user