docs: refactor to use TypeScript, ESLint, and Tailwind CSS (#4136)
* docs(refactoring): configured eslint and typescript (#3511) * docs: configured eslint and typescript * fixed yarn.lock * docs(refactoring): migrate components directory to typescript (#3517) * docs: migrate components directory to typescript * removed vscode settings * fix following merge * docs: refactored QueryNote component (#3576) * docs: refactored first batch of theme components (#3579) * docs: refactored second batch of theme components (#3580) * added missing badge styles * fix after merge * docs(refactoring): migrated remaining component to TypeScript (#3770) * docs(refactoring): configured eslint and typescript (#3511) * docs: configured eslint and typescript * fixed yarn.lock * docs(refactoring): migrate components directory to typescript (#3517) * docs: migrate components directory to typescript * removed vscode settings * fix following merge * docs: refactored QueryNote component (#3576) * docs: refactored first batch of theme components (#3579) * docs: refactored second batch of theme components (#3580) * added missing badge styles * docs: refactoring second batch of theme components * fix after merge * refactored icons and other components * docs: refactored all components * docs(refactoring): set up and configured Tailwind Css (#3841) * docs: added tailwind config * docs: added more tailwind configurations * add includes option * added more tailwind configurations * fix to configurations * docs(refactoring): use tailwind css (#4134) * docs: added tailwind config * docs: added more tailwind configurations * add includes option * added more tailwind configurations * fix to configurations * docs(refactoring): refactored all styles to use tailwind css (#4132) * refactored Badge component to use tailwind css * refactored Bordered component to use tailwind css * updated to latest docusaurus * refactored BorderedIcon component to use tailwind css * refactored Feedback component to use tailwind css * refactored icons and footersociallinks to tailwind css * start refactoring of large card * refactored large card styling * refactored until admonitions * refactored until codeblock * refactored until Tabs * refactored Tabs (without testing * finished refactoring styles to tailwind css * upgraded to version 2.4.1 * general fixes * adjusted eslint configurations * fixed ignore files * fixes to large card * fix search styling * fix npx command * updated tabs to use isCodeTabs prop * fixed os tabs * removed os-tabs class in favor of general styling * improvements to buttons * fix for searchbar * fixed redocly download button * chore: added eslint code action (#4135) * small change in commerce modules page
This commit is contained in:
23
.github/workflows/docs-test.yml
vendored
23
.github/workflows/docs-test.yml
vendored
@@ -84,4 +84,25 @@ jobs:
|
||||
extension: eslint-docs
|
||||
|
||||
- name: Run Eslint
|
||||
run: yarn lint:docs
|
||||
run: yarn lint:docs
|
||||
|
||||
code-eslint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: www/docs
|
||||
run: yarn install
|
||||
|
||||
- name: Run Eslint
|
||||
working-directory: www/docs
|
||||
run: yarn lint
|
||||
@@ -302,7 +302,7 @@ If you are adding images to a documentation page, you can host the image on [Img
|
||||
|
||||
To use Tabs with Code Blocks, you have to use [Docusaurus's `Tabs` and `TabItem` components](https://docusaurus.io/docs/markdown-features/code-blocks#multi-language-support-code-blocks).
|
||||
|
||||
You must also pass to the `Tabs` component the prop `wrapperClassName="code-tabs"` to ensure correct styling.
|
||||
You must also pass to the `Tabs` component the prop `isCodeTabs={true}` to ensure correct styling.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -311,7 +311,7 @@ import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -344,7 +344,7 @@ For example:
|
||||
```md
|
||||
<Tabs
|
||||
groupId="request-type"
|
||||
wrapperClassName="code-tabs"
|
||||
isCodeTabs={true}
|
||||
codeTitle="/src/services/hello.ts">
|
||||
```
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ A Medusa project is composed of the backend, storefront, and admin.
|
||||
|
||||
In your terminal, run the following command:
|
||||
|
||||
<Tabs groupId="npxyarn" wrapperClassName='code-tabs'>
|
||||
<Tabs groupId="npxyarn" isCodeTabs={true}>
|
||||
<TabItem value="npx" label="NPX" default>
|
||||
|
||||
```bash
|
||||
@@ -63,6 +63,13 @@ In your terminal, run the following command:
|
||||
yarn create medusa-app
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="pnpm" label="pnpm">
|
||||
|
||||
```bash
|
||||
pnpm dlx create-medusa-app
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@ description: 'Learn step-by-step.'
|
||||
addHowToData: true
|
||||
---
|
||||
|
||||
import styles from '../deployment.module.css';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Deploy Your Medusa Backend on Heroku
|
||||
|
||||
In this document, you'll learn how to deploy your Medusa backend on Heroku. Heroku is a PaaS (Platform as a Service) that allows you to easily deploy your applications in the cloud.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
.osTabs {
|
||||
background-color: var(--ifm-note-background);
|
||||
padding: 10px;
|
||||
border: 1px solid var(--ifm-note-border-color);
|
||||
border-radius: var(--ifm-global-radius);
|
||||
color: var(--ifm-alert-foreground-color);
|
||||
}
|
||||
|
||||
.osTabs li:not([aria-selected=true]) {
|
||||
color: var(--ifm-color-content);
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
description: 'Learn how to prepare your development environment while using Medusa. This guide includes how to install Node.js, Git, Medusa CLI tool, and PostgreSQL.'
|
||||
---
|
||||
|
||||
import styles from './development.module.css';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
@@ -28,7 +27,7 @@ node -v
|
||||
|
||||
:::
|
||||
|
||||
<Tabs groupId="operating-systems" wrapperClassName={styles.osTabs}>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="windows" label="Windows" default>
|
||||
|
||||
You can install the executable directly from [the Node.js website](https://nodejs.org/en/#home-downloadhead).
|
||||
@@ -53,7 +52,7 @@ For other Linux distributions, you can check out [Node.js’s guide](https://nod
|
||||
|
||||
You can use the following commands to install Node.js on macOS:
|
||||
|
||||
<Tabs groupId="homebrew" wrapperClassName='code-tabs'>
|
||||
<Tabs groupId="homebrew" isCodeTabs={true}>
|
||||
<TabItem value="homebrew" label="Homebrew">
|
||||
|
||||
```bash
|
||||
@@ -89,7 +88,7 @@ Make sure that you have Xcode command line tools installed; if not, run the fol
|
||||
|
||||
Medusa uses Git behind the scenes when you create a new project so you'll have to install it on your computer to get started.
|
||||
|
||||
<Tabs groupId="operating-systems" wrapperClassName={styles.osTabs}>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="windows" label="Windows" default>
|
||||
|
||||
To install Git on Windows, you need to [download the installable package](https://git-scm.com/download/win).
|
||||
@@ -165,7 +164,7 @@ After installing PostgreSQL, check out the [Configure your Backend documentation
|
||||
|
||||
:::
|
||||
|
||||
<Tabs groupId="operating-systems" wrapperClassName={styles.osTabs}>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="windows" label="Windows">
|
||||
|
||||
You can [download the PostgreSQL Windows installer](https://www.postgresql.org/download/windows/) from their website.
|
||||
|
||||
@@ -302,7 +302,7 @@ The first step is to create a batch job using the [Create Batch Job endpoint](/a
|
||||
|
||||
For example, this creates a batch job of the type `publish-products`:
|
||||
|
||||
<Tabs groupId="request-types" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-types" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -363,7 +363,7 @@ Make sure to replace `<BACKEND_URL>` with the backend URL where applicable.
|
||||
|
||||
You can retrieve the batch job afterward to get its status and view details about the process in the `result` property:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -418,7 +418,7 @@ Based on the batch job strategy implemented in this documentation, the `result`
|
||||
|
||||
To process the batch job, send a request to [confirm the batch job](/api/admin/#tag/Batch-Job/operation/PostBatchJobsBatchJobConfirmProcessing):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -63,7 +63,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can retrieve a list of publishable API keys by sending a request to the [List Publishable API Keys](/api/admin/#tag/PublishableApiKey/operation/GetPublishableApiKeys) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -154,7 +154,7 @@ You can learn more about pagination in the [API reference](/api/admin/#section/P
|
||||
|
||||
You can create a publishable API key by sending a request to the [Create Publishable API Key](/api/admin/#tag/PublishableApiKey/operation/PostPublishableApiKeys) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -233,7 +233,7 @@ It returns the created publishable API key in the response.
|
||||
|
||||
You can update a publishable API key’s details by sending a request to the [Update Publishable API Key](/api/admin/#tag/PublishableApiKey/operation/PostPublishableApiKysPublishableApiKey) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -318,7 +318,7 @@ Revoking a publishable API key does not remove it, but does not allow using it i
|
||||
|
||||
You can revoke a publishable API key by sending a request to the [Revoke Publishable API Key](/api/admin/#tag/PublishableApiKey/operation/PostPublishableApiKeysPublishableApiKeyRevoke) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -388,7 +388,7 @@ This request requires the ID of the publishable API key as a path parameter. It
|
||||
|
||||
You can delete a publishable API key by sending a request to the [Delete Publishable API Key](/api/admin/#tag/PublishableApiKey/operation/DeletePublishableApiKeysPublishableApiKey) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -465,7 +465,7 @@ This section covers how to manage sales channels in a publishable API key. This
|
||||
|
||||
You can retrieve the list of sales channels associated with a publishable API key by sending a request to the [List Sales Channels](/api/admin/#tag/PublishableApiKey/operation/GetPublishableApiKeySalesChannels) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -548,7 +548,7 @@ It returns an array of sales channels associated with the publishable API key in
|
||||
|
||||
You can add a sales channel to a publishable API key by sending a request to the [Add Sales Channels](/api/admin/#tag/PublishableApiKey/operation/PostPublishableApiKeySalesChannelsChannelsBatch) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -658,7 +658,7 @@ This request returns the updated publishable API key in the response.
|
||||
|
||||
You can delete a sales channel from a publishable API key by sending a request to the [Delete Sales Channels](/api/admin/#tag/PublishableApiKey/operation/DeletePublishableApiKeySalesChannelsChannelsBatch) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -52,7 +52,7 @@ It's also assumed you already have [used CartProvider higher in your component t
|
||||
|
||||
You can create a cart with the following code snippet:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -115,7 +115,7 @@ The cart by default will have a random region assigned to it. You can specify th
|
||||
|
||||
Otherwise, you can assign it a specific region during creation:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -198,7 +198,7 @@ Notice that in the previous code snippets, you set the cart’s ID in the local
|
||||
|
||||
You can retrieve the cart at any given point using its ID with the following code snippet:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -261,7 +261,7 @@ A cart has different data associated with it including the region, email, addres
|
||||
|
||||
You can use the following snippet to update any of the cart’s data:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -327,7 +327,7 @@ A customer might add items to their cart, then creates an account or log in. In
|
||||
|
||||
You can do that using the same update operation:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -389,7 +389,7 @@ In case the customer doesn't want to use their own account, you must at least as
|
||||
|
||||
You can do that using the same update operation:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -449,7 +449,7 @@ fetch(`<BACKEND_URLL>/store/carts/${cartId}`, {
|
||||
|
||||
To create a line item of a product and add it to a cart, you can use the following code snippet:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -524,7 +524,7 @@ If you’re using Sales Channels, make sure that the cart and the product belong
|
||||
|
||||
To update a line item's quantity in the cart, you can use the following code snippet:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -591,7 +591,7 @@ It returns the updated cart.
|
||||
|
||||
To delete a line item from the cart, you can use the following code snippet:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -62,7 +62,7 @@ In this step, the customer generally enters their shipping info, then chooses th
|
||||
|
||||
After the customer enters their shipping address information, you must send a `POST` request to the [Update a Cart](/api/store/#tag/Cart/operation/PostCartsCart) API endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -166,7 +166,7 @@ After updating the cart with the customer’s address, the list of available [sh
|
||||
|
||||
You can retrieve the list of shipping options by sending a `GET` request to the [Retrieve Shipping Options for Cart API](/api/store/#tag/Shipping-Option/operation/GetShippingOptionsCartId) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -237,7 +237,7 @@ The request accepts the ID of the cart as a path parameter. It returns the array
|
||||
|
||||
Once the customer chooses one of the available shipping options, send a `POST` request to the [Add a Shipping Method](/api/store/#tag/Cart/operation/PostCartsCartShippingMethod) API endpoint. This will create a [shipping method](../shipping.md#shipping-method) based on the shipping option chosen and will associate it with the customer’s cart:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -311,7 +311,7 @@ When the page opens and before the payment providers are displayed to the custom
|
||||
|
||||
To initialize the payment sessions, send a `POST` request to the [Initialize Payment Sessions](/api/store/#tag/Cart/operation/PostCartsCartPaymentSessions) API endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -380,7 +380,7 @@ This endpoint accepts the ID of the cart as a path parameter. It returns the upd
|
||||
|
||||
When the customer chooses the payment processor they want to complete purchase with, you should select the payment session associated with that payment processor. To do that, send a `POST` request to the [Select a Payment Session](/api/store/#tag/Cart/operation/PostCartsCartPaymentSession) API endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -455,7 +455,7 @@ This step is optional and is only necessary for some payment processors. As ment
|
||||
|
||||
If you need to update that data at any point before the purchase is made, send a request to [Update a Payment Session](/api/store/#tag/Cart/operation/PostCartsCartPaymentSessionUpdate) API endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -541,7 +541,7 @@ The last step is to place the order by completing the cart. When you complete th
|
||||
|
||||
To complete a cart, send a `POST` request to the [Complete a Cart](/api/store/#tag/Cart/operation/PostCartsCartComplete) API endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -50,7 +50,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can create a customer group by sending a request to the Create Customer Group endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -133,7 +133,7 @@ This request requires the `name` parameter and optionally accepts the `metadata`
|
||||
|
||||
You can get a list of all customer groups by sending a request to the List Customer Groups endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -214,7 +214,7 @@ You can also pass filters and other selection query parameters to the request. C
|
||||
|
||||
You can retrieve a single customer group by sending a request to the Get a Customer Group endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -281,7 +281,7 @@ This request accepts the ID of the customer group to retrieve as a path paramete
|
||||
|
||||
You can update a customer group’s data by sending a request to the Update Customer Group endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -375,7 +375,7 @@ This request accepts the ID of the customer group as a path parameter, and optio
|
||||
|
||||
You can delete a customer group by sending a request to the Delete a Customer Group endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -445,7 +445,7 @@ This request accepts the ID of the customer group to delete as a path parameter.
|
||||
|
||||
You can add a customer to a group by sending a request to the Customer Group’s Add Customer endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -545,7 +545,7 @@ This request accepts the ID of the customer group as a path parameter. In its bo
|
||||
|
||||
You can retrieve a list of all customers in a customer group using the List Customers endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -628,7 +628,7 @@ Removing customers from a group does not remove them entirely. They’ll still b
|
||||
|
||||
You can remove customers from a customer group by sending a request to the Remove Customers endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can show a list of customers by sending a request to the [List Customers](/api/admin/#tag/Customer/operation/GetCustomers) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -141,7 +141,7 @@ Admins can create customer accounts. They have to supply the customer’s creden
|
||||
|
||||
You can create a customer account by sending a request to the [Create a Customer](/api/admin/#tag/Customer/operation/PostCustomers) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -248,7 +248,7 @@ An admin can edit a customer’s basic information and credentials.
|
||||
|
||||
You can edit a customer’s information by sending a request to the [Update a Customer](/api/admin/#tag/Customer/operation/PostCustomersCustomer) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -60,7 +60,7 @@ A customer can register with an email and a password to store and manage their d
|
||||
|
||||
You can register a new customer by sending a request to the [Create a Customer](/api/store/#tag/Customer/operation/PostCustomers) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -152,7 +152,7 @@ A customer can log in to your store to manage their data and make purchases usin
|
||||
|
||||
You can log in a customer into your store by sending a request to the [Customer Login](/api/store/#tag/Auth/operation/PostAuth) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -201,7 +201,7 @@ However, if you’re using the Fetch API, you must include the option `credentia
|
||||
|
||||
You can log out a customer by sending a request to the [Customer Logout](/api/store/#tag/Auth/operation/DeleteAuth) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -241,7 +241,7 @@ The customer must first enter their account’s email. Then, if an account with
|
||||
|
||||
You can request to reset a customer’s password by sending a request to the [Request Password Reset](/api/store/#tag/Customer/operation/PostCustomersCustomerPasswordToken) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -297,7 +297,7 @@ After the first step, the customer should receive an email with a link to a page
|
||||
|
||||
You can then reset the customer’s password to the new password they enter by sending a request to the [Reset Password](/api/store/#tag/Customer/operation/PostCustomersResetPassword) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -352,7 +352,7 @@ A logged-in customer can edit their info, such as their first name or email addr
|
||||
|
||||
You can edit a customer’s info using the [Update Customer](/api/store/#tag/Customer/operation/PostCustomersCustomer) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -437,7 +437,7 @@ The customer object returned in the requests mentioned in this document include
|
||||
|
||||
You can add a shipping address to a customer’s account by sending a request to the [Add a Shipping Address](/api/store/#tag/Customer/operation/PostCustomersCustomerAddresses) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -513,7 +513,7 @@ This request returns the updated customer object in the response.
|
||||
|
||||
You can edit a customer’s shipping address using the [Update a Shipping Address](/api/store/#tag/Customer/operation/PostCustomersCustomerAddressesAddress) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -558,7 +558,7 @@ This request returns the updated customer object in the response.
|
||||
|
||||
You can delete a shipping address by sending a request to the [Delete an Address](/api/store/#tag/Customer/operation/DeleteCustomersCustomerAddressesAddress) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -597,7 +597,7 @@ Logged-in customers can see their orders along with the orders’ details.
|
||||
|
||||
You can retrieve a customer’s orders by sending a request to the [List Orders](/api/store/#tag/Customer/operation/GetCustomersCustomerOrders) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -66,7 +66,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can create a discount by sending a request to the [Create Discount](/api/admin/#tag/Discount/operation/PostDiscounts) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -206,7 +206,7 @@ You can update any of the discount’s information, configurations, and conditio
|
||||
|
||||
For example, you can update the discount’s description and status by sending the following request:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -296,7 +296,7 @@ You can learn more about conditions and conditions types in the [Discount Archit
|
||||
|
||||
You can send a request to the [Create Condition](/api/admin/#tag/Discount-Condition/operation/PostDiscountsDiscountConditions) endpoint to create a condition in a discount:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -409,7 +409,7 @@ This request returns the full `discount` object in the response which includes a
|
||||
|
||||
You can retrieve a condition and its resources by sending a request to the [Get Condition](/api/admin/#tag/Discount-Condition/operation/GetDiscountsDiscountConditionsCondition) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -510,7 +510,7 @@ You can update a condition’s resources using the [Update Condition](/api/admin
|
||||
|
||||
For example, to update the products in a condition:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -610,7 +610,7 @@ This request returns the full `discount` object with the updated condition in th
|
||||
|
||||
You can delete a condition by sending a request to the [Delete Condition](/api/admin/#tag/Discount-Condition/operation/DeleteDiscountsDiscountConditionsCondition) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -685,7 +685,7 @@ It returns the `discount` object in the response.
|
||||
|
||||
You can delete a discount by sending a request to the [Delete Discount](/api/admin/#tag/Discount/operation/DeleteDiscountsDiscount) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -64,7 +64,7 @@ The customer can enter a discount code during the checkout flow to benefit from
|
||||
|
||||
You can add a discount to a customer’s cart by sending the [Update Cart request](/api/store/#tag/Cart/operation/PostCartsCart):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -255,7 +255,7 @@ The customer can choose to remove a discount from their cart.
|
||||
|
||||
You can remove a discount from a customer’s cart using the [Remove Discount request](/api/store/#tag/Cart/operation/DeleteCartsCartDiscountsDiscount):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -65,7 +65,7 @@ As gift cards are, before purchase, essentially products, you’ll be using prod
|
||||
|
||||
You can retrieve the gift card products by sending a request to the [List Products](/api/admin/#tag/Product/operation/GetProducts) endpoint, but filtering the products with the `is_giftcard` flag:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -154,7 +154,7 @@ The request returns the `products` array in the response which holds the gift ca
|
||||
|
||||
You can create a gift card product by sending a request to the [Create a Product](/api/admin/#tag/Product/operation/PostProducts) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -355,7 +355,7 @@ After creating a gift card, merchants can update it or its denomination.
|
||||
|
||||
You can update a gift card product’s details by sending a request to the [Update a Product](/api/admin/#tag/Product/operation/PostProductsProduct) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -434,7 +434,7 @@ This request returns the updated gift card product in the response.
|
||||
|
||||
You can delete a gift card product by sending a request to the [Delete a Product](/api/admin/#tag/Product/operation/DeleteProductsProduct) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -507,7 +507,7 @@ This section covers how to manage custom gift cards. You can create an unlimited
|
||||
|
||||
You can retrieve all custom gift cards by sending a request to the [List Gift Cards](/api/admin/#tag/Gift-Card/operation/GetGiftCards) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -581,7 +581,7 @@ Merchants can create custom gift cards to send a reward or gift to the customer.
|
||||
|
||||
You can create a custom gift card by sending a request to the [Create a Gift Card](/api/admin/#tag/Gift-Card/operation/PostGiftCards) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -666,7 +666,7 @@ Merchants can update any of the gift card’s properties, except for the value o
|
||||
|
||||
You can update a gift card by sending a request to the [Update a Gift Card](/api/admin/#tag/Gift-Card/operation/PostGiftCardsGiftCard) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -747,7 +747,7 @@ This request returns the updated gift card object in the response.
|
||||
|
||||
You can delete a custom gift card by sending a request to the [Delete a Gift Card](/api/admin/#tag/Gift-Card/operation/DeleteGiftCardsGiftCard) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -60,7 +60,7 @@ Customers should be able to view gift cards before they make the purchase. Gift
|
||||
|
||||
You can retrieve the gift card product using the [List Products](/api/store/#tag/Product/operation/GetProducts) endpoint, but passing it the `is_giftcard` query parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -149,7 +149,7 @@ After the customer purchases the gift card, they’ll receive a code to redeem t
|
||||
|
||||
You can retrieve the details of a gift card by sending a request to the [Get Gift Card by Code](/api/store/#tag/Gift-Card/operation/GetGiftCardsCode) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -224,7 +224,7 @@ A customer can redeem more than one gift card during checkout. The cart’s tota
|
||||
|
||||
You can redeem a gift card during checkout by sending a request to the [Update Cart](/api/store/#tag/Cart/operation/PostCartsCart) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -59,7 +59,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list inventory items by sending a request to the [List Inventory Items endpoint](/api/admin#tag/Inventory-Items/operation/GetInventoryItems):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -142,7 +142,7 @@ Inventory items are automatically created when a variant is created with `manage
|
||||
|
||||
You can create an inventory item by sending a request to the [Create Inventory Item endpoint](/api/admin#tag/Inventory-Items/operation/PostInventoryItems):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -221,7 +221,7 @@ This request returns the created inventory item as an object.
|
||||
|
||||
You can retrieve an inventory item by sending a request to the [Get Inventory Item endpoint](/api/admin#tag/Inventory-Items/operation/GetInventoryItemsInventoryItem):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -291,7 +291,7 @@ The request returns the inventory item as an object.
|
||||
|
||||
You can update an inventory item by sending a request to the [Update Inventory Item endpoint](/api/admin#tag/Inventory-Items/operation/PostInventoryItemsInventoryItem):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -378,7 +378,7 @@ This section shows you the different ways you can manage inventory levels. Each
|
||||
|
||||
You can list inventory levels of an inventory item by sending a request to the [List inventory levels endpoint](/api/admin#tag/Inventory-Items/operation/GetInventoryItemsInventoryItemLocationLevels):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -453,7 +453,7 @@ The request returns the inventory item as an object. In that object, the list of
|
||||
|
||||
You can create a location level by sending a request to the [Create Inventory Level endpoint](/api/admin#tag/Inventory-Items/operation/PostInventoryItemsInventoryItemLocationLevels):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -546,7 +546,7 @@ This request returns the inventory item associated with the created location lev
|
||||
|
||||
You can update a location level by sending a request to the [Update Location Level endpoint](/api/admin#tag/Inventory-Items/operation/PostInventoryItemsInventoryItemLocationLevelsLocationLevel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -634,7 +634,7 @@ The request returns the inventory item associated with the location level as an
|
||||
|
||||
You can delete a location level of an inventory item by sending a request to the [Delete Location Level endpoint](/api/admin#tag/Inventory-Items/operation/DeleteInventoryItemsInventoryIteLocationLevelsLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -706,7 +706,7 @@ The request returns the inventory item as an object.
|
||||
|
||||
You can delete an inventory item by sending a request to the [Delete Inventory Item endpoint](/api/admin#tag/Inventory-Items/operation/DeleteInventoryItemsInventoryItem):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -78,7 +78,7 @@ Item allocations are created automatically for items that are associated with pr
|
||||
|
||||
You can create an item allocation by sending a request to the [Create a Reservation endpoint](/api/admin#tag/Reservations/operation/PostReservations):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -174,7 +174,7 @@ When listing item allocations, by default, you’ll be retrieving all item alloc
|
||||
|
||||
You can retrieve the item allocations of a line item in an order using the [List Reservations endpoint](/api/admin#tag/Reservations/operation/GetReservations):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -251,7 +251,7 @@ The request returns the reservations along with [pagination fields](/api/admin#s
|
||||
|
||||
You can retrieve a single item allocation by its ID using the [Get a Reservation endpoint](/api/admin#tag/Reservations/operation/GetReservationsReservation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -317,7 +317,7 @@ The request returns the reservation as an object.
|
||||
|
||||
You can update an item allocation to change the location to allocate from or the quantity to allocate by sending a request to the [Update Reservation endpoint](/api/admin#tag/Reservations/operation/PostReservationsReservation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -404,7 +404,7 @@ Deleting an item allocation means that the quantity that was previously reserved
|
||||
|
||||
You can delete an item allocation by sending a request to the [Delete Reservation endpoint](/api/admin#tag/Reservations/operation/DeleteReservationsReservation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -475,7 +475,7 @@ The request returns the following fields:
|
||||
|
||||
When you create a fulfillment of an order, you can specify the location to fulfill the item from by passing the `location_id` parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -581,7 +581,7 @@ You can learn more about this endpoint’s parameters and response in the [API r
|
||||
|
||||
When requesting a return, you can specify the location to return the item to by passing the `location_id` parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -61,7 +61,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list stock locations by using the [List Stock Locations endpoint](/api/admin#tag/Stock-Locations/operation/GetStockLocations):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -138,7 +138,7 @@ The request returns an array of stock location objects along with [pagination pa
|
||||
|
||||
You can create a stock location using the [Create a Stock Location endpoint](/api/admin#tag/Stock-Locations/operation/PostStockLocations):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -217,7 +217,7 @@ This request returns the created stock location as an object.
|
||||
|
||||
You can retrieve a stock location by sending a request to the [Get Stock Location endpoint](/api/admin#tag/Stock-Locations/operation/GetStockLocationsStockLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -287,7 +287,7 @@ It returns the stock location as an object.
|
||||
|
||||
You can associate a stock location with a sales channel by sending a request to the [Associate Stock Channel endpoint](/api/admin#tag/Sales-Channels/operation/PostSalesChannelsSalesChannelStockLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -373,7 +373,7 @@ You can associate a location with more than one sales channel, and you can assoc
|
||||
|
||||
You can remove the association between a stock location and a sales channel by sending a request to the [Remove Stock Location Association endpoint](/api/admin#tag/Sales-Channels/operation/DeleteSalesChannelsSalesChannelStockLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -466,7 +466,7 @@ This request does not delete the stock location. It only removes the association
|
||||
|
||||
You can update a stock location by sending a request to the [Update Stock Location endpoint](/api/admin#tag/Stock-Locations/operation/PostStockLocationsStockLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -547,7 +547,7 @@ This request returns the updated stock location as an object.
|
||||
|
||||
You can delete a stock location by sending a request to the [Delete Stock Location endpoint](/api/admin#tag/Stock-Locations/operation/DeleteStockLocationsStockLocation):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -82,7 +82,7 @@ Before you can start making changes to an order, you have to create a new order
|
||||
|
||||
To do that, send a request to the [Create an OrderEdit](/api/admin/#tag/OrderEdit/operation/PostOrderEdits) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -176,7 +176,7 @@ You can only make changes to items that have not been fulfilled yet in the order
|
||||
|
||||
To add a new item to the original order, send a request to the [Add Line Item](/api/admin/#tag/OrderEdit/operation/PostOrderEditsEditLineItems) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -261,7 +261,7 @@ You can edit an item’s quantity in the original order.
|
||||
|
||||
To update an item, send a request to the [Update Line Item](/api/admin/#tag/OrderEdit/operation/PostOrderEditsEditLineItemsLineItem) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -344,7 +344,7 @@ This request returns the Order Edit object. You can access returned item changes
|
||||
|
||||
You can remove an item from the original order by sending a request to the [Remove Line Item](/api/admin/#tag/OrderEdit/operation/DeleteOrderEditsOrderEditLineItemsLineItem) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -415,7 +415,7 @@ A merchant might make a mistake while making a change to the original order’s
|
||||
|
||||
To revert an item change, send a request to the [Delete Item Change](/api/admin/#tag/OrderEdit/operation/DeleteOrderEditsOrderEditItemChange) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -493,7 +493,7 @@ After an Order Edit is created and all the item changes are added, it must be mo
|
||||
|
||||
To move an Order Edit into the request state, send a request to the [Request Confirmation](/api/admin/#tag/OrderEdit/operation/PostOrderEditsOrderEditRequest) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -589,7 +589,7 @@ This section covers how the Admin API can be used to force-confirm the Order Edi
|
||||
|
||||
To confirm an Order Edit, send a request to the [Confirm Order Edit](/api/admin/#tag/OrderEdit/operation/PostOrderEditsOrderEditConfirm) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -672,7 +672,7 @@ You can learn how to allow customers to authorize payment on the storefront in [
|
||||
|
||||
If the payment is authorized by the customer, it can be captured by sending a request to the [Capture Payment](/api/admin/#tag/Payment/operation/PostPaymentsPaymentCapture) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -738,7 +738,7 @@ When the total after the order edit is less than the original order total, the m
|
||||
|
||||
To refund the difference to the customer, send a request to the [Refund Payment](/api/admin/#tag/Payment/operation/PostPaymentsPaymentRefunds) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -60,7 +60,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
To view an order’s claims, you can retrieve the order using the [Get Order endpoint](/api/admin#tag/Orders/operation/GetOrdersOrder) and access the order’s claims:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -139,7 +139,7 @@ The request returns the order as an object. In that object, you can access an ar
|
||||
|
||||
You can create a claim by sending a request to the [Create Claim endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderClaims):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -257,7 +257,7 @@ The request returns the updated order as an object. You can access the order’s
|
||||
|
||||
You can update a claim by sending a request to the [Update Claim endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderClaimsClaim):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -348,7 +348,7 @@ Fulfillments are available on a claim object under the `fulfillments` property,
|
||||
|
||||
You can create a fulfillment for a claim by sending a request to the [Create Claim Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderClaimsClaimFulfillments):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -418,7 +418,7 @@ The request returns the updated order as an object. You can access the order’s
|
||||
|
||||
You can create a shipment for a claim by sending a request to the [Create Claim Shipment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderClaimsClaimShipments):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -510,7 +510,7 @@ You can’t cancel a fulfillment that has a shipment
|
||||
|
||||
You can cancel a fulfillment by sending a request to the [Cancel Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersClaimFulfillmentsCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -594,7 +594,7 @@ You can’t cancel a claim that has been refunded. You must also cancel the clai
|
||||
|
||||
You can cancel a claim by sending a request to the [Cancel Claim endpoint](/api/admin#tag/Orders/operation/PostOrdersClaimCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list draft orders by sending a request to the [List Draft Orders endpoint]( /api/admin#tag/Draft-Orders/operation/GetDraftOrders):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -127,7 +127,7 @@ The request returns an array of draft order objects along with [pagination param
|
||||
|
||||
You can create a draft order by sending a request to the [Create Draft Order endpoint]( /api/admin#tag/Draft-Orders/operation/PostDraftOrders):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -300,7 +300,7 @@ The request returns the created draft order as an object.
|
||||
|
||||
You can retrieve a draft order by sending a request to the [Get Draft Order endpoint]( /api/admin#tag/Draft-Orders/operation/GetDraftOrdersDraftOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -368,7 +368,7 @@ The request returns the draft order as an object.
|
||||
|
||||
You can update a draft order by sending a request to the [Update Draft Order endpoint]( /api/admin#tag/Draft-Orders/operation/PostDraftOrdersDraftOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -453,7 +453,7 @@ The request returns the updated draft order as an object.
|
||||
|
||||
You can add line items to a draft order by sending a request to the [Create Line Items endpoint]( /api/admin#tag/Draft-Orders/operation/PostDraftOrdersDraftOrderLineItems):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -543,7 +543,7 @@ The request returns the updated draft order as an object. You can access the dra
|
||||
|
||||
You can update a line item by sending a request to the [Update Line Item endpoint]( /api/admin#tag/Draft-Orders/operation/PostDraftOrdersDraftOrderLineItemsItem):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -627,7 +627,7 @@ The request returns the updated draft order as an object. You can access the dra
|
||||
|
||||
You can delete a line item by sending a request to the [Delete Line Item endpoint]( /api/admin#tag/Draft-Orders/operation/DeleteDraftOrdersDraftOrderLineItemsItem):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -698,7 +698,7 @@ Registering the draft order’s payment leads to authorizing and capturing the p
|
||||
|
||||
You can register the draft order payment by sending a request to the [Register Draft Order Payment endpoint]( /api/admin#tag/Draft-Orders/operation/PostDraftOrdersDraftOrderRegisterPayment):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -765,7 +765,7 @@ The request returns the order created from the draft order as an object.
|
||||
|
||||
You can delete a draft order by sending a request to the [Delete Draft Order endpoint]( /api/admin#tag/Draft-Orders/operation/DeleteDraftOrdersDraftOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -62,7 +62,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list orders by sending a request to the [List Orders endpoint](/api/admin#tag/Orders/operation/GetOrders):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -133,7 +133,7 @@ This endpoint accepts a variety of query parameters that allow you to filter ord
|
||||
|
||||
For example, you can filter the orders by one or more status:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -214,7 +214,7 @@ You can check available order statuses [here](../../../references/entities/enums
|
||||
|
||||
Another example is filtering the orders by a sales channel:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -295,7 +295,7 @@ curl -L -X GET '<BACKEND_URL>/admin/orders?sales_channel_id[]=<CHANNEL_ID>' \
|
||||
|
||||
You can also combine filters together:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -382,7 +382,7 @@ curl -L -X GET '<BACKEND_URL>/admin/orders?status[]=completed&sales_channel_id[]
|
||||
|
||||
You can retrieve an order by sending a request to the [Get an Order endpoint](/api/admin#tag/Orders/operation/GetOrdersOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -463,7 +463,7 @@ Updating an order’s details can include updating its:
|
||||
|
||||
You can update any of the above details of an order by sending a request to the [Update an Order endpoint](/api/admin#tag/Orders/operation/PostOrdersOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -548,7 +548,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can capture an order’s payment by sending a request to the [Capture Order’s Payment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderCapture):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -616,7 +616,7 @@ You can refund an amount that is less than `order.refundable_amount`.
|
||||
|
||||
To refund payment, send a request to the [Refund Payment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderRefunds):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -710,7 +710,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can create a fulfillment by sending a request to the [Create a Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderFulfillments):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -818,7 +818,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can create a shipment for a fulfillment by sending a request to the [Create Shipment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderShipment):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -899,7 +899,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can cancel a fulfillment by sending a request to the [Cancel Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderFulfillmentsCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -968,7 +968,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can mark an order completed, changing its status, by sending a request to the [Complete an Order endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderComplete):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -1035,7 +1035,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can cancel an order by sending a request to the [Cancel Order endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -1102,7 +1102,7 @@ The request returns the updated order as an object.
|
||||
|
||||
You can archive an order by sending a request to the [Archive Order endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderArchive):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -59,7 +59,7 @@ Return reasons allow you to specify why an item is returned. They are especially
|
||||
|
||||
You can list available return reasons using the [List Return Reasons endpoint](/api/admin#tag/Return-Reasons/operation/GetReturnReasons):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -132,7 +132,7 @@ The request returns an array of return reason objects.
|
||||
|
||||
You can create a return reason using the [Create Return Reason endpoint](/api/admin#tag/Return-Reasons/operation/PostReturnReasons):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -218,7 +218,7 @@ This request returns the created return reason as an object.
|
||||
|
||||
You can update a return reason by sending a request to the [Update Return Reason endpoint](/api/admin#tag/Return-Reasons/operation/PostReturnReasonsReason):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -299,7 +299,7 @@ The request returns the updated return reason as an object.
|
||||
|
||||
You can delete a return reason by sending a request to the [Delete Return Reason endpoint](/api/admin#tag/Return-Reasons/operation/DeleteReturnReason):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -376,7 +376,7 @@ You can view all returns in your commerce system, regardless of which order they
|
||||
|
||||
When you retrieve an order using the [Get Order endpoint](/api/admin#tag/Orders/operation/GetOrdersOrder), you can access the returns within the order object:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -469,7 +469,7 @@ You can retrieve a claim using the Get Order endpoint as explained [here](./mana
|
||||
|
||||
You can mark a return as received by sending a request to the [Receive a Return endpoint](/api/admin#tag/Returns/operation/PostReturnsReturnReceive):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -578,7 +578,7 @@ A received return can’t be canceled.
|
||||
|
||||
You can cancel a return by sending a request to the [Cancel Return endpoint](/api/admin#tag/Returns/operation/PostReturnsReturnCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -67,7 +67,7 @@ If you want to view all swaps in your system, and not swaps specific to an order
|
||||
|
||||
You can view an order’s swaps by retrieving the order using the [Get Order endpoint](/api/admin#tag/Orders/operation/GetOrdersOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -147,7 +147,7 @@ Processing a swap’s payment can mean either refunding or capturing payment, de
|
||||
|
||||
Regardless of whether you need to refund or capture the payment, you can process the swap’s payment by sending a request to the [Process Swap Payment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderSwapsSwapProcessPayment):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -222,7 +222,7 @@ Fulfillments are available on a swap object under the `fulfillments` property, w
|
||||
|
||||
You can create a fulfillment for a swap by sending a request to the [Create Swap Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderSwapsSwapFulfillments):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -294,7 +294,7 @@ The request returns the updated order as an object. You can access the order’s
|
||||
|
||||
You can create a shipment for a swap’s fulfillment using the [Create Swap Shipment endpoint](/api/admin#tag/Orders/operation/PostOrdersOrderSwapsSwapShipments):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -388,7 +388,7 @@ You can’t cancel a fulfillment that has a shipment
|
||||
|
||||
You can cancel a fulfillment by sending a request to the [Cancel Swap Fulfillment endpoint](/api/admin#tag/Orders/operation/PostOrdersSwapFulfillmentsCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -472,7 +472,7 @@ You can’t cancel a swap that has been refunded. You must also cancel all swap
|
||||
|
||||
You can cancel a swap by sending a request to the [Cancel Swap endpoint](/api/admin#tag/Orders/operation/PostOrdersSwapCancel):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -59,7 +59,7 @@ When a customer wants to create a return, they must choose the items they want t
|
||||
|
||||
You can optionally allow customers to choose a return shipping option that they’ll use to return the items. To show the customers the available return shipping options, send a request to the Get [Shipping Options endpoint](/api/store#tag/Shipping-Options/operation/GetShippingOptions):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -131,7 +131,7 @@ The request returns an array of shipping option objects.
|
||||
|
||||
You can create the return by sending a request to the [Create Return endpoint](/api/store#tag/Returns/operation/PostReturns):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -62,7 +62,7 @@ You can optionally allow customers to choose a return shipping option that they
|
||||
|
||||
After collecting the swap details in step 1, you can create a swap in the Medusa backend by sending a request to the [Create Swap endpoint](/api/store#tag/Swaps/operation/PostSwaps):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -190,7 +190,7 @@ When you complete the cart, the returned `type` field can be used to indicate th
|
||||
|
||||
During your checkout flow, you might need to retrieve the swap using the cart’s ID. For example, if you want to display the swap’s details after the cart is successfully completed. You can do that using the [Get by Cart ID endpoint](/api/store#tag/Swaps/operation/GetSwapsSwapCartId):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -72,7 +72,7 @@ You must have an existing order edit in the “request” state.
|
||||
|
||||
You can retrieve a single order edit by its ID by sending a request to the [Get Order Edit](/api/store/#tag/OrderEdit/operation/GetOrderEditsOrderEdit) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -200,7 +200,7 @@ If `difference_due` is greater than 0, then additional payment from the customer
|
||||
1. Show the customer the available payment processors. These can be retrieved from the details of [the region of the order](/api/store/#tag/Region/operation/GetRegionsRegion).
|
||||
2. When the customer selects the payment processor, initialize the payment session of that provider in the payment collection. You can do that by sending a request to the [Manage Payment Sessions](/api/store/#tag/Payment/operation/PostPaymentCollectionsSessions) endpoint, passing it the payment collection’s ID as a path parameter, and the payment processor's ID as a request body parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
<!-- eslint-disable max-len -->
|
||||
@@ -269,7 +269,7 @@ fetch(
|
||||
1. Show the customer the payment details form based on the payment session’s provider. For example, if the provider ID of a payment session is `stripe`, you must show Stripe’s card component to enter the customer’s card details.
|
||||
2. Authorize the payment using the payment processor. The [Authorize Payment Session](/api/store/#tag/Payment/operation/PostPaymentCollectionsSessionsSessionAuthorize) endpoint accepts the payment collection’s ID and the ID of the payment session as path parameters:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -337,7 +337,7 @@ After performing the above steps, you can [complete the Order Edit](#complete-th
|
||||
|
||||
To confirm and complete the order edit, send a request to the [Complete Order Edit](/api/store/#tag/OrderEdit/operation/PostOrderEditsOrderEditComplete) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -404,7 +404,7 @@ If the payment isn’t authorized first, the order edit completion will fail.
|
||||
|
||||
If the customer wants to decline the Order Edit, you can do that by sending a request to the Decline Order Edit endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -79,7 +79,7 @@ When the customer wants to claim an order, they must supply its ID.
|
||||
|
||||
To allow the customer to claim an order, send a request to the Claim an Order endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -137,7 +137,7 @@ The link in the email that the customer receives should be a page in your storef
|
||||
|
||||
Then, you send a request to the Verify Claim Order endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -38,7 +38,7 @@ Retrieving an order by its ID is useful for different scenarios, such as using a
|
||||
|
||||
You can retrieve an order by its ID using the [Get Order endpoint](/api/store#tag/Orders/operation/GetOrdersOrder):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -100,7 +100,7 @@ Display IDs allow you to show human-readable IDs to your customers. Retrieving a
|
||||
|
||||
You can retrieve an order by its display ID using the [Look Up Order endpoint](/api/store#tag/Orders/operation/GetOrders):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -172,7 +172,7 @@ In certain scenarios, you may need to retrieve an order’s details using the ID
|
||||
|
||||
You can retrieve an order by the cart ID using the [Get by Cart ID endpoint](/api/store#tag/Orders/operation/GetOrdersOrderCartId):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -232,6 +232,9 @@ If you have any questions about Medusa, its features, and development with it, f
|
||||
description: 'Learn how to create a payment processor.',
|
||||
},
|
||||
},
|
||||
]} />
|
||||
|
||||
<DocCardList colSize={4} items={[
|
||||
{
|
||||
type: 'link',
|
||||
href: '/modules/orders/admin/edit-order',
|
||||
@@ -259,4 +262,4 @@ If you have any questions about Medusa, its features, and development with it, f
|
||||
description: 'Manage sales channels.',
|
||||
}
|
||||
}
|
||||
]} />
|
||||
]} />
|
||||
@@ -71,7 +71,7 @@ The first step is to upload the CSV file to import prices from.
|
||||
|
||||
You can do that by sending the following request to the [Upload Files](/api/admin/#tag/Upload/operation/PostUploads) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -145,7 +145,7 @@ To start a new price import, you must create a batch job.
|
||||
|
||||
You can do that by sending the following request to the [Create a Batch Job](/api/admin/#tag/Batch-Job/operation/PostBatchJobs) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -259,7 +259,7 @@ After creating the batch job, it will be pre-processed. At this point, the CSV f
|
||||
|
||||
You can retrieve all the details of the batch job, including its status and the brief statistics related to the prices by sending the following request:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -349,7 +349,7 @@ A batch job can be confirmed only once the batch job has the status `pre_process
|
||||
|
||||
To confirm a batch job send the following request:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -76,7 +76,7 @@ You can learn more about what the conditions you can apply on a price list and i
|
||||
|
||||
For example, sending the following request creates a price list with two prices: one that is applied when the maximum quantity of the product variant in the cart is 3; another is applied when the minimum quantity of the same variant in the cart is 4:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -232,7 +232,7 @@ You can check the full list of request body parameters in the [API reference](/a
|
||||
|
||||
You can retrieve all of a price list’s details using the Get a Price List endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -298,7 +298,7 @@ After creating a price list, you can update all of its fields including its stat
|
||||
|
||||
For example, by sending the following request the end date of the price list will be updated:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -387,7 +387,7 @@ You can also set the `override` request body parameter to `true` to replace the
|
||||
|
||||
For example, sending the following request adds a new price to the price list:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
@@ -490,7 +490,7 @@ For a full list of request body parameters, check out the [API reference](/api/a
|
||||
|
||||
You can delete all the prices of a product’s variants using the [Delete Product Prices](/api/admin/#tag/Price-List/operation/DeletePriceListsPriceListProductsProductPrices) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```tsx
|
||||
@@ -564,7 +564,7 @@ This request returns the IDs of the deleted prices.
|
||||
|
||||
You can delete all the prices of a variant using the [Delete Variant Prices](/api/admin/#tag/Price-List/operation/DeletePriceListsPriceListVariantsVariantPrices) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```tsx
|
||||
@@ -641,7 +641,7 @@ This request returns the IDs of the deleted prices.
|
||||
|
||||
You can delete a price list, and subsequently all prices defined in it, using the [Delete Price List](/api/admin/#tag/Price-List/operation/DeletePriceListsPriceList) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -65,7 +65,7 @@ The first step is to upload the CSV file that you want to import products.
|
||||
|
||||
You can do that by sending the following request to the [Upload Files](/api/admin/#tag/Upload/operation/PostUploads) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -139,7 +139,7 @@ To start a new product import, you must create a batch job.
|
||||
|
||||
You can do that by sending the following request to the [Create a Batch Job](/api/admin/#tag/Batch-Job/operation/PostBatchJobs) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -247,7 +247,7 @@ After creating the batch job, it will be pre-processed. At this point, the CSV f
|
||||
|
||||
You can retrieve all the details of the batch job, including its status and the brief statistics related to the products by sending the following request:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -337,7 +337,7 @@ A batch job can be confirmed only once the batch job has the status `pre_process
|
||||
|
||||
To confirm a batch job send the following request:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -53,7 +53,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can retrieve available categories by sending a request to the [List Categories](/api/admin#tag/Product-Category/operation/GetProductCategories) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -133,7 +133,7 @@ You can also pass filters and other selection query parameters to the request. C
|
||||
|
||||
You can create a category by sending a request to the [Create a Category](/api/admin#tag/Product-Category/operation/PostProductCategories) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -217,7 +217,7 @@ The request returns the newly created product category.
|
||||
|
||||
You can retrieve a product category by sending a request to the [Get a Product Category](/api/admin#tag/Product-Category/operation/GetProductCategoriesCategory) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -287,7 +287,7 @@ It returns the full object of the product category.
|
||||
|
||||
You can edit a product category by sending a request to the [Update a Product Category](/api/admin#tag/Product-Category/operation/PostProductCategoriesCategory) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -382,7 +382,7 @@ You can manage the categories of each product individually using the [product AP
|
||||
|
||||
You can add more than one product to a category using the [Add Products to a Category](/api/admin#tag/Product-Category/operation/PostProductCategoriesCategoryProductsBatch) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -493,7 +493,7 @@ The request returns the full object of the product category updated with the new
|
||||
|
||||
You can remove products from a category by sending a request to the [Delete Products](/api/admin#tag/Product-Category/operation/DeleteProductCategoriesCategoryProductsBatch) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -610,7 +610,7 @@ The request returns the full object of the product category updated with the its
|
||||
|
||||
You can delete a product category by sending a request to the [Delete a Product Category](/api/admin#tag/Product-Category/operation/DeleteProductCategoriesCategory) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list products as an admin using the [List Products endpoint](/api/admin#tag/Products/operation/GetProducts):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -127,7 +127,7 @@ The request returns an array of products along with [pagination parameters](/api
|
||||
|
||||
You can create a product by sending a request to the [Create a Product endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProducts):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -401,7 +401,7 @@ You can learn more about pricing and zero-decimal currencies [here](../products.
|
||||
|
||||
You can retrieve a single product as an admin by sending a request to the [Get a Product endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/GetProductsProduct):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -469,7 +469,7 @@ The request returns the product as an object.
|
||||
|
||||
You can update a product by sending a request to the [Update Product endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProductsProduct):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -560,7 +560,7 @@ You can retrieve a product’s options by retrieving the product either using th
|
||||
|
||||
You can add a product option to a product by sending a request to the [Add Product Option endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProductsProductOptions):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -639,7 +639,7 @@ The request returns the updated product as an option. You can view available opt
|
||||
|
||||
You can update a product option by sending a request to the [Update Product Option endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProductsProductOptionsOption):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -723,7 +723,7 @@ The request returns the updated product as an option. You can view available opt
|
||||
|
||||
You can delete a product option by sending a request to the [Delete Product Option endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/DeleteProductsProductOptionsOption):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -805,7 +805,7 @@ You can retrieve a product’s variants by retrieving the product either using t
|
||||
|
||||
You can create a product variant by sending a request to the [Create Product Variant endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProductsProductVariants):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -940,7 +940,7 @@ The request returns the updated product. You can access the product’s variants
|
||||
|
||||
You can update a product variant by sending a request to the [Update a Product Variant endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProductsProductVariantsVariant):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -1024,7 +1024,7 @@ The request returns the updated product. You can access the product’s variants
|
||||
|
||||
You can delete a product variant by sending a request to the [Delete a Product Variant endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/DeleteProductsProductVariantsVariant):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -1098,7 +1098,7 @@ The request returns the following fields:
|
||||
|
||||
You can delete a product by sending a request to the [Delete a Product endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/DeleteProductsProduct):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -51,7 +51,7 @@ If you follow the Medusa React code blocks, it's assumed you already have [Medus
|
||||
|
||||
You can list available products using the [List Products endpoint](/api/store#tag/Products/operation/GetProducts):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -122,7 +122,7 @@ The List Products endpoint accepts different query parameters that allow you to
|
||||
|
||||
For example, you can filter products by a category ID:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -193,7 +193,7 @@ This will retrieve only products that belong to that category.
|
||||
|
||||
To expand the categories of each product, you can pass `categories` to the `expand` query parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -272,7 +272,7 @@ It’s recommended to always include the cart and region’s IDs when you’re l
|
||||
|
||||
For example:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -391,7 +391,7 @@ Medusa React provides utility methods such as `formatVariantPrice` that handles
|
||||
|
||||
Here’s an example of how you can calculate the price with and without Medusa React:
|
||||
|
||||
<Tabs groupId="client-preference" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="client-preference" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Without Medusa Client" default>
|
||||
|
||||
```tsx
|
||||
@@ -505,7 +505,7 @@ The Search functionality requires either installing a [search plugin](../../../p
|
||||
|
||||
You can search products using the [Search Products endpoint](/api/store#tag/Products/operation/PostProductsSearch):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -551,7 +551,7 @@ The request returns a `hits` array holding the result items. The structure of th
|
||||
|
||||
You can retrieve the details of a single product by its ID using the [Get a Product endpoint](/api/store#tag/Products/operation/GetProductsProduct):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -618,7 +618,7 @@ On the storefront, you may use the handle of a product as its page’s path. For
|
||||
|
||||
You can retrieve the details of a product by its handle by sending a request to the List Products endpoint, passing the `handle` as a filter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -49,7 +49,7 @@ If you follow the Medusa React code blocks, it's assumed you already have [Medus
|
||||
|
||||
You can list product categories by sending a request to the [List Product Categories endpoint](/api/store#tag/Product-Category/operation/GetProductCategories):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -132,7 +132,7 @@ By default, the categories are not retrieved along with their nested children. T
|
||||
|
||||
You can retrieve a single product category by its ID using the [Get a Product Category endpoint](/api/store#tag/Product-Category/operation/GetProductCategoriesCategory):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -200,7 +200,7 @@ On the storefront, you may use the handle of a category as its page’s path. Fo
|
||||
|
||||
You can retrieve the details of a category by its handle by sending a request to the List Categories endpoint, passing the `handle` as a filter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -62,7 +62,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list all available currencies in your system by sending a request to the [List Currencies endpoint](/api/admin#tag/Currencies/operation/GetCurrencies):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -136,7 +136,7 @@ This request returns an array of currencies along with pagination parameters.
|
||||
|
||||
You can update a currency by sending a request to the [Update Currency endpoint](/api/admin#tag/Currencies/operation/PostCurrenciesCurrency):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -227,7 +227,7 @@ This section explains how you can manage the currencies of a store.
|
||||
|
||||
You can list currencies in a store by sending a request to the [Get Store Details endpoint](/api/admin#tag/Store/operation/GetStore):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -305,7 +305,7 @@ This request returns the store as an object. In that object, there are two prope
|
||||
|
||||
You can add a currency to a store using the [Add a Currency Code endpoint](/api/admin#tag/Store/operation/PostStoreCurrenciesCode):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -368,7 +368,7 @@ The request returns the updated store as an object. You can access the new list
|
||||
|
||||
You can remove a currency from a store by sending a request to the [Delete Currency Code endpoint](/api/admin#tag/Store/operation/DeleteStoreCurrenciesCode):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -62,7 +62,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can retrieve regions available on your backend using the [List Regions](/api/admin/#tag/Region/operation/GetRegions) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -136,7 +136,7 @@ You can also pass filters and other selection query parameters to the request. C
|
||||
|
||||
You can create a region by sending a request to the [Create a Region](/api/admin/#tag/Region/operation/PostRegions) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -270,7 +270,7 @@ You can update any of the region’s fields and configurations. The REST APIs of
|
||||
|
||||
Alternatively, you can update the details of a region using the [Update a Region](/api/admin/#tag/Region/operation/PostRegionsRegion) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -369,7 +369,7 @@ In the example above, the list of countries replace any countries that were prev
|
||||
|
||||
You can add a shipping option to a region by sending a request to the [Create Shipping Option](/api/admin/#tag/Shipping-Option/operation/PostShippingOptions) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -488,7 +488,7 @@ You can also manage shipping options such as list, update, and delete. You can l
|
||||
|
||||
You can delete a region by sending a request to the [Delete a Region](/api/admin/#tag/Region/operation/DeleteRegionsRegion) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ Customers should be able to see the list of available regions and select their r
|
||||
|
||||
You can retrieve available regions by sending a request to the [List Regions](/api/store/#tag/Region/operation/GetRegions) endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -123,7 +123,7 @@ To retrieve products with the prices based on the selected regions, you can pass
|
||||
|
||||
For example:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -196,7 +196,7 @@ You can learn how to implement cart functionalities in your storefront in [this
|
||||
|
||||
For example:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can create a sales channel by sending a request to the Create a Sales Channel endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -137,7 +137,7 @@ It returns the created sales channel.
|
||||
|
||||
You can list all sales channels by sending a request to the List Sales Channels endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -209,7 +209,7 @@ This request returns an array of all sales channels in your store. You can also
|
||||
|
||||
You can retrieve a sales channel’s details by its ID using the Get Sales Channel endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -274,7 +274,7 @@ This request returns the sales channel with the specified ID.
|
||||
|
||||
You can update a Sales Channel’s details and attributes by sending a request to the Update Sales Channel endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -357,7 +357,7 @@ You can check out [the API Reference for a full list of body parameters](/api/ad
|
||||
|
||||
You can delete a sales channel by sending a request to the Delete Sales Channel endpoint with the ID of the sales channel to delete:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -424,7 +424,7 @@ The ID of the deleted sales channel is returned in the response.
|
||||
|
||||
To add a product to a sales channel, send a request to the Sales Channel’s Add Products endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -524,7 +524,7 @@ This request returns the sales channel.
|
||||
|
||||
You can list the products available in a sales channel by sending a request to the List Products endpoint and passing the `sales_channel_id` query parameter to filter by a specific sales channel:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -616,7 +616,7 @@ Deleting a product from a sales channel doesn't delete it completely. It only ma
|
||||
|
||||
You can delete a product from a sales channel by sending a request to the Sales Channel’s Delete Products endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
<!-- eslint-disable max-len -->
|
||||
@@ -722,7 +722,7 @@ This request returns the sales channel.
|
||||
|
||||
You can filter orders by a specific sales channel by sending a request to the List Orders endpoint and passing the `sales_channel_id` query parameter to filter by a specific sales channel:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -55,7 +55,7 @@ For requests that use the cart, it's also assumed you already have [used CartPro
|
||||
|
||||
To filter products by a specific sales channel, pass the `sales_channel_id` query parameter to the List Products endpoint:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -129,7 +129,7 @@ The request returns an array of products. These are the products that are availa
|
||||
|
||||
To associate a sales channel with a cart while creating it, you can pass the `sales_channel_id` request body parameter with the ID of the sales channel:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ The request returns the created cart.
|
||||
|
||||
You can update the sales channel of an existing cart by passing the `sales_channel_id` request body parameter with the ID of the sales channel:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -53,7 +53,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list the tax rates by sending a request to the [List Tax Rates endpoint](/api/admin#tag/Tax-Rates/operation/GetTaxRates):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -124,7 +124,7 @@ The endpoint returns an array of tax rate objects along with [pagination paramet
|
||||
|
||||
You can retrieve the tax rate of a region by passing the `region_id` query parameter:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -195,7 +195,7 @@ In the example above, you pass the region’s ID as the value of the `region_id`
|
||||
|
||||
This query parameter also accepts an array of strings, allowing you to filter the tax rates by more than one region:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -270,7 +270,7 @@ curl -L -X GET '<BACKEND_URL>/admin/tax-rates?region_id[]=reg_123®ion_id[]=re
|
||||
|
||||
You can create a tax rate by sending a request to the [Create Tax Rate endpoint](/api/admin#tag/Tax-Rates/operation/PostTaxRates):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -373,7 +373,7 @@ The request returns the created tax rate as an object.
|
||||
|
||||
You can update a tax rate by sending a request to the [Update Tax Rate endpoint](/api/admin#tag/Tax-Rates/operation/PostTaxRatesTaxRate):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -458,7 +458,7 @@ This section explains how you can add and remove products from a tax rate.
|
||||
|
||||
You can add a product to a tax rate by sending a request to the [Add Products endpoint](/api/admin#tag/Tax-Rates/operation/PostTaxRatesTaxRateProducts):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -547,7 +547,7 @@ The request returns the updated tax rate as an object. You can access the tax ra
|
||||
|
||||
You can remove a product from a tax rate by sending a request to the [Delete Products endpoint](/api/admin#tag/Tax-Rates/operation/DeleteTaxRatesTaxRateProducts):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -642,7 +642,7 @@ This section explains how you can add and remove product types from a tax rate.
|
||||
|
||||
You can add a product type to a tax rate by sending a request to the [Add Product Types endpoint](/api/admin#tag/Tax-Rates/operation/PostTaxRatesTaxRateProductTypes):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -735,7 +735,7 @@ The request returns the updated tax rate as an object. You can access the tax ra
|
||||
|
||||
You can remove a product type from a tax rate by sending a request to the [Delete Product Types endpoint](/api/admin#tag/Tax-Rates/operation/DeleteTaxRatesTaxRateProductTypes):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -834,7 +834,7 @@ This section explains how you can add and remove shipping options from a tax rat
|
||||
|
||||
You can add a shipping option to a tax rate by sending a request to the [Add Shipping Option endpoint](/api/admin#tag/Tax-Rates/operation/PostTaxRatesTaxRateShippingOptions):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -925,7 +925,7 @@ The request returns the updated tax rate as an object. You can access the tax ra
|
||||
|
||||
You can remove a shipping option from a tax rate by sending a request to the [Delete Shipping Options endpoint](/api/admin#tag/Tax-Rates/operation/DeleteTaxRatesTaxRateShippingOptions):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -1018,7 +1018,7 @@ The request returns the updated tax rate as an object. You can access the tax ra
|
||||
|
||||
You can delete a tax rate by sending a request to the [Delete Tax Rate endpoint](/api/admin#tag/Tax-Rates/operation/DeleteTaxRatesTaxRate):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list all tax providers of a store using the [List Tax Providers endpoint](/api/admin#tag/Store/operation/GetStoreTaxProviders):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -130,7 +130,7 @@ The request returns an array of tax provider objects.
|
||||
|
||||
You can change the tax provider of a region using the [Update Region endpoint](/api/admin#tag/Regions/operation/PostRegionsRegion):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -211,7 +211,7 @@ The request returns the updated region as an object.
|
||||
|
||||
In addition to changing the tax provider, you can use the same [Update Region endpoint](/api/admin#tag/Regions/operation/PostRegionsRegion) to update the region’s other tax settings:
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -56,7 +56,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can list invites by sending a request to the [List Invite endpoint](/api/admin#tag/Invites/operation/GetInvites):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -127,7 +127,7 @@ The request returns an array of invite endpoints.
|
||||
|
||||
You can create an invite by sending a request to the [Create Invite endpoint](/api/admin#tag/Invites/operation/PostInvites):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -215,7 +215,7 @@ A logged-out user can accept an invite, which would create a user for that user.
|
||||
|
||||
You can accept an invite by sending a request to the [Accept Invite endpoint](/api/admin#tag/Invites/operation/PostInvitesInviteAccept):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -319,7 +319,7 @@ The request does not return any data. If the invite was accepted successfully, t
|
||||
|
||||
You can resend an invite if it’s not accepted yet. To resend an invite, send a request to the [Resend Invite endpoint](/api/admin#tag/Invites/operation/PostInvitesInviteResend):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -384,7 +384,7 @@ The request does not return any data. If the invite was resent successfully, the
|
||||
|
||||
You can delete an invite by sending a request to the [Delete Invite endpoint](/api/admin#tag/Invites/operation/DeleteInvitesInvite):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -54,7 +54,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can log in a user by sending a request to the [User Login endpoint](/api/admin#tag/Auth/operation/PostAuth):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -137,7 +137,7 @@ The request returns the logged-in user as an object.
|
||||
|
||||
You can log out a user by sending a request to the [User Logout endpoint](/api/admin#tag/Auth/operation/DeleteAuth):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -202,7 +202,7 @@ The request does not return any data. The response code will be `200` for succes
|
||||
|
||||
You can retrieve the current user’s details for their profile by sending a request to the [Get Current User endpoint](/api/admin#tag/Auth/operation/GetAuth):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -266,7 +266,7 @@ The request returns the current user as an object.
|
||||
|
||||
You can update a user’s details in their profile by sending a request to the [Update User endpoint](/api/admin#tag/Users/operation/PostUsersUser):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -362,7 +362,7 @@ Sending the password reset email is not handled by default in the Medusa backend
|
||||
|
||||
You can request a password reset by sending a request to the [Request Password Reset endpoint](/api/admin#tag/Users/operation/PostUsersUserPasswordToken):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -440,7 +440,7 @@ After the user resets their password and, typically, receives an email with a li
|
||||
|
||||
You can reset the password by sending a request to the [Reset Password endpoint](/api/admin#tag/Users/operation/PostUsersUserPassword):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -55,7 +55,7 @@ You can learn more about [authenticating as an admin user in the API reference](
|
||||
|
||||
You can retrieve users in a store by sending a request to the [List Users endpoint](/api/admin#tag/Users/operation/GetUsers):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -126,7 +126,7 @@ The request returns an array of user objects.
|
||||
|
||||
You can create a user by sending a request to the [Create User endpoint](/api/admin#tag/Users/operation/PostUsers):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -214,7 +214,7 @@ The request returns the created user as an object.
|
||||
|
||||
You can update a user’s details by sending a request to the [Update User endpoint](/api/admin#tag/Users/operation/PostUsersUser):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
@@ -295,7 +295,7 @@ The request returns the updated user as an object.
|
||||
|
||||
You can delete a user by sending a request to the [Delete User endpoint](/api/admin#tag/Users/operation/DeleteUsersUser):
|
||||
|
||||
<Tabs groupId="request-type" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="request-type" isCodeTabs={true}>
|
||||
<TabItem value="client" label="Medusa JS Client" default>
|
||||
|
||||
```ts
|
||||
|
||||
@@ -43,7 +43,7 @@ command not found: medusa
|
||||
|
||||
You have to add Yarn’s install location to the PATH variable:
|
||||
|
||||
<Tabs groupId="operating-systems" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="operating-systems" isCodeTabs={true}>
|
||||
<TabItem value="unix" label="MacOS / Linux" default>
|
||||
|
||||
```bash
|
||||
|
||||
@@ -7,7 +7,7 @@ This error can occur while installing one of the storefronts or the Medusa admin
|
||||
|
||||
One way to resolve it is by removing the `node_modules` directory in the project and re-installing the dependencies:
|
||||
|
||||
<Tabs groupId="operating-systems" wrapperClassName="code-tabs">
|
||||
<Tabs groupId="operating-systems" isCodeTabs={true}>
|
||||
<TabItem value="unix" label="MacOS / Linux" default>
|
||||
|
||||
```bash
|
||||
|
||||
5
www/docs/.eslintignore
Normal file
5
www/docs/.eslintignore
Normal file
@@ -0,0 +1,5 @@
|
||||
**/node_modules/*
|
||||
**/.docusaurus/*
|
||||
**/build/*
|
||||
.eslintrc.js
|
||||
babel.config.js
|
||||
120
www/docs/.eslintrc.js
Normal file
120
www/docs/.eslintrc.js
Normal file
@@ -0,0 +1,120 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: "@babel/eslint-parser",
|
||||
parserOptions: {
|
||||
requireConfigFile: false,
|
||||
ecmaFeatures: {
|
||||
experimentalDecorators: true,
|
||||
jsx: true
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
"prettier"
|
||||
],
|
||||
extends: [
|
||||
"plugin:@docusaurus/recommended",
|
||||
"eslint:recommended",
|
||||
"google",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime",
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect"
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
curly: ["error", "all"],
|
||||
"new-cap": "off",
|
||||
"require-jsdoc": "off",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": "off",
|
||||
camelcase: "off",
|
||||
"no-invalid-this": "off",
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
code: 80,
|
||||
ignoreStrings: true,
|
||||
ignoreRegExpLiterals: true,
|
||||
ignoreComments: true,
|
||||
ignoreTrailingComments: true,
|
||||
ignoreUrls: true,
|
||||
ignoreTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
semi: ["error", "never"],
|
||||
quotes: [
|
||||
"error",
|
||||
"double",
|
||||
{
|
||||
allowTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
{
|
||||
arrays: "always-multiline",
|
||||
objects: "always-multiline",
|
||||
imports: "always-multiline",
|
||||
exports: "always-multiline",
|
||||
functions: "never",
|
||||
},
|
||||
],
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"arrow-parens": ["error", "always"],
|
||||
"linebreak-style": 0,
|
||||
"no-confusing-arrow": [
|
||||
"error",
|
||||
{
|
||||
allowParens: false,
|
||||
},
|
||||
],
|
||||
"space-before-function-paren": [
|
||||
"error",
|
||||
{
|
||||
anonymous: "always",
|
||||
named: "never",
|
||||
asyncArrow: "always",
|
||||
},
|
||||
],
|
||||
"space-infix-ops": "error",
|
||||
"eol-last": ["error", "always"],
|
||||
},
|
||||
env: {
|
||||
es6: true,
|
||||
node: true,
|
||||
jest: true,
|
||||
browser: true,
|
||||
},
|
||||
ignorePatterns: [],
|
||||
overrides: [
|
||||
{
|
||||
files: ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
plugins: ["@typescript-eslint/eslint-plugin"],
|
||||
extends: ["plugin:@typescript-eslint/recommended", "plugin:react/recommended"],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
rules: {
|
||||
"valid-jsdoc": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"@typescript-eslint/promise-function-async": "error",
|
||||
"@typescript-eslint/keyword-spacing": "error",
|
||||
"@typescript-eslint/space-before-function-paren": [
|
||||
"error",
|
||||
{
|
||||
anonymous: "always",
|
||||
named: "never",
|
||||
asyncArrow: "always",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/space-infix-ops": "error",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
8
www/docs/.prettierrc
Normal file
8
www/docs/.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"endOfLine": "auto",
|
||||
"semi": false,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "always"
|
||||
}
|
||||
@@ -4,8 +4,18 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
|
||||
|
||||
## Note Before Development
|
||||
|
||||
If you have installed the dependencies in the root of this repository (i.e., if you have a `node_modules` directory at the root of this repository), this will cause an error when running this documentation website. This is because the content resides in `docs/content` and when that content is being imported from there, a mix up can happen between the dependencies which will cause an `invalid hook call` error.
|
||||
If you have installed the dependencies in the root of this repository (in other words, if you have a `node_modules` directory at the root of this repository), this will cause an error when running this documentation website. This is because the content resides in `docs/content` and when that content is being imported from there, a mix up can happen between the dependencies which will cause an `invalid hook call` error.
|
||||
|
||||
For that reason, we added a `clean-node-modules` script that deletes the `node_modules` directory, and we call that script before the `start` and `build` scripts are ran.
|
||||
For that reason, the `clean-node-modules` script was added that deletes the `node_modules` directory. The script is called that script before the `start` and `build` scripts are ran.
|
||||
|
||||
So, everytime you run these 2 scripts, the `node_modules` directory at the root will be deleted.
|
||||
So, everytime you run these two scripts, the `node_modules` directory at the root will be deleted.
|
||||
|
||||
## Components and Theme
|
||||
|
||||
### Extended Theme Components
|
||||
|
||||
Components that extend themes from Docusaurus or other plugins are placed under `src/theme`.
|
||||
|
||||
### Medusa Docs Components
|
||||
|
||||
Components created specifically for the Medusa Docs are placed under the `src/componenets` directory.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
require("dotenv").config()
|
||||
const path = require("path")
|
||||
const fs = require("fs")
|
||||
@@ -10,7 +11,7 @@ const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
|
||||
|
||||
const announcementBar = JSON.parse(fs.readFileSync("./announcement.json"))
|
||||
|
||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
||||
/** @type {import('@medusajs/docs').MedusaDocusaurusConfig} */
|
||||
const config = {
|
||||
title: "Medusa",
|
||||
tagline: "Explore and learn how to use Medusa",
|
||||
@@ -29,6 +30,17 @@ const config = {
|
||||
},
|
||||
],
|
||||
require.resolve("docusaurus-plugin-image-zoom"),
|
||||
async function tailwindPlugin() {
|
||||
return {
|
||||
name: "docusaurus-tailwindcss",
|
||||
configurePostCss(postcssOptions) {
|
||||
// Appends TailwindCSS and AutoPrefixer.
|
||||
postcssOptions.plugins.push(require("tailwindcss"))
|
||||
postcssOptions.plugins.push(require("autoprefixer"))
|
||||
return postcssOptions
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
themeConfig: {
|
||||
image: "img/docs-banner.jpg",
|
||||
@@ -200,7 +212,6 @@ const config = {
|
||||
disableSearch: true,
|
||||
nativeScrollbars: true,
|
||||
sortTagsAlphabetically: true,
|
||||
hideDownloadButton: true,
|
||||
expandResponses: "200,204",
|
||||
generatedPayloadSamplesMaxDepth: 4,
|
||||
showObjectSchemaExamples: true,
|
||||
|
||||
33304
www/docs/package-lock.json
generated
33304
www/docs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,9 +14,11 @@
|
||||
"clear": "docusaurus clear",
|
||||
"serve": "docusaurus serve",
|
||||
"write-translations": "docusaurus write-translations",
|
||||
"write-heading-ids": "docusaurus write-heading-ids"
|
||||
"write-heading-ids": "docusaurus write-heading-ids",
|
||||
"lint": "eslint --ignore-path .eslintignore --ext .js,.jsx,.ts,.tsx ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@cloudinary/react": "^1.11.2",
|
||||
"@cloudinary/url-gen": "^1.9.2",
|
||||
"@docusaurus/core": "latest",
|
||||
@@ -26,12 +28,14 @@
|
||||
"@svgr/webpack": "6.2.1",
|
||||
"algoliasearch-helper": "^3.11.3",
|
||||
"animate.css": "^4.1.1",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"clsx": "^1.1.1",
|
||||
"docusaurus-plugin-image-zoom": "^0.1.1",
|
||||
"docusaurus-plugin-segment": "^1.0.3",
|
||||
"dotenv": "^16.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"postcss": "^8.4.21",
|
||||
"prism-react-renderer": "^1.3.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
@@ -39,6 +43,7 @@
|
||||
"react-transition-group": "^4.4.5",
|
||||
"react-uuid": "^2.0.0",
|
||||
"redocusaurus": "^1.4.0",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"url-loader": "^4.1.1"
|
||||
},
|
||||
"browserslist": {
|
||||
@@ -54,6 +59,18 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.3.2"
|
||||
"@babel/eslint-parser": "^7.21.3",
|
||||
"@docusaurus/eslint-plugin": "latest",
|
||||
"@docusaurus/module-type-aliases": "latest",
|
||||
"@tsconfig/docusaurus": "^1.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
||||
"@typescript-eslint/parser": "^5.55.0",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"eslint-config-prettier": "^8.7.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.32.2",
|
||||
"prettier": "^2.8.4",
|
||||
"typescript": "^5.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import React from "react"
|
||||
import styles from "./styles.module.css"
|
||||
import clsx from "clsx"
|
||||
|
||||
export default function Badge({ className, variant, children }) {
|
||||
return (
|
||||
<span
|
||||
className={clsx(
|
||||
styles.badge,
|
||||
className,
|
||||
variant === "purple" && styles.purpleBadge,
|
||||
variant === "orange" && styles.orangeBadge,
|
||||
variant === "green" && styles.greenBadge,
|
||||
variant === "blue" && styles.blueBadge
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
30
www/docs/src/components/Badge/index.tsx
Normal file
30
www/docs/src/components/Badge/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from "react"
|
||||
import clsx from "clsx"
|
||||
|
||||
export type BadgeProps = {
|
||||
className?: string
|
||||
variant: string
|
||||
} & React.HTMLAttributes<HTMLSpanElement>
|
||||
|
||||
const Badge: React.FC<BadgeProps> = ({ className, variant, children }) => {
|
||||
return (
|
||||
<span
|
||||
className={clsx(
|
||||
"tw-text-label-x-small-plus tw-py-px tw-px-0.4 tw-rounded tw-border tw-border-solid tw-text-center",
|
||||
variant === "purple" &&
|
||||
"tw-bg-medusa-tag-purple-bg dark:tw-bg-medusa-tag-purple-bg-dark tw-text-medusa-tag-purple-text dark:tw-text-medusa-tag-purple-text-dark tw-border-medusa-tag-purple-border dark:tw-border-medusa-tag-purple-border-dark",
|
||||
variant === "orange" &&
|
||||
"tw-bg-medusa-tag-orange-bg dark:tw-bg-medusa-tag-orange-bg-dark tw-text-medusa-tag-orange-text dark:tw-text-medusa-tag-orange-text-dark tw-border-medusa-tag-orange-border dark:tw-border-medusa-tag-orange-border-dark",
|
||||
variant === "green" &&
|
||||
"tw-bg-medusa-tag-green-bg dark:tw-bg-medusa-tag-green-bg-dark tw-text-medusa-tag-green-text dark:tw-text-medusa-tag-green-text-dark tw-border-medusa-tag-green-border dark:tw-border-medusa-tag-green-border-dark",
|
||||
variant === "blue" &&
|
||||
"tw-bg-medusa-tag-blue-bg dark:tw-bg-medusa-tag-blue-bg-dark tw-text-medusa-tag-blue-text dark:tw-text-medusa-tag-blue-text-dark tw-border-medusa-tag-blue-border dark:tw-border-medusa-tag-blue-border-dark",
|
||||
className
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export default Badge
|
||||
@@ -1,33 +0,0 @@
|
||||
.badge {
|
||||
font-size: var(--medusa-label-x-small-plus-size);
|
||||
line-height: var(--medusa-label-x-small-plus-line-height);
|
||||
font-weight: var(--medusa-label-x-small-plus-font-weight);
|
||||
padding: 1px 7px;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
border: 1px solid;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.purpleBadge {
|
||||
background-color: var(--medusa-tag-purple-bg);
|
||||
border-color: var(--medusa-tag-purple-border);
|
||||
color: var(--medusa-tag-purple-text);
|
||||
}
|
||||
|
||||
.orangeBadge {
|
||||
background-color: var(--medusa-tag-orange-bg);
|
||||
border-color: var(--medusa-tag-orange-border);
|
||||
color: var(--medusa-tag-orange-text);
|
||||
}
|
||||
|
||||
.greenBadge {
|
||||
background-color: var(--medusa-tag-green-bg);
|
||||
border-color: var(--medusa-tag-green-border);
|
||||
color: var(--medusa-tag-green-text);
|
||||
}
|
||||
|
||||
.blueBadge {
|
||||
background-color: var(--medusa-tag-blue-bg);
|
||||
border-color: var(--medusa-tag-blue-border);
|
||||
color: var(--medusa-tag-blue-text);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import React from "react"
|
||||
import clsx from 'clsx'
|
||||
import styles from './styles.module.css'
|
||||
|
||||
export default function Bordered ({ wrapperClassName, children }) {
|
||||
return (
|
||||
<span className={clsx(styles.elementWrapper, 'no-zoom-img', wrapperClassName)}>
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
22
www/docs/src/components/Bordered/index.tsx
Normal file
22
www/docs/src/components/Bordered/index.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from "react"
|
||||
import clsx from "clsx"
|
||||
|
||||
type BorderedProps = {
|
||||
wrapperClassName?: string
|
||||
} & React.HTMLAttributes<HTMLSpanElement>
|
||||
|
||||
const Bordered: React.FC<BorderedProps> = ({ wrapperClassName, children }) => {
|
||||
return (
|
||||
<span
|
||||
className={clsx(
|
||||
"tw-inline-flex tw-justify-center tw-items-center tw-rounded tw-p-[3px] tw-border tw-border-solid tw-border-medusa-border-strong dark:tw-border-medusa-border-strong-dark tw-mr-1 tw-w-fit tw-bg-docs-bg dark:tw-bg-docs-bg-dark",
|
||||
"no-zoom-img",
|
||||
wrapperClassName
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export default Bordered
|
||||
@@ -1,11 +0,0 @@
|
||||
.elementWrapper {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
padding: var(--bordered-padding);
|
||||
border: 1px solid var(--bordered-border-color);
|
||||
margin-right: var(--bordered-margin-right);
|
||||
width: fit-content;
|
||||
background-color: var(--ifm-background-color);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import React from "react"
|
||||
import ThemedImage from '@theme/ThemedImage'
|
||||
import clsx from 'clsx'
|
||||
import styles from './styles.module.css'
|
||||
import Bordered from "../Bordered"
|
||||
|
||||
export default function BorderedIcon ({ icon = null, IconComponent = null, wrapperClassName, iconWrapperClassName, iconClassName }) {
|
||||
return (
|
||||
<Bordered wrapperClassName={wrapperClassName}>
|
||||
<span className={clsx(styles.borderedIconWrapper, iconWrapperClassName)}>
|
||||
{!IconComponent && (
|
||||
<ThemedImage sources={{
|
||||
light: icon.light,
|
||||
dark: icon.dark || icon.light
|
||||
}} className={clsx(styles.icon, iconClassName, 'bordered-icon')} />
|
||||
)}
|
||||
{IconComponent && <IconComponent className={clsx(styles.icon, iconClassName, 'bordered-icon')} />}
|
||||
</span>
|
||||
</Bordered>
|
||||
)
|
||||
}
|
||||
55
www/docs/src/components/BorderedIcon/index.tsx
Normal file
55
www/docs/src/components/BorderedIcon/index.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import React from "react"
|
||||
import ThemedImage from "@theme/ThemedImage"
|
||||
import clsx from "clsx"
|
||||
import Bordered from "../Bordered/index"
|
||||
import { IconProps } from "@site/src/theme/Icon/index"
|
||||
|
||||
type BorderedIconProp = {
|
||||
icon?: {
|
||||
light: string
|
||||
dark?: string
|
||||
}
|
||||
IconComponent?: React.FC<IconProps>
|
||||
wrapperClassName?: string
|
||||
iconWrapperClassName?: string
|
||||
iconClassName?: string
|
||||
iconColorClassName?: string
|
||||
} & React.HTMLAttributes<HTMLSpanElement>
|
||||
|
||||
const BorderedIcon: React.FC<BorderedIconProp> = ({
|
||||
icon = null,
|
||||
IconComponent = null,
|
||||
wrapperClassName,
|
||||
iconWrapperClassName,
|
||||
iconClassName,
|
||||
iconColorClassName = "",
|
||||
}) => {
|
||||
return (
|
||||
<Bordered wrapperClassName={wrapperClassName}>
|
||||
<span
|
||||
className={clsx(
|
||||
"tw-inline-flex tw-justify-center tw-items-center tw-rounded-sm tw-p-[2px] tw-bg-medusa-bg-component dark:tw-bg-medusa-bg-component-dark",
|
||||
iconWrapperClassName
|
||||
)}
|
||||
>
|
||||
{!IconComponent && (
|
||||
<ThemedImage
|
||||
sources={{
|
||||
light: icon.light,
|
||||
dark: icon.dark || icon.light,
|
||||
}}
|
||||
className={clsx(iconClassName, "bordered-icon")}
|
||||
/>
|
||||
)}
|
||||
{IconComponent && (
|
||||
<IconComponent
|
||||
className={clsx(iconClassName, "bordered-icon")}
|
||||
iconColorClassName={iconColorClassName}
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
</Bordered>
|
||||
)
|
||||
}
|
||||
|
||||
export default BorderedIcon
|
||||
@@ -1,8 +0,0 @@
|
||||
.borderedIconWrapper {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: calc(var(--ifm-global-radius) / 2);
|
||||
padding: var(--bordered-inside-padding);
|
||||
background-color: var(--medusa-bg-component);
|
||||
}
|
||||
27
www/docs/src/components/Button/index.tsx
Normal file
27
www/docs/src/components/Button/index.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from "react"
|
||||
import clsx from "clsx"
|
||||
|
||||
type ButtonProps = {
|
||||
className?: string
|
||||
onClick?: React.MouseEventHandler<HTMLButtonElement>
|
||||
disabled?: boolean
|
||||
} & React.HTMLAttributes<HTMLButtonElement>
|
||||
|
||||
const Button: React.FC<ButtonProps> = ({
|
||||
className = "",
|
||||
onClick,
|
||||
children,
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
<button
|
||||
className={clsx("btn-primary", className)}
|
||||
onClick={onClick}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export default Button
|
||||
@@ -1,78 +0,0 @@
|
||||
import React from "react"
|
||||
import { useThemeConfig } from '@docusaurus/theme-common'
|
||||
import { Cloudinary } from "@cloudinary/url-gen";
|
||||
import MDXImg from '@theme/MDXComponents/Img';
|
||||
import { pad, imaggaScale, imaggaCrop, crop, fit, minimumPad, fill, scale, limitFit, thumbnail, limitFill, minimumFit, limitPad, fillPad } from "@cloudinary/url-gen/actions/resize";
|
||||
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";
|
||||
|
||||
const resizeActions = {
|
||||
'pad': pad,
|
||||
'imaggaScale': imaggaScale,
|
||||
'imaggaCrop': imaggaCrop,
|
||||
'crop': crop,
|
||||
'fit': fit,
|
||||
'minimumPad': minimumPad,
|
||||
'fill': fill,
|
||||
'scale': scale,
|
||||
'limitFit': limitFit,
|
||||
'thumbnail': thumbnail,
|
||||
'limitFill': limitFill,
|
||||
'minimumFit': minimumFit,
|
||||
'limitPad': limitPad,
|
||||
'fillPad': fillPad
|
||||
}
|
||||
|
||||
const imageRegex = /^https:\/\/res.cloudinary.com\/.*\/upload\/v[0-9]+\/(?<imageId>.*)$/
|
||||
|
||||
export default function CloudinaryImage ({ src, ...props }) {
|
||||
const { cloudinaryConfig } = useThemeConfig();
|
||||
const matchingRegex = src.match(imageRegex)
|
||||
if (!cloudinaryConfig || !cloudinaryConfig.cloudName || !matchingRegex?.groups || !matchingRegex.groups.imageId) {
|
||||
// either cloudinary isn't configured or
|
||||
// could not match url to a cloudinary url
|
||||
// default to docusaurus's image component
|
||||
return <MDXImg src={src} {...props} />
|
||||
}
|
||||
|
||||
const cloudinary = new Cloudinary({
|
||||
cloud: {
|
||||
cloudName: cloudinaryConfig.cloudName
|
||||
}
|
||||
});
|
||||
let image = cloudinary.image(matchingRegex.groups.imageId.replaceAll('%20', ' '))
|
||||
|
||||
cloudinaryConfig.flags?.forEach((flag) => image.addTransformation(flag))
|
||||
|
||||
if (cloudinaryConfig.roundCorners) {
|
||||
image.roundCorners(byRadius(cloudinaryConfig.roundCorners))
|
||||
}
|
||||
if (cloudinaryConfig.resize) {
|
||||
const action = resizeActions[cloudinaryConfig.resize.action]
|
||||
let resizeAction = action()
|
||||
if (props.width || props.height) {
|
||||
if (props.width) {
|
||||
resizeAction = resizeAction.width(props.width)
|
||||
}
|
||||
|
||||
if (props.height) {
|
||||
resizeAction = resizeAction.height(props.height)
|
||||
}
|
||||
} else if (cloudinaryConfig.resize.aspectRatio) {
|
||||
resizeAction = resizeAction.aspectRatio(cloudinaryConfig.resize.aspectRatio)
|
||||
} else {
|
||||
if (cloudinaryConfig.resize.width) {
|
||||
resizeAction = resizeAction.width(cloudinaryConfig.resize.width)
|
||||
}
|
||||
|
||||
if (cloudinaryConfig.resize.height) {
|
||||
resizeAction = resizeAction.height(cloudinaryConfig.resize.height)
|
||||
}
|
||||
}
|
||||
|
||||
image.resize(resizeAction)
|
||||
}
|
||||
|
||||
return (
|
||||
<MDXImg {...props} src={image.toURL()} />
|
||||
)
|
||||
}
|
||||
106
www/docs/src/components/CloudinaryImage/index.tsx
Normal file
106
www/docs/src/components/CloudinaryImage/index.tsx
Normal file
@@ -0,0 +1,106 @@
|
||||
import React from "react"
|
||||
import { useThemeConfig } from "@docusaurus/theme-common"
|
||||
// @ts-expect-error: wait until docusaurus uses type: module
|
||||
import { Cloudinary } from "@cloudinary/url-gen"
|
||||
import MDXImg, { Props as MDXImgProps } from "@theme/MDXComponents/Img"
|
||||
import {
|
||||
pad,
|
||||
imaggaScale,
|
||||
imaggaCrop,
|
||||
crop,
|
||||
fit,
|
||||
minimumPad,
|
||||
fill,
|
||||
scale,
|
||||
limitFit,
|
||||
thumbnail,
|
||||
limitFill,
|
||||
minimumFit,
|
||||
limitPad,
|
||||
fillPad,
|
||||
} from "@cloudinary/url-gen/actions/resize"
|
||||
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners"
|
||||
import { ThemeConfig } from "@medusajs/docs"
|
||||
|
||||
const resizeActions = {
|
||||
pad: pad,
|
||||
imaggaScale: imaggaScale,
|
||||
imaggaCrop: imaggaCrop,
|
||||
crop: crop,
|
||||
fit: fit,
|
||||
minimumPad: minimumPad,
|
||||
fill: fill,
|
||||
scale: scale,
|
||||
limitFit: limitFit,
|
||||
thumbnail: thumbnail,
|
||||
limitFill: limitFill,
|
||||
minimumFit: minimumFit,
|
||||
limitPad: limitPad,
|
||||
fillPad: fillPad,
|
||||
}
|
||||
|
||||
const imageRegex =
|
||||
/^https:\/\/res.cloudinary.com\/.*\/upload\/v[0-9]+\/(?<imageId>.*)$/
|
||||
|
||||
type CloudinaryImageProps = MDXImgProps
|
||||
|
||||
const CloudinaryImage: React.FC<CloudinaryImageProps> = ({ src, ...props }) => {
|
||||
const { cloudinaryConfig } = useThemeConfig() as ThemeConfig
|
||||
const matchingRegex = src.match(imageRegex)
|
||||
if (
|
||||
!cloudinaryConfig ||
|
||||
!matchingRegex?.groups ||
|
||||
!matchingRegex.groups.imageId
|
||||
) {
|
||||
// either cloudinary isn't configured or
|
||||
// could not match url to a cloudinary url
|
||||
// default to docusaurus's image component
|
||||
return <MDXImg src={src} {...props} />
|
||||
}
|
||||
|
||||
const cloudinary = new Cloudinary({
|
||||
cloud: {
|
||||
cloudName: cloudinaryConfig.cloudName,
|
||||
},
|
||||
})
|
||||
const image = cloudinary.image(
|
||||
matchingRegex.groups.imageId.replaceAll("%20", " ")
|
||||
)
|
||||
|
||||
cloudinaryConfig.flags?.forEach((flag) => image.addTransformation(flag))
|
||||
|
||||
if (cloudinaryConfig.roundCorners) {
|
||||
image.roundCorners(byRadius(cloudinaryConfig.roundCorners))
|
||||
}
|
||||
if (cloudinaryConfig.resize) {
|
||||
const action = resizeActions[cloudinaryConfig.resize.action]
|
||||
let resizeAction = action()
|
||||
if (props.width || props.height) {
|
||||
if (props.width) {
|
||||
resizeAction = resizeAction.width(props.width)
|
||||
}
|
||||
|
||||
if (props.height) {
|
||||
resizeAction = resizeAction.height(props.height)
|
||||
}
|
||||
} else if (cloudinaryConfig.resize.aspectRatio) {
|
||||
resizeAction = resizeAction.aspectRatio(
|
||||
cloudinaryConfig.resize.aspectRatio
|
||||
)
|
||||
} else {
|
||||
if (cloudinaryConfig.resize.width) {
|
||||
resizeAction = resizeAction.width(cloudinaryConfig.resize.width)
|
||||
}
|
||||
|
||||
if (cloudinaryConfig.resize.height) {
|
||||
resizeAction = resizeAction.height(cloudinaryConfig.resize.height)
|
||||
}
|
||||
}
|
||||
|
||||
image.resize(resizeAction)
|
||||
}
|
||||
|
||||
return <MDXImg {...props} src={image.toURL()} />
|
||||
}
|
||||
|
||||
export default CloudinaryImage
|
||||
47
www/docs/src/components/CopyButton/index.tsx
Normal file
47
www/docs/src/components/CopyButton/index.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import React, { useState, useEffect, useRef, useCallback } from "react"
|
||||
// @ts-expect-error: wait until docusaurus uses type: module
|
||||
import copy from "copy-text-to-clipboard"
|
||||
import Tooltip from "@site/src/components/Tooltip"
|
||||
import clsx from "clsx"
|
||||
|
||||
type CopyButtonProps = {
|
||||
text: string
|
||||
buttonClassName?: string
|
||||
tooltipClassName?: string
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const CopyButton: React.FC<CopyButtonProps> = ({
|
||||
text,
|
||||
buttonClassName = "",
|
||||
tooltipClassName = "",
|
||||
children,
|
||||
}) => {
|
||||
const [isCopied, setIsCopied] = useState(false)
|
||||
const copyTimeout = useRef(undefined)
|
||||
|
||||
const handleCopy = useCallback(() => {
|
||||
copy(text)
|
||||
setIsCopied(true)
|
||||
copyTimeout.current = window.setTimeout(() => {
|
||||
setIsCopied(false)
|
||||
}, 1000)
|
||||
}, [text])
|
||||
|
||||
useEffect(() => () => window.clearTimeout(copyTimeout.current), [])
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
text={isCopied ? `Copied!` : `Copy to Clipboard`}
|
||||
tooltipClassName={tooltipClassName}
|
||||
>
|
||||
<span
|
||||
className={clsx("tw-cursor-pointer", buttonClassName)}
|
||||
onClick={handleCopy}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
export default CopyButton
|
||||
45
www/docs/src/components/DocSidebarItemIcon/index.tsx
Normal file
45
www/docs/src/components/DocSidebarItemIcon/index.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import React from "react"
|
||||
import icons from "@site/src/theme/Icon"
|
||||
import BorderedIcon from "@site/src/components/BorderedIcon"
|
||||
import clsx from "clsx"
|
||||
|
||||
type DocSidebarItemIconProps = {
|
||||
icon?: string
|
||||
is_title?: boolean
|
||||
is_disabled?: boolean
|
||||
} & React.HTMLAttributes<HTMLSpanElement>
|
||||
|
||||
const DocSidebarItemIcon: React.FC<DocSidebarItemIconProps> = ({
|
||||
icon,
|
||||
is_title,
|
||||
is_disabled,
|
||||
}) => {
|
||||
const IconComponent = icons[icon]
|
||||
|
||||
return (
|
||||
<>
|
||||
{is_title && (
|
||||
<BorderedIcon
|
||||
icon={null}
|
||||
IconComponent={IconComponent}
|
||||
iconClassName={clsx("sidebar-item-icon")}
|
||||
iconColorClassName={clsx(
|
||||
is_disabled &&
|
||||
"tw-stroke-medusa-icon-disabled dark:tw-stroke-medusa-icon-disabled-dark"
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{!is_title && (
|
||||
<IconComponent
|
||||
className={clsx("sidebar-item-icon")}
|
||||
iconColorClassName={
|
||||
is_disabled &&
|
||||
"tw-stroke-medusa-icon-disabled dark:tw-stroke-medusa-icon-disabled-dark"
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default DocSidebarItemIcon
|
||||
92
www/docs/src/components/Feedback/Solutions/index.tsx
Normal file
92
www/docs/src/components/Feedback/Solutions/index.tsx
Normal file
@@ -0,0 +1,92 @@
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { request } from "@octokit/request"
|
||||
// import "./index.css"
|
||||
|
||||
type SolutionsProps = {
|
||||
feedback: boolean
|
||||
message?: string
|
||||
}
|
||||
|
||||
type GitHubSearchItem = {
|
||||
url: string
|
||||
html_url: string
|
||||
title: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
const Solutions: React.FC<SolutionsProps> = ({ feedback, message }) => {
|
||||
const [possibleSolutionsQuery, setPossibleSolutionsQuery] =
|
||||
useState<string>("")
|
||||
const [possibleSolutions, setPossibleSolutions] = useState<
|
||||
GitHubSearchItem[]
|
||||
>([])
|
||||
|
||||
function constructQuery(searchQuery: string) {
|
||||
return `${searchQuery} repo:medusajs/medusa is:closed is:issue`
|
||||
}
|
||||
|
||||
async function searchGitHub(query) {
|
||||
return request(`GET /search/issues`, {
|
||||
q: query,
|
||||
sort: "updated",
|
||||
per_page: 3,
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!feedback) {
|
||||
let query = constructQuery(
|
||||
// Github does not allow queries longer than 256 characters
|
||||
message ? message.substring(0, 256) : document.title
|
||||
)
|
||||
searchGitHub(query)
|
||||
.then(async (result) => {
|
||||
if (!result.data.items.length && message) {
|
||||
query = constructQuery(document.title)
|
||||
result = await searchGitHub(query)
|
||||
}
|
||||
|
||||
setPossibleSolutionsQuery(query)
|
||||
setPossibleSolutions(result.data.items)
|
||||
})
|
||||
.catch((err) => console.error(err))
|
||||
} else {
|
||||
setPossibleSolutionsQuery("")
|
||||
setPossibleSolutions([])
|
||||
}
|
||||
}, [feedback])
|
||||
|
||||
return (
|
||||
<>
|
||||
{possibleSolutions.length > 0 && (
|
||||
<div className="tw-text-label-large-plus tw-font-normal">
|
||||
<span className="tw-inline-block tw-my-1 tw-mx-0">
|
||||
If you faced a problem, here are some possible solutions from
|
||||
GitHub:
|
||||
</span>
|
||||
<ul>
|
||||
{possibleSolutions.map((solution) => (
|
||||
<li key={solution.url} className="tw-mb-0.5 last:tw-mb-0">
|
||||
<a href={solution.html_url} target="_blank" rel="noreferrer">
|
||||
{solution.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<span>
|
||||
Explore more issues in{" "}
|
||||
<a
|
||||
href={`https://github.com/medusajs/medusa/issues?q=${possibleSolutionsQuery}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
the GitHub repository
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Solutions
|
||||
@@ -1,139 +0,0 @@
|
||||
.feedback-container {
|
||||
padding-top: var(--ifm-base-margin-vertical);
|
||||
padding-bottom: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
|
||||
.doc-footer .feedback-container {
|
||||
border-top: 1px solid var(--ifm-doc-footer-border-color);
|
||||
}
|
||||
|
||||
.inline-feedback {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.inline-question,
|
||||
.feedback-message {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.inline-feedback span {
|
||||
margin-right: 24px;
|
||||
font-size: var(--medusa-body-regular-size);
|
||||
line-height: var(--medusa-body-regular-line-height);
|
||||
font-weight: var(--medusa-body-regular-font-weight);
|
||||
}
|
||||
|
||||
.inline-question span {
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) / 2);
|
||||
}
|
||||
|
||||
.feedback-btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
cursor: pointer;
|
||||
background-color: var(--ifm-secondary-btn-background-color);
|
||||
border: 1px solid var(--ifm-secondary-btn-border-color);
|
||||
color: var(--ifm-secondary-btn-color);
|
||||
font-size: var(--medusa-label-small-plus-size);
|
||||
line-height: var(--medusa-label-small-plus-line-height);
|
||||
font-weight: var(--medusa-label-small-plus-font-weight);
|
||||
}
|
||||
|
||||
.feedback-btn:hover {
|
||||
background-color: var(--ifm-secondary-btn-hover-background-color);
|
||||
}
|
||||
|
||||
.feedback-btn:focus {
|
||||
box-shadow: var(--ifm-secondary-btn-focused-shadow);
|
||||
}
|
||||
|
||||
.feedback-btn:not(:last-child) {
|
||||
margin-right: calc(var(--ifm-base-spacing) / 2);
|
||||
}
|
||||
|
||||
.inline-question .feedback-btn {
|
||||
margin-top: calc(var(--ifm-base-margin-vertical) / 2);
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.inline-question textarea {
|
||||
border-radius: 4px;
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--ifm-base-border-color);
|
||||
padding: 8px;
|
||||
font-family: var(--ifm-font-family-base);
|
||||
}
|
||||
|
||||
.feedback-message,
|
||||
.solutions-wrapper {
|
||||
font-size: var(--medusa-label-large-plus-size);
|
||||
line-height: var(--medusa-label-large-plus-line-height);
|
||||
}
|
||||
|
||||
.feedback-message {
|
||||
font-weight: var(--medusa-label-large-plus-font-weight);
|
||||
}
|
||||
|
||||
.solutions-wrapper {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.solutions-message {
|
||||
display: inline-block;
|
||||
margin: calc(var(--ifm-base-margin-vertical) / 2) 0;
|
||||
}
|
||||
|
||||
.solutions-wrapper li:not(:last-child) {
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) / 4);
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
-webkit-animation: fade-in .3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
animation: fade-in .3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.fade-out {
|
||||
-webkit-animation: fade-out .3s ease-out both;
|
||||
animation: fade-out .3s ease-out both;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fade-out {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes fade-out {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
import React, { useRef, useState, useEffect } from 'react';
|
||||
import { CSSTransition, SwitchTransition } from 'react-transition-group';
|
||||
import './index.css';
|
||||
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import {useLocation} from '@docusaurus/router';
|
||||
import uuid from 'react-uuid';
|
||||
import { request } from "@octokit/request";
|
||||
|
||||
export default function Feedback ({
|
||||
event,
|
||||
question = 'Was this page helpful?',
|
||||
positiveBtn = 'Yes',
|
||||
negativeBtn = 'No',
|
||||
positiveQuestion = 'What was most helpful?',
|
||||
negativeQuestion = 'What can we improve?',
|
||||
submitBtn = 'Submit',
|
||||
submitMessage = 'Thank you for helping improve our documentation!',
|
||||
showPossibleSolutions = true
|
||||
}) {
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [submittedFeedback, setSubmittedFeedback] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const inlineFeedbackRef = useRef(null);
|
||||
const inlineQuestionRef = useRef(null);
|
||||
const inlineMessageRef = useRef(null)
|
||||
const [positiveFeedback, setPositiveFeedback] = useState(false);
|
||||
const [message, setMessage] = useState("");
|
||||
const [id, setId] = useState(null);
|
||||
const [possibleSolutionsQuery, setPossibleSolutionsQuery] = useState('')
|
||||
const [possibleSolutions, setPossibleSolutions] = useState([]);
|
||||
const nodeRef = submittedFeedback ? inlineMessageRef : (showForm ? inlineQuestionRef : inlineFeedbackRef);
|
||||
|
||||
const isBrowser = useIsBrowser();
|
||||
const location = useLocation();
|
||||
|
||||
function handleFeedback (e) {
|
||||
const feedback = e.target.classList.contains('positive');
|
||||
submitFeedback(e, feedback)
|
||||
setPositiveFeedback(feedback);
|
||||
setShowForm(true);
|
||||
}
|
||||
|
||||
function submitFeedback (e, feedback = null) {
|
||||
if (isBrowser) {
|
||||
if (window.analytics) {
|
||||
if (showForm) {
|
||||
setLoading(true);
|
||||
}
|
||||
window.analytics.track(event, {
|
||||
url: location.pathname,
|
||||
label: document.title,
|
||||
feedback: (feedback !== null && feedback) || (feedback === null && positiveFeedback) ? 'yes' : 'no',
|
||||
message: message?.length ? message : null,
|
||||
uuid: id
|
||||
}, function () {
|
||||
if (showForm) {
|
||||
setLoading(false);
|
||||
checkAvailableSolutions(positiveFeedback, message);
|
||||
resetForm();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (showForm) {
|
||||
resetForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm () {
|
||||
setShowForm(false);
|
||||
setSubmittedFeedback(true);
|
||||
if (message) {
|
||||
setId(null);
|
||||
}
|
||||
}
|
||||
|
||||
function constructQuery (searchQuery) {
|
||||
return `${searchQuery} repo:medusajs/medusa is:closed is:issue`; //Github does not allow queries longer than 256 characters
|
||||
}
|
||||
|
||||
function searchGitHub (query) {
|
||||
return request(`GET /search/issues`, {
|
||||
q: query,
|
||||
sort: 'updated',
|
||||
per_page: 3,
|
||||
})
|
||||
}
|
||||
|
||||
async function checkAvailableSolutions (feedback, message) {
|
||||
if (showPossibleSolutions && !feedback) {
|
||||
//fetch some possible solutions related to the answer.
|
||||
let query = constructQuery(message ? message.substring(0, 256) : document.title)
|
||||
let result = await searchGitHub(query);
|
||||
|
||||
if (!result.data.items.length && message) {
|
||||
query = constructQuery(document.title)
|
||||
result = await searchGitHub(query)
|
||||
}
|
||||
|
||||
setPossibleSolutionsQuery(query);
|
||||
setPossibleSolutions(result.data.items);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!id) {
|
||||
setId(uuid())
|
||||
}
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<div className='feedback-container'>
|
||||
<SwitchTransition mode="out-in">
|
||||
<CSSTransition
|
||||
key={showForm}
|
||||
nodeRef={nodeRef}
|
||||
timeout={300}
|
||||
addEndListener={(done) => {
|
||||
nodeRef.current.addEventListener("transitionend", done, false);
|
||||
}}
|
||||
classNames={{
|
||||
enter: 'fade-in',
|
||||
exit: 'fade-out'
|
||||
}}
|
||||
>
|
||||
<>
|
||||
{(!showForm && !submittedFeedback) && (
|
||||
<div className='inline-feedback' ref={inlineFeedbackRef}>
|
||||
<span>{question}</span>
|
||||
<button className='positive feedback-btn' onClick={handleFeedback}>{positiveBtn}</button>
|
||||
<button className='negative feedback-btn' onClick={handleFeedback}>{negativeBtn}</button>
|
||||
</div>
|
||||
)}
|
||||
{(showForm && !submittedFeedback) && (
|
||||
<div className='inline-question' ref={inlineQuestionRef}>
|
||||
<span>{positiveFeedback ? positiveQuestion : negativeQuestion}</span>
|
||||
<textarea rows={4} value={message} onChange={(e) => setMessage(e.target.value)}></textarea>
|
||||
<button className='feedback-btn' onClick={submitFeedback} disabled={loading}>{submitBtn}</button>
|
||||
</div>
|
||||
)}
|
||||
{submittedFeedback && (
|
||||
<div className='feedback-message-wrapper'>
|
||||
<div className='feedback-message' ref={inlineMessageRef}>
|
||||
<span>{submitMessage}</span>
|
||||
{possibleSolutions.length > 0 && (
|
||||
<div className='solutions-wrapper'>
|
||||
<span className='solutions-message'>If you faced a problem, here are some possible solutions from GitHub:</span>
|
||||
<ul>
|
||||
{possibleSolutions.map((solution) => (
|
||||
<li key={solution.url}>
|
||||
<a href={solution.html_url} target="_blank">{solution.title}</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<span>Explore more issues in <a
|
||||
href={`https://github.com/medusajs/medusa/issues?q=${possibleSolutionsQuery}`}
|
||||
target="_blank"
|
||||
>
|
||||
the GitHub repository
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</CSSTransition>
|
||||
</SwitchTransition>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
187
www/docs/src/components/Feedback/index.tsx
Normal file
187
www/docs/src/components/Feedback/index.tsx
Normal file
@@ -0,0 +1,187 @@
|
||||
import React, { useRef, useState, useEffect } from "react"
|
||||
import { CSSTransition, SwitchTransition } from "react-transition-group"
|
||||
// import "./index.css"
|
||||
|
||||
import useIsBrowser from "@docusaurus/useIsBrowser"
|
||||
import { useLocation } from "@docusaurus/router"
|
||||
import uuid from "react-uuid"
|
||||
import Solutions from "./Solutions/index"
|
||||
import Button from "../Button"
|
||||
|
||||
type FeedbackProps = {
|
||||
event?: string
|
||||
question?: string
|
||||
positiveBtn?: string
|
||||
negativeBtn?: string
|
||||
positiveQuestion?: string
|
||||
negativeQuestion?: string
|
||||
submitBtn?: string
|
||||
submitMessage?: string
|
||||
showPossibleSolutions?: boolean
|
||||
className?: string
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const Feedback: React.FC<FeedbackProps> = ({
|
||||
event,
|
||||
question = "Was this page helpful?",
|
||||
positiveBtn = "Yes",
|
||||
negativeBtn = "No",
|
||||
positiveQuestion = "What was most helpful?",
|
||||
negativeQuestion = "What can we improve?",
|
||||
submitBtn = "Submit",
|
||||
submitMessage = "Thank you for helping improve our documentation!",
|
||||
showPossibleSolutions = true,
|
||||
className = "",
|
||||
}) => {
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
const [submittedFeedback, setSubmittedFeedback] = useState(false)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const inlineFeedbackRef = useRef(null)
|
||||
const inlineQuestionRef = useRef(null)
|
||||
const inlineMessageRef = useRef(null)
|
||||
const [positiveFeedback, setPositiveFeedback] = useState(false)
|
||||
const [message, setMessage] = useState("")
|
||||
const [id, setId] = useState(null)
|
||||
const nodeRef = submittedFeedback
|
||||
? inlineMessageRef
|
||||
: showForm
|
||||
? inlineQuestionRef
|
||||
: inlineFeedbackRef
|
||||
|
||||
const isBrowser = useIsBrowser()
|
||||
const location = useLocation()
|
||||
|
||||
function handleFeedback(e) {
|
||||
const feedback = e.target.classList.contains("positive")
|
||||
submitFeedback(e, feedback)
|
||||
setPositiveFeedback(feedback)
|
||||
setShowForm(true)
|
||||
}
|
||||
|
||||
function submitFeedback(e, feedback = null) {
|
||||
if (isBrowser) {
|
||||
if (window.analytics) {
|
||||
if (showForm) {
|
||||
setLoading(true)
|
||||
}
|
||||
window.analytics.track(
|
||||
event,
|
||||
{
|
||||
url: location.pathname,
|
||||
label: document.title,
|
||||
feedback:
|
||||
(feedback !== null && feedback) ||
|
||||
(feedback === null && positiveFeedback)
|
||||
? "yes"
|
||||
: "no",
|
||||
message: message?.length ? message : null,
|
||||
uuid: id,
|
||||
},
|
||||
function () {
|
||||
if (showForm) {
|
||||
setLoading(false)
|
||||
resetForm()
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
if (showForm) {
|
||||
resetForm()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
setShowForm(false)
|
||||
setSubmittedFeedback(true)
|
||||
if (message) {
|
||||
setId(null)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!id) {
|
||||
setId(uuid())
|
||||
}
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<div className={`tw-py-2 ${className}`}>
|
||||
<SwitchTransition mode="out-in">
|
||||
<CSSTransition
|
||||
key={showForm}
|
||||
nodeRef={nodeRef}
|
||||
timeout={300}
|
||||
addEndListener={(done) => {
|
||||
nodeRef.current.addEventListener("transitionend", done, false)
|
||||
}}
|
||||
classNames={{
|
||||
enter: "animate__animated animate__fadeIn",
|
||||
exit: "animate__animated animate__fadeOut",
|
||||
}}
|
||||
>
|
||||
<>
|
||||
{!showForm && !submittedFeedback && (
|
||||
<div
|
||||
className="tw-flex tw-flex-row tw-items-center"
|
||||
ref={inlineFeedbackRef}
|
||||
>
|
||||
<span className="tw-mr-1.5 tw-text-body-regular">
|
||||
{question}
|
||||
</span>
|
||||
<Button
|
||||
onClick={handleFeedback}
|
||||
className="tw-w-fit tw-mr-0.5 last:tw-mr-0"
|
||||
>
|
||||
{positiveBtn}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleFeedback}
|
||||
className="tw-w-fit tw-mr-0.5 last:tw-mr-0"
|
||||
>
|
||||
{negativeBtn}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{showForm && !submittedFeedback && (
|
||||
<div className="tw-flex tw-flex-col" ref={inlineQuestionRef}>
|
||||
<span className="tw-mb-1">
|
||||
{positiveFeedback ? positiveQuestion : negativeQuestion}
|
||||
</span>
|
||||
<textarea
|
||||
rows={4}
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
className="tw-rounded-sm tw-bg-transparent tw-border tw-border-medusa-border-base dark:tw-border-medusa-border-base-dark tw-p-1 tw-font-base"
|
||||
></textarea>
|
||||
<Button
|
||||
onClick={submitFeedback}
|
||||
disabled={loading}
|
||||
className="tw-mt-1 tw-w-fit"
|
||||
>
|
||||
{submitBtn}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{submittedFeedback && (
|
||||
<div>
|
||||
<div
|
||||
className="tw-flex tw-flex-col tw-text-label-large-plus"
|
||||
ref={inlineMessageRef}
|
||||
>
|
||||
<span>{submitMessage}</span>
|
||||
{showPossibleSolutions && (
|
||||
<Solutions message={message} feedback={positiveFeedback} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</CSSTransition>
|
||||
</SwitchTransition>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Feedback
|
||||
43
www/docs/src/components/Footer/SocialLinks/index.tsx
Normal file
43
www/docs/src/components/Footer/SocialLinks/index.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import React from "react"
|
||||
import IconTwitter from "@site/src/theme/Icon/Twitter"
|
||||
import IconGitHub from "@site/src/theme/Icon/GitHub"
|
||||
import IconDiscord from "@site/src/theme/Icon/Discord"
|
||||
import IconLinkedIn from "@site/src/theme/Icon/LinkedIn"
|
||||
import { SocialLink } from "@medusajs/docs"
|
||||
|
||||
type SocialLinksProps = {
|
||||
links?: SocialLink[]
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const SocialLinks: React.FC<SocialLinksProps> = ({ links = [] }) => {
|
||||
const socialIcons = {
|
||||
twitter: (
|
||||
<IconTwitter iconColorClassName="tw-fill-medusa-icon-placeholder dark:tw-fill-medusa-icon-placeholder-dark group-hover:tw-fill-medusa-icon-secondary dark:group-hover:tw-fill-medusa-icon-secondary-dark" />
|
||||
),
|
||||
github: (
|
||||
<IconGitHub iconColorClassName="tw-fill-medusa-icon-placeholder dark:tw-fill-medusa-icon-placeholder-dark group-hover:tw-fill-medusa-icon-secondary dark:group-hover:tw-fill-medusa-icon-secondary-dark" />
|
||||
),
|
||||
discord: (
|
||||
<IconDiscord iconColorClassName="tw-fill-medusa-icon-placeholder dark:tw-fill-medusa-icon-placeholder-dark group-hover:tw-fill-medusa-icon-secondary dark:group-hover:tw-fill-medusa-icon-secondary-dark" />
|
||||
),
|
||||
linkedin: (
|
||||
<IconLinkedIn iconColorClassName="tw-fill-medusa-icon-placeholder dark:tw-fill-medusa-icon-placeholder-dark group-hover:tw-fill-medusa-icon-secondary dark:group-hover:tw-fill-medusa-icon-secondary-dark" />
|
||||
),
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="tw-flex tw-items-center">
|
||||
{links.map((link) => (
|
||||
<a
|
||||
className="tw-group tw-ml-1 first:tw-ml-0"
|
||||
href={link.href}
|
||||
key={link.type}
|
||||
>
|
||||
{socialIcons[link.type]}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default SocialLinks
|
||||
@@ -1,130 +0,0 @@
|
||||
.large-card {
|
||||
background-color: var(--large-card-bg);
|
||||
border: 1px solid var(--large-card-border-color);
|
||||
border-radius: var(--ifm-global-radius);
|
||||
padding: calc(var(--ifm-base-margin-vertical) * 3) var(--ifm-base-spacing) calc(var(--ifm-base-margin-vertical) / 2);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-bottom: var(--ifm-base-margin-vertical);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.large-card:not(.large-card-soon):hover,
|
||||
.large-card:not(.large-card-soon):hover:before {
|
||||
background-color: var(--large-card-bg-hover);
|
||||
}
|
||||
|
||||
.large-card-soon:hover a {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.large-card-soon:hover .large-card-title,
|
||||
.large-card-soon:hover .large-card-content {
|
||||
color: var(--medusa-text-disabled);
|
||||
}
|
||||
|
||||
.large-card:before,
|
||||
.large-card:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
}
|
||||
|
||||
.large-card:before {
|
||||
z-index: 1;
|
||||
height: calc(var(--ifm-base-margin-vertical) * 4);
|
||||
top: 0;
|
||||
background-image: var(--large-card-bg-image);
|
||||
background-color: var(--large-card-bg);
|
||||
}
|
||||
|
||||
.large-card:nth-child(3n+1):before {
|
||||
background-position-x: 2%;
|
||||
background-position-y: 52%;
|
||||
}
|
||||
|
||||
.large-card:nth-child(3n + 2):before {
|
||||
background-position-x: 19%;
|
||||
background-position-y: 16%;
|
||||
}
|
||||
|
||||
.large-card:nth-child(3n + 3):before {
|
||||
background-position-x: 17%;
|
||||
background-position-y: 50%;
|
||||
}
|
||||
|
||||
.large-card:after {
|
||||
z-index: 2;
|
||||
left: 0;
|
||||
top: calc(var(--ifm-base-margin-vertical) * 2);
|
||||
height: calc(var(--ifm-base-margin-vertical) * 2);
|
||||
background: var(--large-card-fade-effect);
|
||||
}
|
||||
|
||||
.large-card:not(.large-card-soon):hover:after {
|
||||
background: var(--large-card-fade-effect-hover);
|
||||
}
|
||||
|
||||
.large-card > * {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.large-card-bordered-icon-wrapper {
|
||||
--bordered-padding: var(--large-card-icon-wrapper-padding);
|
||||
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) / 2);
|
||||
}
|
||||
|
||||
.large-card-icon-wrapper {
|
||||
--bordered-inside-padding: var(--large-card-icon-inside-padding);
|
||||
}
|
||||
|
||||
.large-card-icon {
|
||||
width: var(--large-card-icon-size);
|
||||
height: var(--large-card-icon-size);
|
||||
}
|
||||
|
||||
.large-card-heading {
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) / 4);
|
||||
}
|
||||
|
||||
.large-card-title {
|
||||
color: var(--ifm-color-primary);
|
||||
font-size: var(--medusa-label-regular-plus-size);
|
||||
line-height: var(--medusa-label-regular-plus-line-height);
|
||||
font-weight: var(--medusa-label-regular-plus-font-weight);
|
||||
}
|
||||
|
||||
.large-card-content {
|
||||
font-size: var(--medusa-body-regular-size);
|
||||
line-height: var(--medusa-body-regular-line-height);
|
||||
font-weight: var(--medusa-body-regular-font-weight);
|
||||
}
|
||||
|
||||
.large-card-title,
|
||||
.large-card-content {
|
||||
transition: all var(--ifm-transition-fast) ease;
|
||||
}
|
||||
|
||||
.large-card-content ul {
|
||||
padding-left: var(--ifm-base-spacing);
|
||||
}
|
||||
|
||||
.large-card-link {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 4;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
}
|
||||
|
||||
.large-card-badge {
|
||||
position: absolute;
|
||||
top: calc(var(--ifm-base-margin-vertical) / 2);
|
||||
right: var(--ifm-base-spacing);
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import React from "react"
|
||||
import './index.css'
|
||||
import BorderedIcon from "../BorderedIcon"
|
||||
import clsx from 'clsx';
|
||||
import Badge from "../Badge";
|
||||
|
||||
export default function LargeCard ({
|
||||
Icon,
|
||||
image,
|
||||
title,
|
||||
action: {
|
||||
href
|
||||
},
|
||||
isSoon = false,
|
||||
children
|
||||
}) {
|
||||
return (
|
||||
<article className={clsx(
|
||||
'large-card',
|
||||
isSoon && 'large-card-soon'
|
||||
)}>
|
||||
<div>
|
||||
{isSoon && <Badge variant={'purple'} className={'large-card-badge'}>Guide coming soon</Badge>}
|
||||
{(Icon || image) && (
|
||||
<BorderedIcon
|
||||
IconComponent={Icon}
|
||||
icon={image}
|
||||
iconClassName='large-card-icon'
|
||||
wrapperClassName='large-card-bordered-icon-wrapper'
|
||||
iconWrapperClassName='large-card-icon-wrapper'
|
||||
/>
|
||||
)}
|
||||
<div className="large-card-heading">
|
||||
<span className="large-card-title">{title}</span>
|
||||
</div>
|
||||
<div className="large-card-content">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
<a href={href} className="large-card-link"></a>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
96
www/docs/src/components/LargeCard/index.tsx
Normal file
96
www/docs/src/components/LargeCard/index.tsx
Normal file
@@ -0,0 +1,96 @@
|
||||
import React from "react"
|
||||
import BorderedIcon from "../BorderedIcon"
|
||||
import clsx from "clsx"
|
||||
import Badge from "../Badge"
|
||||
import { IconProps } from "@site/src/theme/Icon/index"
|
||||
|
||||
type LargeCardProps = {
|
||||
Icon: React.FC<IconProps>
|
||||
image: {
|
||||
light: string
|
||||
dark?: string
|
||||
}
|
||||
title: string
|
||||
action: {
|
||||
href: string
|
||||
}
|
||||
isSoon?: boolean
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const LargeCard: React.FC<LargeCardProps> = ({
|
||||
Icon,
|
||||
image,
|
||||
title,
|
||||
action: { href },
|
||||
isSoon = false,
|
||||
children,
|
||||
}) => {
|
||||
return (
|
||||
<article
|
||||
className={clsx(
|
||||
"tw-group tw-bg-docs-bg-surface dark:tw-bg-docs-bg-surface-dark",
|
||||
"tw-border tw-border-solid tw-border-medusa-border-base dark:tw-border-medusa-border-base-dark tw-rounded",
|
||||
"tw-pt-6 tw-pb-1 tw-px-1 tw-mb-2",
|
||||
"tw-flex tw-flex-col tw-justify-between tw-relative",
|
||||
"before:tw-content-[''] before:tw-absolute before:tw-left-0 before:tw-w-full before:tw-rounded before:tw-z-[1] before:tw-h-8 before:tw-top-0",
|
||||
"before:tw-bg-large-card dark:before:tw-bg-large-card-dark before:tw-bg-docs-bg-surface dark:before:tw-bg-docs-bg-surface-dark",
|
||||
"[&:nth-child(3n+1):before]:tw-bg-[2%_52%] [&:nth-child(3n+2):before]:tw-bg-[19%_16%] [&:nth-child(3n+3):before]:tw-bg-[17%_50%]",
|
||||
"after:tw-content-[''] after:tw-absolute after:tw-left-0 after:tw-w-full after:tw-rounded",
|
||||
"after:tw-z-[2] after:tw-left-0 after:tw-top-4 after:tw-height-4 after:tw-bg-large-card-fade dark:after:tw-bg-large-card-fade-dark",
|
||||
!isSoon &&
|
||||
"hover:after:tw-bg-large-card-fade-hover dark:hover:after:tw-bg-large-card-fade-hover",
|
||||
!isSoon &&
|
||||
"hover:tw-bg-medusa-bg-subtle-hover dark:hover:tw-bg-medusa-bg-base-hover-dark",
|
||||
!isSoon &&
|
||||
"hover:before:tw-bg-medusa-bg-subtle-hover dark:hover:before:tw-bg-medusa-bg-base-hover-dark"
|
||||
)}
|
||||
>
|
||||
<div className={clsx("tw-z-[3]")}>
|
||||
{isSoon && (
|
||||
<Badge variant={"purple"} className="tw-absolute tw-top-1 tw-right-1">
|
||||
Guide coming soon
|
||||
</Badge>
|
||||
)}
|
||||
{(Icon || image) && (
|
||||
<BorderedIcon
|
||||
IconComponent={Icon}
|
||||
icon={image}
|
||||
iconClassName="tw-w-[20px] tw-h-[20px]"
|
||||
wrapperClassName="tw-mb-1"
|
||||
iconWrapperClassName="tw-p-[6px]"
|
||||
/>
|
||||
)}
|
||||
<div className="tw-mb-0.5">
|
||||
<span
|
||||
className={clsx(
|
||||
isSoon &&
|
||||
"group-hover:tw-text-medusa-text-disabled dark:group-hover:tw-text-medusa-text-disabled-dark",
|
||||
"tw-text-medusa-text-base dark:tw-text-medusa-text-base-dark tw-text-label-regular-plus",
|
||||
"tw-transition-all tw-duration-200 tw-ease-ease"
|
||||
)}
|
||||
>
|
||||
{title}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
className={clsx(
|
||||
isSoon &&
|
||||
"group-hover:tw-text-medusa-text-disabled dark:group-hover:tw-text-medusa-text-disabled-dark",
|
||||
"tw-transition-all tw-duration-200 tw-ease-ease tw-text-body-regular"
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
href={href}
|
||||
className={clsx(
|
||||
"tw-absolute tw-top-0 tw-left-0 tw-w-full tw-h-full tw-z-[4] tw-rounded",
|
||||
isSoon && "group-hover:tw-pointer-events-none"
|
||||
)}
|
||||
></a>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
export default LargeCard
|
||||
@@ -1,10 +0,0 @@
|
||||
import React from "react"
|
||||
import clsx from 'clsx'
|
||||
|
||||
export default function LargeCardList ({ colSize, className, children }) {
|
||||
return (
|
||||
<section className={clsx('cards-grid', `grid-${colSize || '4'}`, className)}>
|
||||
{children}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
21
www/docs/src/components/LargeCardList/index.tsx
Normal file
21
www/docs/src/components/LargeCardList/index.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from "react"
|
||||
import clsx from "clsx"
|
||||
|
||||
type LargeCardListProps = {
|
||||
colSize?: string
|
||||
className?: string
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const LargeCardList: React.FC<LargeCardListProps> = ({
|
||||
colSize = "4",
|
||||
className,
|
||||
children,
|
||||
}) => {
|
||||
return (
|
||||
<section className={clsx("cards-grid", `grid-${colSize}`, className)}>
|
||||
{children}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
export default LargeCardList
|
||||
28
www/docs/src/components/MDXComponents/InlineCode.tsx
Normal file
28
www/docs/src/components/MDXComponents/InlineCode.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from "react"
|
||||
import CopyButton from "@site/src/components/CopyButton"
|
||||
import type { Props } from "@theme/MDXComponents/Code"
|
||||
import clsx from "clsx"
|
||||
|
||||
const MDXInlineCode: React.FC<Props> = (props) => {
|
||||
return (
|
||||
<CopyButton
|
||||
text={props.children as string}
|
||||
buttonClassName={clsx(
|
||||
"tw-bg-transparent tw-border-0 tw-p-0 tw-inline tw-text-medusa-text-subtle dark:tw-text-medusa-text-subtle-dark",
|
||||
"active:[&>code]:tw-bg-medusa-bg-subtle-pressed dark:active:[&>code]:tw-bg-medusa-bg-subtle-pressed-dark",
|
||||
"focus:[&>code]:tw-bg-medusa-bg-subtle-pressed dark:focus:[&>code]:tw-bg-medusa-bg-subtle-pressed-dark",
|
||||
"hover:[&>code]:tw-bg-medusa-bg-subtle-hover dark:hover:[&>code]:tw-bg-medusa-bg-base-hover-dark"
|
||||
)}
|
||||
>
|
||||
<code
|
||||
{...props}
|
||||
className={clsx(
|
||||
"tw-border tw-border-solid tw-border-medusa-border-base dark:tw-border-medusa-border-base-dark",
|
||||
"tw-text-medusa-text-subtle dark:tw-text-medusa-text-subtle-dark tw-leading-6"
|
||||
)}
|
||||
/>
|
||||
</CopyButton>
|
||||
)
|
||||
}
|
||||
|
||||
export default MDXInlineCode
|
||||
46
www/docs/src/components/Navbar/Actions/index.tsx
Normal file
46
www/docs/src/components/Navbar/Actions/index.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import React from "react"
|
||||
import Tooltip from "@site/src/components/Tooltip"
|
||||
import { NavbarAction } from "@medusajs/docs"
|
||||
import Icon from "@site/src/theme/Icon"
|
||||
import clsx from "clsx"
|
||||
|
||||
type NavbarActionsProps = {
|
||||
items: NavbarAction[]
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const NavbarActions: React.FC<NavbarActionsProps> = ({ items = [] }) => {
|
||||
return (
|
||||
<div className="lg:tw-block tw-hidden">
|
||||
{items.map((item, index) => {
|
||||
switch (item.type) {
|
||||
case "link":
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const ItemIcon = item.icon ? Icon[item.icon] : null
|
||||
return (
|
||||
<Tooltip text={item.title} key={index}>
|
||||
<a
|
||||
href={item.href}
|
||||
title={item.title}
|
||||
// className={`${ItemIcon ? "navbar-link-icon" : ""} ${
|
||||
// item.className || ""
|
||||
// }`}
|
||||
className={clsx(
|
||||
ItemIcon &&
|
||||
"tw-bg-medusa-button-secondary dark:tw-bg-medusa-button-secondary-dark tw-border tw-border-solid tw-border-medusa-border-base dark:tw-border-medusa-border-base-dark tw-rounded tw-w-2 tw-h-2 tw-flex tw-justify-center tw-items-center hover:tw-bg-medusa-button-secondary-hover dark:hover:tw-bg-medusa-button-secondary-hover-dark",
|
||||
item.className
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
{ItemIcon && <ItemIcon />}
|
||||
</a>
|
||||
</Tooltip>
|
||||
)
|
||||
default:
|
||||
return <></>
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default NavbarActions
|
||||
@@ -1,25 +0,0 @@
|
||||
import React from "react";
|
||||
import { useQueryStringValue } from "@docusaurus/theme-common/internal"
|
||||
import Admonition from "@theme/Admonition"
|
||||
|
||||
export default function QueryNote ({
|
||||
query: {
|
||||
key,
|
||||
value = ''
|
||||
},
|
||||
//admonition props
|
||||
admonition,
|
||||
children
|
||||
}) {
|
||||
const queryValue = useQueryStringValue(key)
|
||||
|
||||
return (
|
||||
<>
|
||||
{queryValue === value && (
|
||||
<Admonition {...admonition}>
|
||||
{children}
|
||||
</Admonition>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
29
www/docs/src/components/QueryNote/index.tsx
Normal file
29
www/docs/src/components/QueryNote/index.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import Admonition, { Props as AdmonitionProps } from "@theme/Admonition"
|
||||
import { useQueryStringValue } from "@docusaurus/theme-common/internal"
|
||||
import React from "react"
|
||||
|
||||
type QueryNoteProps = {
|
||||
query: {
|
||||
key: string
|
||||
value?: string
|
||||
}
|
||||
admonition: AdmonitionProps
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const QueryNote: React.FC<QueryNoteProps> = ({
|
||||
query: { key, value = "" },
|
||||
admonition,
|
||||
children,
|
||||
}) => {
|
||||
const queryValue = useQueryStringValue(key)
|
||||
|
||||
return (
|
||||
<>
|
||||
{queryValue === value && (
|
||||
<Admonition {...admonition}>{children}</Admonition>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default QueryNote
|
||||
44
www/docs/src/components/StructuredData/HowTo/index.tsx
Normal file
44
www/docs/src/components/StructuredData/HowTo/index.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import React from "react"
|
||||
import Head from "@docusaurus/Head"
|
||||
import { useLocation } from "@docusaurus/router"
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
|
||||
import type { TOCItem } from "@docusaurus/mdx-loader"
|
||||
|
||||
type StructuredDataHowToProps = {
|
||||
toc: readonly TOCItem[]
|
||||
title: string
|
||||
}
|
||||
|
||||
const StructuredDataHowTo: React.FC<StructuredDataHowToProps> = ({
|
||||
toc,
|
||||
title,
|
||||
}) => {
|
||||
const location = useLocation()
|
||||
const {
|
||||
siteConfig: { url },
|
||||
} = useDocusaurusContext()
|
||||
const mainUrl = `${url}/${location.pathname}`
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<script type="application/ld+json">
|
||||
{JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "HowTo",
|
||||
name: title,
|
||||
step: [
|
||||
toc
|
||||
.filter((item) => item.level === 2)
|
||||
.map((item) => ({
|
||||
"@type": "HowToStep",
|
||||
text: item.value,
|
||||
url: `${mainUrl}#${item.id}`,
|
||||
})),
|
||||
],
|
||||
})}
|
||||
</script>
|
||||
</Head>
|
||||
)
|
||||
}
|
||||
|
||||
export default StructuredDataHowTo
|
||||
33
www/docs/src/components/StructuredData/Searchbox/index.tsx
Normal file
33
www/docs/src/components/StructuredData/Searchbox/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import React from "react"
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
|
||||
import Head from "@docusaurus/Head"
|
||||
|
||||
type StructuredDataSearchboxProps = React.HTMLAttributes<HTMLScriptElement>
|
||||
|
||||
const StructuredDataSearchbox: React.FC<StructuredDataSearchboxProps> = () => {
|
||||
const {
|
||||
siteConfig: { url },
|
||||
} = useDocusaurusContext()
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<script type="application/ld+json">
|
||||
{JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
url,
|
||||
potentialAction: {
|
||||
"@type": "SearchAction",
|
||||
target: {
|
||||
"@type": "EntryPoint",
|
||||
urlTemplate: `${url}/search?q={search_term_string}`,
|
||||
},
|
||||
"query-input": "required name=search_term_string",
|
||||
},
|
||||
})}
|
||||
</script>
|
||||
</Head>
|
||||
)
|
||||
}
|
||||
|
||||
export default StructuredDataSearchbox
|
||||
@@ -1,9 +1,20 @@
|
||||
import React, { useState, useEffect } from "react"
|
||||
import { Tooltip as ReactTooltip } from "react-tooltip"
|
||||
import type { ITooltip } from "react-tooltip"
|
||||
import uuid from "react-uuid"
|
||||
import "react-tooltip/dist/react-tooltip.css"
|
||||
|
||||
export default function Tooltip({ children, text, tooltipClassName }) {
|
||||
type TooltipProps = {
|
||||
text: string
|
||||
tooltipClassName?: string
|
||||
} & React.HTMLAttributes<HTMLSpanElement> &
|
||||
ITooltip
|
||||
|
||||
const Tooltip: React.FC<TooltipProps> = ({
|
||||
text,
|
||||
tooltipClassName = "",
|
||||
children,
|
||||
}) => {
|
||||
const [elementId, setElementId] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -25,3 +36,5 @@ export default function Tooltip({ children, text, tooltipClassName }) {
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Tooltip
|
||||
@@ -1,12 +0,0 @@
|
||||
import React from 'react';
|
||||
import ThemedImage from '@theme/ThemedImage';
|
||||
|
||||
export default function UiIcon ({ lightIcon, darkIcon = '', alt = '' }) {
|
||||
|
||||
return (
|
||||
<ThemedImage alt={alt} sources={{
|
||||
light: lightIcon,
|
||||
dark: darkIcon || lightIcon
|
||||
}} className="ui-icon" />
|
||||
)
|
||||
}
|
||||
27
www/docs/src/components/UiIcon/index.tsx
Normal file
27
www/docs/src/components/UiIcon/index.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from "react"
|
||||
import ThemedImage from "@theme/ThemedImage"
|
||||
|
||||
type UiIconProps = {
|
||||
lightIcon: string
|
||||
darkIcon?: string
|
||||
alt?: string
|
||||
}
|
||||
|
||||
const UiIcon: React.FC<UiIconProps> = ({
|
||||
lightIcon,
|
||||
darkIcon = "",
|
||||
alt = "",
|
||||
}) => {
|
||||
return (
|
||||
<ThemedImage
|
||||
alt={alt}
|
||||
sources={{
|
||||
light: lightIcon,
|
||||
dark: darkIcon || lightIcon,
|
||||
}}
|
||||
className="tw-align-sub tw-w-[20px] tw-h-[20px]"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default UiIcon
|
||||
@@ -1,18 +0,0 @@
|
||||
import React from "react"
|
||||
|
||||
const CloseIcon = ({ fill = "black" }) => (
|
||||
<svg
|
||||
width="15"
|
||||
height="15"
|
||||
viewBox="0 0 9 8"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M1.05 7.76L0.51 7.22L3.79 3.92L0.51 0.62L1.05 0.0799997L4.33 3.38L7.59 0.0799997L8.13 0.62L4.85 3.92L8.13 7.22L7.59 7.76L4.33 4.48L1.05 7.76Z"
|
||||
fill={fill}
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default CloseIcon
|
||||
@@ -1,48 +0,0 @@
|
||||
import React from "react"
|
||||
|
||||
const ConfLogo = ({ fill }) => (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 371.2226 96">
|
||||
<title>medusa-logo-one-colour-rgb</title>
|
||||
<g id="black-rgb">
|
||||
<path
|
||||
id="logoMark"
|
||||
d="M77.8271,15.6225,56.08,3.0664a22.8877,22.8877,0,0,0-22.8877,0L11.4438,15.6225A22.8877,22.8877,0,0,0,0,35.4438V60.5562A22.8877,22.8877,0,0,0,11.4438,80.3775L33.1919,92.9336a22.8877,22.8877,0,0,0,22.8877,0L77.8271,80.3775A22.8876,22.8876,0,0,0,89.271,60.5562V35.4438A22.8876,22.8876,0,0,0,77.8271,15.6225ZM44.6357,70.3178A22.3178,22.3178,0,1,1,66.9531,48,22.3176,22.3176,0,0,1,44.6357,70.3178Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<g id="type">
|
||||
<path
|
||||
id="type_CompoundPathItem_"
|
||||
d="M163.5361,22.6571h14.1416V71.662H169.206V30.078L155.625,71.662h-8.8907l-13.581-41.0948V71.662h-8.4707V22.6571h14.2109l12.3906,39.2734Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<path
|
||||
id="type_CompoundPathItem_2"
|
||||
d="M220.4453,60.6c-2.03,7.3516-8.2608,12.042-17.0118,12.042-10.9209,0-17.8525-7.3515-17.8525-18.4824s7.001-18.4814,18.0625-18.4814c12.3213,0,18.6914,9.24,15.332,20.7216H194.0517c.7012,5.8106,3.9209,9.2413,9.5215,9.2413,3.92,0,7.001-1.82,8.1914-5.0411Zm-26.253-9.871H211.414c.49-5.04-2.38-8.33-7.9111-8.33C198.2529,42.3993,195.0322,45.34,194.1923,50.7294Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<path
|
||||
id="type_CompoundPathItem_3"
|
||||
d="M252.5742,22.6571h7.9814V71.662h-7.9814V66.4813a13.8489,13.8489,0,0,1-11.9014,6.1611c-9.24,0-15.752-7.3515-15.752-18.4824,0-11.06,6.4415-18.4814,15.752-18.4814a13.85,13.85,0,0,1,11.9014,6.16Zm.3506,31.5029c0-6.9306-3.9209-11.4814-9.8018-11.4814-5.95,0-9.87,4.5508-9.87,11.4814s3.92,11.4815,9.87,11.4815C249.0039,65.6415,252.9248,61.0907,252.9248,54.16Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<path
|
||||
id="type_CompoundPathItem_4"
|
||||
d="M290.2333,36.6581h7.9805V71.662h-7.9805V65.3612c-2.4511,4.69-6.4414,7.1406-11.3417,7.1406-9.7305,0-11.2715-9.6611-11.2715-15.8916V36.6581h7.98V56.5409c0,4.62,1.0508,9.03,6.0918,9.03,5.18,0,8.541-4.62,8.541-11.0605Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<path
|
||||
id="type_CompoundPathItem_5"
|
||||
d="M304.0888,59.1307H311.79c-.49,4.3408,2.7305,7.07,8.1914,7.07,4.2695,0,7.1406-1.68,7.1406-4.2,0-7.0009-22.5429-1.96-22.5429-15.0517,0-7,6.5107-11.27,14.9824-11.27,9.3808,0,16.1709,5.25,14.7011,13.1611h-7.7714c.98-3.99-2.17-6.7207-7-6.7207-4.0606,0-6.7207,1.82-6.7207,4.34,0,7.0713,22.6123,1.6807,22.6123,14.9825,0,7.07-6.3711,11.2011-15.4717,11.2011C310.04,72.6424,303.5292,67.6014,304.0888,59.1307Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
<path
|
||||
id="type_CompoundPathItem_6"
|
||||
d="M371.2226,51.78V71.662H363.872V65.5711a13.7856,13.7856,0,0,1-12.6015,7.0713c-7.42,0-12.0411-4.3408-12.0411-10.4316,0-7.07,6.16-11.3408,16.0313-11.3408a36.6377,36.6377,0,0,1,7.9814.91c0-5.3213-1.8906-9.1709-7.4912-9.1709-4.2,0-6.791,2.1-5.95,6.02H341.749c-1.89-7.77,4.9707-12.9511,14.0722-12.9511C366.0419,35.6786,371.2226,42.0487,371.2226,51.78Zm-7.7,6.0909a25.2,25.2,0,0,0-7.6308-1.19c-5.7413,0-8.5411,2.1006-8.5411,5.32,0,2.8008,2.1,4.27,5.53,4.27A10.8339,10.8339,0,0,0,363.5224,57.871Z"
|
||||
style="fill: #0a3149"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default ConfLogo
|
||||
@@ -1,111 +0,0 @@
|
||||
.card {
|
||||
background-color: var(--ifm-card-bg);
|
||||
border: 1px solid var(--ifm-card-bg-hover) !important;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
}
|
||||
|
||||
img.card-icon {
|
||||
width: var(--ifm-card-icon-size);
|
||||
height: var(--ifm-card-icon-size);
|
||||
}
|
||||
|
||||
.cards-grid {
|
||||
display: grid;
|
||||
column-gap: var(--ifm-base-spacing);
|
||||
grid-auto-rows: 1fr;
|
||||
}
|
||||
|
||||
.cards-grid.grid-6 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.card-highlighted {
|
||||
--bordered-inside-padding: 6px;
|
||||
|
||||
position: relative;
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) * 2);
|
||||
}
|
||||
|
||||
.card-highlighted {
|
||||
background-color: var(--ifm-card-bg);
|
||||
}
|
||||
|
||||
/* html[data-theme="dark"] .card-highlighted::before,
|
||||
html[data-theme="dark"] .card-highlighted::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
} */
|
||||
|
||||
/* html[data-theme="dark"] .card-highlighted::before {
|
||||
z-index: -2;
|
||||
background-color: var(--ifm-card-bg);
|
||||
background-image: url('/img/stardust.png');
|
||||
transition: all var(--ifm-transition-fast) ease;
|
||||
}
|
||||
|
||||
html[data-theme="dark"] .card-highlighted::after {
|
||||
z-index: -1;
|
||||
background-image: url('/img/light-beam.png');
|
||||
} */
|
||||
|
||||
.card-highlighted:hover {
|
||||
background-color: var(--ifm-card-bg-hover);
|
||||
}
|
||||
|
||||
.card + p {
|
||||
margin-top: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
|
||||
.card-wrapper:hover > [class*=cardSoon] [class*=cardTitle],
|
||||
.card-wrapper:hover > [class*=cardSoon] [class*=cardDescription] {
|
||||
color: var(--medusa-text-disabled);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 992px) {
|
||||
.cards-grid.grid-4 {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 991px) and (min-width: 768px) {
|
||||
.cards-grid.grid-4 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.card-highlighted [class*=cardDescription] {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.card-highlighted::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.card-highlighted::before {
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-image: var(--ifm-card-highlighted-bg-image);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
.cards-grid.grid-4 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.cards-grid.grid-6 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
code {
|
||||
border: 1px solid var(--ifm-code-border-color);
|
||||
color: var(--ifm-code-color);
|
||||
line-height: var(--medusa-body-regular-line-height);
|
||||
}
|
||||
|
||||
[data-tooltip-content]:hover code {
|
||||
background-color: var(--ifm-code-background-hover);
|
||||
}
|
||||
|
||||
[data-tooltip-content] > span:active > code,
|
||||
[data-tooltip-content] > span:focus > code {
|
||||
background-color: var(--ifm-code-background-pressed);
|
||||
}
|
||||
|
||||
.inline-code-copy {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
color: var(--ifm-code-color)
|
||||
}
|
||||
|
||||
.prism-code {
|
||||
background-color: none;
|
||||
word-break: break-word;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.prism-code div,
|
||||
.prism-code div:focus,
|
||||
.prism-code div:active {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.code-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.code-header {
|
||||
padding: 12px var(--ifm-base-spacing);
|
||||
background-color: var(--medusa-code-tabs-bg);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-radius: var(--ifm-code-border-radius) var(--ifm-code-border-radius) 0px 0px;
|
||||
}
|
||||
|
||||
.code-tabs .tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.code-tabs .tabs__item {
|
||||
color: var(--ifm-code-tabs-color);
|
||||
font-size: var(--medusa-label-small-plus-size);
|
||||
font-weight: var(--medusa-label-small-plus-font-weight);
|
||||
line-height: var(--medusa-label-small-plus-line-height);
|
||||
padding: 4px 12px;
|
||||
border: 1px solid transparent;
|
||||
white-space: nowrap;
|
||||
border-radius: 99999px;
|
||||
}
|
||||
|
||||
.code-tabs .tabs__item:not(:first-child) {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.code-title {
|
||||
font-size: var(--medusa-label-small-plus-size);
|
||||
font-weight: var(--medusa-label-small-plus-font-weight);
|
||||
line-height: var(--medusa-label-small-plus-line-height);
|
||||
color: var(--ifm-code-title-color);
|
||||
}
|
||||
|
||||
.code-tabs-ul-wrapper {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.code-tabs-ul-wrapper .tabs__item {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.code-tabs .tabs__item--active {
|
||||
color: var(--ifm-code-tabs-active-color);
|
||||
}
|
||||
|
||||
.theme-code-block:not(.no-header-block),
|
||||
.code-tabs .theme-code-block {
|
||||
border-radius: 0 0 var(--ifm-code-border-radius) var(--ifm-code-border-radius) !important;
|
||||
}
|
||||
|
||||
.theme-code-block.no-header-block {
|
||||
border-radius: var(--ifm-code-border-radius);
|
||||
}
|
||||
|
||||
.code-action-copy {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.code-action {
|
||||
--ifm-icon-color: var(--medusa-code-block-action);
|
||||
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 4px;
|
||||
cursor: pointer;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
}
|
||||
|
||||
.code-action:hover,
|
||||
.tabs__item:hover {
|
||||
background-color: var(--ifm-code-action-hover-bg) !important;
|
||||
}
|
||||
|
||||
.code-action:not(:first-child) {
|
||||
margin-left: calc(var(--ifm-base-spacing) / 2);
|
||||
}
|
||||
|
||||
a.code-action {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copy-action {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.code-header,
|
||||
.theme-code-block {
|
||||
border: 1px solid var(--ifm-code-block-border-color);
|
||||
}
|
||||
|
||||
.code-header {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.theme-code-block.no-header-block code:not(.thin-code),
|
||||
.theme-code-block:not(.no-header-block) code {
|
||||
padding: var(--ifm-pre-padding);
|
||||
}
|
||||
|
||||
.theme-code-block.no-header-block .thin-code {
|
||||
padding: calc(var(--ifm-pre-padding) / 2);
|
||||
padding-left: var(--ifm-pre-padding);
|
||||
}
|
||||
|
||||
[class*=codeLineNumber] {
|
||||
color: var(--ifm-code-line-number-color);
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 568px) {
|
||||
.prism-code {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.prism-code:after {
|
||||
border-radius: var(--ifm-global-radius);
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: calc(10% + 24px);
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--ifm-pre-background-transparent), var(--ifm-pre-background) 24px);
|
||||
}
|
||||
|
||||
.prism-code:not(:hover)::-webkit-scrollbar-thumb,
|
||||
.prism-code:not(:hover)::-webkit-scrollbar-track {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.prism-code:hover::-webkit-scrollbar-thumb,
|
||||
.prism-code:hover::-webkit-scrollbar-track {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.code-tabs-ul-wrapper .code-tab-selector {
|
||||
position: absolute;
|
||||
border: 1px solid var(--medusa-code-tab-border);
|
||||
background-color: var(--ifm-code-tabs-active-bg);
|
||||
transition: all var(--ifm-transition-fast) ease;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
border-radius: 99999px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 567px) {
|
||||
.code-tabs .tabs__item--active {
|
||||
border: 1px solid var(--medusa-code-tab-border);
|
||||
background-color: var(--ifm-code-tabs-active-bg);
|
||||
}
|
||||
.code-action {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.tablist-wrapper.code-header .code-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -1,383 +0,0 @@
|
||||
/* Search Modal */
|
||||
.DocSearch-Modal {
|
||||
border: 1px solid var(--docsearch-modal-border-color);
|
||||
border-radius: var(--ifm-global-radius) !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.DocSearch-SearchBar {
|
||||
padding: 0 !important
|
||||
}
|
||||
|
||||
.DocSearch-Form {
|
||||
--docsearch-spacing: var(--docsearch-spacing-x);
|
||||
--docsearch-searchbox-height: var(--docsearch-modal-searchbox-height);
|
||||
--docsearch-searchbox-shadow: var(--docsearch-modal-searchbox-focus-background);
|
||||
--docsearch-searchbox-focus-background: var(--docsearch-modal-background);
|
||||
|
||||
border-radius: var(--ifm-global-radius) var(--ifm-global-radius) 0 0 !important;
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
|
||||
.DocSearch-LoadingIndicator svg, .DocSearch-MagnifierLabel svg {
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
}
|
||||
|
||||
.DocSearch-Input {
|
||||
font-size: var(--medusa-body-regular-size) !important;
|
||||
line-height: var(--medusa-body-regular-line-height) !important;
|
||||
font-weight: var(--medusa-body-regular-font-weight) !important;
|
||||
padding-left: var(--ifm-base-spacing) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Input::placeholder,
|
||||
.DocSearch-Input:-ms-input-placeholder,
|
||||
.DocSearch-Input::-ms-input-placeholder {
|
||||
color: var(--docsearch-placeholder-color);
|
||||
}
|
||||
|
||||
.DocSearch-Dropdown {
|
||||
padding: 0 0 var(--docsearch-footer-height) 0 !important;
|
||||
max-height: calc(var(--docsearch-modal-height) - var(--docsearch-modal-searchbox-height)) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-source {
|
||||
margin: 0 !important;
|
||||
font-size: var(--medusa-label-small-plus-size) !important;
|
||||
line-height: var(--medusa-label-small-plus-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-plus-font-weight) !important;
|
||||
text-transform: uppercase;
|
||||
color: var(--docsearch-source-color);
|
||||
border-bottom: 1px solid var(--docsearch-hit-border-color);
|
||||
padding: var(--docsearch-source-spacing) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Footer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit:not(.DocSearch-Hit--Child) .DocSearch-Hit-icon {
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
padding: 2px;
|
||||
border: 1px solid var(--medusa-border-strong);
|
||||
border-radius: var(--ifm-global-radius);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-icon svg {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.DocSearch-Hit:not(.DocSearch-Hit--Child) .DocSearch-Hit-icon::before {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
content: '';
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .DocSearch-Hit:not(.DocSearch-Hit--Child) .DocSearch-Hit-icon::before {
|
||||
background-image: url('/img/search-hit.svg');
|
||||
}
|
||||
|
||||
html:not([data-theme="dark"]) .DocSearch-Hit:not(.DocSearch-Hit--Child) .DocSearch-Hit-icon::before {
|
||||
background-image: url('/img/search-hit-light.svg');
|
||||
}
|
||||
|
||||
.DocSearch-Hit--Child .DocSearch-Hit-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.DocSearch-Hit a {
|
||||
padding: var(--docsearch-spacing) !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit:not(:last-of-type) a {
|
||||
border-bottom: 1px solid var(--docsearch-hit-border-color);
|
||||
}
|
||||
|
||||
.DocSearch-Hit-content-wrapper {
|
||||
margin: 0 16px !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-title,
|
||||
.DocSearch-Hit-title mark {
|
||||
color: var(--docsearch-hit-title-color) !important;
|
||||
font-size: var(--medusa-label-small-plus-size) !important;
|
||||
line-height: var(--medusa-label-small-plus-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-plus-font-weight) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-path {
|
||||
color: var(--docsearch-muted-color) !important;
|
||||
font-size: var(--medusa-label-small-size) !important;
|
||||
line-height: var(--medusa-label-small-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-font-weight) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path {
|
||||
--docsearch-hit-active-color: var(--docsearch-muted-color);
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] a {
|
||||
background-color: var(--docsearch-hit-active-bg) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child {
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
border: 1px solid var(--medusa-border-strong);
|
||||
border-radius: var(--ifm-global-radius);
|
||||
background-color: var(--docsearch-modal-background);
|
||||
padding: 2px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child svg,
|
||||
.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child svg {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child::before {
|
||||
content: '';
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background-image: url('/img/search-hit-arrow.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .DocSearch-Hit[aria-selected=true] .DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child::before {
|
||||
background-image: url('/img/search-hit-arrow.svg');
|
||||
}
|
||||
|
||||
html:not([data-theme="dark"]) .DocSearch-Hit[aria-selected=true] .DocSearch-Hit-content-wrapper + .DocSearch-Hit-action:last-child::before {
|
||||
background-image: url('/img/search-hit-arrow-light.svg');
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] mark {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.DocSearch-Hit-Tree {
|
||||
color: var(--docsearch-tree-color);
|
||||
}
|
||||
|
||||
.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree {
|
||||
color: var(--docsearch-tree-hover-color);
|
||||
}
|
||||
|
||||
.DocSearch-HitsFooter {
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: var(--docsearch-footer-height);
|
||||
background-color: var(--docsearch-modal-background);
|
||||
border-top: 1px solid var(--docsearch-modal-border-color);
|
||||
}
|
||||
|
||||
.DocSearch-HitsFooter a {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.DocSearch-Reset {
|
||||
border-radius: var(--ifm-global-radius) !important;
|
||||
transition: all var(--ifm-transition-fast) ease;
|
||||
}
|
||||
|
||||
.DocSearch-Reset:hover {
|
||||
background-color: var(--medusa-bg-base-hover);
|
||||
}
|
||||
|
||||
.DocSearch-Hits:last-of-type {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* Modal no results */
|
||||
|
||||
.DocSearch-NoResults .DocSearch-Screen-Icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0 !important;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 auto calc(var(--ifm-base-margin-vertical) / 2) auto;
|
||||
}
|
||||
|
||||
.DocSearch-NoResults .DocSearch-Screen-Icon svg {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.DocSearch-NoResults .DocSearch-Screen-Icon::before {
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .DocSearch-NoResults .DocSearch-Screen-Icon::before {
|
||||
background-image: url('/img/search-no-result.svg');
|
||||
}
|
||||
|
||||
html:not([data-theme="dark"]) .DocSearch-NoResults .DocSearch-Screen-Icon::before {
|
||||
background-image: url('/img/search-no-result-light.svg');
|
||||
}
|
||||
|
||||
.DocSearch-NoResults .DocSearch-Title {
|
||||
font-size: var(--medusa-label-small-size) !important;
|
||||
line-height: var(--medusa-label-small-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-font-weight) !important;
|
||||
padding-left: var(--ifm-base-spacing) !important;
|
||||
}
|
||||
|
||||
.DocSearch-NoResults-Prefill-List {
|
||||
text-align: center;
|
||||
font-size: var(--medusa-label-small-plus-size) !important;
|
||||
line-height: var(--medusa-label-small-plus-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-plus-font-weight) !important;
|
||||
padding-left: var(--ifm-base-spacing) !important;
|
||||
}
|
||||
|
||||
.DocSearch-NoResults-Prefill-List li::marker {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.DocSearch-NoResults-Prefill-List li button {
|
||||
color: var(--ifm-link-color);
|
||||
}
|
||||
|
||||
/* Search Bar */
|
||||
|
||||
.DocSearch-Button {
|
||||
width: 100%;
|
||||
height: 100% !important;
|
||||
border-radius: var(--ifm-global-radius) !important;
|
||||
border: 1px solid var(--docsearch-searchbox-border-color) !important;
|
||||
padding: 6px 6px 6px 8px !important;
|
||||
}
|
||||
|
||||
span.DocSearch-Button-Key {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.DocSearch-Container {
|
||||
z-index: 1001 !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button .DocSearch-Search-Icon {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.DocSearch-Button {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Container:before {
|
||||
content: '';
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
top: 5px;
|
||||
background-image: url('/static/img/magnifying-glass.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Placeholder {
|
||||
color: var(--docsearch-placeholder-color);
|
||||
padding-left: calc(var(--ifm-base-spacing) / 2) !important;
|
||||
font-size: var(--medusa-label-small-size) !important;
|
||||
line-height: var(--medusa-label-small-line-height) !important;
|
||||
font-weight: var(--medusa-label-small-font-weight) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Keys {
|
||||
width: fit-content;
|
||||
min-width: unset !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Key {
|
||||
box-shadow: none !important;
|
||||
border-radius: 6px !important;
|
||||
font-size: var(--medusa-label-x-small-plus-size) !important;
|
||||
line-height: var(--medusa-label-x-small-plus-line-height) !important;
|
||||
font-weight: var(--medusa-label-x-small-plus-font-weight) !important;
|
||||
font-family: var(--ifm-font-family-base) !important;
|
||||
vertical-align: middle;
|
||||
padding: 2px !important;
|
||||
border: 1px solid var(--medusa-border-strong) !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Key:not(:last-child) {
|
||||
margin-right: 4px !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button-Key:last-child {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button:active, .DocSearch-Button:focus, .DocSearch-Button:hover,
|
||||
.DocSearch-Form, .DocSearch-Form {
|
||||
border-color: var(--docsearch-searchbox-border-color) !important;
|
||||
}
|
||||
|
||||
/* Search Page */
|
||||
.search-page-wrapper article[class*=searchResultItem] {
|
||||
max-width: unset !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 992px) {
|
||||
[class*=searchBox] {
|
||||
width: var(--docsearch-searchbox-width);
|
||||
max-width: var(--docsearch-searchbox-width);
|
||||
height: var(--docsearch-searchbox-height) !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 991px) {
|
||||
.DocSearch-Button-Keys, .DocSearch-Button-Placeholder {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button {
|
||||
border: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.DocSearch-Button:focus, .DocSearch-Button:hover {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.DocSearch-Modal {
|
||||
margin: unset !important;
|
||||
width: var(--docsearch-modal-width);
|
||||
}
|
||||
|
||||
.DocSearch-Container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
@@ -1,225 +0,0 @@
|
||||
.main-wrapper {
|
||||
max-width: var(--ifm-max-content-width);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.theme-doc-breadcrumbs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
article {
|
||||
max-width: var(--ifm-docs-page-max-width);
|
||||
}
|
||||
|
||||
.padding-top--md {
|
||||
padding-top: 48px !important;
|
||||
}
|
||||
|
||||
.margin-bottom--lg {
|
||||
margin-bottom: calc(var(--ifm-base-margin-vertical) / 2) !important;
|
||||
}
|
||||
|
||||
.pagination-nav {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: var(--ifm-docs-page-max-width);
|
||||
}
|
||||
|
||||
details summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.reference-table {
|
||||
display: table !important;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.reference-table p {
|
||||
--ifm-paragraph-margin-bottom: 0;
|
||||
}
|
||||
|
||||
.reference-table.table-col-4 th:nth-child(1),
|
||||
.reference-table.table-col-4 td:nth-child(1) {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.reference-table.table-col-4 th:nth-child(2),
|
||||
.reference-table.table-col-4 td:nth-child(2) {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.reference-table.table-col-4 th:nth-child(3),
|
||||
.reference-table.table-col-4 td:nth-child(3) {
|
||||
width: 40% !important;
|
||||
}
|
||||
|
||||
.reference-table.table-col-4 th:nth-child(4),
|
||||
.reference-table.table-col-4 td:nth-child(4) {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.reference-table th:nth-child(1),
|
||||
.reference-table td:nth-child(1) {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.reference-table th:nth-child(2),
|
||||
.reference-table td:nth-child(2) {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.reference-table th:nth-child(3),
|
||||
.reference-table td:nth-child(3) {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.reference-table .tooltip-container code {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.reference-table .theme-code-block span {
|
||||
max-width: 100%;
|
||||
word-break: break-word;
|
||||
white-space: break-spaces;
|
||||
}
|
||||
|
||||
.reference-table [class*=codeBlockLinesWithNumbering] {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.container:not(.footer-container) {
|
||||
padding-top: 38px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.pagination-nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* User Guide Styling */
|
||||
kbd {
|
||||
font: 100% var(--ifm-font-family-monospace) !important;
|
||||
background-color: var(--medusa-bg-component) !important;
|
||||
color: var(--medusa-text-subtle) !important;
|
||||
border-radius: 6px !important;
|
||||
border-color: var(--medusa-border-strong) !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.ui-icon {
|
||||
vertical-align: sub;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.markdown-doc-wrapper {
|
||||
margin: 0 auto;
|
||||
max-width: var(--ifm-container-width);
|
||||
width: 100%;
|
||||
margin-left: auto !important;
|
||||
}
|
||||
|
||||
.markdown-doc-wrapper--fluid {
|
||||
max-width: inherit;
|
||||
}
|
||||
|
||||
.markdown-row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.theme-doc-footer {
|
||||
margin-top: 0 !important;
|
||||
border-top: 1px solid var(--ifm-doc-footer-border-color) !important;
|
||||
padding-top: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
|
||||
.theme-edit-this-page {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
border-radius: var(--ifm-global-radius);
|
||||
cursor: pointer;
|
||||
background-color: var(--ifm-secondary-btn-background-color);
|
||||
border: 1px solid var(--ifm-secondary-btn-border-color);
|
||||
font-size: var(--medusa-label-small-plus-size);
|
||||
line-height: var(--medusa-label-small-plus-line-height);
|
||||
font-weight: var(--medusa-label-small-plus-font-weight);
|
||||
}
|
||||
|
||||
.theme-edit-this-page:hover {
|
||||
background-color: var(--ifm-secondary-btn-hover-background-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.theme-edit-this-page,
|
||||
.theme-edit-this-page:hover {
|
||||
color: var(--ifm-secondary-btn-color);
|
||||
}
|
||||
|
||||
.theme-edit-this-page:focus {
|
||||
box-shadow: var(--ifm-secondary-btn-focused-shadow);
|
||||
}
|
||||
|
||||
.theme-last-updated {
|
||||
font-style: normal;
|
||||
font-size: var(--medusa-label-small-plus-size);
|
||||
line-height: var(--medusa-label-small-plus-line-height);
|
||||
}
|
||||
|
||||
.theme-last-updated,
|
||||
.theme-last-updated b {
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
|
||||
.medium-zoom-overlay {
|
||||
z-index: var(--ifm-z-index-overlay);
|
||||
}
|
||||
|
||||
.tabs-wrapper:not(.code-tabs) > .tabs-container > div:not(.tablist-wrapper) {
|
||||
padding-top: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
|
||||
.medium-zoom-image--opened {
|
||||
z-index: var(--ifm-z-index-overlay);
|
||||
}
|
||||
|
||||
details > div {
|
||||
--docusaurus-details-decoration-color: transparent !important;
|
||||
}
|
||||
|
||||
.row--justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.docs-page-container {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1419px) {
|
||||
.main-wrapper {
|
||||
min-width: var(--ifm-max-content-width);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1418px) {
|
||||
.main-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 992px) {
|
||||
.markdown-doc-wrapper {
|
||||
padding: 0 calc(var(--ifm-spacing-horizontal) * 4);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 991px) {
|
||||
.markdown-doc-wrapper {
|
||||
padding: 0 var(--ifm-spacing-horizontal);
|
||||
}
|
||||
}
|
||||
276
www/docs/src/css/_docusaurus.css
Normal file
276
www/docs/src/css/_docusaurus.css
Normal file
@@ -0,0 +1,276 @@
|
||||
/** This CSS file includes tailwind styling definitions for classes defined by docusaurus **/
|
||||
html,
|
||||
body {
|
||||
@apply tw-h-full;
|
||||
}
|
||||
|
||||
.cards-grid {
|
||||
@apply tw-grid tw-gap-x-1 tw-auto-rows-fr;
|
||||
}
|
||||
|
||||
.cards-grid.grid-6 {
|
||||
@apply md:tw-grid-cols-2 tw-grid-cols-1;
|
||||
}
|
||||
|
||||
.cards-grid.grid-4 {
|
||||
@apply lg:tw-grid-cols-3 md:tw-grid-cols-2 tw-grid-cols-1;
|
||||
}
|
||||
|
||||
h1 + .cards-grid,
|
||||
h1 + .card-wrapper,
|
||||
h2 + .cards-grid,
|
||||
h2 + .card-wrapper,
|
||||
h3 + .cards-grid,
|
||||
h3 + .card-wrapper {
|
||||
@apply tw-mt-1.5;
|
||||
}
|
||||
|
||||
.markdown p + img,
|
||||
.markdown .alert,
|
||||
.markdown .code-wrapper {
|
||||
@apply tw-mb-2;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown p + .code-wrapper,
|
||||
.markdown p + .tabs-wrapper,
|
||||
.markdown p + .alert,
|
||||
.markdown p + section,
|
||||
video {
|
||||
@apply tw-mt-2;
|
||||
}
|
||||
|
||||
.theme-code-block {
|
||||
@apply tw-border tw-border-solid tw-border-medusa-code-block-border;
|
||||
}
|
||||
|
||||
.markdown p + .card-wrapper {
|
||||
@apply tw-mt-1.5;
|
||||
}
|
||||
|
||||
.card + p {
|
||||
@apply tw-mt-2;
|
||||
}
|
||||
|
||||
.card-highlighted {
|
||||
|
||||
@apply tw-relative tw-mb-4 tw-bg-medusa-bg-subtle dark:tw-bg-medusa-bg-base-dark hover:tw-bg-medusa-bg-subtle-hover dark:hover:tw-bg-medusa-bg-subtle-hover-dark;
|
||||
}
|
||||
|
||||
.col.toc-wrapper {
|
||||
--ifm-col-width: var(--ifm-toc-width);
|
||||
}
|
||||
|
||||
.markdown-doc-wrapper--fluid {
|
||||
@apply tw-max-w-[inherit];
|
||||
}
|
||||
|
||||
:global(.docusaurus-mt-lg) {
|
||||
@apply tw-mt-3;
|
||||
}
|
||||
|
||||
:global(#__docusaurus) {
|
||||
@apply tw-min-h-full tw-flex tw-flex-col;
|
||||
}
|
||||
|
||||
.code-tabs .theme-code-block {
|
||||
@apply !tw-rounded-t-none !tw-rounded-b
|
||||
}
|
||||
|
||||
[class*=codeLineNumber] {
|
||||
@apply tw-text-medusa-text-placeholder !tw-pl-0;
|
||||
}
|
||||
|
||||
.prism-code {
|
||||
@apply xs:tw-max-w-[90%] xs:after:tw-content-[''] xs:after:tw-rounded xs:after:tw-absolute;
|
||||
@apply xs:after:tw-right-0 xs:after:tw-top-0 xs:after:tw-w-[calc(10%+24px)] xs:after:tw-h-full xs:after:tw-bg-code-fade;
|
||||
}
|
||||
|
||||
.prism-code:not(:hover)::-webkit-scrollbar-thumb,
|
||||
.prism-code:not(:hover)::-webkit-scrollbar-track {
|
||||
@apply xs:tw-invisible;
|
||||
}
|
||||
|
||||
.prism-code:hover::-webkit-scrollbar-thumb,
|
||||
.prism-code:hover::-webkit-scrollbar-track {
|
||||
@apply xs:tw-opacity-100
|
||||
}
|
||||
|
||||
.prism-code {
|
||||
@apply tw-bg-transparent tw-break-words !tw-outline-none;
|
||||
}
|
||||
|
||||
.prism-code div {
|
||||
@apply !tw-outline-none focus:!tw-outline-none active:!tw-outline-none;
|
||||
}
|
||||
|
||||
.code-tabs {
|
||||
@apply tw-relative;
|
||||
}
|
||||
|
||||
.sidebar-desktop nav {
|
||||
--ifm-scrollbar-track-background-color: transparent !important;
|
||||
--ifm-scrollbar-thumb-background-color: transparent !important;
|
||||
--ifm-scrollbar-thumb-hover-background-color: transparent !important;
|
||||
}
|
||||
|
||||
.main-wrapper {
|
||||
@apply tw-max-w-xl tw-mx-auto xl:tw-min-w-xl tw-w-full;
|
||||
}
|
||||
|
||||
.theme-doc-breadcrumbs {
|
||||
@apply tw-hidden;
|
||||
}
|
||||
|
||||
article {
|
||||
@apply tw-max-w-[960px];
|
||||
}
|
||||
|
||||
.padding-top--md {
|
||||
@apply !tw-pt-3;
|
||||
}
|
||||
|
||||
.margin-bottom--lg {
|
||||
@apply !tw-mb-1;
|
||||
}
|
||||
|
||||
details summary {
|
||||
@apply tw-cursor-pointer;
|
||||
}
|
||||
|
||||
.reference-table {
|
||||
@apply !tw-table tw-table-fixed tw-w-full;
|
||||
}
|
||||
|
||||
.reference-table p {
|
||||
--ifm-paragraph-margin-bottom: 0;
|
||||
}
|
||||
|
||||
.reference-table.table-col-4 th,
|
||||
.reference-table.table-col-4 td {
|
||||
@apply [&:nth-child(1)]:!tw-w-1/5 [&:nth-child(2)]:!tw-w-1/5 [&:nth-child(3)]:!tw-w-2/5 [&:nth-child(4)]:!tw-w-1/5;
|
||||
}
|
||||
|
||||
.reference-table th:nth-child(1),
|
||||
.reference-table td:nth-child(1) {
|
||||
@apply [&:nth-child(1)]:!tw-w-[30%] [&:nth-child(2)]:!tw-w-[30%] [&:nth-child(3)]:!tw-w-2/5;
|
||||
}
|
||||
|
||||
.reference-table .tooltip-container code {
|
||||
@apply tw-whitespace-nowrap;
|
||||
}
|
||||
|
||||
.reference-table .theme-code-block span {
|
||||
@apply !tw-max-w-full !tw-break-words !tw-whitespace-break-spaces;
|
||||
}
|
||||
|
||||
.reference-table .code-block-numbering {
|
||||
@apply !tw-block;
|
||||
}
|
||||
|
||||
.container {
|
||||
@apply !tw-pt-[38px] !tw-max-w-full;
|
||||
}
|
||||
|
||||
.pagination-nav {
|
||||
@apply tw-hidden;
|
||||
}
|
||||
|
||||
.markdown kbd {
|
||||
@apply !tw-font-monospace !tw-bg-medusa-bg-component dark:!tw-bg-medusa-bg-component-dark !tw-text-medusa-text-subtle dark:!tw-text-medusa-text-subtle-dark;
|
||||
@apply !tw-rounded-md !tw-border-medusa-border-strong dark:!tw-border-medusa-border-strong-dark !tw-shadow-none;
|
||||
}
|
||||
|
||||
.theme-doc-footer {
|
||||
@apply !tw-mt-0 tw-border-0 !tw-border-t tw-border-solid !tw-border-medusa-border-base dark:!tw-border-medusa-border-base-dark;
|
||||
@apply tw-pt-2;
|
||||
}
|
||||
|
||||
.theme-last-updated {
|
||||
@apply tw-font-normal tw-not-italic tw-text-label-small-plus;
|
||||
}
|
||||
|
||||
.theme-last-updated,
|
||||
.theme-last-updated b {
|
||||
@apply !tw-font-normal;
|
||||
}
|
||||
|
||||
.medium-zoom-overlay {
|
||||
@apply tw-z-[400];
|
||||
}
|
||||
|
||||
.medium-zoom-image--opened {
|
||||
@apply tw-z-[400];
|
||||
}
|
||||
|
||||
details > div {
|
||||
--docusaurus-details-decoration-color: transparent !important;
|
||||
}
|
||||
|
||||
.row--justify-end {
|
||||
@apply tw-justify-end;
|
||||
}
|
||||
|
||||
.docs-page-container {
|
||||
@apply !tw-px-0;
|
||||
}
|
||||
|
||||
.search-result-match {
|
||||
@apply tw-text-medusa-text-base dark:tw-text-medusa-text-base-dark;
|
||||
@apply tw-bg-medusa-bg-highlight dark:tw-bg-medusa-bg-highlight-dark tw-py-[4px] tw-px-0;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
@apply tw-z-[399] tw-p-0;
|
||||
}
|
||||
|
||||
html:not(.plugin-redoc) .navbar:not(.navbar-sidebar--show) {
|
||||
@apply supports-[backdrop-filter]:tw-bg-transparent supports-[backdrop-filter]:tw-backdrop-blur-md;
|
||||
}
|
||||
|
||||
.navbar__link {
|
||||
@apply tw-text-label-small-plus;
|
||||
}
|
||||
|
||||
.navbar__brand {
|
||||
@apply tw-mr-2;
|
||||
}
|
||||
|
||||
.navbar__logo {
|
||||
@apply tw-w-[83px] tw-h-[20px] tw-flex tw-justify-center tw-items-center !tw-mr-0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@apply !tw-text-h1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@apply !tw-text-h2;
|
||||
}
|
||||
|
||||
h3 {
|
||||
@apply !tw-text-h3;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
@apply tw-text-medusa-text-base dark:tw-text-medusa-text-base-dark;
|
||||
}
|
||||
|
||||
.markdown > h1:first-child,
|
||||
.markdown > h2,
|
||||
.markdown > h3 {
|
||||
@apply tw-mb-0.5;
|
||||
}
|
||||
|
||||
.markdown > p {
|
||||
@apply tw-mb-0.5;
|
||||
}
|
||||
|
||||
.markdown > p img {
|
||||
@apply tw-mt-0.5;
|
||||
}
|
||||
|
||||
.markdown {
|
||||
@apply tw-mb-0;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
footer.footer {
|
||||
border-top: 1px solid var(--ifm-footer-border-color);
|
||||
padding-top: 108px;
|
||||
padding-bottom: calc(var(--ifm-base-margin-vertical) * 2);
|
||||
margin-top: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
display: flex;
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.footer-container .col {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
footer .social-links {
|
||||
--ifm-icon-color: var(--ifm-footer-social-icons-color);
|
||||
}
|
||||
|
||||
footer .social-link:hover {
|
||||
--ifm-icon-color: var(--ifm-footer-social-icons-color-hover);
|
||||
}
|
||||
|
||||
.social-links {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.social-link:not(:first-child) {
|
||||
margin-left: var(--ifm-base-spacing);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 991px) {
|
||||
.footer-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.footer-container .row--justify-end {
|
||||
justify-content: start;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
margin-bottom: var(--ifm-base-margin-vertical);
|
||||
}
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
/** Light theme/default **/
|
||||
:root {
|
||||
/** Backgrounds **/
|
||||
--medusa-bg-subtle: #F8F9FA;
|
||||
--medusa-bg-subtle-hover: #F1F3F5;
|
||||
--medusa-bg-subtle-pressed: #ECEEF0;
|
||||
--medusa-bg-base: #FFFFFF;
|
||||
--medusa-bg-base-hover: #F8F9FA;
|
||||
--medusa-bg-base-pressed: #F1F3F5;
|
||||
--medusa-bg-component: #F1F3F5;
|
||||
--medusa-bg-field: #F8F9FA;
|
||||
--medusa-bg-field-hover: #F1F3F5;
|
||||
--medusa-bg-highlight: #EDE9FE;
|
||||
--medusa-bg-toggle-off: #C1C8CD;
|
||||
--medusa-bg-overlay: rgba(17, 24, 28, 0.4);
|
||||
--medusa-bg-interactive: #6E56CF;
|
||||
|
||||
/** Borders **/
|
||||
--medusa-border-base: #E6E8EB;
|
||||
--medusa-border-strong: #D7DBDF;
|
||||
--medusa-border-focus: #6E56CF;
|
||||
--medusa-border-focus-inset: #FFFFFF;
|
||||
--medusa-border-interactive: #6E56CF;
|
||||
|
||||
/** Text **/
|
||||
--medusa-text-base: #11181C;
|
||||
--medusa-text-subtle: #687076;
|
||||
--medusa-text-placeholder: #889096;
|
||||
--medusa-text-disabled: #C1C8CD;
|
||||
--medusa-text-on-color: #FFFFFF;
|
||||
--medusa-text-interactive: #6E56CF;
|
||||
--medusa-text-interactive-hover: #644FC1;
|
||||
--medusa-text-error: #E5484D;
|
||||
|
||||
/** Buttons **/
|
||||
--medusa-button-primary: #6E56CF;
|
||||
--medusa-button-primary-hover: #644FC1;
|
||||
--medusa-button-primary-pressed: #5746AF;
|
||||
--medusa-button-secondary: #FFFFFF;
|
||||
--medusa-button-secondary-hover: #F8F9FA;
|
||||
--medusa-button-secondary-pressed: #F1F3F5;
|
||||
--medusa-button-danger: #E5484D;
|
||||
--medusa-button-danger-hover: #DC3D43;
|
||||
--medusa-button-danger-pressed: #CD2B31;
|
||||
--medusa-button-danger-text: var(--medusa-text-on-color);
|
||||
--medusa-button-success: #30A46C;
|
||||
--medusa-button-success-text: var(--medusa-text-on-color);
|
||||
|
||||
/** Icons **/
|
||||
--medusa-icon-primary: #11181C;
|
||||
--medusa-icon-secondary: #687076;
|
||||
--medusa-icon-placeholder: #889096;
|
||||
--medusa-icon-disabled: #C1C8CD;
|
||||
--medusa-icon-on-color: #FFFFFF;
|
||||
--medusa-icon-interactive: #6E56CF;
|
||||
--medusa-icon-interactive-hover: #644FC1;
|
||||
--medusa-icon-error: #E5484D;
|
||||
|
||||
/** Support Info **/
|
||||
--medusa-support-error: #E5484D;
|
||||
--medusa-support-warning: #FFB224;
|
||||
--medusa-support-success: #30A46C;
|
||||
--medusa-support-info: #0091FF;
|
||||
|
||||
/** Code Block **/
|
||||
--medusa-code-block: #1C1C1F;
|
||||
--medusa-code-block-transparent: #1C1C1F00;
|
||||
--medusa-code-block-border: #2E2E32;
|
||||
--medusa-code-block-action: #706F78;
|
||||
|
||||
/** Code Tabs **/
|
||||
--medusa-code-tabs-bg: #161616;
|
||||
--medusa-code-tab: #1C1C1F;
|
||||
--medusa-code-tab-hover: rgba(141, 141, 141, 0.16);
|
||||
--medusa-code-tab-border: #3E3E44;
|
||||
--medusa-code-tab-text: #7E7D86;
|
||||
--medusa-code-tab-active-text: #EDEDEF;
|
||||
--medusa-code-tab-title: #7E7D86;
|
||||
|
||||
/** Tooltip **/
|
||||
--medusa-tooltip: var(--medusa-bg-base);
|
||||
--medusa-tooltip-border: var(--medusa-border-base);
|
||||
--medusa-tooltip-shadow: var(--medusa-shadow-overlay);
|
||||
--medusa-tooltip-text: var(--medusa-text-subtle);
|
||||
|
||||
/** Shadow **/
|
||||
--medusa-shadow-overlay: 0px 2px 16px rgba(0, 0, 0, 0.08);
|
||||
--medusa-shadow-field-focused: 0px 0px 0px 4px #EDE9FE;
|
||||
--medusa-shadow-button-focused: 0px 0px 0px 2px #FFFFFF, 0px 0px 0px 4px #6E56CF;
|
||||
|
||||
/** Typography **/
|
||||
--medusa-body-regular-plus-size: 14px;
|
||||
--medusa-body-regular-plus-line-height: 24px;
|
||||
--medusa-body-regular-plus-font-weight: 500;
|
||||
--medusa-body-regular-size: 14px;
|
||||
--medusa-body-regular-line-height: 24px;
|
||||
--medusa-body-regular-font-weight: 400;
|
||||
--medusa-h1-size: 32px;
|
||||
--medusa-h1-line-height: 44px;
|
||||
--medusa-h1-weight: 500;
|
||||
--medusa-h2-size: 24px;
|
||||
--medusa-h2-line-height: 32px;
|
||||
--medusa-h2-weight: 500;
|
||||
--medusa-h3-size: 18px;
|
||||
--medusa-h3-line-height: 28px;
|
||||
--medusa-h3-weight: 500;
|
||||
--medusa-label-large-plus-size: 16px;
|
||||
--medusa-label-large-plus-line-height: 20px;
|
||||
--medusa-label-large-plus-font-weight: 500;
|
||||
--medusa-label-regular-plus-size: 14px;
|
||||
--medusa-label-regular-plus-line-height: 20px;
|
||||
--medusa-label-regular-plus-font-weight: 500;
|
||||
--medusa-label-regular-size: 14px;
|
||||
--medusa-label-regular-line-height: 20px;
|
||||
--medusa-label-regular-font-weight: 400;
|
||||
--medusa-label-small-plus-size: 13px;
|
||||
--medusa-label-small-plus-line-height: 20px;
|
||||
--medusa-label-small-plus-font-weight: 500;
|
||||
--medusa-label-small-size: 13px;
|
||||
--medusa-label-small-line-height: 20px;
|
||||
--medusa-label-small-font-weight: 400;
|
||||
--medusa-label-x-small-plus-size: 12px;
|
||||
--medusa-label-x-small-plus-line-height: 20px;
|
||||
--medusa-label-x-small-plus-font-weight: 500;
|
||||
|
||||
/** Tags **/
|
||||
--medusa-tag-purple-bg: #EDE9FE;
|
||||
--medusa-tag-purple-bg-hover: #E4DEFC;
|
||||
--medusa-tag-purple-text: #5746AF;
|
||||
--medusa-tag-purple-icon: #6E56CF;
|
||||
--medusa-tag-purple-border: #D7CFF9;
|
||||
--medusa-tag-orange-bg: #FFECBC;
|
||||
--medusa-tag-orange-bg-hover: #FFE3A2;
|
||||
--medusa-tag-orange-text: #AD5700;
|
||||
--medusa-tag-orange-icon: #FFB224;
|
||||
--medusa-tag-orange-border: #FFD386;
|
||||
--medusa-tag-green-bg: #DDF3E4;
|
||||
--medusa-tag-green-bg-hover: #CCEBD7;
|
||||
--medusa-tag-green-text: #18794E;
|
||||
--medusa-tag-green-icon: #30A46C;
|
||||
--medusa-tag-green-border: #B4DFC4;
|
||||
--medusa-tag-blue-bg: #E1F0FF;
|
||||
--medusa-tag-blue-bg-hover: #CEE7FE;
|
||||
--medusa-tag-blue-text: #006ADC;
|
||||
--medusa-tag-blue-icon: #0091FF;
|
||||
--medusa-tag-blue-border: #B7D9F8;
|
||||
}
|
||||
|
||||
/** Dark theme **/
|
||||
html[data-theme="dark"] {
|
||||
/** Backgrounds **/
|
||||
--medusa-bg-subtle: #161618;
|
||||
--medusa-bg-subtle-hover: #1C1C1F;
|
||||
--medusa-bg-subtle-pressed: #232326;
|
||||
--medusa-bg-base: #1C1C1F;
|
||||
--medusa-bg-base-hover: #232326;
|
||||
--medusa-bg-base-pressed: #28282C;
|
||||
--medusa-bg-component: #2E2E32;
|
||||
--medusa-bg-field: #232326;
|
||||
--medusa-bg-field-hover: #28282C;
|
||||
--medusa-bg-highlight: #2C2250;
|
||||
--medusa-bg-toggle-off: #3E3E44;
|
||||
--medusa-bg-overlay: rgba(22, 22, 24, 0.7);
|
||||
--medusa-bg-interactive: #6E56CF;
|
||||
|
||||
/** Borders **/
|
||||
--medusa-border-base: #2E2E32;
|
||||
--medusa-border-strong: #3E3E44;
|
||||
--medusa-border-focus: #6E56CF;
|
||||
--medusa-border-focus-inset: #1C1C1F;
|
||||
--medusa-border-interactive: #6E56CF;
|
||||
|
||||
/** Text **/
|
||||
--medusa-text-base: #EDEDEF;
|
||||
--medusa-text-subtle: #7E7D86;
|
||||
--medusa-text-placeholder: #706F78;
|
||||
--medusa-text-disabled: #504F57;
|
||||
--medusa-text-on-color: #FFFFFF;
|
||||
--medusa-text-interactive: #7C66DC;
|
||||
--medusa-text-interactive-hover: #9E8CFC;
|
||||
--medusa-text-error: #E5484D;
|
||||
|
||||
/** Buttons **/
|
||||
--medusa-button-primary: #6E56CF;
|
||||
--medusa-button-primary-hover: #7C66DC;
|
||||
--medusa-button-primary-pressed: #9E8CFC;
|
||||
--medusa-button-secondary: #232326;
|
||||
--medusa-button-secondary-hover: #2E2E32;
|
||||
--medusa-button-secondary-pressed: #2E2E32;
|
||||
|
||||
/** Icons **/
|
||||
--medusa-icon-primary: #EDEDEF;
|
||||
--medusa-icon-secondary: #7E7D86;
|
||||
--medusa-icon-placeholder: #706F78;
|
||||
--medusa-icon-disabled: #504F57;
|
||||
--medusa-icon-on-color: #FFFFFF;
|
||||
--medusa-icon-interactive: #7C66DC;
|
||||
--medusa-icon-interactive-hover: #9E8CFC;
|
||||
--medusa-icon-error: #E5484D;
|
||||
|
||||
/** Shadow **/
|
||||
--medusa-shadow-overlay: 0px 2px 16px rgba(0, 0, 0, 0.32);
|
||||
--medusa-shadow-field-focused: 0px 0px 0px 4px #2C2250;
|
||||
--medusa-shadow-button-focused: 0px 0px 0px 2px #1C1C1F, 0px 0px 0px 4px #6E56CF;
|
||||
|
||||
/** Tags **/
|
||||
--medusa-tag-purple-bg: #2C2250;
|
||||
--medusa-tag-purple-bg-hover: #32275F;
|
||||
--medusa-tag-purple-text: #9E8CFC;
|
||||
--medusa-tag-purple-icon: #6E56CF;
|
||||
--medusa-tag-purple-border: #392C72;
|
||||
--medusa-tag-orange-bg: #3F2200;
|
||||
--medusa-tag-orange-bg-hover: #4A2900;
|
||||
--medusa-tag-orange-text: #F1A10D;
|
||||
--medusa-tag-orange-icon: #FFB224;
|
||||
--medusa-tag-orange-border: #573300;
|
||||
--medusa-tag-green-bg: #113123;
|
||||
--medusa-tag-green-bg-hover: #133929;
|
||||
--medusa-tag-green-text: #4CC38A;
|
||||
--medusa-tag-green-icon: #30A46C;
|
||||
--medusa-tag-green-border: #164430;
|
||||
--medusa-tag-blue-bg: #102A4C;
|
||||
--medusa-tag-blue-bg-hover: #0F3058;
|
||||
--medusa-tag-blue-text: #52A9FF;
|
||||
--medusa-tag-blue-icon: #0091FF;
|
||||
--medusa-tag-blue-border: #0D3868;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user