chore(): Allow to register modules through array (#9522)
This commit is contained in:
@@ -144,18 +144,18 @@ medusaIntegrationTestRunner({
|
|||||||
|
|
||||||
await remoteLink.create([
|
await remoteLink.create([
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: product.variants[0].id,
|
variant_id: product.variants[0].id,
|
||||||
},
|
},
|
||||||
Pricing: {
|
[Modules.PRICING]: {
|
||||||
price_set_id: priceSet.id,
|
price_set_id: priceSet.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: product.variants[1].id,
|
variant_id: product.variants[1].id,
|
||||||
},
|
},
|
||||||
Pricing: {
|
[Modules.PRICING]: {
|
||||||
price_set_id: priceSetTwo.id,
|
price_set_id: priceSetTwo.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -232,8 +232,8 @@ medusaIntegrationTestRunner({
|
|||||||
|
|
||||||
await remoteLink.create([
|
await remoteLink.create([
|
||||||
{
|
{
|
||||||
Product: { variant_id: product.variants[0].id },
|
[Modules.PRODUCT]: { variant_id: product.variants[0].id },
|
||||||
Pricing: { price_set_id: priceSet.id },
|
[Modules.PRICING]: { price_set_id: priceSet.id },
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -1080,10 +1080,10 @@ medusaIntegrationTestRunner({
|
|||||||
|
|
||||||
await remoteLink.create([
|
await remoteLink.create([
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: productWithDefaultTax.variants[0].id,
|
variant_id: productWithDefaultTax.variants[0].id,
|
||||||
},
|
},
|
||||||
Pricing: { price_set_id: priceSetDefaultTax.id },
|
[Modules.PRICING]: { price_set_id: priceSetDefaultTax.id },
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -1212,10 +1212,10 @@ medusaIntegrationTestRunner({
|
|||||||
|
|
||||||
await remoteLink.create([
|
await remoteLink.create([
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: productWithDefaultTax.variants[0].id,
|
variant_id: productWithDefaultTax.variants[0].id,
|
||||||
},
|
},
|
||||||
Pricing: { price_set_id: priceSetDefaultTax.id },
|
[Modules.PRICING]: { price_set_id: priceSetDefaultTax.id },
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -2104,16 +2104,16 @@ medusaIntegrationTestRunner({
|
|||||||
|
|
||||||
await remoteLink.create([
|
await remoteLink.create([
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: productWithSpecialTax.variants[0].id,
|
variant_id: productWithSpecialTax.variants[0].id,
|
||||||
},
|
},
|
||||||
Pricing: { price_set_id: priceSet.id },
|
[Modules.PRICING]: { price_set_id: priceSet.id },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: productWithDefaultTax.variants[0].id,
|
variant_id: productWithDefaultTax.variants[0].id,
|
||||||
},
|
},
|
||||||
Pricing: { price_set_id: priceSetDefaultTax.id },
|
[Modules.PRICING]: { price_set_id: priceSetDefaultTax.id },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[Modules.CART]: { cart_id: cart.id },
|
[Modules.CART]: { cart_id: cart.id },
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ medusaIntegrationTestRunner({
|
|||||||
primaryKeys: ["id", "currency_code", "region_id"],
|
primaryKeys: ["id", "currency_code", "region_id"],
|
||||||
relationships: [
|
relationships: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
entity: "Currency",
|
entity: "Currency",
|
||||||
primaryKey: "code",
|
primaryKey: "code",
|
||||||
foreignKey: "currency_code",
|
foreignKey: "currency_code",
|
||||||
@@ -53,7 +53,7 @@ medusaIntegrationTestRunner({
|
|||||||
deleteCascade: false,
|
deleteCascade: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
entity: "Region",
|
entity: "Region",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
foreignKey: "region_id",
|
foreignKey: "region_id",
|
||||||
@@ -66,7 +66,7 @@ medusaIntegrationTestRunner({
|
|||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
region: {
|
region: {
|
||||||
path: "region_link.region",
|
path: "region_link.region",
|
||||||
@@ -84,7 +84,7 @@ medusaIntegrationTestRunner({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
currency: {
|
currency: {
|
||||||
path: "currency_link.currency",
|
path: "currency_link.currency",
|
||||||
@@ -139,7 +139,7 @@ medusaIntegrationTestRunner({
|
|||||||
primaryKeys: ["id", "product_variant_id", "region_id"],
|
primaryKeys: ["id", "product_variant_id", "region_id"],
|
||||||
relationships: [
|
relationships: [
|
||||||
{
|
{
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
entity: "ProductVariant",
|
entity: "ProductVariant",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
foreignKey: "product_variant_id",
|
foreignKey: "product_variant_id",
|
||||||
@@ -150,7 +150,7 @@ medusaIntegrationTestRunner({
|
|||||||
deleteCascade: false,
|
deleteCascade: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
entity: "Region",
|
entity: "Region",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
foreignKey: "region_id",
|
foreignKey: "region_id",
|
||||||
@@ -163,7 +163,7 @@ medusaIntegrationTestRunner({
|
|||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
{
|
{
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
region: {
|
region: {
|
||||||
path: "region_link.region",
|
path: "region_link.region",
|
||||||
@@ -181,7 +181,7 @@ medusaIntegrationTestRunner({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
product_variant: {
|
product_variant: {
|
||||||
path: "product_variant_link.product_variant",
|
path: "product_variant_link.product_variant",
|
||||||
@@ -241,7 +241,7 @@ medusaIntegrationTestRunner({
|
|||||||
primaryKeys: ["id", "currency_code", "region_id"],
|
primaryKeys: ["id", "currency_code", "region_id"],
|
||||||
relationships: [
|
relationships: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
entity: "Currency",
|
entity: "Currency",
|
||||||
primaryKey: "code",
|
primaryKey: "code",
|
||||||
foreignKey: "currency_code",
|
foreignKey: "currency_code",
|
||||||
@@ -252,7 +252,7 @@ medusaIntegrationTestRunner({
|
|||||||
deleteCascade: true,
|
deleteCascade: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
entity: "Region",
|
entity: "Region",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
foreignKey: "region_id",
|
foreignKey: "region_id",
|
||||||
@@ -265,7 +265,7 @@ medusaIntegrationTestRunner({
|
|||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
region: {
|
region: {
|
||||||
path: "region_link.region",
|
path: "region_link.region",
|
||||||
@@ -283,7 +283,7 @@ medusaIntegrationTestRunner({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
currency: {
|
currency: {
|
||||||
path: "currency_link.currency",
|
path: "currency_link.currency",
|
||||||
@@ -337,7 +337,7 @@ medusaIntegrationTestRunner({
|
|||||||
primaryKeys: ["id", "currency_code", "region_id"],
|
primaryKeys: ["id", "currency_code", "region_id"],
|
||||||
relationships: [
|
relationships: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
entity: "Currency",
|
entity: "Currency",
|
||||||
primaryKey: "code",
|
primaryKey: "code",
|
||||||
foreignKey: "currency_code",
|
foreignKey: "currency_code",
|
||||||
@@ -348,7 +348,7 @@ medusaIntegrationTestRunner({
|
|||||||
deleteCascade: false,
|
deleteCascade: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
entity: "Region",
|
entity: "Region",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
foreignKey: "region_id",
|
foreignKey: "region_id",
|
||||||
@@ -361,7 +361,7 @@ medusaIntegrationTestRunner({
|
|||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
{
|
{
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
regions: {
|
regions: {
|
||||||
path: "region_link.region",
|
path: "region_link.region",
|
||||||
@@ -379,7 +379,7 @@ medusaIntegrationTestRunner({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
fieldAlias: {
|
fieldAlias: {
|
||||||
currency: {
|
currency: {
|
||||||
path: "currency_link.currency",
|
path: "currency_link.currency",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
import { ContainerRegistrationKeys, Modules } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
export const attachInventoryItemToVariantsStepId =
|
export const attachInventoryItemToVariantsStepId =
|
||||||
"attach-inventory-items-to-variants-step"
|
"attach-inventory-items-to-variants-step"
|
||||||
@@ -21,10 +21,10 @@ export const attachInventoryItemToVariants = createStep(
|
|||||||
const linkDefinitions = input
|
const linkDefinitions = input
|
||||||
.filter(({ tag }) => !!tag)
|
.filter(({ tag }) => !!tag)
|
||||||
.map(({ inventoryItemId, tag }) => ({
|
.map(({ inventoryItemId, tag }) => ({
|
||||||
Product: {
|
[Modules.PRODUCT]: {
|
||||||
variant_id: tag!,
|
variant_id: tag!,
|
||||||
},
|
},
|
||||||
Inventory: {
|
[Modules.INVENTORY]: {
|
||||||
inventory_item_id: inventoryItemId,
|
inventory_item_id: inventoryItemId,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,39 +1,12 @@
|
|||||||
import { ModuleDefinition } from "@medusajs/types"
|
import { ModuleDefinition } from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
|
MODULE_PACKAGE_NAMES,
|
||||||
Modules,
|
Modules,
|
||||||
upperCaseFirst,
|
upperCaseFirst,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { MODULE_RESOURCE_TYPE, MODULE_SCOPE } from "./types"
|
import { MODULE_RESOURCE_TYPE, MODULE_SCOPE } from "./types"
|
||||||
|
|
||||||
export const MODULE_PACKAGE_NAMES = {
|
|
||||||
[Modules.AUTH]: "@medusajs/medusa/auth",
|
|
||||||
[Modules.CACHE]: "@medusajs/medusa/cache-inmemory",
|
|
||||||
[Modules.CART]: "@medusajs/medusa/cart",
|
|
||||||
[Modules.CUSTOMER]: "@medusajs/medusa/customer",
|
|
||||||
[Modules.EVENT_BUS]: "@medusajs/medusa/event-bus-local",
|
|
||||||
[Modules.INVENTORY]: "@medusajs/medusa/inventory-next", // TODO: To be replaced when current `@medusajs/inventory` is deprecated
|
|
||||||
[Modules.LINK]: "@medusajs/medusa/link-modules",
|
|
||||||
[Modules.PAYMENT]: "@medusajs/medusa/payment",
|
|
||||||
[Modules.PRICING]: "@medusajs/medusa/pricing",
|
|
||||||
[Modules.PRODUCT]: "@medusajs/medusa/product",
|
|
||||||
[Modules.PROMOTION]: "@medusajs/medusa/promotion",
|
|
||||||
[Modules.SALES_CHANNEL]: "@medusajs/medusa/sales-channel",
|
|
||||||
[Modules.FULFILLMENT]: "@medusajs/medusa/fulfillment",
|
|
||||||
[Modules.STOCK_LOCATION]: "@medusajs/medusa/stock-location-next", // TODO: To be replaced when current `@medusajs/stock-location` is deprecated
|
|
||||||
[Modules.TAX]: "@medusajs/medusa/tax",
|
|
||||||
[Modules.USER]: "@medusajs/medusa/user",
|
|
||||||
[Modules.WORKFLOW_ENGINE]: "@medusajs/medusa/workflow-engine-inmemory",
|
|
||||||
[Modules.REGION]: "@medusajs/medusa/region",
|
|
||||||
[Modules.ORDER]: "@medusajs/medusa/order",
|
|
||||||
[Modules.API_KEY]: "@medusajs/medusa/api-key",
|
|
||||||
[Modules.STORE]: "@medusajs/medusa/store",
|
|
||||||
[Modules.CURRENCY]: "@medusajs/medusa/currency",
|
|
||||||
[Modules.FILE]: "@medusajs/medusa/file",
|
|
||||||
[Modules.NOTIFICATION]: "@medusajs/medusa/notification",
|
|
||||||
[Modules.INDEX]: "@medusajs/medusa/index-module",
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ModulesDefinition: {
|
export const ModulesDefinition: {
|
||||||
[key: string]: ModuleDefinition
|
[key: string]: ModuleDefinition
|
||||||
} = {
|
} = {
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ import {
|
|||||||
isObject,
|
isObject,
|
||||||
isString,
|
isString,
|
||||||
MedusaError,
|
MedusaError,
|
||||||
|
MODULE_PACKAGE_NAMES,
|
||||||
Modules,
|
Modules,
|
||||||
ModulesSdkUtils,
|
ModulesSdkUtils,
|
||||||
promiseAll,
|
promiseAll,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { asValue } from "awilix"
|
import { asValue } from "awilix"
|
||||||
import { MODULE_PACKAGE_NAMES } from "./definitions"
|
|
||||||
import {
|
import {
|
||||||
MedusaModule,
|
MedusaModule,
|
||||||
MigrationOptions,
|
MigrationOptions,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { Module } from "../../../../modules-sdk"
|
||||||
|
|
||||||
|
export default Module("GithubModuleService", {
|
||||||
|
service: class GithubModuleService {},
|
||||||
|
})
|
||||||
@@ -12,8 +12,10 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
"featureFlags": {},
|
"featureFlags": {},
|
||||||
"modules": {
|
"modules": {
|
||||||
"ApiKey": true,
|
"api_key": {
|
||||||
"Auth": {
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -22,14 +24,24 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/auth",
|
"resolve": "@medusajs/medusa/auth",
|
||||||
},
|
},
|
||||||
"Cache": true,
|
"cache": {
|
||||||
"Cart": true,
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
"Currency": true,
|
},
|
||||||
"Customer": true,
|
"cart": {
|
||||||
"EventBus": true,
|
"resolve": "@medusajs/medusa/cart",
|
||||||
"File": {
|
},
|
||||||
|
"currency": {
|
||||||
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -38,9 +50,9 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/file",
|
"resolve": "@medusajs/medusa/file",
|
||||||
},
|
},
|
||||||
"Fulfillment": {
|
"fulfillment": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -49,10 +61,12 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/fulfillment",
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
},
|
},
|
||||||
"Inventory": true,
|
"inventory": {
|
||||||
"Notification": {
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -67,25 +81,47 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/notification",
|
"resolve": "@medusajs/medusa/notification",
|
||||||
},
|
},
|
||||||
"Order": true,
|
"order": {
|
||||||
"Payment": true,
|
"resolve": "@medusajs/medusa/order",
|
||||||
"Pricing": true,
|
},
|
||||||
"Product": true,
|
"payment": {
|
||||||
"Promotion": true,
|
"resolve": "@medusajs/medusa/payment",
|
||||||
"Region": true,
|
},
|
||||||
"SalesChannel": true,
|
"pricing": {
|
||||||
"StockLocation": true,
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
"Store": true,
|
},
|
||||||
"Tax": true,
|
"product": {
|
||||||
"User": {
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
"options": {
|
"options": {
|
||||||
"jwt_secret": "supersecret",
|
"jwt_secret": "supersecret",
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/user",
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
},
|
},
|
||||||
"Workflows": true,
|
|
||||||
},
|
},
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
"projectConfig": {
|
"projectConfig": {
|
||||||
@@ -120,8 +156,13 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
"featureFlags": {},
|
"featureFlags": {},
|
||||||
"modules": {
|
"modules": {
|
||||||
"ApiKey": true,
|
"GithubModuleService": {
|
||||||
"Auth": {
|
"resolve": "./modules/github",
|
||||||
|
},
|
||||||
|
"api_key": {
|
||||||
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -130,14 +171,24 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/auth",
|
"resolve": "@medusajs/medusa/auth",
|
||||||
},
|
},
|
||||||
"Cache": true,
|
"cache": {
|
||||||
"Cart": true,
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
"Currency": true,
|
},
|
||||||
"Customer": true,
|
"cart": {
|
||||||
"EventBus": true,
|
"resolve": "@medusajs/medusa/cart",
|
||||||
"File": {
|
},
|
||||||
|
"currency": {
|
||||||
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -146,9 +197,9 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/file",
|
"resolve": "@medusajs/medusa/file",
|
||||||
},
|
},
|
||||||
"Fulfillment": {
|
"fulfillment": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -157,13 +208,12 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/fulfillment",
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
},
|
},
|
||||||
"GithubModuleService": {
|
"inventory": {
|
||||||
"resolve": "./modules/github",
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
},
|
},
|
||||||
"Inventory": true,
|
"notification": {
|
||||||
"Notification": {
|
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -178,25 +228,358 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/notification",
|
"resolve": "@medusajs/medusa/notification",
|
||||||
},
|
},
|
||||||
"Order": true,
|
"order": {
|
||||||
"Payment": true,
|
"resolve": "@medusajs/medusa/order",
|
||||||
"Pricing": true,
|
},
|
||||||
"Product": true,
|
"payment": {
|
||||||
"Promotion": true,
|
"resolve": "@medusajs/medusa/payment",
|
||||||
"Region": true,
|
},
|
||||||
"SalesChannel": true,
|
"pricing": {
|
||||||
"StockLocation": true,
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
"Store": true,
|
},
|
||||||
"Tax": true,
|
"product": {
|
||||||
"User": {
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
"options": {
|
"options": {
|
||||||
"jwt_secret": "supersecret",
|
"jwt_secret": "supersecret",
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/user",
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"plugins": [],
|
||||||
|
"projectConfig": {
|
||||||
|
"databaseUrl": "postgres://localhost/medusa-starter-default",
|
||||||
|
"http": {
|
||||||
|
"adminCors": "http://localhost:7000,http://localhost:7001,http://localhost:5173",
|
||||||
|
"authCors": "http://localhost:7000,http://localhost:7001,http://localhost:5173",
|
||||||
|
"cookieSecret": "supersecret",
|
||||||
|
"jwtSecret": "supersecret",
|
||||||
|
"storeCors": "http://localhost:8000",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should merge custom modules when an array is provided", function () {
|
||||||
|
expect(
|
||||||
|
defineConfig({
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
resolve: require.resolve("../__fixtures__/define-config/github"),
|
||||||
|
options: {
|
||||||
|
apiKey: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
).toMatchInlineSnapshot(`
|
||||||
|
{
|
||||||
|
"admin": {
|
||||||
|
"backendUrl": "http://localhost:9000",
|
||||||
|
"outDir": ".medusa/admin",
|
||||||
|
"path": "/app",
|
||||||
|
},
|
||||||
|
"featureFlags": {},
|
||||||
|
"modules": {
|
||||||
|
"GithubModuleService": {
|
||||||
|
"options": {
|
||||||
|
"apiKey": "test",
|
||||||
|
},
|
||||||
|
"resolve": "${require.resolve(
|
||||||
|
"../__fixtures__/define-config/github"
|
||||||
|
)}",
|
||||||
|
},
|
||||||
|
"api_key": {
|
||||||
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "emailpass",
|
||||||
|
"resolve": "@medusajs/auth-emailpass",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/auth",
|
||||||
|
},
|
||||||
|
"cache": {
|
||||||
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
|
},
|
||||||
|
"cart": {
|
||||||
|
"resolve": "@medusajs/medusa/cart",
|
||||||
|
},
|
||||||
|
"currency": {
|
||||||
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "local",
|
||||||
|
"resolve": "@medusajs/file-local-next",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/file",
|
||||||
|
},
|
||||||
|
"fulfillment": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "manual",
|
||||||
|
"resolve": "@medusajs/fulfillment-manual",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
|
},
|
||||||
|
"inventory": {
|
||||||
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "local",
|
||||||
|
"options": {
|
||||||
|
"channels": [
|
||||||
|
"feed",
|
||||||
|
],
|
||||||
|
"name": "Local Notification Provider",
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/notification-local",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/notification",
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"resolve": "@medusajs/medusa/order",
|
||||||
|
},
|
||||||
|
"payment": {
|
||||||
|
"resolve": "@medusajs/medusa/payment",
|
||||||
|
},
|
||||||
|
"pricing": {
|
||||||
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
|
},
|
||||||
|
"product": {
|
||||||
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"options": {
|
||||||
|
"jwt_secret": "supersecret",
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"plugins": [],
|
||||||
|
"projectConfig": {
|
||||||
|
"databaseUrl": "postgres://localhost/medusa-starter-default",
|
||||||
|
"http": {
|
||||||
|
"adminCors": "http://localhost:7000,http://localhost:7001,http://localhost:5173",
|
||||||
|
"authCors": "http://localhost:7000,http://localhost:7001,http://localhost:5173",
|
||||||
|
"cookieSecret": "supersecret",
|
||||||
|
"jwtSecret": "supersecret",
|
||||||
|
"storeCors": "http://localhost:8000",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should merge custom modules when an array is provided with a key to override the module registration name", function () {
|
||||||
|
expect(
|
||||||
|
defineConfig({
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
key: "GithubModuleServiceOverride",
|
||||||
|
resolve: require.resolve("../__fixtures__/define-config/github"),
|
||||||
|
options: {
|
||||||
|
apiKey: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
).toMatchInlineSnapshot(`
|
||||||
|
{
|
||||||
|
"admin": {
|
||||||
|
"backendUrl": "http://localhost:9000",
|
||||||
|
"outDir": ".medusa/admin",
|
||||||
|
"path": "/app",
|
||||||
|
},
|
||||||
|
"featureFlags": {},
|
||||||
|
"modules": {
|
||||||
|
"GithubModuleServiceOverride": {
|
||||||
|
"options": {
|
||||||
|
"apiKey": "test",
|
||||||
|
},
|
||||||
|
"resolve": "${require.resolve(
|
||||||
|
"../__fixtures__/define-config/github"
|
||||||
|
)}",
|
||||||
|
},
|
||||||
|
"api_key": {
|
||||||
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "emailpass",
|
||||||
|
"resolve": "@medusajs/auth-emailpass",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/auth",
|
||||||
|
},
|
||||||
|
"cache": {
|
||||||
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
|
},
|
||||||
|
"cart": {
|
||||||
|
"resolve": "@medusajs/medusa/cart",
|
||||||
|
},
|
||||||
|
"currency": {
|
||||||
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "local",
|
||||||
|
"resolve": "@medusajs/file-local-next",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/file",
|
||||||
|
},
|
||||||
|
"fulfillment": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "manual",
|
||||||
|
"resolve": "@medusajs/fulfillment-manual",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
|
},
|
||||||
|
"inventory": {
|
||||||
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
|
"options": {
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"id": "local",
|
||||||
|
"options": {
|
||||||
|
"channels": [
|
||||||
|
"feed",
|
||||||
|
],
|
||||||
|
"name": "Local Notification Provider",
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/notification-local",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/notification",
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"resolve": "@medusajs/medusa/order",
|
||||||
|
},
|
||||||
|
"payment": {
|
||||||
|
"resolve": "@medusajs/medusa/payment",
|
||||||
|
},
|
||||||
|
"pricing": {
|
||||||
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
|
},
|
||||||
|
"product": {
|
||||||
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"options": {
|
||||||
|
"jwt_secret": "supersecret",
|
||||||
|
},
|
||||||
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
},
|
},
|
||||||
"Workflows": true,
|
|
||||||
},
|
},
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
"projectConfig": {
|
"projectConfig": {
|
||||||
@@ -231,8 +614,10 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
"featureFlags": {},
|
"featureFlags": {},
|
||||||
"modules": {
|
"modules": {
|
||||||
"ApiKey": true,
|
"api_key": {
|
||||||
"Auth": {
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -241,14 +626,24 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/auth",
|
"resolve": "@medusajs/medusa/auth",
|
||||||
},
|
},
|
||||||
"Cache": true,
|
"cache": {
|
||||||
"Cart": true,
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
"Currency": true,
|
},
|
||||||
"Customer": true,
|
"cart": {
|
||||||
"EventBus": true,
|
"resolve": "@medusajs/medusa/cart",
|
||||||
"File": {
|
},
|
||||||
|
"currency": {
|
||||||
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -257,9 +652,9 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/file",
|
"resolve": "@medusajs/medusa/file",
|
||||||
},
|
},
|
||||||
"Fulfillment": {
|
"fulfillment": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -268,10 +663,12 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/fulfillment",
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
},
|
},
|
||||||
"Inventory": true,
|
"inventory": {
|
||||||
"Notification": {
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -286,25 +683,47 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/notification",
|
"resolve": "@medusajs/medusa/notification",
|
||||||
},
|
},
|
||||||
"Order": true,
|
"order": {
|
||||||
"Payment": true,
|
"resolve": "@medusajs/medusa/order",
|
||||||
"Pricing": true,
|
},
|
||||||
"Product": true,
|
"payment": {
|
||||||
"Promotion": true,
|
"resolve": "@medusajs/medusa/payment",
|
||||||
"Region": true,
|
},
|
||||||
"SalesChannel": true,
|
"pricing": {
|
||||||
"StockLocation": true,
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
"Store": true,
|
},
|
||||||
"Tax": true,
|
"product": {
|
||||||
"User": {
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
"options": {
|
"options": {
|
||||||
"jwt_secret": "supersecret",
|
"jwt_secret": "supersecret",
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/user",
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
},
|
},
|
||||||
"Workflows": true,
|
|
||||||
},
|
},
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
"projectConfig": {
|
"projectConfig": {
|
||||||
@@ -342,8 +761,10 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
"featureFlags": {},
|
"featureFlags": {},
|
||||||
"modules": {
|
"modules": {
|
||||||
"ApiKey": true,
|
"api_key": {
|
||||||
"Auth": {
|
"resolve": "@medusajs/medusa/api-key",
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -352,13 +773,21 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/auth",
|
"resolve": "@medusajs/medusa/auth",
|
||||||
},
|
},
|
||||||
"Cache": true,
|
"cache": {
|
||||||
"Currency": true,
|
"resolve": "@medusajs/medusa/cache-inmemory",
|
||||||
"Customer": true,
|
},
|
||||||
"EventBus": true,
|
"currency": {
|
||||||
"File": {
|
"resolve": "@medusajs/medusa/currency",
|
||||||
|
},
|
||||||
|
"customer": {
|
||||||
|
"resolve": "@medusajs/medusa/customer",
|
||||||
|
},
|
||||||
|
"event_bus": {
|
||||||
|
"resolve": "@medusajs/medusa/event-bus-local",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -367,9 +796,9 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/file",
|
"resolve": "@medusajs/medusa/file",
|
||||||
},
|
},
|
||||||
"Fulfillment": {
|
"fulfillment": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -378,10 +807,12 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/fulfillment",
|
"resolve": "@medusajs/medusa/fulfillment",
|
||||||
},
|
},
|
||||||
"Inventory": true,
|
"inventory": {
|
||||||
"Notification": {
|
"resolve": "@medusajs/medusa/inventory-next",
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
"options": {
|
"options": {
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
@@ -396,25 +827,47 @@ describe("defineConfig", function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/notification",
|
"resolve": "@medusajs/medusa/notification",
|
||||||
},
|
},
|
||||||
"Order": true,
|
"order": {
|
||||||
"Payment": true,
|
"resolve": "@medusajs/medusa/order",
|
||||||
"Pricing": true,
|
},
|
||||||
"Product": true,
|
"payment": {
|
||||||
"Promotion": true,
|
"resolve": "@medusajs/medusa/payment",
|
||||||
"Region": true,
|
},
|
||||||
"SalesChannel": true,
|
"pricing": {
|
||||||
"StockLocation": true,
|
"resolve": "@medusajs/medusa/pricing",
|
||||||
"Store": true,
|
},
|
||||||
"Tax": true,
|
"product": {
|
||||||
"User": {
|
"resolve": "@medusajs/medusa/product",
|
||||||
|
},
|
||||||
|
"promotion": {
|
||||||
|
"resolve": "@medusajs/medusa/promotion",
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"resolve": "@medusajs/medusa/region",
|
||||||
|
},
|
||||||
|
"sales_channel": {
|
||||||
|
"resolve": "@medusajs/medusa/sales-channel",
|
||||||
|
},
|
||||||
|
"stock_location": {
|
||||||
|
"resolve": "@medusajs/medusa/stock-location-next",
|
||||||
|
},
|
||||||
|
"store": {
|
||||||
|
"resolve": "@medusajs/medusa/store",
|
||||||
|
},
|
||||||
|
"tax": {
|
||||||
|
"resolve": "@medusajs/medusa/tax",
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
"options": {
|
"options": {
|
||||||
"jwt_secret": "supersecret",
|
"jwt_secret": "supersecret",
|
||||||
},
|
},
|
||||||
"resolve": "@medusajs/user",
|
"resolve": "@medusajs/medusa/user",
|
||||||
|
},
|
||||||
|
"workflows": {
|
||||||
|
"resolve": "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
},
|
},
|
||||||
"Workflows": true,
|
|
||||||
},
|
},
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
"projectConfig": {
|
"projectConfig": {
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
import { ConfigModule } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "../modules-sdk/definition"
|
ConfigModule,
|
||||||
|
ExternalModuleDeclaration,
|
||||||
|
InternalModuleDeclaration,
|
||||||
|
} from "@medusajs/types"
|
||||||
|
import {
|
||||||
|
MODULE_PACKAGE_NAMES,
|
||||||
|
Modules,
|
||||||
|
REVERSED_MODULE_PACKAGE_NAMES,
|
||||||
|
} from "../modules-sdk"
|
||||||
|
import { isString } from "./is-string"
|
||||||
|
import { resolveExports } from "./resolve-exports"
|
||||||
|
import { isObject } from "./is-object"
|
||||||
|
import { normalizeImportPathWithSource } from "./normalize-import-path-with-source"
|
||||||
|
|
||||||
const DEFAULT_SECRET = "supersecret"
|
const DEFAULT_SECRET = "supersecret"
|
||||||
const DEFAULT_ADMIN_URL = "http://localhost:9000"
|
const DEFAULT_ADMIN_URL = "http://localhost:9000"
|
||||||
@@ -8,6 +20,42 @@ const DEFAULT_DATABASE_URL = "postgres://localhost/medusa-starter-default"
|
|||||||
const DEFAULT_ADMIN_CORS =
|
const DEFAULT_ADMIN_CORS =
|
||||||
"http://localhost:7000,http://localhost:7001,http://localhost:5173"
|
"http://localhost:7000,http://localhost:7001,http://localhost:5173"
|
||||||
|
|
||||||
|
type InternalModuleDeclarationOverride = InternalModuleDeclaration & {
|
||||||
|
/**
|
||||||
|
* Optional key to be used to identify the module, if not provided, it will be inferred from the module joiner config service name.
|
||||||
|
*/
|
||||||
|
key?: string
|
||||||
|
/**
|
||||||
|
* By default, modules are enabled, if provided as true, this will disable the module entirely.
|
||||||
|
*/
|
||||||
|
disable?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExternalModuleDeclarationOverride = ExternalModuleDeclaration & {
|
||||||
|
/**
|
||||||
|
* key to be used to identify the module, if not provided, it will be inferred from the module joiner config service name.
|
||||||
|
*/
|
||||||
|
key: string
|
||||||
|
/**
|
||||||
|
* By default, modules are enabled, if provided as true, this will disable the module entirely.
|
||||||
|
*/
|
||||||
|
disable?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = Partial<
|
||||||
|
Omit<ConfigModule, "admin" | "modules"> & {
|
||||||
|
admin: Partial<ConfigModule["admin"]>
|
||||||
|
modules:
|
||||||
|
| Partial<
|
||||||
|
InternalModuleDeclarationOverride | ExternalModuleDeclarationOverride
|
||||||
|
>[]
|
||||||
|
/**
|
||||||
|
* @deprecated use the array instead
|
||||||
|
*/
|
||||||
|
| ConfigModule["modules"]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "defineConfig" helper can be used to define the configuration
|
* The "defineConfig" helper can be used to define the configuration
|
||||||
* of a medusa application.
|
* of a medusa application.
|
||||||
@@ -16,13 +64,7 @@ const DEFAULT_ADMIN_CORS =
|
|||||||
* make an application work seamlessly, but still provide you the ability
|
* make an application work seamlessly, but still provide you the ability
|
||||||
* to override configuration as needed.
|
* to override configuration as needed.
|
||||||
*/
|
*/
|
||||||
export function defineConfig(
|
export function defineConfig(config: Config = {}): ConfigModule {
|
||||||
config: Partial<
|
|
||||||
Omit<ConfigModule, "admin"> & {
|
|
||||||
admin: Partial<ConfigModule["admin"]>
|
|
||||||
}
|
|
||||||
> = {}
|
|
||||||
): ConfigModule {
|
|
||||||
const { http, ...restOfProjectConfig } = config.projectConfig || {}
|
const { http, ...restOfProjectConfig } = config.projectConfig || {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,32 +103,54 @@ export function defineConfig(
|
|||||||
...config.featureFlags,
|
...config.featureFlags,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modules = resolveModules(config.modules)
|
||||||
|
|
||||||
|
return {
|
||||||
|
projectConfig,
|
||||||
|
featureFlags,
|
||||||
|
plugins: config.plugins || [],
|
||||||
|
admin,
|
||||||
|
modules: modules,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The user API allow to use array of modules configuration. This method manage the loading of the user modules
|
||||||
|
* along side the default modules and re map them to an object.
|
||||||
|
*
|
||||||
|
* @param configModules
|
||||||
|
*/
|
||||||
|
function resolveModules(
|
||||||
|
configModules: Config["modules"]
|
||||||
|
): ConfigModule["modules"] {
|
||||||
/**
|
/**
|
||||||
* The default set of modules to always use. The end user can swap
|
* The default set of modules to always use. The end user can swap
|
||||||
* the modules by providing an alternate implementation via their
|
* the modules by providing an alternate implementation via their
|
||||||
* config. But they can never remove a module from this list.
|
* config. But they can never remove a module from this list.
|
||||||
*/
|
*/
|
||||||
const modules: ConfigModule["modules"] = {
|
const modules: Config["modules"] = [
|
||||||
[Modules.CACHE]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.CACHE] },
|
||||||
[Modules.EVENT_BUS]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.EVENT_BUS] },
|
||||||
[Modules.WORKFLOW_ENGINE]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.WORKFLOW_ENGINE] },
|
||||||
[Modules.STOCK_LOCATION]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.STOCK_LOCATION] },
|
||||||
[Modules.INVENTORY]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.INVENTORY] },
|
||||||
[Modules.PRODUCT]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.PRODUCT] },
|
||||||
[Modules.PRICING]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.PRICING] },
|
||||||
[Modules.PROMOTION]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.PROMOTION] },
|
||||||
[Modules.CUSTOMER]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.CUSTOMER] },
|
||||||
[Modules.SALES_CHANNEL]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.SALES_CHANNEL] },
|
||||||
[Modules.CART]: true,
|
|
||||||
[Modules.REGION]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.CART] },
|
||||||
[Modules.API_KEY]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.REGION] },
|
||||||
[Modules.STORE]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.API_KEY] },
|
||||||
[Modules.TAX]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.STORE] },
|
||||||
[Modules.CURRENCY]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.TAX] },
|
||||||
[Modules.PAYMENT]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.CURRENCY] },
|
||||||
[Modules.ORDER]: true,
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.PAYMENT] },
|
||||||
[Modules.AUTH]: {
|
{ resolve: MODULE_PACKAGE_NAMES[Modules.ORDER] },
|
||||||
resolve: "@medusajs/auth",
|
|
||||||
|
{
|
||||||
|
resolve: MODULE_PACKAGE_NAMES[Modules.AUTH],
|
||||||
options: {
|
options: {
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
@@ -96,15 +160,14 @@ export function defineConfig(
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
[Modules.USER]: {
|
resolve: MODULE_PACKAGE_NAMES[Modules.USER],
|
||||||
resolve: "@medusajs/user",
|
|
||||||
options: {
|
options: {
|
||||||
jwt_secret: process.env.JWT_SECRET ?? DEFAULT_SECRET,
|
jwt_secret: process.env.JWT_SECRET ?? DEFAULT_SECRET,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[Modules.FILE]: {
|
{
|
||||||
resolve: "@medusajs/file",
|
resolve: MODULE_PACKAGE_NAMES[Modules.FILE],
|
||||||
options: {
|
options: {
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
@@ -114,8 +177,8 @@ export function defineConfig(
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[Modules.FULFILLMENT]: {
|
{
|
||||||
resolve: "@medusajs/fulfillment",
|
resolve: MODULE_PACKAGE_NAMES[Modules.FULFILLMENT],
|
||||||
options: {
|
options: {
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
@@ -125,8 +188,8 @@ export function defineConfig(
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[Modules.NOTIFICATION]: {
|
{
|
||||||
resolve: "@medusajs/notification",
|
resolve: MODULE_PACKAGE_NAMES[Modules.NOTIFICATION],
|
||||||
options: {
|
options: {
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
@@ -140,21 +203,95 @@ export function defineConfig(
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...config.modules,
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backward compatibility for the old way of defining modules (object vs array)
|
||||||
|
*/
|
||||||
|
if (configModules) {
|
||||||
|
if (isObject(configModules)) {
|
||||||
|
const modules_ = (configModules ??
|
||||||
|
{}) as unknown as Required<ConfigModule>["modules"]
|
||||||
|
|
||||||
|
Object.entries(modules_).forEach(([key, moduleConfig]) => {
|
||||||
|
modules.push({
|
||||||
|
key,
|
||||||
|
...(isObject(moduleConfig)
|
||||||
|
? moduleConfig
|
||||||
|
: { disable: !moduleConfig }),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else if (Array.isArray(configModules)) {
|
||||||
|
const modules_ = (configModules ?? []) as InternalModuleDeclaration[]
|
||||||
|
modules.push(...modules_)
|
||||||
|
} else {
|
||||||
|
throw new Error(
|
||||||
|
"Invalid modules configuration. Should be an array or object."
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const remappedModules = modules.reduce((acc, moduleConfig) => {
|
||||||
|
if (moduleConfig.scope === "external" && !moduleConfig.key) {
|
||||||
|
throw new Error(
|
||||||
|
"External modules configuration must have a 'key'. Please provide a key for the module."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("disable" in moduleConfig && "key" in moduleConfig) {
|
||||||
|
acc[moduleConfig.key!] = moduleConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: handle external modules later
|
||||||
|
let serviceName: string =
|
||||||
|
"key" in moduleConfig && moduleConfig.key ? moduleConfig.key : ""
|
||||||
|
delete moduleConfig.key
|
||||||
|
|
||||||
|
if (!serviceName && "resolve" in moduleConfig) {
|
||||||
|
if (
|
||||||
|
isString(moduleConfig.resolve!) &&
|
||||||
|
REVERSED_MODULE_PACKAGE_NAMES[moduleConfig.resolve!]
|
||||||
|
) {
|
||||||
|
serviceName = REVERSED_MODULE_PACKAGE_NAMES[moduleConfig.resolve!]
|
||||||
|
acc[serviceName] = moduleConfig
|
||||||
|
return acc
|
||||||
|
}
|
||||||
|
|
||||||
|
let resolution = isString(moduleConfig.resolve!)
|
||||||
|
? normalizeImportPathWithSource(moduleConfig.resolve as string)
|
||||||
|
: moduleConfig.resolve
|
||||||
|
|
||||||
|
const moduleExport = isString(resolution)
|
||||||
|
? require(resolution)
|
||||||
|
: resolution
|
||||||
|
|
||||||
|
const defaultExport = resolveExports(moduleExport).default
|
||||||
|
|
||||||
|
const joinerConfig =
|
||||||
|
typeof defaultExport.service.prototype.__joinerConfig === "function"
|
||||||
|
? defaultExport.service.prototype.__joinerConfig() ?? {}
|
||||||
|
: defaultExport.service.prototype.__joinerConfig ?? {}
|
||||||
|
|
||||||
|
serviceName = joinerConfig.serviceName
|
||||||
|
|
||||||
|
if (!serviceName) {
|
||||||
|
throw new Error(
|
||||||
|
`Module ${moduleConfig.resolve} doesn't have a serviceName. Please provide a 'key' for the module or check the service joiner config.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
acc[serviceName] = moduleConfig
|
||||||
|
|
||||||
|
return acc
|
||||||
|
}, {})
|
||||||
|
|
||||||
// Remove any modules set to false
|
// Remove any modules set to false
|
||||||
Object.keys(modules).forEach((key) => {
|
Object.keys(remappedModules).forEach((key) => {
|
||||||
if (modules[key] === false) {
|
if (remappedModules[key].disable) {
|
||||||
delete modules[key]
|
delete remappedModules[key]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return remappedModules as ConfigModule["modules"]
|
||||||
projectConfig,
|
|
||||||
featureFlags,
|
|
||||||
plugins: config.plugins || [],
|
|
||||||
admin,
|
|
||||||
modules,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ describe("MessageAggregator", function () {
|
|||||||
aggregator.save({
|
aggregator.save({
|
||||||
name: "ProductVariant.created",
|
name: "ProductVariant.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -20,7 +20,7 @@ describe("MessageAggregator", function () {
|
|||||||
aggregator.save({
|
aggregator.save({
|
||||||
name: "Product.created",
|
name: "Product.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "Product",
|
object: "Product",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -30,7 +30,7 @@ describe("MessageAggregator", function () {
|
|||||||
aggregator.save({
|
aggregator.save({
|
||||||
name: "ProductVariant.created",
|
name: "ProductVariant.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -40,7 +40,7 @@ describe("MessageAggregator", function () {
|
|||||||
aggregator.save({
|
aggregator.save({
|
||||||
name: "ProductType.detached",
|
name: "ProductType.detached",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "detached",
|
action: "detached",
|
||||||
object: "ProductType",
|
object: "ProductType",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -50,7 +50,7 @@ describe("MessageAggregator", function () {
|
|||||||
aggregator.save({
|
aggregator.save({
|
||||||
name: "ProductVariant.updated",
|
name: "ProductVariant.updated",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "updated",
|
action: "updated",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -76,7 +76,7 @@ describe("MessageAggregator", function () {
|
|||||||
{
|
{
|
||||||
name: "ProductType.detached",
|
name: "ProductType.detached",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "detached",
|
action: "detached",
|
||||||
object: "ProductType",
|
object: "ProductType",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -89,7 +89,7 @@ describe("MessageAggregator", function () {
|
|||||||
{
|
{
|
||||||
name: "ProductVariant.updated",
|
name: "ProductVariant.updated",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "updated",
|
action: "updated",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -102,7 +102,7 @@ describe("MessageAggregator", function () {
|
|||||||
{
|
{
|
||||||
name: "ProductVariant.created",
|
name: "ProductVariant.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -112,7 +112,7 @@ describe("MessageAggregator", function () {
|
|||||||
{
|
{
|
||||||
name: "ProductVariant.created",
|
name: "ProductVariant.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "ProductVariant",
|
object: "ProductVariant",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
@@ -125,7 +125,7 @@ describe("MessageAggregator", function () {
|
|||||||
{
|
{
|
||||||
name: "Product.created",
|
name: "Product.created",
|
||||||
metadata: {
|
metadata: {
|
||||||
source: "Product",
|
source: "product",
|
||||||
action: "created",
|
action: "created",
|
||||||
object: "Product",
|
object: "Product",
|
||||||
eventGroupId: "1",
|
eventGroupId: "1",
|
||||||
|
|||||||
@@ -1,31 +1,66 @@
|
|||||||
export const Modules = {
|
export const Modules = {
|
||||||
AUTH: "Auth",
|
AUTH: "auth",
|
||||||
CACHE: "Cache",
|
CACHE: "cache",
|
||||||
CART: "Cart",
|
CART: "cart",
|
||||||
CUSTOMER: "Customer",
|
CUSTOMER: "customer",
|
||||||
EVENT_BUS: "EventBus",
|
EVENT_BUS: "event_bus",
|
||||||
INVENTORY: "Inventory",
|
INVENTORY: "inventory",
|
||||||
LINK: "LinkModules",
|
LINK: "link_modules",
|
||||||
PAYMENT: "Payment",
|
PAYMENT: "payment",
|
||||||
PRICING: "Pricing",
|
PRICING: "pricing",
|
||||||
PRODUCT: "Product",
|
PRODUCT: "product",
|
||||||
PROMOTION: "Promotion",
|
PROMOTION: "promotion",
|
||||||
SALES_CHANNEL: "SalesChannel",
|
SALES_CHANNEL: "sales_channel",
|
||||||
TAX: "Tax",
|
TAX: "tax",
|
||||||
FULFILLMENT: "Fulfillment",
|
FULFILLMENT: "fulfillment",
|
||||||
STOCK_LOCATION: "StockLocation",
|
STOCK_LOCATION: "stock_location",
|
||||||
USER: "User",
|
USER: "user",
|
||||||
WORKFLOW_ENGINE: "Workflows",
|
WORKFLOW_ENGINE: "workflows",
|
||||||
REGION: "Region",
|
REGION: "region",
|
||||||
ORDER: "Order",
|
ORDER: "order",
|
||||||
API_KEY: "ApiKey",
|
API_KEY: "api_key",
|
||||||
STORE: "Store",
|
STORE: "store",
|
||||||
CURRENCY: "Currency",
|
CURRENCY: "currency",
|
||||||
FILE: "File",
|
FILE: "file",
|
||||||
NOTIFICATION: "Notification",
|
NOTIFICATION: "notification",
|
||||||
INDEX: "Index",
|
INDEX: "index",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
export const MODULE_PACKAGE_NAMES = {
|
||||||
|
[Modules.AUTH]: "@medusajs/medusa/auth",
|
||||||
|
[Modules.CACHE]: "@medusajs/medusa/cache-inmemory",
|
||||||
|
[Modules.CART]: "@medusajs/medusa/cart",
|
||||||
|
[Modules.CUSTOMER]: "@medusajs/medusa/customer",
|
||||||
|
[Modules.EVENT_BUS]: "@medusajs/medusa/event-bus-local",
|
||||||
|
[Modules.INVENTORY]: "@medusajs/medusa/inventory-next", // TODO: To be replaced when current `@medusajs/inventory` is deprecated
|
||||||
|
[Modules.LINK]: "@medusajs/medusa/link-modules",
|
||||||
|
[Modules.PAYMENT]: "@medusajs/medusa/payment",
|
||||||
|
[Modules.PRICING]: "@medusajs/medusa/pricing",
|
||||||
|
[Modules.PRODUCT]: "@medusajs/medusa/product",
|
||||||
|
[Modules.PROMOTION]: "@medusajs/medusa/promotion",
|
||||||
|
[Modules.SALES_CHANNEL]: "@medusajs/medusa/sales-channel",
|
||||||
|
[Modules.FULFILLMENT]: "@medusajs/medusa/fulfillment",
|
||||||
|
[Modules.STOCK_LOCATION]: "@medusajs/medusa/stock-location-next", // TODO: To be replaced when current `@medusajs/stock-location` is deprecated
|
||||||
|
[Modules.TAX]: "@medusajs/medusa/tax",
|
||||||
|
[Modules.USER]: "@medusajs/medusa/user",
|
||||||
|
[Modules.WORKFLOW_ENGINE]: "@medusajs/medusa/workflow-engine-inmemory",
|
||||||
|
[Modules.REGION]: "@medusajs/medusa/region",
|
||||||
|
[Modules.ORDER]: "@medusajs/medusa/order",
|
||||||
|
[Modules.API_KEY]: "@medusajs/medusa/api-key",
|
||||||
|
[Modules.STORE]: "@medusajs/medusa/store",
|
||||||
|
[Modules.CURRENCY]: "@medusajs/medusa/currency",
|
||||||
|
[Modules.FILE]: "@medusajs/medusa/file",
|
||||||
|
[Modules.NOTIFICATION]: "@medusajs/medusa/notification",
|
||||||
|
[Modules.INDEX]: "@medusajs/medusa/index-module",
|
||||||
|
}
|
||||||
|
|
||||||
|
export const REVERSED_MODULE_PACKAGE_NAMES = Object.entries(
|
||||||
|
MODULE_PACKAGE_NAMES
|
||||||
|
).reduce((acc, [key, value]) => {
|
||||||
|
acc[value] = key
|
||||||
|
return acc
|
||||||
|
}, {})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Making modules be referenced as a type as well.
|
* Making modules be referenced as a type as well.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ moduleIntegrationTestRunner<IApiKeyModuleService>({
|
|||||||
linkable: "api_key_id",
|
linkable: "api_key_id",
|
||||||
entity: "ApiKey",
|
entity: "ApiKey",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "ApiKey",
|
serviceName: "api_key",
|
||||||
field: "apiKey",
|
field: "apiKey",
|
||||||
},
|
},
|
||||||
publishable_key_id: {
|
publishable_key_id: {
|
||||||
@@ -64,7 +64,7 @@ moduleIntegrationTestRunner<IApiKeyModuleService>({
|
|||||||
entity: "ApiKey",
|
entity: "ApiKey",
|
||||||
linkable: "publishable_key_id",
|
linkable: "publishable_key_id",
|
||||||
primaryKey: "publishable_key_id",
|
primaryKey: "publishable_key_id",
|
||||||
serviceName: "ApiKey",
|
serviceName: "api_key",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "auth_identity_id",
|
linkable: "auth_identity_id",
|
||||||
entity: "AuthIdentity",
|
entity: "AuthIdentity",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Auth",
|
serviceName: "auth",
|
||||||
field: "authIdentity",
|
field: "authIdentity",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -66,7 +66,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "provider_identity_id",
|
linkable: "provider_identity_id",
|
||||||
entity: "ProviderIdentity",
|
entity: "ProviderIdentity",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Auth",
|
serviceName: "auth",
|
||||||
field: "providerIdentity",
|
field: "providerIdentity",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
+8
-8
@@ -36,7 +36,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "cart_id",
|
linkable: "cart_id",
|
||||||
entity: "Cart",
|
entity: "Cart",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "cart",
|
field: "cart",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -45,7 +45,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "address_id",
|
linkable: "address_id",
|
||||||
entity: "Address",
|
entity: "Address",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "address",
|
field: "address",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -54,7 +54,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "line_item_id",
|
linkable: "line_item_id",
|
||||||
entity: "LineItem",
|
entity: "LineItem",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "lineItem",
|
field: "lineItem",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -63,7 +63,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "line_item_adjustment_id",
|
linkable: "line_item_adjustment_id",
|
||||||
entity: "LineItemAdjustment",
|
entity: "LineItemAdjustment",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "lineItemAdjustment",
|
field: "lineItemAdjustment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -72,7 +72,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "line_item_tax_line_id",
|
linkable: "line_item_tax_line_id",
|
||||||
entity: "LineItemTaxLine",
|
entity: "LineItemTaxLine",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "lineItemTaxLine",
|
field: "lineItemTaxLine",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -81,7 +81,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "shipping_method_id",
|
linkable: "shipping_method_id",
|
||||||
entity: "ShippingMethod",
|
entity: "ShippingMethod",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "shippingMethod",
|
field: "shippingMethod",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -90,7 +90,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "shipping_method_adjustment_id",
|
linkable: "shipping_method_adjustment_id",
|
||||||
entity: "ShippingMethodAdjustment",
|
entity: "ShippingMethodAdjustment",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "shippingMethodAdjustment",
|
field: "shippingMethodAdjustment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -99,7 +99,7 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
linkable: "shipping_method_tax_line_id",
|
linkable: "shipping_method_tax_line_id",
|
||||||
entity: "ShippingMethodTaxLine",
|
entity: "ShippingMethodTaxLine",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Cart",
|
serviceName: "cart",
|
||||||
field: "shippingMethodTaxLine",
|
field: "shippingMethodTaxLine",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ moduleIntegrationTestRunner<ICurrencyModuleService>({
|
|||||||
linkable: "currency_code",
|
linkable: "currency_code",
|
||||||
entity: "Currency",
|
entity: "Currency",
|
||||||
primaryKey: "code",
|
primaryKey: "code",
|
||||||
serviceName: "Currency",
|
serviceName: "currency",
|
||||||
field: "currency",
|
field: "currency",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-4
@@ -31,7 +31,7 @@ moduleIntegrationTestRunner<ICustomerModuleService>({
|
|||||||
linkable: "customer_address_id",
|
linkable: "customer_address_id",
|
||||||
entity: "CustomerAddress",
|
entity: "CustomerAddress",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Customer",
|
serviceName: "customer",
|
||||||
field: "customerAddress",
|
field: "customerAddress",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -40,7 +40,7 @@ moduleIntegrationTestRunner<ICustomerModuleService>({
|
|||||||
linkable: "customer_group_customer_id",
|
linkable: "customer_group_customer_id",
|
||||||
entity: "CustomerGroupCustomer",
|
entity: "CustomerGroupCustomer",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Customer",
|
serviceName: "customer",
|
||||||
field: "customerGroupCustomer",
|
field: "customerGroupCustomer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -49,7 +49,7 @@ moduleIntegrationTestRunner<ICustomerModuleService>({
|
|||||||
linkable: "customer_group_id",
|
linkable: "customer_group_id",
|
||||||
entity: "CustomerGroup",
|
entity: "CustomerGroup",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Customer",
|
serviceName: "customer",
|
||||||
field: "customerGroup",
|
field: "customerGroup",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ moduleIntegrationTestRunner<ICustomerModuleService>({
|
|||||||
linkable: "customer_id",
|
linkable: "customer_id",
|
||||||
entity: "Customer",
|
entity: "Customer",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Customer",
|
serviceName: "customer",
|
||||||
field: "customer",
|
field: "customer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export function buildExpectedEventMessageShape(options: {
|
|||||||
metadata: {
|
metadata: {
|
||||||
action: options.action,
|
action: options.action,
|
||||||
eventGroupId: options.eventGroupId,
|
eventGroupId: options.eventGroupId,
|
||||||
source: "Fulfillment",
|
source: "fulfillment",
|
||||||
object: options.object,
|
object: options.object,
|
||||||
},
|
},
|
||||||
data: options.data,
|
data: options.data,
|
||||||
|
|||||||
+12
-12
@@ -137,7 +137,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_address_id",
|
linkable: "fulfillment_address_id",
|
||||||
entity: "FulfillmentAddress",
|
entity: "FulfillmentAddress",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillmentAddress",
|
field: "fulfillmentAddress",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -146,7 +146,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_item_id",
|
linkable: "fulfillment_item_id",
|
||||||
entity: "FulfillmentItem",
|
entity: "FulfillmentItem",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillmentItem",
|
field: "fulfillmentItem",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_label_id",
|
linkable: "fulfillment_label_id",
|
||||||
entity: "FulfillmentLabel",
|
entity: "FulfillmentLabel",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillmentLabel",
|
field: "fulfillmentLabel",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -164,7 +164,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_provider_id",
|
linkable: "fulfillment_provider_id",
|
||||||
entity: "FulfillmentProvider",
|
entity: "FulfillmentProvider",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillmentProvider",
|
field: "fulfillmentProvider",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -173,7 +173,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_set_id",
|
linkable: "fulfillment_set_id",
|
||||||
entity: "FulfillmentSet",
|
entity: "FulfillmentSet",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillmentSet",
|
field: "fulfillmentSet",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -182,7 +182,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "fulfillment_id",
|
linkable: "fulfillment_id",
|
||||||
entity: "Fulfillment",
|
entity: "Fulfillment",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "fulfillment",
|
field: "fulfillment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -191,7 +191,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "geo_zone_id",
|
linkable: "geo_zone_id",
|
||||||
entity: "GeoZone",
|
entity: "GeoZone",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "geoZone",
|
field: "geoZone",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -200,7 +200,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "service_zone_id",
|
linkable: "service_zone_id",
|
||||||
entity: "ServiceZone",
|
entity: "ServiceZone",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "serviceZone",
|
field: "serviceZone",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -209,7 +209,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "shipping_option_rule_id",
|
linkable: "shipping_option_rule_id",
|
||||||
entity: "ShippingOptionRule",
|
entity: "ShippingOptionRule",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "shippingOptionRule",
|
field: "shippingOptionRule",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -218,7 +218,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "shipping_option_type_id",
|
linkable: "shipping_option_type_id",
|
||||||
entity: "ShippingOptionType",
|
entity: "ShippingOptionType",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "shippingOptionType",
|
field: "shippingOptionType",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -227,7 +227,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "shipping_option_id",
|
linkable: "shipping_option_id",
|
||||||
entity: "ShippingOption",
|
entity: "ShippingOption",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "shippingOption",
|
field: "shippingOption",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -236,7 +236,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "shipping_profile_id",
|
linkable: "shipping_profile_id",
|
||||||
entity: "ShippingProfile",
|
entity: "ShippingProfile",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Fulfillment",
|
serviceName: "fulfillment",
|
||||||
field: "shippingProfile",
|
field: "shippingProfile",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
|
import { Modules } from "@medusajs/utils"
|
||||||
|
|
||||||
export const defaultSchema = `
|
export const defaultSchema = `
|
||||||
type Product @Listeners(values: ["Product.product.created", "Product.product.updated", "Product.product.deleted"]) {
|
type Product @Listeners(values: ["${Modules.PRODUCT}.product.created", "${Modules.PRODUCT}.product.updated", "${Modules.PRODUCT}.product.deleted"]) {
|
||||||
id: String
|
id: String
|
||||||
title: String
|
title: String
|
||||||
variants: [ProductVariant]
|
variants: [ProductVariant]
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductVariant @Listeners(values: ["Product.product-variant.created", "Product.product-variant.updated", "Product.product-variant.deleted"]) {
|
type ProductVariant @Listeners(values: ["${Modules.PRODUCT}.product-variant.created", "${Modules.PRODUCT}.product-variant.updated", "${Modules.PRODUCT}.product-variant.deleted"]) {
|
||||||
id: String
|
id: String
|
||||||
product_id: String
|
product_id: String
|
||||||
sku: String
|
sku: String
|
||||||
prices: [Price]
|
prices: [Price]
|
||||||
}
|
}
|
||||||
|
|
||||||
type Price @Listeners(values: ["Pricing.price.created", "Pricing.price.updated", "Pricing.price.deleted"]) {
|
type Price @Listeners(values: ["${Modules.PRICING}.price.created", "${Modules.PRICING}.price.updated", "${Modules.PRICING}.price.deleted"]) {
|
||||||
amount: Int
|
amount: Int
|
||||||
currency_code: String
|
currency_code: String
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -31,7 +31,7 @@ moduleIntegrationTestRunner<IInventoryService>({
|
|||||||
entity: "InventoryItem",
|
entity: "InventoryItem",
|
||||||
linkable: "inventory_item_id",
|
linkable: "inventory_item_id",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Inventory",
|
serviceName: "inventory",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
inventoryLevel: {
|
inventoryLevel: {
|
||||||
@@ -40,7 +40,7 @@ moduleIntegrationTestRunner<IInventoryService>({
|
|||||||
entity: "InventoryLevel",
|
entity: "InventoryLevel",
|
||||||
linkable: "inventory_level_id",
|
linkable: "inventory_level_id",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Inventory",
|
serviceName: "inventory",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
reservationItem: {
|
reservationItem: {
|
||||||
@@ -49,7 +49,7 @@ moduleIntegrationTestRunner<IInventoryService>({
|
|||||||
entity: "ReservationItem",
|
entity: "ReservationItem",
|
||||||
linkable: "reservation_item_id",
|
linkable: "reservation_item_id",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Inventory",
|
serviceName: "inventory",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ moduleIntegrationTestRunner<INotificationModuleService>({
|
|||||||
linkable: "notification_id",
|
linkable: "notification_id",
|
||||||
entity: "Notification",
|
entity: "Notification",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Notification",
|
serviceName: "notification",
|
||||||
field: "notification",
|
field: "notification",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_id",
|
linkable: "order_id",
|
||||||
entity: "Order",
|
entity: "Order",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "order",
|
field: "order",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -44,7 +44,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_address_id",
|
linkable: "order_address_id",
|
||||||
entity: "OrderAddress",
|
entity: "OrderAddress",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderAddress",
|
field: "orderAddress",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -53,7 +53,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_change_id",
|
linkable: "order_change_id",
|
||||||
entity: "OrderChange",
|
entity: "OrderChange",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderChange",
|
field: "orderChange",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -62,14 +62,14 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_claim_id",
|
linkable: "order_claim_id",
|
||||||
entity: "OrderClaim",
|
entity: "OrderClaim",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderClaim",
|
field: "orderClaim",
|
||||||
},
|
},
|
||||||
claim_id: {
|
claim_id: {
|
||||||
linkable: "claim_id",
|
linkable: "claim_id",
|
||||||
entity: "OrderClaim",
|
entity: "OrderClaim",
|
||||||
primaryKey: "claim_id",
|
primaryKey: "claim_id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderClaim",
|
field: "orderClaim",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -78,14 +78,14 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_exchange_id",
|
linkable: "order_exchange_id",
|
||||||
entity: "OrderExchange",
|
entity: "OrderExchange",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderExchange",
|
field: "orderExchange",
|
||||||
},
|
},
|
||||||
exchange_id: {
|
exchange_id: {
|
||||||
linkable: "exchange_id",
|
linkable: "exchange_id",
|
||||||
entity: "OrderExchange",
|
entity: "OrderExchange",
|
||||||
primaryKey: "exchange_id",
|
primaryKey: "exchange_id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderExchange",
|
field: "orderExchange",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -94,7 +94,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_line_item_id",
|
linkable: "order_line_item_id",
|
||||||
entity: "OrderLineItem",
|
entity: "OrderLineItem",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderLineItem",
|
field: "orderLineItem",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -103,7 +103,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_shipping_method_id",
|
linkable: "order_shipping_method_id",
|
||||||
entity: "OrderShippingMethod",
|
entity: "OrderShippingMethod",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderShippingMethod",
|
field: "orderShippingMethod",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -112,7 +112,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "order_transaction_id",
|
linkable: "order_transaction_id",
|
||||||
entity: "OrderTransaction",
|
entity: "OrderTransaction",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "orderTransaction",
|
field: "orderTransaction",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -121,7 +121,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "return_id",
|
linkable: "return_id",
|
||||||
entity: "Return",
|
entity: "Return",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "return",
|
field: "return",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -130,7 +130,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
|||||||
linkable: "return_reason_id",
|
linkable: "return_reason_id",
|
||||||
entity: "ReturnReason",
|
entity: "ReturnReason",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Order",
|
serviceName: "order",
|
||||||
field: "returnReason",
|
field: "returnReason",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+5
-5
@@ -37,7 +37,7 @@ moduleIntegrationTestRunner<IPaymentModuleService>({
|
|||||||
linkable: "payment_id",
|
linkable: "payment_id",
|
||||||
entity: "Payment",
|
entity: "Payment",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Payment",
|
serviceName: "payment",
|
||||||
field: "payment",
|
field: "payment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ moduleIntegrationTestRunner<IPaymentModuleService>({
|
|||||||
linkable: "payment_collection_id",
|
linkable: "payment_collection_id",
|
||||||
entity: "PaymentCollection",
|
entity: "PaymentCollection",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Payment",
|
serviceName: "payment",
|
||||||
field: "paymentCollection",
|
field: "paymentCollection",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -55,7 +55,7 @@ moduleIntegrationTestRunner<IPaymentModuleService>({
|
|||||||
linkable: "payment_provider_id",
|
linkable: "payment_provider_id",
|
||||||
entity: "PaymentProvider",
|
entity: "PaymentProvider",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Payment",
|
serviceName: "payment",
|
||||||
field: "paymentProvider",
|
field: "paymentProvider",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -65,7 +65,7 @@ moduleIntegrationTestRunner<IPaymentModuleService>({
|
|||||||
entity: "PaymentSession",
|
entity: "PaymentSession",
|
||||||
linkable: "payment_session_id",
|
linkable: "payment_session_id",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Payment",
|
serviceName: "payment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
refundReason: {
|
refundReason: {
|
||||||
@@ -73,7 +73,7 @@ moduleIntegrationTestRunner<IPaymentModuleService>({
|
|||||||
linkable: "refund_reason_id",
|
linkable: "refund_reason_id",
|
||||||
entity: "RefundReason",
|
entity: "RefundReason",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Payment",
|
serviceName: "payment",
|
||||||
field: "refundReason",
|
field: "refundReason",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-4
@@ -29,7 +29,7 @@ moduleIntegrationTestRunner<IPricingModuleService>({
|
|||||||
linkable: "price_set_id",
|
linkable: "price_set_id",
|
||||||
entity: "PriceSet",
|
entity: "PriceSet",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Pricing",
|
serviceName: "pricing",
|
||||||
field: "priceSet",
|
field: "priceSet",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -38,7 +38,7 @@ moduleIntegrationTestRunner<IPricingModuleService>({
|
|||||||
linkable: "price_list_id",
|
linkable: "price_list_id",
|
||||||
entity: "PriceList",
|
entity: "PriceList",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Pricing",
|
serviceName: "pricing",
|
||||||
field: "priceList",
|
field: "priceList",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -47,7 +47,7 @@ moduleIntegrationTestRunner<IPricingModuleService>({
|
|||||||
linkable: "price_id",
|
linkable: "price_id",
|
||||||
entity: "Price",
|
entity: "Price",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Pricing",
|
serviceName: "pricing",
|
||||||
field: "price",
|
field: "price",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -56,7 +56,7 @@ moduleIntegrationTestRunner<IPricingModuleService>({
|
|||||||
linkable: "price_preference_id",
|
linkable: "price_preference_id",
|
||||||
entity: "PricePreference",
|
entity: "PricePreference",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Pricing",
|
serviceName: "pricing",
|
||||||
field: "pricePreference",
|
field: "pricePreference",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -692,7 +692,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
|||||||
[
|
[
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
data: { id: productCategoryOne.id },
|
data: { id: productCategoryOne.id },
|
||||||
name: "Product.product-category.deleted",
|
name: "product.product-category.deleted",
|
||||||
metadata: {
|
metadata: {
|
||||||
action: CommonEvents.DELETED,
|
action: CommonEvents.DELETED,
|
||||||
object: "product_category",
|
object: "product_category",
|
||||||
|
|||||||
+1
-1
@@ -281,7 +281,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
|||||||
expect(eventBusSpy).toHaveBeenCalledWith(
|
expect(eventBusSpy).toHaveBeenCalledWith(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
name: "Product.product-collection.deleted",
|
name: "product.product-collection.deleted",
|
||||||
data: { id: collectionId },
|
data: { id: collectionId },
|
||||||
metadata: {
|
metadata: {
|
||||||
action: CommonEvents.DELETED,
|
action: CommonEvents.DELETED,
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_id",
|
linkable: "product_id",
|
||||||
entity: "Product",
|
entity: "Product",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "product",
|
field: "product",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -81,7 +81,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_variant_id",
|
linkable: "product_variant_id",
|
||||||
entity: "ProductVariant",
|
entity: "ProductVariant",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productVariant",
|
field: "productVariant",
|
||||||
},
|
},
|
||||||
variant_id: {
|
variant_id: {
|
||||||
@@ -89,7 +89,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
entity: "ProductVariant",
|
entity: "ProductVariant",
|
||||||
linkable: "variant_id",
|
linkable: "variant_id",
|
||||||
primaryKey: "variant_id",
|
primaryKey: "variant_id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
productOption: {
|
productOption: {
|
||||||
@@ -97,7 +97,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_option_id",
|
linkable: "product_option_id",
|
||||||
entity: "ProductOption",
|
entity: "ProductOption",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productOption",
|
field: "productOption",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -106,7 +106,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_type_id",
|
linkable: "product_type_id",
|
||||||
entity: "ProductType",
|
entity: "ProductType",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productType",
|
field: "productType",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -115,7 +115,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_image_id",
|
linkable: "product_image_id",
|
||||||
entity: "ProductImage",
|
entity: "ProductImage",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productImage",
|
field: "productImage",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -124,7 +124,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_tag_id",
|
linkable: "product_tag_id",
|
||||||
entity: "ProductTag",
|
entity: "ProductTag",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productTag",
|
field: "productTag",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -133,7 +133,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_collection_id",
|
linkable: "product_collection_id",
|
||||||
entity: "ProductCollection",
|
entity: "ProductCollection",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productCollection",
|
field: "productCollection",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -142,7 +142,7 @@ moduleIntegrationTestRunner<Service>({
|
|||||||
linkable: "product_category_id",
|
linkable: "product_category_id",
|
||||||
entity: "ProductCategory",
|
entity: "ProductCategory",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Product",
|
serviceName: "product",
|
||||||
field: "productCategory",
|
field: "productCategory",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-3
@@ -49,7 +49,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "promotion_id",
|
linkable: "promotion_id",
|
||||||
entity: "Promotion",
|
entity: "Promotion",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Promotion",
|
serviceName: "promotion",
|
||||||
field: "promotion",
|
field: "promotion",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "campaign_id",
|
linkable: "campaign_id",
|
||||||
entity: "Campaign",
|
entity: "Campaign",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Promotion",
|
serviceName: "promotion",
|
||||||
field: "campaign",
|
field: "campaign",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -67,7 +67,7 @@ moduleIntegrationTestRunner({
|
|||||||
linkable: "promotion_rule_id",
|
linkable: "promotion_rule_id",
|
||||||
entity: "PromotionRule",
|
entity: "PromotionRule",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Promotion",
|
serviceName: "promotion",
|
||||||
field: "promotionRule",
|
field: "promotionRule",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ moduleIntegrationTestRunner<IRegionModuleService>({
|
|||||||
linkable: "region_id",
|
linkable: "region_id",
|
||||||
entity: "Region",
|
entity: "Region",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
field: "region",
|
field: "region",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -35,7 +35,7 @@ moduleIntegrationTestRunner<IRegionModuleService>({
|
|||||||
linkable: "country_iso_2",
|
linkable: "country_iso_2",
|
||||||
entity: "Country",
|
entity: "Country",
|
||||||
primaryKey: "iso_2",
|
primaryKey: "iso_2",
|
||||||
serviceName: "Region",
|
serviceName: "region",
|
||||||
field: "country",
|
field: "country",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ moduleIntegrationTestRunner<ISalesChannelModuleService>({
|
|||||||
linkable: "sales_channel_id",
|
linkable: "sales_channel_id",
|
||||||
entity: "SalesChannel",
|
entity: "SalesChannel",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "SalesChannel",
|
serviceName: "sales_channel",
|
||||||
field: "salesChannel",
|
field: "salesChannel",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-3
@@ -30,7 +30,7 @@ moduleIntegrationTestRunner<IStockLocationService>({
|
|||||||
linkable: "stock_location_address_id",
|
linkable: "stock_location_address_id",
|
||||||
entity: "StockLocationAddress",
|
entity: "StockLocationAddress",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "StockLocation",
|
serviceName: "stock_location",
|
||||||
field: "stockLocationAddress",
|
field: "stockLocationAddress",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -40,13 +40,13 @@ moduleIntegrationTestRunner<IStockLocationService>({
|
|||||||
entity: "StockLocation",
|
entity: "StockLocation",
|
||||||
linkable: "stock_location_id",
|
linkable: "stock_location_id",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "StockLocation",
|
serviceName: "stock_location",
|
||||||
},
|
},
|
||||||
location_id: {
|
location_id: {
|
||||||
linkable: "location_id",
|
linkable: "location_id",
|
||||||
entity: "StockLocation",
|
entity: "StockLocation",
|
||||||
primaryKey: "location_id",
|
primaryKey: "location_id",
|
||||||
serviceName: "StockLocation",
|
serviceName: "stock_location",
|
||||||
field: "stockLocation",
|
field: "stockLocation",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ moduleIntegrationTestRunner<IStoreModuleService>({
|
|||||||
linkable: "store_id",
|
linkable: "store_id",
|
||||||
entity: "Store",
|
entity: "Store",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Store",
|
serviceName: "store",
|
||||||
field: "store",
|
field: "store",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -36,7 +36,7 @@ moduleIntegrationTestRunner<IStoreModuleService>({
|
|||||||
linkable: "store_currency_id",
|
linkable: "store_currency_id",
|
||||||
entity: "StoreCurrency",
|
entity: "StoreCurrency",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Store",
|
serviceName: "store",
|
||||||
field: "storeCurrency",
|
field: "storeCurrency",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
|||||||
linkable: "tax_rate_id",
|
linkable: "tax_rate_id",
|
||||||
entity: "TaxRate",
|
entity: "TaxRate",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Tax",
|
serviceName: "tax",
|
||||||
field: "taxRate",
|
field: "taxRate",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -41,7 +41,7 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
|||||||
linkable: "tax_region_id",
|
linkable: "tax_region_id",
|
||||||
entity: "TaxRegion",
|
entity: "TaxRegion",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Tax",
|
serviceName: "tax",
|
||||||
field: "taxRegion",
|
field: "taxRegion",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -50,7 +50,7 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
|||||||
linkable: "tax_rate_rule_id",
|
linkable: "tax_rate_rule_id",
|
||||||
entity: "TaxRateRule",
|
entity: "TaxRateRule",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Tax",
|
serviceName: "tax",
|
||||||
field: "taxRateRule",
|
field: "taxRateRule",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -59,7 +59,7 @@ moduleIntegrationTestRunner<ITaxModuleService>({
|
|||||||
linkable: "tax_provider_id",
|
linkable: "tax_provider_id",
|
||||||
entity: "TaxProvider",
|
entity: "TaxProvider",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Tax",
|
serviceName: "tax",
|
||||||
field: "taxProvider",
|
field: "taxProvider",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
|||||||
linkable: "user_id",
|
linkable: "user_id",
|
||||||
entity: "User",
|
entity: "User",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "User",
|
serviceName: "user",
|
||||||
field: "user",
|
field: "user",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -54,7 +54,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
|||||||
linkable: "invite_id",
|
linkable: "invite_id",
|
||||||
entity: "Invite",
|
entity: "Invite",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "User",
|
serviceName: "user",
|
||||||
field: "invite",
|
field: "invite",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
|
|||||||
linkable: "workflow_execution_id",
|
linkable: "workflow_execution_id",
|
||||||
entity: "WorkflowExecution",
|
entity: "WorkflowExecution",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Workflows",
|
serviceName: "workflows",
|
||||||
field: "workflowExecution",
|
field: "workflowExecution",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
|
|||||||
linkable: "workflow_execution_id",
|
linkable: "workflow_execution_id",
|
||||||
entity: "WorkflowExecution",
|
entity: "WorkflowExecution",
|
||||||
primaryKey: "id",
|
primaryKey: "id",
|
||||||
serviceName: "Workflows",
|
serviceName: "workflows",
|
||||||
field: "workflowExecution",
|
field: "workflowExecution",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user