chore: remove container registration name (#9137)
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
IRegionModuleService,
|
||||
ISalesChannelModuleService,
|
||||
} from "@medusajs/types"
|
||||
import { ModuleRegistrationName, Modules } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -26,16 +26,12 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
cartModuleService = appContainer.resolve(ModuleRegistrationName.CART)
|
||||
regionModule = appContainer.resolve(ModuleRegistrationName.REGION)
|
||||
customerModule = appContainer.resolve(ModuleRegistrationName.CUSTOMER)
|
||||
scModuleService = appContainer.resolve(
|
||||
ModuleRegistrationName.SALES_CHANNEL
|
||||
)
|
||||
regionModule = appContainer.resolve(ModuleRegistrationName.REGION)
|
||||
paymentModuleService = appContainer.resolve(
|
||||
ModuleRegistrationName.PAYMENT
|
||||
)
|
||||
cartModuleService = appContainer.resolve(Modules.CART)
|
||||
regionModule = appContainer.resolve(Modules.REGION)
|
||||
customerModule = appContainer.resolve(Modules.CUSTOMER)
|
||||
scModuleService = appContainer.resolve(Modules.SALES_CHANNEL)
|
||||
regionModule = appContainer.resolve(Modules.REGION)
|
||||
paymentModuleService = appContainer.resolve(Modules.PAYMENT)
|
||||
remoteQuery = appContainer.resolve("remoteQuery")
|
||||
remoteLink = appContainer.resolve("remoteLink")
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ICartModuleService, IRegionModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -17,8 +17,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
cartModuleService = appContainer.resolve(ModuleRegistrationName.CART)
|
||||
regionModule = appContainer.resolve(ModuleRegistrationName.REGION)
|
||||
cartModuleService = appContainer.resolve(Modules.CART)
|
||||
regionModule = appContainer.resolve(Modules.REGION)
|
||||
remoteQuery = appContainer.resolve("remoteQuery")
|
||||
})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ medusaIntegrationTestRunner({
|
||||
expect(link.serviceName).toEqual(linkDefinition.serviceName)
|
||||
expect(link.entryPoint).toEqual(linkDefinition.alias[0].name[0])
|
||||
expect(linkDefinition).toEqual({
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
isLink: true,
|
||||
alias: [
|
||||
{
|
||||
@@ -42,7 +42,7 @@ medusaIntegrationTestRunner({
|
||||
primaryKeys: ["id", "currency_code", "region_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
entity: "Currency",
|
||||
primaryKey: "code",
|
||||
foreignKey: "currency_code",
|
||||
@@ -53,7 +53,7 @@ medusaIntegrationTestRunner({
|
||||
deleteCascade: false,
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
entity: "Region",
|
||||
primaryKey: "id",
|
||||
foreignKey: "region_id",
|
||||
@@ -66,7 +66,7 @@ medusaIntegrationTestRunner({
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
fieldAlias: {
|
||||
region: {
|
||||
path: "region_link.region",
|
||||
@@ -75,7 +75,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "currency_code",
|
||||
foreignKey: "code",
|
||||
alias: "region_link",
|
||||
@@ -83,7 +83,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
fieldAlias: {
|
||||
currency: {
|
||||
path: "currency_link.currency",
|
||||
@@ -92,7 +92,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "region_id",
|
||||
foreignKey: "id",
|
||||
alias: "currency_link",
|
||||
@@ -124,20 +124,20 @@ medusaIntegrationTestRunner({
|
||||
expect(link.serviceName).toEqual(linkDefinition.serviceName)
|
||||
expect(link.entryPoint).toEqual(linkDefinition.alias[0].name[0])
|
||||
expect(linkDefinition).toEqual({
|
||||
serviceName: "productProductVariantRegionRegionLink",
|
||||
serviceName: "ProductProductVariantRegionRegionLink",
|
||||
isLink: true,
|
||||
alias: [
|
||||
{
|
||||
name: ["product_variant_region"],
|
||||
args: {
|
||||
entity: "LinkProductServiceProductVariantRegionRegion",
|
||||
entity: "LinkProductProductVariantRegionRegion",
|
||||
},
|
||||
},
|
||||
],
|
||||
primaryKeys: ["id", "product_variant_id", "region_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: "productService",
|
||||
serviceName: "Product",
|
||||
entity: "ProductVariant",
|
||||
primaryKey: "id",
|
||||
foreignKey: "product_variant_id",
|
||||
@@ -148,7 +148,7 @@ medusaIntegrationTestRunner({
|
||||
deleteCascade: false,
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
entity: "Region",
|
||||
primaryKey: "id",
|
||||
foreignKey: "region_id",
|
||||
@@ -161,7 +161,7 @@ medusaIntegrationTestRunner({
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: "productService",
|
||||
serviceName: "Product",
|
||||
fieldAlias: {
|
||||
region: {
|
||||
path: "region_link.region",
|
||||
@@ -170,7 +170,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "productProductVariantRegionRegionLink",
|
||||
serviceName: "ProductProductVariantRegionRegionLink",
|
||||
primaryKey: "product_variant_id",
|
||||
foreignKey: "id",
|
||||
alias: "region_link",
|
||||
@@ -178,7 +178,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
fieldAlias: {
|
||||
product_variant: {
|
||||
path: "product_variant_link.product_variant",
|
||||
@@ -189,7 +189,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "productProductVariantRegionRegionLink",
|
||||
serviceName: "ProductProductVariantRegionRegionLink",
|
||||
primaryKey: "region_id",
|
||||
foreignKey: "id",
|
||||
alias: "product_variant_link",
|
||||
@@ -224,7 +224,7 @@ medusaIntegrationTestRunner({
|
||||
expect(link.serviceName).toEqual(linkDefinition.serviceName)
|
||||
expect(link.entryPoint).toEqual(linkDefinition.alias[0].name[0])
|
||||
expect(linkDefinition).toEqual({
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
isLink: true,
|
||||
alias: [
|
||||
{
|
||||
@@ -237,7 +237,7 @@ medusaIntegrationTestRunner({
|
||||
primaryKeys: ["id", "currency_code", "region_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
entity: "Currency",
|
||||
primaryKey: "code",
|
||||
foreignKey: "currency_code",
|
||||
@@ -248,7 +248,7 @@ medusaIntegrationTestRunner({
|
||||
deleteCascade: true,
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
entity: "Region",
|
||||
primaryKey: "id",
|
||||
foreignKey: "region_id",
|
||||
@@ -261,7 +261,7 @@ medusaIntegrationTestRunner({
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
fieldAlias: {
|
||||
region: {
|
||||
path: "region_link.region",
|
||||
@@ -270,7 +270,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "currency_code",
|
||||
foreignKey: "code",
|
||||
alias: "region_link",
|
||||
@@ -278,7 +278,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
fieldAlias: {
|
||||
currency: {
|
||||
path: "currency_link.currency",
|
||||
@@ -287,7 +287,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "region_id",
|
||||
foreignKey: "id",
|
||||
alias: "currency_link",
|
||||
@@ -316,9 +316,9 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
.filter(Boolean)[0]
|
||||
|
||||
expect(link.serviceName).toEqual("currencyCurrencyRegionRegionLink")
|
||||
expect(link.serviceName).toEqual("CurrencyCurrencyRegionRegionLink")
|
||||
expect(linkDefinition).toEqual({
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
isLink: true,
|
||||
alias: [
|
||||
{
|
||||
@@ -331,7 +331,7 @@ medusaIntegrationTestRunner({
|
||||
primaryKeys: ["id", "currency_code", "region_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
entity: "Currency",
|
||||
primaryKey: "code",
|
||||
foreignKey: "currency_code",
|
||||
@@ -342,7 +342,7 @@ medusaIntegrationTestRunner({
|
||||
deleteCascade: false,
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
entity: "Region",
|
||||
primaryKey: "id",
|
||||
foreignKey: "region_id",
|
||||
@@ -355,7 +355,7 @@ medusaIntegrationTestRunner({
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: "currency",
|
||||
serviceName: "Currency",
|
||||
fieldAlias: {
|
||||
regions: {
|
||||
path: "region_link.region",
|
||||
@@ -364,7 +364,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "currency_code",
|
||||
foreignKey: "code",
|
||||
alias: "region_link",
|
||||
@@ -372,7 +372,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: "region",
|
||||
serviceName: "Region",
|
||||
fieldAlias: {
|
||||
currency: {
|
||||
path: "currency_link.currency",
|
||||
@@ -381,7 +381,7 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: "currencyCurrencyRegionRegionLink",
|
||||
serviceName: "CurrencyCurrencyRegionRegionLink",
|
||||
primaryKey: "region_id",
|
||||
foreignKey: "id",
|
||||
alias: "currency_link",
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -26,12 +25,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
fulfillmentModule = appContainer.resolve(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
)
|
||||
locationModule = appContainer.resolve(
|
||||
ModuleRegistrationName.STOCK_LOCATION
|
||||
)
|
||||
fulfillmentModule = appContainer.resolve(Modules.FULFILLMENT)
|
||||
locationModule = appContainer.resolve(Modules.STOCK_LOCATION)
|
||||
remoteQuery = appContainer.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { IPricingModuleService, IProductModuleService } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -23,8 +22,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
productModule = appContainer.resolve(ModuleRegistrationName.PRODUCT)
|
||||
pricingModule = appContainer.resolve(ModuleRegistrationName.PRICING)
|
||||
productModule = appContainer.resolve(Modules.PRODUCT)
|
||||
pricingModule = appContainer.resolve(Modules.PRICING)
|
||||
remoteQuery = appContainer.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
|
||||
+3
-9
@@ -2,11 +2,7 @@ import {
|
||||
IApiKeyModuleService,
|
||||
ISalesChannelModuleService,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { Modules, remoteQueryObjectFromString } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -25,10 +21,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
apiKeyModule = appContainer.resolve(ModuleRegistrationName.API_KEY)
|
||||
scModuleService = appContainer.resolve(
|
||||
ModuleRegistrationName.SALES_CHANNEL
|
||||
)
|
||||
apiKeyModule = appContainer.resolve(Modules.API_KEY)
|
||||
scModuleService = appContainer.resolve(Modules.SALES_CHANNEL)
|
||||
remoteQuery = appContainer.resolve("remoteQuery")
|
||||
remoteLink = appContainer.resolve("remoteLink")
|
||||
})
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { IRegionModuleService } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
} from "@medusajs/utils"
|
||||
import { ContainerRegistrationKeys, Modules } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -21,7 +17,7 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
regionModule = appContainer.resolve(ModuleRegistrationName.REGION)
|
||||
regionModule = appContainer.resolve(Modules.REGION)
|
||||
remoteQuery = appContainer.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
|
||||
@@ -2,11 +2,7 @@ import {
|
||||
ISalesChannelModuleService,
|
||||
IStockLocationService,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { Modules, remoteQueryObjectFromString } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -24,10 +20,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
scService = appContainer.resolve(ModuleRegistrationName.SALES_CHANNEL)
|
||||
locationService = appContainer.resolve(
|
||||
ModuleRegistrationName.STOCK_LOCATION
|
||||
)
|
||||
scService = appContainer.resolve(Modules.SALES_CHANNEL)
|
||||
locationService = appContainer.resolve(Modules.STOCK_LOCATION)
|
||||
remoteQuery = appContainer.resolve("remoteQuery")
|
||||
remoteLink = appContainer.resolve("remoteLink")
|
||||
})
|
||||
|
||||
@@ -2,11 +2,7 @@ import {
|
||||
IFulfillmentModuleService,
|
||||
IPricingModuleService,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
} from "@medusajs/utils"
|
||||
import { ContainerRegistrationKeys, Modules } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
import {
|
||||
adminHeaders,
|
||||
@@ -28,10 +24,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
fulfillmentModule = appContainer.resolve(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
)
|
||||
pricingModule = appContainer.resolve(ModuleRegistrationName.PRICING)
|
||||
fulfillmentModule = appContainer.resolve(Modules.FULFILLMENT)
|
||||
pricingModule = appContainer.resolve(Modules.PRICING)
|
||||
remoteQuery = appContainer.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { ICurrencyModuleService, IStoreModuleService } from "@medusajs/types"
|
||||
import {
|
||||
ModuleRegistrationName,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { Modules, remoteQueryObjectFromString } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
|
||||
jest.setTimeout(50000)
|
||||
@@ -20,10 +17,8 @@ medusaIntegrationTestRunner({
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
storeModuleService = appContainer.resolve(ModuleRegistrationName.STORE)
|
||||
currencyModuleService = appContainer.resolve(
|
||||
ModuleRegistrationName.CURRENCY
|
||||
)
|
||||
storeModuleService = appContainer.resolve(Modules.STORE)
|
||||
currencyModuleService = appContainer.resolve(Modules.CURRENCY)
|
||||
remoteQuery = appContainer.resolve("remoteQuery")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user