docs: update imports and package names across docs (#9375)

* docs: update imports and package names across docs
+ reference configs

* generate files

* fix import

* change preview to rc
This commit is contained in:
Shahed Nasser
2024-10-01 11:03:42 +02:00
committed by GitHub
parent c726ed54f5
commit 2e16949979
196 changed files with 1379 additions and 1491 deletions
@@ -135,9 +135,9 @@ For example, consider you want to store the data passed in `additional_data` in
To do that, create the file `src/workflows/hooks/product-created.ts` with the following content:
```ts title="src/workflows/hooks/product-created.ts"
import { StepResponse } from "@medusajs/workflows-sdk"
import { createProductsWorkflow } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { StepResponse } from "@medusajs/framework/workflows-sdk"
import { createProductsWorkflow } from "@medusajs/medusa/core-flows"
import { Modules } from "@medusajs/framework/utils"
createProductsWorkflow.hooks.productsCreated(
async ({ products, additional_data }, { container }) => {
@@ -87,8 +87,8 @@ import type {
MedusaRequest,
MedusaResponse,
} from "@medusajs/medusa"
import { ConfigModule } from "@medusajs/types"
import { parseCorsOrigins } from "@medusajs/utils"
import { ConfigModule } from "@medusajs/framework/types"
import { parseCorsOrigins } from "@medusajs/framework/utils"
import cors from "cors"
export default defineMiddlewares({
@@ -10,7 +10,7 @@ In this guide, you'll learn how to throw errors in your Medusa application, how
## Throw MedusaError
When throwing an error in your API routes, middlewares, workflows, or any customization, throw a `MedusaError`, which is imported from `@medusajs/utils`.
When throwing an error in your API routes, middlewares, workflows, or any customization, throw a `MedusaError`, which is imported from `@medusajs/framework/utils`.
The Medusa application's API route error handler then wraps your thrown error in a uniform object and returns it in the response.
@@ -18,7 +18,7 @@ For example:
```ts
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
import { MedusaError } from "@medusajs/utils"
import { MedusaError } from "@medusajs/framework/utils"
export const GET = async (
req: MedusaRequest,
@@ -258,7 +258,7 @@ import {
MedusaRequest,
MedusaResponse,
} from "@medusajs/medusa"
import { MedusaError } from "@medusajs/utils"
import { MedusaError } from "@medusajs/framework/utils"
export default defineMiddlewares({
errorHandler: (
@@ -125,8 +125,8 @@ import type {
AuthenticatedMedusaRequest,
MedusaResponse,
} from "@medusajs/medusa"
import { Modules } from "@medusajs/utils"
import { ICustomerModuleService } from "@medusajs/types"
import { Modules } from "@medusajs/framework/utils"
import { ICustomerModuleService } from "@medusajs/framework/types"
export const GET = async (
req: AuthenticatedMedusaRequest,
@@ -160,8 +160,8 @@ import type {
AuthenticatedMedusaRequest,
MedusaResponse,
} from "@medusajs/medusa"
import { Modules } from "@medusajs/utils"
import { IUserModuleService } from "@medusajs/types"
import { Modules } from "@medusajs/framework/utils"
import { IUserModuleService } from "@medusajs/framework/types"
export const GET = async (
req: AuthenticatedMedusaRequest,