feat: loosely typed container
This commit is contained in:
@@ -107,6 +107,7 @@ export const refetchBatchProducts = async (
|
||||
fields: remapKeysForProduct(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -119,6 +120,7 @@ export const refetchBatchProducts = async (
|
||||
fields: remapKeysForProduct(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
@@ -148,6 +150,7 @@ export const refetchBatchVariants = async (
|
||||
fields: remapKeysForVariant(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -160,6 +163,7 @@ export const refetchBatchVariants = async (
|
||||
fields: remapKeysForVariant(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -54,6 +55,7 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -57,6 +58,7 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../../../types/routing"
|
||||
|
||||
import { IWorkflowEngineService } from "@medusajs/workflows-sdk"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
|
||||
export const GET = async (
|
||||
|
||||
@@ -4,9 +4,8 @@ import {
|
||||
} from "../../../../../types/routing"
|
||||
import {
|
||||
IWorkflowEngineService,
|
||||
WorkflowOrchestratorTypes,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
|
||||
WorkflowOrchestratorRunDTO,
|
||||
} from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { AdminCreateWorkflowsRunType } from "../../validators"
|
||||
|
||||
@@ -28,7 +27,7 @@ export const POST = async (
|
||||
context: {
|
||||
requestId: req.requestId,
|
||||
},
|
||||
} as WorkflowOrchestratorTypes.WorkflowOrchestratorRunDTO
|
||||
} as WorkflowOrchestratorRunDTO
|
||||
|
||||
const { acknowledgement } = await workflowEngineService.run(
|
||||
workflow_id,
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { IWorkflowEngineService, StepResponse } from "@medusajs/workflows-sdk"
|
||||
import { StepResponse } from "@medusajs/workflows-sdk"
|
||||
import { TransactionHandlerType, isDefined } from "@medusajs/utils"
|
||||
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { AdminCreateWorkflowsAsyncResponseType } from "../../../validators"
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateWorkflowsAsyncResponseType>,
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { IWorkflowEngineService, StepResponse } from "@medusajs/workflows-sdk"
|
||||
import { StepResponse } from "@medusajs/workflows-sdk"
|
||||
import { TransactionHandlerType, isDefined } from "@medusajs/utils"
|
||||
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import { AdminCreateWorkflowsAsyncResponseType } from "../../../validators"
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateWorkflowsAsyncResponseType>,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IWorkflowEngineService } from "@medusajs/types"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
|
||||
import { IWorkflowEngineService } from "@medusajs/workflows-sdk"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
|
||||
export const GET = async (
|
||||
|
||||
@@ -62,7 +62,9 @@ export const GET = async (req: MedusaRequest, res: MedusaResponse) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
// @ts-expect-error
|
||||
secret: jwtSecret,
|
||||
// @ts-expect-error
|
||||
expiresIn: jwtExpiresIn,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -69,7 +69,9 @@ export const GET = async (req: MedusaRequest, res: MedusaResponse) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
// @ts-expect-error
|
||||
secret: jwtSecret,
|
||||
// @ts-expect-error
|
||||
expiresIn: jwtExpiresIn,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -9,6 +9,7 @@ export const POST = async (req: MedusaRequest, res: MedusaResponse) => {
|
||||
const { provider } = req.params
|
||||
|
||||
const options: PaymentModuleOptions =
|
||||
// @ts-expect-error "Not sure if .options exists on a module"
|
||||
req.scope.resolve(ModuleRegistrationName.PAYMENT).options || {}
|
||||
|
||||
const event = {
|
||||
|
||||
@@ -160,6 +160,7 @@ export default async ({
|
||||
|
||||
await promiseAll([
|
||||
container.dispose(),
|
||||
// @ts-expect-error "Do we want to call `client.destroy` "
|
||||
pgConnection?.context?.destroy(),
|
||||
entrypointsShutdown(),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user