docs: update api-reference project for v2 (#7307)
* remove everything v1 and make v2 default * move main v2 rewrites to book * move rewrites to book + other fixes
This commit is contained in:
1 parent
9b1998b9b2
commit
22f30f54fd
2103 files changed
+8909
-140227
No files matched your search
@@ -10,10 +10,10 @@ NEXT_PUBLIC_DOCS_URL=
|
|||||||
NEXT_PUBLIC_UI_URL=
|
NEXT_PUBLIC_UI_URL=
|
||||||
NEXT_PUBLIC_RESOURCES_URL=
|
NEXT_PUBLIC_RESOURCES_URL=
|
||||||
NEXT_PUBLIC_USER_GUIDE_URL=
|
NEXT_PUBLIC_USER_GUIDE_URL=
|
||||||
|
NEXT_PUBLIC_DOCS_V1_URL=
|
||||||
|
NEXT_PUBLIC_API_V1_URL=
|
||||||
ALGOLIA_WRITE_API_KEY=
|
ALGOLIA_WRITE_API_KEY=
|
||||||
ANALYZE_BUNDLE=
|
ANALYZE_BUNDLE=
|
||||||
NEXT_PUBLIC_AI_ASSISTANT_URL=
|
NEXT_PUBLIC_AI_ASSISTANT_URL=
|
||||||
NEXT_PUBLIC_AI_WEBSITE_ID=
|
NEXT_PUBLIC_AI_WEBSITE_ID=
|
||||||
NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY=
|
NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY=
|
||||||
NEXT_PUBLIC_VERSIONING=
|
|
||||||
NEXT_PUBLIC_SHOW_V2=
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File diff suppressed because it is too large.
Load diff
@@ -1,34 +0,0 @@
|
|||||||
import { CodeTabs, CodeTab } from "docs-ui"
|
|
||||||
import Space from "@/components/Space"
|
|
||||||
import DownloadFull from "@/components/DownloadFull"
|
|
||||||
|
|
||||||
### Just Getting Started?
|
|
||||||
|
|
||||||
Check out the [quickstart guide](https://docs.medusajs.com/create-medusa-app).
|
|
||||||
|
|
||||||
<Space bottom={8} />
|
|
||||||
|
|
||||||
### Client Libraries
|
|
||||||
|
|
||||||
<CodeTabs group="clients">
|
|
||||||
<CodeTab label="Medusa JS Client" value="js-client">
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install @medusajs/medusa-js
|
|
||||||
```
|
|
||||||
|
|
||||||
</CodeTab>
|
|
||||||
<CodeTab label="Medusa React" value="medusa-react">
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install medusa-react @tanstack/react-query @medusajs/medusa
|
|
||||||
```
|
|
||||||
|
|
||||||
</CodeTab>
|
|
||||||
</CodeTabs>
|
|
||||||
|
|
||||||
### Download Full Reference
|
|
||||||
|
|
||||||
Download this reference as an OpenApi YAML file. You can import this file to tools like Postman and start sending requests directly to your Medusa backend.
|
|
||||||
|
|
||||||
<DownloadFull />
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,14 +1,13 @@
|
|||||||
import AreaProvider from "@/providers/area"
|
import AreaProvider from "@/providers/area"
|
||||||
import AdminContentV1 from "../../_mdx/v1/admin.mdx"
|
import AdminContentV2 from "../../_mdx/admin.mdx"
|
||||||
import StoreContentV1 from "../../_mdx/v1/store.mdx"
|
import StoreContentV2 from "../../_mdx/store.mdx"
|
||||||
import ClientLibrariesV1 from "../../_mdx/v1/client-libraries.mdx"
|
import ClientLibrariesV2 from "../../_mdx/client-libraries.mdx"
|
||||||
import Section from "@/components/Section"
|
import Section from "@/components/Section"
|
||||||
import Tags from "@/components/Tags"
|
import Tags from "@/components/Tags"
|
||||||
import type { Area } from "@/types/openapi"
|
import type { Area } from "@/types/openapi"
|
||||||
import DividedLayout from "@/layouts/Divided"
|
import DividedLayout from "@/layouts/Divided"
|
||||||
import { capitalize } from "docs-ui"
|
import { capitalize } from "docs-ui"
|
||||||
import PageTitleProvider from "../../../providers/page-title"
|
import PageTitleProvider from "@/providers/page-title"
|
||||||
import PageHeading from "../../../components/PageHeading"
|
|
||||||
|
|
||||||
type ReferencePageProps = {
|
type ReferencePageProps = {
|
||||||
params: {
|
params: {
|
||||||
@@ -20,16 +19,20 @@ const ReferencePage = async ({ params: { area } }: ReferencePageProps) => {
|
|||||||
return (
|
return (
|
||||||
<AreaProvider area={area}>
|
<AreaProvider area={area}>
|
||||||
<PageTitleProvider>
|
<PageTitleProvider>
|
||||||
<PageHeading className="!text-h2 block lg:hidden" />
|
<h1 className="!text-h2 block lg:hidden">
|
||||||
|
Medusa V2 {capitalize(area)} API Reference
|
||||||
|
</h1>
|
||||||
<DividedLayout
|
<DividedLayout
|
||||||
mainContent={
|
mainContent={
|
||||||
<Section>
|
<Section>
|
||||||
<PageHeading className="!text-h2 hidden lg:block" />
|
<h1 className="!text-h2 hidden lg:block">
|
||||||
{area.includes("admin") && <AdminContentV1 />}
|
Medusa V2 {capitalize(area)} API Reference
|
||||||
{area.includes("store") && <StoreContentV1 />}
|
</h1>
|
||||||
|
{area.includes("admin") && <AdminContentV2 />}
|
||||||
|
{area.includes("store") && <StoreContentV2 />}
|
||||||
</Section>
|
</Section>
|
||||||
}
|
}
|
||||||
codeContent={<ClientLibrariesV1 />}
|
codeContent={<ClientLibrariesV2 />}
|
||||||
className="flex-col-reverse"
|
className="flex-col-reverse"
|
||||||
/>
|
/>
|
||||||
<Tags />
|
<Tags />
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 253 KiB |
@@ -1,62 +0,0 @@
|
|||||||
import AreaProvider from "@/providers/area"
|
|
||||||
import AdminContentV2 from "../../../_mdx/v2/admin.mdx"
|
|
||||||
import StoreContentV2 from "../../../_mdx/v2/store.mdx"
|
|
||||||
import ClientLibrariesV2 from "../../../_mdx/v2/client-libraries.mdx"
|
|
||||||
import Section from "@/components/Section"
|
|
||||||
import Tags from "@/components/Tags"
|
|
||||||
import type { Area } from "@/types/openapi"
|
|
||||||
import DividedLayout from "@/layouts/Divided"
|
|
||||||
import { capitalize } from "docs-ui"
|
|
||||||
import PageTitleProvider from "@/providers/page-title"
|
|
||||||
import PageHeading from "@/components/PageHeading"
|
|
||||||
|
|
||||||
type ReferencePageProps = {
|
|
||||||
params: {
|
|
||||||
area: Area
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const ReferencePage = async ({ params: { area } }: ReferencePageProps) => {
|
|
||||||
return (
|
|
||||||
<AreaProvider area={area}>
|
|
||||||
<PageTitleProvider>
|
|
||||||
<PageHeading className="!text-h2 block lg:hidden" />
|
|
||||||
<DividedLayout
|
|
||||||
mainContent={
|
|
||||||
<Section>
|
|
||||||
<PageHeading className="!text-h2 hidden lg:block" />
|
|
||||||
{area.includes("admin") && <AdminContentV2 />}
|
|
||||||
{area.includes("store") && <StoreContentV2 />}
|
|
||||||
</Section>
|
|
||||||
}
|
|
||||||
codeContent={<ClientLibrariesV2 />}
|
|
||||||
className="flex-col-reverse"
|
|
||||||
/>
|
|
||||||
<Tags />
|
|
||||||
</PageTitleProvider>
|
|
||||||
</AreaProvider>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ReferencePage
|
|
||||||
|
|
||||||
export function generateMetadata({ params: { area } }: ReferencePageProps) {
|
|
||||||
return {
|
|
||||||
title: `Medusa ${capitalize(area)} API Reference`,
|
|
||||||
description: `REST API reference for the Medusa ${area} API. This reference includes code snippets and examples for Medusa JS Client and cURL.`,
|
|
||||||
metadataBase: process.env.NEXT_PUBLIC_BASE_URL,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const dynamicParams = false
|
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
area: "admin",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
area: "store",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 253 KiB |
@@ -24,7 +24,7 @@ export async function GET() {
|
|||||||
const defaultIndexData = {
|
const defaultIndexData = {
|
||||||
version: ["current"],
|
version: ["current"],
|
||||||
lang: "en",
|
lang: "en",
|
||||||
_tags: ["api", area],
|
_tags: ["api", `${area}-v2`],
|
||||||
}
|
}
|
||||||
// find and parse static headers from pages
|
// find and parse static headers from pages
|
||||||
const dom = await JSDOM.fromURL(getUrl(area))
|
const dom = await JSDOM.fromURL(getUrl(area))
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ import { NextResponse } from "next/server"
|
|||||||
import path from "path"
|
import path from "path"
|
||||||
import OpenAPIParser from "@readme/openapi-parser"
|
import OpenAPIParser from "@readme/openapi-parser"
|
||||||
import getPathsOfTag from "@/utils/get-paths-of-tag"
|
import getPathsOfTag from "@/utils/get-paths-of-tag"
|
||||||
import type { ExpandedDocument, Version } from "@/types/openapi"
|
import type { ExpandedDocument } from "@/types/openapi"
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url)
|
||||||
const area = searchParams.get("area")
|
const area = searchParams.get("area")
|
||||||
const version = (searchParams.get("version") as Version) || "1"
|
|
||||||
const expand = searchParams.get("expand")
|
const expand = searchParams.get("expand")
|
||||||
if (area !== "admin" && area !== "store") {
|
if (area !== "admin" && area !== "store") {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
@@ -21,11 +20,7 @@ export async function GET(request: Request) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
const baseSpecs = (await OpenAPIParser.parse(
|
const baseSpecs = (await OpenAPIParser.parse(
|
||||||
path.join(
|
path.join(process.cwd(), "specs", area, "openapi.yaml")
|
||||||
process.cwd(),
|
|
||||||
version === "1" ? "specs" : "specs-v2",
|
|
||||||
`${area}/openapi.yaml`
|
|
||||||
)
|
|
||||||
)) as ExpandedDocument
|
)) as ExpandedDocument
|
||||||
|
|
||||||
if (expand) {
|
if (expand) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { existsSync, readFileSync } from "fs"
|
import { existsSync, readFileSync } from "fs"
|
||||||
import { NextResponse } from "next/server"
|
import { NextResponse } from "next/server"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { Version } from "../../../../types/openapi"
|
|
||||||
|
|
||||||
type DownloadParams = {
|
type DownloadParams = {
|
||||||
params: {
|
params: {
|
||||||
@@ -10,16 +9,8 @@ type DownloadParams = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function GET(request: Request, { params }: DownloadParams) {
|
export function GET(request: Request, { params }: DownloadParams) {
|
||||||
const { searchParams } = new URL(request.url)
|
|
||||||
const { area } = params
|
const { area } = params
|
||||||
const version =
|
const filePath = path.join(process.cwd(), "specs", area, "openapi.full.yaml")
|
||||||
process.env.NEXT_PUBLIC_VERSIONING === "true"
|
|
||||||
? (searchParams.get("version") as Version) || "1"
|
|
||||||
: "1"
|
|
||||||
const filePath = path.join(
|
|
||||||
process.cwd(),
|
|
||||||
`${version === "1" ? "specs" : "specs-v2"}/${area}/openapi.full.yaml`
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!existsSync(filePath)) {
|
if (!existsSync(filePath)) {
|
||||||
return new NextResponse(null, {
|
return new NextResponse(null, {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextResponse } from "next/server"
|
import { NextResponse } from "next/server"
|
||||||
import { SchemaObject, Version } from "../../../types/openapi"
|
import { SchemaObject } from "../../../types/openapi"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { existsSync, promises as fs } from "fs"
|
import { existsSync, promises as fs } from "fs"
|
||||||
import { parseDocument } from "yaml"
|
import { parseDocument } from "yaml"
|
||||||
@@ -8,7 +8,6 @@ export async function GET(request: Request) {
|
|||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url)
|
||||||
let name = searchParams.get("name")
|
let name = searchParams.get("name")
|
||||||
const area = searchParams.get("area")
|
const area = searchParams.get("area")
|
||||||
const version = (searchParams.get("version") as Version) || "1"
|
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
@@ -40,7 +39,7 @@ export async function GET(request: Request) {
|
|||||||
|
|
||||||
const schemaPath = path.join(
|
const schemaPath = path.join(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
version === "1" ? "specs" : "specs-v2",
|
"specs",
|
||||||
area,
|
area,
|
||||||
"components",
|
"components",
|
||||||
"schemas",
|
"schemas",
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { NextResponse } from "next/server"
|
import { NextResponse } from "next/server"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import getPathsOfTag from "@/utils/get-paths-of-tag"
|
import getPathsOfTag from "@/utils/get-paths-of-tag"
|
||||||
import { Version } from "../../../types/openapi"
|
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url)
|
||||||
const tagName = searchParams.get("tagName") || ""
|
const tagName = searchParams.get("tagName") || ""
|
||||||
const area = searchParams.get("area")
|
const area = searchParams.get("area")
|
||||||
const version = (searchParams.get("version") as Version) || "1"
|
|
||||||
|
|
||||||
if (area !== "admin" && area !== "store") {
|
if (area !== "admin" && area !== "store") {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
@@ -23,10 +21,9 @@ export async function GET(request: Request) {
|
|||||||
|
|
||||||
// this is just to ensure that vercel picks up these files on build
|
// this is just to ensure that vercel picks up these files on build
|
||||||
path.join(process.cwd(), "specs")
|
path.join(process.cwd(), "specs")
|
||||||
path.join(process.cwd(), "specs-v2")
|
|
||||||
|
|
||||||
// get path files
|
// get path files
|
||||||
const paths = await getPathsOfTag(tagName, area, version)
|
const paths = await getPathsOfTag(tagName, area)
|
||||||
|
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,20 +11,19 @@ import { useMemo } from "react"
|
|||||||
import { config } from "../../config"
|
import { config } from "../../config"
|
||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
import VersionSwitcher from "../VersionSwitcher"
|
import VersionSwitcher from "../VersionSwitcher"
|
||||||
import { useVersion } from "../../providers/version"
|
import basePathUrl from "../../utils/base-path-url"
|
||||||
|
|
||||||
const Navbar = () => {
|
const Navbar = () => {
|
||||||
const { setMobileSidebarOpen, mobileSidebarOpen } = useSidebar()
|
const { setMobileSidebarOpen, mobileSidebarOpen } = useSidebar()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const { isLoading } = usePageLoading()
|
const { isLoading } = usePageLoading()
|
||||||
const { isVersioningEnabled } = useVersion()
|
|
||||||
|
|
||||||
const navbarItems = useMemo(
|
const navbarItems = useMemo(
|
||||||
() =>
|
() =>
|
||||||
getNavbarItems({
|
getNavbarItems({
|
||||||
basePath: config.baseUrl,
|
basePath: config.baseUrl,
|
||||||
activePath: pathname,
|
activePath: pathname,
|
||||||
version: process.env.NEXT_PUBLIC_SHOW_V2 ? "v1" : "legacy",
|
version: "v2",
|
||||||
}),
|
}),
|
||||||
[pathname]
|
[pathname]
|
||||||
)
|
)
|
||||||
@@ -32,17 +31,15 @@ const Navbar = () => {
|
|||||||
return (
|
return (
|
||||||
<UiNavbar
|
<UiNavbar
|
||||||
logo={{
|
logo={{
|
||||||
light: "/images/logo-icon.png",
|
light: basePathUrl("/images/logo-icon.png"),
|
||||||
dark: "/images/logo-icon-dark.png",
|
dark: basePathUrl("/images/logo-icon-dark.png"),
|
||||||
}}
|
}}
|
||||||
items={navbarItems}
|
items={navbarItems}
|
||||||
mobileMenuButton={{
|
mobileMenuButton={{
|
||||||
setMobileSidebarOpen,
|
setMobileSidebarOpen,
|
||||||
mobileSidebarOpen,
|
mobileSidebarOpen,
|
||||||
}}
|
}}
|
||||||
additionalActionsBefore={
|
additionalActionsBefore={<VersionSwitcher />}
|
||||||
<>{isVersioningEnabled && <VersionSwitcher />}</>
|
|
||||||
}
|
|
||||||
additionalActionsAfter={<FeedbackModal />}
|
additionalActionsAfter={<FeedbackModal />}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { capitalize } from "docs-ui"
|
|
||||||
import { useArea } from "../../providers/area"
|
|
||||||
import { useVersion } from "../../providers/version"
|
|
||||||
|
|
||||||
type PageHeadingProps = {
|
|
||||||
className?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const PageHeading = ({ className }: PageHeadingProps) => {
|
|
||||||
const { area } = useArea()
|
|
||||||
const { version, isVersioningEnabled } = useVersion()
|
|
||||||
|
|
||||||
const versionText = isVersioningEnabled ? ` V${version}` : ""
|
|
||||||
|
|
||||||
return (
|
|
||||||
<h1 className={className}>
|
|
||||||
Medusa{versionText} {capitalize(area)} API Reference
|
|
||||||
</h1>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PageHeading
|
|
||||||
@@ -4,7 +4,7 @@ import getSectionId from "@/utils/get-section-id"
|
|||||||
import type { OpenAPIV3 } from "openapi-types"
|
import type { OpenAPIV3 } from "openapi-types"
|
||||||
import useSWR from "swr"
|
import useSWR from "swr"
|
||||||
import type { Operation, PathsObject } from "@/types/openapi"
|
import type { Operation, PathsObject } from "@/types/openapi"
|
||||||
import { useSidebar, swrFetcher, getLinkWithBasePath } from "docs-ui"
|
import { useSidebar, swrFetcher } from "docs-ui"
|
||||||
import { Fragment, useEffect, useMemo } from "react"
|
import { Fragment, useEffect, useMemo } from "react"
|
||||||
import dynamic from "next/dynamic"
|
import dynamic from "next/dynamic"
|
||||||
import type { TagOperationProps } from "../Operation"
|
import type { TagOperationProps } from "../Operation"
|
||||||
@@ -15,7 +15,7 @@ import getTagChildSidebarItems from "@/utils/get-tag-child-sidebar-items"
|
|||||||
import { useLoading } from "@/providers/loading"
|
import { useLoading } from "@/providers/loading"
|
||||||
import DividedLoading from "@/components/DividedLoading"
|
import DividedLoading from "@/components/DividedLoading"
|
||||||
import { SidebarItemSections, SidebarItemType } from "types"
|
import { SidebarItemSections, SidebarItemType } from "types"
|
||||||
import { useVersion } from "../../../providers/version"
|
import basePathUrl from "../../../utils/base-path-url"
|
||||||
|
|
||||||
const TagOperation = dynamic<TagOperationProps>(
|
const TagOperation = dynamic<TagOperationProps>(
|
||||||
async () => import("../Operation")
|
async () => import("../Operation")
|
||||||
@@ -28,7 +28,6 @@ export type TagPathsProps = {
|
|||||||
const TagPaths = ({ tag, className }: TagPathsProps) => {
|
const TagPaths = ({ tag, className }: TagPathsProps) => {
|
||||||
const tagSlugName = useMemo(() => getSectionId([tag.name]), [tag])
|
const tagSlugName = useMemo(() => getSectionId([tag.name]), [tag])
|
||||||
const { area } = useArea()
|
const { area } = useArea()
|
||||||
const { version } = useVersion()
|
|
||||||
const { items, addItems, findItemInSection } = useSidebar()
|
const { items, addItems, findItemInSection } = useSidebar()
|
||||||
const { baseSpecs } = useBaseSpecs()
|
const { baseSpecs } = useBaseSpecs()
|
||||||
const { loading } = useLoading()
|
const { loading } = useLoading()
|
||||||
@@ -44,10 +43,7 @@ const TagPaths = ({ tag, className }: TagPathsProps) => {
|
|||||||
paths: PathsObject
|
paths: PathsObject
|
||||||
}>(
|
}>(
|
||||||
!Object.keys(paths).length
|
!Object.keys(paths).length
|
||||||
? getLinkWithBasePath(
|
? basePathUrl(`/api/tag?tagName=${tagSlugName}&area=${area}`)
|
||||||
`/tag?tagName=${tagSlugName}&area=${area}&version=${version}`,
|
|
||||||
process.env.NEXT_PUBLIC_BASE_PATH
|
|
||||||
)
|
|
||||||
: null,
|
: null,
|
||||||
swrFetcher,
|
swrFetcher,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import getSectionId from "@/utils/get-section-id"
|
|||||||
import { useInView } from "react-intersection-observer"
|
import { useInView } from "react-intersection-observer"
|
||||||
import { useEffect, useMemo, useState } from "react"
|
import { useEffect, useMemo, useState } from "react"
|
||||||
import {
|
import {
|
||||||
getLinkWithBasePath,
|
|
||||||
isElmWindow,
|
isElmWindow,
|
||||||
swrFetcher,
|
swrFetcher,
|
||||||
useScrollController,
|
useScrollController,
|
||||||
@@ -25,8 +24,8 @@ import { usePathname } from "next/navigation"
|
|||||||
import formatReportLink from "@/utils/format-report-link"
|
import formatReportLink from "@/utils/format-report-link"
|
||||||
import { SchemaObject, TagObject } from "@/types/openapi"
|
import { SchemaObject, TagObject } from "@/types/openapi"
|
||||||
import useSWR from "swr"
|
import useSWR from "swr"
|
||||||
import { useVersion } from "@/providers/version"
|
|
||||||
import { TagSectionSchemaProps } from "./Schema"
|
import { TagSectionSchemaProps } from "./Schema"
|
||||||
|
import basePathUrl from "../../../utils/base-path-url"
|
||||||
|
|
||||||
export type TagSectionProps = {
|
export type TagSectionProps = {
|
||||||
tag: TagObject
|
tag: TagObject
|
||||||
@@ -54,14 +53,12 @@ const TagSection = ({ tag }: TagSectionProps) => {
|
|||||||
const { area } = useArea()
|
const { area } = useArea()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const { scrollableElement } = useScrollController()
|
const { scrollableElement } = useScrollController()
|
||||||
const { version } = useVersion()
|
|
||||||
const { data } = useSWR<{
|
const { data } = useSWR<{
|
||||||
schema: SchemaObject
|
schema: SchemaObject
|
||||||
}>(
|
}>(
|
||||||
tag["x-associatedSchema"]
|
tag["x-associatedSchema"]
|
||||||
? getLinkWithBasePath(
|
? basePathUrl(
|
||||||
`/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}&version=${version}`,
|
`/api/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}`
|
||||||
process.env.NEXT_PUBLIC_BASE_PATH
|
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
swrFetcher,
|
swrFetcher,
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import { useBaseSpecs } from "@/providers/base-specs"
|
|||||||
import dynamic from "next/dynamic"
|
import dynamic from "next/dynamic"
|
||||||
import type { TagSectionProps } from "./Section"
|
import type { TagSectionProps } from "./Section"
|
||||||
import { useArea } from "@/providers/area"
|
import { useArea } from "@/providers/area"
|
||||||
import { swrFetcher, useSidebar, getLinkWithBasePath } from "docs-ui"
|
import { swrFetcher, useSidebar } from "docs-ui"
|
||||||
import getSectionId from "@/utils/get-section-id"
|
import getSectionId from "@/utils/get-section-id"
|
||||||
import { ExpandedDocument } from "@/types/openapi"
|
import { ExpandedDocument } from "@/types/openapi"
|
||||||
import getTagChildSidebarItems from "@/utils/get-tag-child-sidebar-items"
|
import getTagChildSidebarItems from "@/utils/get-tag-child-sidebar-items"
|
||||||
import { SidebarItemSections } from "types"
|
import { SidebarItemSections } from "types"
|
||||||
import { useVersion } from "../../providers/version"
|
import basePathUrl from "../../utils/base-path-url"
|
||||||
|
|
||||||
const TagSection = dynamic<TagSectionProps>(
|
const TagSection = dynamic<TagSectionProps>(
|
||||||
async () => import("./Section")
|
async () => import("./Section")
|
||||||
@@ -33,14 +33,10 @@ const Tags = () => {
|
|||||||
const { baseSpecs, setBaseSpecs } = useBaseSpecs()
|
const { baseSpecs, setBaseSpecs } = useBaseSpecs()
|
||||||
const { addItems } = useSidebar()
|
const { addItems } = useSidebar()
|
||||||
const { area } = useArea()
|
const { area } = useArea()
|
||||||
const { version } = useVersion()
|
|
||||||
|
|
||||||
const { data } = useSWR<ExpandedDocument>(
|
const { data } = useSWR<ExpandedDocument>(
|
||||||
loadData && !baseSpecs
|
loadData && !baseSpecs
|
||||||
? getLinkWithBasePath(
|
? basePathUrl(`/api/base-specs?area=${area}&expand=${expand}`)
|
||||||
`/base-specs?area=${area}&expand=${expand}&version=${version}`,
|
|
||||||
process.env.NEXT_PUBLIC_BASE_PATH
|
|
||||||
)
|
|
||||||
: null,
|
: null,
|
||||||
swrFetcher,
|
swrFetcher,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,41 +3,20 @@
|
|||||||
import { Toggle } from "docs-ui"
|
import { Toggle } from "docs-ui"
|
||||||
import clsx from "clsx"
|
import clsx from "clsx"
|
||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
import { useVersion } from "../../providers/version"
|
|
||||||
|
|
||||||
const VersionSwitcher = () => {
|
const VersionSwitcher = () => {
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const { version } = useVersion()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex gap-0.5 justify-center items-center">
|
<div className="flex gap-0.5 justify-center items-center">
|
||||||
<span
|
<span className={clsx("text-medusa-fg-disabled")}>V1</span>
|
||||||
className={clsx(
|
|
||||||
version === "1" && "text-medusa-fg-subtle",
|
|
||||||
version === "2" && "text-medusa-fg-disabled"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
V1
|
|
||||||
</span>
|
|
||||||
<Toggle
|
<Toggle
|
||||||
checked={version === "2"}
|
checked={true}
|
||||||
onCheckedChange={(checked) => {
|
onCheckedChange={() => {
|
||||||
let newPath = pathname.replace("/v2", "")
|
location.href = process.env.NEXT_PUBLIC_API_V1_URL + pathname
|
||||||
if (checked) {
|
|
||||||
newPath += `/v2`
|
|
||||||
}
|
|
||||||
|
|
||||||
location.href = location.href.replace(pathname, newPath)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span
|
<span className={clsx("text-medusa-fg-subtle")}>V2</span>
|
||||||
className={clsx(
|
|
||||||
version === "1" && "text-medusa-fg-disabled",
|
|
||||||
version === "2" && "text-medusa-fg-subtle"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
V2
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { DocsConfig } from "types"
|
import { DocsConfig } from "types"
|
||||||
import { mobileSidebarItemsV1, legacyMobileSidebarItems } from "docs-ui"
|
import { mobileSidebarItemsV2 } from "docs-ui"
|
||||||
|
|
||||||
export const config: DocsConfig = {
|
export const config: DocsConfig = {
|
||||||
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
|
||||||
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
||||||
// sidebar is auto generated
|
// sidebar is auto generated
|
||||||
sidebar: {
|
sidebar: {
|
||||||
top: [
|
top: [
|
||||||
@@ -13,6 +14,6 @@ export const config: DocsConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
bottom: [],
|
bottom: [],
|
||||||
mobile: process.env.NEXT_PUBLIC_SHOW_V2 ? mobileSidebarItemsV1 : legacyMobileSidebarItems,
|
mobile: mobileSidebarItemsV2,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { NextResponse } from "next/server"
|
|
||||||
import type { NextRequest } from "next/server"
|
|
||||||
|
|
||||||
export function middleware(request: NextRequest) {
|
|
||||||
if (
|
|
||||||
process.env.NEXT_PUBLIC_VERSIONING !== "true" &&
|
|
||||||
request.url.includes("/v2")
|
|
||||||
) {
|
|
||||||
const url = new URL(request.url)
|
|
||||||
return NextResponse.redirect(
|
|
||||||
new URL(url.pathname.replace("/v2", ""), request.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
matcher: "/api/:path*",
|
|
||||||
}
|
|
||||||
@@ -3,45 +3,17 @@ import bundleAnalyzer from "@next/bundle-analyzer"
|
|||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2",
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
const fallbacks = [
|
|
||||||
{
|
|
||||||
source: "/ui",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_UI_URL}/ui`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/ui/:path*",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_UI_URL}/ui/:path*`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/:path*",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_DOCS_URL}/:path*`,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
if (process.env.NEXT_PUBLIC_SHOW_V2) {
|
|
||||||
fallbacks.push(
|
|
||||||
{
|
|
||||||
source: "/v2/resources",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/resources`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/v2/resources/:path*",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/resources/:path*`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/v2",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/v2/:path*",
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/:path*`,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fallback: fallbacks,
|
fallback: [
|
||||||
|
{
|
||||||
|
source: "/:path*",
|
||||||
|
destination: `${
|
||||||
|
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
|
||||||
|
}/:path*`,
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
webpack: (config) => {
|
webpack: (config) => {
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ const AreaProvider = ({ area: passedArea, children }: AreaProviderProps) => {
|
|||||||
const { defaultFilters, setDefaultFilters } = useSearch()
|
const { defaultFilters, setDefaultFilters } = useSearch()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!defaultFilters.includes(area)) {
|
if (!defaultFilters.includes(`${area}-v2`)) {
|
||||||
setDefaultFilters([area])
|
setDefaultFilters([`${area}-v2`])
|
||||||
}
|
}
|
||||||
}, [area, defaultFilters, setDefaultFilters])
|
}, [area, defaultFilters, setDefaultFilters])
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
import BaseSpecsProvider from "./base-specs"
|
import BaseSpecsProvider from "./base-specs"
|
||||||
import SidebarProvider from "./sidebar"
|
import SidebarProvider from "./sidebar"
|
||||||
import SearchProvider from "./search"
|
import SearchProvider from "./search"
|
||||||
import VersionProvider from "./version"
|
|
||||||
import { config } from "../config"
|
import { config } from "../config"
|
||||||
|
|
||||||
type ProvidersProps = {
|
type ProvidersProps = {
|
||||||
@@ -30,9 +29,7 @@ const Providers = ({ children }: ProvidersProps) => {
|
|||||||
<ScrollControllerProvider scrollableSelector="#main">
|
<ScrollControllerProvider scrollableSelector="#main">
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<SearchProvider>
|
<SearchProvider>
|
||||||
<MobileProvider>
|
<MobileProvider>{children}</MobileProvider>
|
||||||
<VersionProvider>{children}</VersionProvider>
|
|
||||||
</MobileProvider>
|
|
||||||
</SearchProvider>
|
</SearchProvider>
|
||||||
</SidebarProvider>
|
</SidebarProvider>
|
||||||
</ScrollControllerProvider>
|
</ScrollControllerProvider>
|
||||||
|
|||||||
@@ -3,11 +3,10 @@
|
|||||||
import {
|
import {
|
||||||
usePageLoading,
|
usePageLoading,
|
||||||
SearchProvider as UiSearchProvider,
|
SearchProvider as UiSearchProvider,
|
||||||
AiAssistantCommandIcon,
|
searchFiltersV2,
|
||||||
AiAssistantProvider,
|
|
||||||
searchFiltersV1,
|
|
||||||
} from "docs-ui"
|
} from "docs-ui"
|
||||||
import { config } from "../config"
|
import { config } from "../config"
|
||||||
|
import basePathUrl from "../utils/base-path-url"
|
||||||
|
|
||||||
type SearchProviderProps = {
|
type SearchProviderProps = {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
@@ -33,49 +32,26 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
|
|||||||
title: "Getting started? Try one of the following terms.",
|
title: "Getting started? Try one of the following terms.",
|
||||||
items: [
|
items: [
|
||||||
"Install Medusa with create-medusa-app",
|
"Install Medusa with create-medusa-app",
|
||||||
"Next.js quickstart",
|
"What is an API route?",
|
||||||
"Admin dashboard quickstart",
|
"What is a Module?",
|
||||||
"Commerce modules",
|
"What is a Workflow?",
|
||||||
"Medusa architecture",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Developing with Medusa",
|
title: "Developing with Medusa",
|
||||||
items: [
|
items: [
|
||||||
"Recipes",
|
"How to create a Module",
|
||||||
"How to create API routes",
|
"How to create an API route",
|
||||||
"How to create an entity",
|
"How to create a data model",
|
||||||
"How to create a plugin",
|
|
||||||
"How to create an admin widget",
|
"How to create an admin widget",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
checkInternalPattern: new RegExp(
|
checkInternalPattern: new RegExp(
|
||||||
`^${config.baseUrl}/api/(admin|store)`
|
`^${config.baseUrl}${basePathUrl("/api/(admin|store)")}`
|
||||||
),
|
),
|
||||||
filterOptions: searchFiltersV1,
|
filterOptions: searchFiltersV2,
|
||||||
}}
|
}}
|
||||||
commands={[
|
|
||||||
{
|
|
||||||
name: "ai-assistant",
|
|
||||||
icon: <AiAssistantCommandIcon />,
|
|
||||||
component: (
|
|
||||||
<AiAssistantProvider
|
|
||||||
apiUrl={process.env.NEXT_PUBLIC_AI_ASSISTANT_URL || "temp"}
|
|
||||||
websiteId={process.env.NEXT_PUBLIC_AI_WEBSITE_ID || "temp"}
|
|
||||||
recaptchaSiteKey={
|
|
||||||
process.env.NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY ||
|
|
||||||
"temp"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
title: "AI Assistant",
|
|
||||||
badge: {
|
|
||||||
variant: "purple",
|
|
||||||
children: "Beta",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</UiSearchProvider>
|
</UiSearchProvider>
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { createContext, useContext, useMemo } from "react"
|
|
||||||
import { Version } from "../types/openapi"
|
|
||||||
import { usePathname } from "next/navigation"
|
|
||||||
|
|
||||||
type VersionContextType = {
|
|
||||||
version: Version
|
|
||||||
isVersioningEnabled: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
const VersionContext = createContext<VersionContextType | null>(null)
|
|
||||||
|
|
||||||
type VersionProviderProps = {
|
|
||||||
children: React.ReactNode
|
|
||||||
}
|
|
||||||
|
|
||||||
const VersionProvider = ({ children }: VersionProviderProps) => {
|
|
||||||
const pathname = usePathname()
|
|
||||||
|
|
||||||
const version = useMemo(() => {
|
|
||||||
return pathname.includes("v2") ? "2" : "1"
|
|
||||||
}, [pathname])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<VersionContext.Provider
|
|
||||||
value={{
|
|
||||||
version,
|
|
||||||
isVersioningEnabled: process.env.NEXT_PUBLIC_VERSIONING === "true",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</VersionContext.Provider>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default VersionProvider
|
|
||||||
|
|
||||||
export const useVersion = (): VersionContextType => {
|
|
||||||
const context = useContext(VersionContext)
|
|
||||||
|
|
||||||
if (!context) {
|
|
||||||
throw new Error("useVersion must be used inside an VersionProvider")
|
|
||||||
}
|
|
||||||
|
|
||||||
return context
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/collections' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/collections' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/collections/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/collections/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/collections/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/currencies' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/customer-groups' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/customer-groups' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/customer-groups/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/customer-groups/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/customer-groups/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/customer-groups/{id}/customers' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/customer-groups/{id}/customers/batch' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"customer_ids": [
|
|
||||||
{
|
|
||||||
"id": "id_dx2Wieq4uGG"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/customers' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/customers' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/customers/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/customers/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/inventory-items' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/inventory-items' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/inventory-items/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/inventory-items/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/inventory-items/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"location_id": "{value}",
|
|
||||||
"stocked_quantity": 1506469662949376
|
|
||||||
}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/invites' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/invites' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/invites/accept' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"first_name": "{value}",
|
|
||||||
"last_name": "{value}"
|
|
||||||
}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/payments/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/payments/{id}/capture' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/payments/{id}/refund' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/price-lists' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/price-lists' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"title": "{value}",
|
|
||||||
"description": "{value}",
|
|
||||||
"prices": [
|
|
||||||
{
|
|
||||||
"currency_code": "{value}",
|
|
||||||
"amount": 1270314195484672,
|
|
||||||
"variant_id": "{value}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/price-lists/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/price-lists/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/price-lists/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"prices": [
|
|
||||||
{
|
|
||||||
"currency_code": "{value}",
|
|
||||||
"amount": 1670236243755008,
|
|
||||||
"variant_id": "{value}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/products' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/products/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/products/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products/{id}/options' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/products/{id}/options/{option_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products/{id}/options/{option_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/products/{id}/variants' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products/{id}/variants' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/products/{id}/variants/{variant_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/products/{id}/variants/{variant_id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/regions' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/regions' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/regions/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/regions/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/regions/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/sales-channels' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/sales-channels' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/sales-channels/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/sales-channels/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/sales-channels/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/stock-locations' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"name": "Dorthy"
|
|
||||||
}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/stock-locations/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/stock-locations/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/tax-rates' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/tax-rates' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"name": "Emilio",
|
|
||||||
"tax_region_id": "{value}"
|
|
||||||
}'
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/tax-rates/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/tax-rates/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/tax-rates/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/users' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X POST '{backend_url}/admin/users' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl -X DELETE '{backend_url}/admin/users/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
curl '{backend_url}/admin/users/{id}' \
|
|
||||||
-H 'x-medusa-access-token: {api_token}'
|
|
||||||
Loaded 100 of 2103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user