chore: remove container registration name (#9137)
This commit is contained in:
@@ -2,7 +2,7 @@ import { beginClaimOrderWorkflow } from "@medusajs/core-flows"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
promiseAll,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -49,7 +49,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
const orderModuleService = req.scope.resolve(Modules.ORDER)
|
||||
|
||||
const workflow = beginClaimOrderWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
|
||||
@@ -2,7 +2,7 @@ import { beginExchangeOrderWorkflow } from "@medusajs/core-flows"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
promiseAll,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -49,7 +49,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
const orderModuleService = req.scope.resolve(Modules.ORDER)
|
||||
|
||||
const workflow = beginExchangeOrderWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ import {
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
MedusaError,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import {
|
||||
@@ -52,7 +52,7 @@ export const POST = async (
|
||||
res: MedusaResponse<AdminFulfillmentSetResponse>
|
||||
) => {
|
||||
const fulfillmentModuleService = req.scope.resolve<IFulfillmentModuleService>(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
Modules.FULFILLMENT
|
||||
)
|
||||
|
||||
// ensure fulfillment set exists and that the service zone is part of it
|
||||
@@ -99,7 +99,7 @@ export const DELETE = async (
|
||||
const { id, zone_id } = req.params
|
||||
|
||||
const fulfillmentModuleService = req.scope.resolve<IFulfillmentModuleService>(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
Modules.FULFILLMENT
|
||||
)
|
||||
|
||||
// ensure fulfillment set exists and that the service zone is part of it
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
@@ -12,7 +12,7 @@ export const GET = async (
|
||||
const { id } = req.params
|
||||
|
||||
// NOTE: Consider replacing with remoteQuery when possible
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
const orderModuleService = req.scope.resolve(Modules.ORDER)
|
||||
|
||||
const order = (await orderModuleService.previewOrderChange(
|
||||
id
|
||||
|
||||
@@ -3,12 +3,12 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName, TransactionHandlerType } from "@medusajs/utils"
|
||||
import {
|
||||
importProductsWorkflowId,
|
||||
waitConfirmationProductImportStepId,
|
||||
} from "@medusajs/core-flows"
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import { Modules, TransactionHandlerType } from "@medusajs/utils"
|
||||
import { StepResponse } from "@medusajs/workflows-sdk"
|
||||
|
||||
export const POST = async (
|
||||
@@ -16,7 +16,7 @@ export const POST = async (
|
||||
res: MedusaResponse
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
const transactionId = req.params.transaction_id
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@ import {
|
||||
beginReceiveReturnWorkflow,
|
||||
cancelReturnReceiveWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
promiseAll,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -13,14 +14,13 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { AdminPostReceiveReturnsReqSchemaType } from "../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminPostReceiveReturnsReqSchemaType>,
|
||||
res: MedusaResponse<HttpTypes.AdminOrderReturnResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
const orderModuleService = req.scope.resolve(Modules.ORDER)
|
||||
|
||||
const { id } = req.params
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { beginReturnOrderWorkflow } from "@medusajs/core-flows"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
ModuleRegistrationName,
|
||||
Modules,
|
||||
promiseAll,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
@@ -49,7 +49,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
const orderModuleService = req.scope.resolve(Modules.ORDER)
|
||||
|
||||
const workflow = beginReturnOrderWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
updateShippingProfilesWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { HttpTypes, IFulfillmentModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -34,7 +34,7 @@ export const DELETE = async (
|
||||
const { id } = req.params
|
||||
|
||||
const fulfillmentModuleService = req.scope.resolve<IFulfillmentModuleService>(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
Modules.FULFILLMENT
|
||||
)
|
||||
|
||||
// Test if exists
|
||||
|
||||
+2
-2
@@ -4,14 +4,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../../types/routing"
|
||||
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
|
||||
const { workflow_id, transaction_id } = req.query as any
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
IWorkflowEngineService,
|
||||
WorkflowOrchestratorRunDTO,
|
||||
} from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -15,7 +15,7 @@ export const POST = async (
|
||||
res: MedusaResponse<HttpTypes.AdminWorkflowRunResponse>
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
|
||||
const { workflow_id } = req.params
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import {
|
||||
} from "../../../../../../types/routing"
|
||||
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { AdminCreateWorkflowsAsyncResponseType } from "../../../validators"
|
||||
|
||||
export const POST = async (
|
||||
@@ -14,7 +14,7 @@ export const POST = async (
|
||||
res: MedusaResponse<{ success: boolean }>
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
|
||||
const { workflow_id } = req.params
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import {
|
||||
} from "../../../../../../types/routing"
|
||||
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { AdminCreateWorkflowsAsyncResponseType } from "../../../validators"
|
||||
|
||||
export const POST = async (
|
||||
@@ -14,7 +14,7 @@ export const POST = async (
|
||||
res: MedusaResponse<{ success: boolean }>
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
|
||||
const { workflow_id } = req.params
|
||||
|
||||
@@ -4,14 +4,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
) => {
|
||||
const workflowEngineService: IWorkflowEngineService = req.scope.resolve(
|
||||
ModuleRegistrationName.WORKFLOW_ENGINE
|
||||
Modules.WORKFLOW_ENGINE
|
||||
)
|
||||
|
||||
const { workflow_id } = req.query as any
|
||||
|
||||
Reference in New Issue
Block a user