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:
@@ -15,8 +15,8 @@ In this document, you’ll find common examples of how you can use the Stock Loc
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function POST(
|
||||
request: MedusaRequest,
|
||||
@@ -41,7 +41,7 @@ export async function POST(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/stock-location-next"
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next"
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const stockLocationModuleService = await initializeStockLocationModule({})
|
||||
@@ -66,8 +66,8 @@ export async function POST(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
request: MedusaRequest,
|
||||
@@ -88,7 +88,7 @@ export async function GET(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/stock-location-next"
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next"
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const stockLocationModuleService = await initializeStockLocationModule({})
|
||||
@@ -111,8 +111,8 @@ export async function GET(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function POST(
|
||||
request: MedusaRequest,
|
||||
@@ -143,7 +143,7 @@ export async function POST(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/stock-location-next"
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next"
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const stockLocationModuleService = await initializeStockLocationModule({})
|
||||
@@ -176,8 +176,8 @@ export async function POST(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function DELETE(
|
||||
request: MedusaRequest,
|
||||
@@ -198,7 +198,7 @@ export async function DELETE(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/stock-location-next"
|
||||
import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next"
|
||||
|
||||
export async function DELETE(request: Request) {
|
||||
const stockLocationModuleService = await initializeStockLocationModule({})
|
||||
|
||||
@@ -6,11 +6,11 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
The Stock Location Module is the `@medusajs/stock-location-next` NPM package that provides stock-location-related features in your Medusa and Node.js applications.
|
||||
The Stock Location Module is the `@medusajs/medusa/stock-location-next` NPM package that provides stock-location-related features in your Medusa and Node.js applications.
|
||||
|
||||
## 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 `Modules.STOCK_LOCATION` imported from `@medusajs/utils`.
|
||||
You can use the Stock Location Module's main service by resolving from the Medusa container the resource `Modules.STOCK_LOCATION` imported from `@medusajs/framework/utils`.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -19,8 +19,8 @@ For example:
|
||||
|
||||
```ts title="src/api/store/custom/route.ts"
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
request: MedusaRequest,
|
||||
@@ -40,8 +40,8 @@ export async function GET(
|
||||
|
||||
```ts title="src/subscribers/custom-handler.ts"
|
||||
import { SubscriberArgs } from "@medusajs/medusa"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export default async function subscriberHandler({ container }: SubscriberArgs) {
|
||||
const stockLocationModuleService: IStockLocationService = container.resolve(
|
||||
@@ -56,9 +56,9 @@ export default async function subscriberHandler({ container }: SubscriberArgs) {
|
||||
<CodeTab label="Workflow Step" value="workflow-step">
|
||||
|
||||
```ts title="src/workflows/hello-world/step1.ts"
|
||||
import { createStep } from "@medusajs/workflows-sdk"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||
import { IStockLocationService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
const step1 = createStep("step-1", async (_, { container }) => {
|
||||
const stockLocationModuleService: IStockLocationService = container.resolve(
|
||||
|
||||
Reference in New Issue
Block a user