Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix ModuleRegistrationName import #8434

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/commerce-modules/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ When you resolve the `ModuleRegistrationName.PRODUCT` (or `productModuleService`

<Note title="Tip">

To resolve the main service of any commerce module, use the registration name defined in the `ModuleRegistrationName` enum imported from `@medusajs/modules-sdk`.
To resolve the main service of any commerce module, use the registration name defined in the `ModuleRegistrationName` enum imported from `@medusajs/utils`.

</Note>
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/events-and-subscribers/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For example:
export const highlights = [
["7", "container", "Recieve the Medusa Container in the object parameter."],
["10", "resolve", "Resolve the Product Module's main service."],
["10", "ModuleRegistrationName.PRODUCT", "The module's registration name imported from `@medusajs/modules-sdk`."]
["10", "ModuleRegistrationName.PRODUCT", "The module's registration name imported from `@medusajs/utils`."]
]

```ts title="src/subscribers/product-created.ts" highlights={highlights}
Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/medusa-container/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const highlights = [
[
"10",
"ModuleRegistrationName.PRODUCT",
"The resource registration name imported from `@medusajs/modules-sdk`.",
"The resource registration name imported from `@medusajs/utils`.",
],
]

Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/scheduled-jobs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ For example:

export const highlights = [
["11", "resolve", "Resolve the Product Module's main service."],
["11", "ModuleRegistrationName.PRODUCT", "The module's registration name imported from `@medusajs/modules-sdk`."]
["11", "ModuleRegistrationName.PRODUCT", "The module's registration name imported from `@medusajs/utils`."]
]

```ts title="src/jobs/hello-world.ts" highlights={highlights}
Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/workflows/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const highlights = [
[
"12",
"ModuleRegistrationName.PRODUCT",
"The resource registration name imported from `@medusajs/modules-sdk`.",
"The resource registration name imported from `@medusajs/utils`.",
],
]

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/api-key/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const newKey = await apiKeyModuleService.createApiKeys({

## How to Use API Key Module's Service

You can use the API Key Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.API_KEY` imported from `@medusajs/modules-sdk`.
You can use the API Key Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.API_KEY` imported from `@medusajs/utils`.

For example:

Expand Down
6 changes: 3 additions & 3 deletions www/apps/resources/app/commerce-modules/auth/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Refer to [this documentation](./module-options/page.mdx) for details on the modu

## How to Use Auth Module's Service

You can use the Auth Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.AUTH` imported from `@medusajs/modules-sdk`.
You can use the Auth Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.AUTH` imported from `@medusajs/utils`.

For example:

Expand Down Expand Up @@ -110,7 +110,7 @@ export async function GET(
```ts title="src/subscribers/custom-handler.ts"
import { SubscriberArgs } from "@medusajs/medusa"
import { IAuthModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { ModuleRegistrationName } from "@medusajs/utils"

export default async function subscriberHandler({ container }: SubscriberArgs) {
const authModuleService: IAuthModuleService = container.resolve(
Expand All @@ -127,7 +127,7 @@ export default async function subscriberHandler({ container }: SubscriberArgs) {
```ts title="src/workflows/hello-world/step1.ts"
import { createStep } from "@medusajs/workflows-sdk"
import { IAuthModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { ModuleRegistrationName } from "@medusajs/utils"

const step1 = createStep("step-1", async (_, { container }) => {
const authModuleService: IAuthModuleService = container.resolve(
Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/cart/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ When used with their respective modules and other commerce modules, you benefit

## How to Use Cart Module's Service

You can use the Cart Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CART` imported from `@medusajs/modules-sdk`.
You can use the Cart Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CART` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const currency = await currencyModuleService.retrieveCurrency(

## How to Use Currency Module's Service

You can use the Currency Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CURRENCY` imported from `@medusajs/modules-sdk`.
You can use the Currency Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CURRENCY` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ await customerModuleService.addCustomerToGroup({

## How to Use Customer Module's Service

You can use the Customer Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CUSTOMER` imported from `@medusajs/modules-sdk`.
You can use the Customer Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CUSTOMER` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Refer to [this documentation](./module-options/page.mdx) for details on the modu

## How to Use Fulfillment Module's Service

You can use the Fulfillment Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.API_KEY` imported from `@medusajs/modules-sdk`.
You can use the Fulfillment Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.API_KEY` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const isAvailable = await inventoryModuleService.confirmInventory(

## How to Use Inventory Module's Service

You can use the Inventory Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.INVENTORY` imported from `@medusajs/modules-sdk`.
You can use the Inventory Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.INVENTORY` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/order/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const orderReturn = await orderModuleService.createReturn({

## How to Use Order Module's Service

You can use the Order Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.ORDER` imported from `@medusajs/modules-sdk`.
You can use the Order Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.ORDER` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/payment/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Refer to [this documentation](./module-options/page.mdx) for details on the modu

## How to Use Payment Module's Service

You can use the Payment Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PAYMENT` imported from `@medusajs/modules-sdk`.
You can use the Payment Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PAYMENT` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/pricing/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const price = await pricingModuleService.calculatePrices(

## How to Use Pricing Module's Service

You can use the Pricing Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PRICING` imported from `@medusajs/modules-sdk`.
You can use the Pricing Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PRICING` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/product/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const products = await productService.updateProducts([

## How to Use Product Module's Service

You can use the Product Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PRODUCT` imported from `@medusajs/modules-sdk`.
You can use the Product Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PRODUCT` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const campaign = await promotionModuleService.createCampaigns({

## How to Use the Promotion Module's Service

You can use the Promotion Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PROMOTION` imported from `@medusajs/modules-sdk`.
You can use the Promotion Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.PROMOTION` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/region/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const regions = await regionModuleService.createRegions([

## How to Use Region Module's Service

You can use the Region Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.REGION` imported from `@medusajs/modules-sdk`.
You can use the Region Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.REGION` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Orders are also scoped to a sales channel due to the relation between the Sales

## How to Use Sales Channel Module's Service

You can use the Sales Channel Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.SALES_CHANNEL` imported from `@medusajs/modules-sdk`.
You can use the Sales Channel Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.SALES_CHANNEL` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const stockLocation = await stockLocationModuleService.updateStockLocations({

## How to Use Stock Location Module's Service

You can use the Stock Location Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.STOCK_LOCATION` imported from `@medusajs/modules-sdk`.
You can use the Stock Location Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.STOCK_LOCATION` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/store/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const stores = await storeModuleService.createStores([

## How to Use Store Module's Service

You can use the Store Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.STORE` imported from `@medusajs/modules-sdk`.
You can use the Store Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.STORE` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/tax/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Refer to [this documentation](./module-options/page.mdx) for details on the modu

## How to Use Tax Module's Service

You can use the Tax Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.TAX` imported from `@medusajs/modules-sdk`.
You can use the Tax Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.TAX` imported from `@medusajs/utils`.

For example:

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/commerce-modules/user/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Refer to [this documentation](./module-options/page.mdx) for details on the modu

## How to Use User Module's Service

You can use the User Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.USER` imported from `@medusajs/modules-sdk`.
You can use the User Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.USER` imported from `@medusajs/utils`.

For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This documentation page includes the list of resources registered in the Medusa
<Table.Cell>

- For custom modules, the registration name is the key of the module in the `modules` configuration.
- For Medusa's commerce modules, you can use the `ModuleRegistrationName` enum imported from `@medusajs/modules-sdk`.
- For Medusa's commerce modules, you can use the `ModuleRegistrationName` enum imported from `@medusajs/utils`.

</Table.Cell>
</Table.Row>
Expand Down
6 changes: 3 additions & 3 deletions www/apps/resources/app/recipes/commerce-automation/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export const syncProductsWorkflowHighlight = [
```ts title="src/workflows/sync-products.ts" highlights={syncProductsWorkflowHighlight} collapsibleLines="1-16" expandButtonLabel="Show Imports"
import {
ModuleRegistrationName
} from "@medusajs/modules-sdk"
} from "@medusajs/utils"
import {
IProductModuleService,
IStoreModuleService,
Expand Down Expand Up @@ -786,7 +786,7 @@ The `order.placed` event is currently not emitted.
} from "@medusajs/medusa"
import {
ModuleRegistrationName,
} from "@medusajs/modules-sdk"
} from "@medusajs/utils"
import {
ICustomerModuleService,
IOrderModuleService,
Expand Down Expand Up @@ -902,7 +902,7 @@ export const newsletterHighlights = [
} from "@medusajs/medusa"
import {
ModuleRegistrationName,
} from "@medusajs/modules-sdk"
} from "@medusajs/utils"
import {
ICustomerModuleService,
IProductModuleService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ For example, suppose an administrator changes the product data in the ERP system
} from "@medusajs/types"
import {
ModuleRegistrationName
} from "@medusajs/modules-sdk"
} from "@medusajs/utils"

type WebhookReq = {
id: string
Expand Down
Loading