docs: prep for v2 documentation (#6710)

This PR includes documentation that preps for v2 docs (but doesn't introduce new docs).

_Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._

## Changes

- Change Medusa version in base OAS used for v2.
- Fix to docblock generator related to not catching all path parameters.
- Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules.
- Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used.
- Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment.
- Upgraded docusaurus to v3.0.1
- Added new Vale rules to ensure correct spelling of Medusa Admin and module names.
- Added new components to the `docs-ui` package that will be used in future documentation changes.
This commit is contained in:
Shahed Nasser
2024-03-18 07:47:35 +00:00
committed by GitHub
parent 56a6ec0227
commit bb87db8342
2008 changed files with 15716 additions and 10536 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
displayed_sidebar: medusaReactSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# ComputeVariantPriceParams
@@ -10,4 +10,4 @@ Options to format a variant's price.
## Properties
<ParameterTypes parameters={[{"name":"variant","type":"[ProductVariantInfo](../types/medusa_react.ProductVariantInfo.mdx)","description":"A variant's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmount](../../entities/classes/entities.MoneyAmount.mdx)[]","description":"The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The money amount's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The 3 character currency code that the money amount may belong to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`null` \\| `string`","description":"The ID of the price list that the money amount may belong to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`null` \\| [PriceList](../../entities/classes/entities.PriceList.mdx)","description":"The details of the price list that the money amount may belong to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant","type":"[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)","description":"The details of the product variant that the money amount may belong to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the Product Variant contained in the Line Item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The region's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[Currency](../../entities/classes/entities.Currency.mdx)","description":"The details of the currency that the money amount may belong to.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"region","type":"[Region](../../entities/classes/entities.Region.mdx)","description":"The details of the region that the money amount may belong to.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]},{"name":"region","type":"[RegionInfo](../types/medusa_react.RegionInfo.mdx)","description":"A region's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The three character currency code used in the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_rate","type":"`number`","description":"The tax rate that should be charged on purchases in the Region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_code","type":"`string`","description":"The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"includeTaxes","type":"`boolean`","description":"Whether the computed price should include taxes or not.","optional":true,"defaultValue":"true","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="ComputeVariantPriceParams"/>
<TypeList types={[{"name":"variant","type":"[ProductVariantInfo](../types/medusa_react.ProductVariantInfo.mdx)","description":"A variant's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmount](../../entities/classes/entities.MoneyAmount.mdx)[]","description":"The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The money amount's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The 3 character currency code that the money amount may belong to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`null` \\| `string`","description":"The ID of the price list that the money amount may belong to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`null` \\| [PriceList](../../entities/classes/entities.PriceList.mdx)","description":"The details of the price list that the money amount may belong to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant","type":"[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)","description":"The details of the product variant that the money amount may belong to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the Product Variant contained in the Line Item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The region's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"[Currency](../../entities/classes/entities.Currency.mdx)","description":"The details of the currency that the money amount may belong to.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"region","type":"[Region](../../entities/classes/entities.Region.mdx)","description":"The details of the region that the money amount may belong to.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]},{"name":"region","type":"[RegionInfo](../types/medusa_react.RegionInfo.mdx)","description":"A region's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The three character currency code used in the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_rate","type":"`number`","description":"The tax rate that should be charged on purchases in the Region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_code","type":"`string`","description":"The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"includeTaxes","type":"`boolean`","description":"Whether the computed price should include taxes or not.","optional":true,"defaultValue":"true","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="ComputeVariantPriceParams"/>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2,10 +2,10 @@
displayed_sidebar: medusaReactSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# MedusaContextState
## Properties
<ParameterTypes parameters={[{"name":"client","type":"`Medusa`","description":"The Medusa JS Client instance.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="MedusaContextState"/>
<TypeList types={[{"name":"client","type":"`Medusa`","description":"The Medusa JS Client instance.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="MedusaContextState"/>
@@ -2,10 +2,10 @@
displayed_sidebar: medusaReactSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# MedusaProviderProps
## Properties
<ParameterTypes parameters={[{"name":"baseUrl","type":"`string`","description":"The URL to your Medusa backend.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryClientProviderProps","type":"`QueryClientProviderProps`","description":"An object used to set the Tanstack Query client. The object requires a `client` property, \nwhich should be an instance of [QueryClient](https://tanstack.com/query/v4/docs/react/reference/QueryClient).","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"medusaClient","type":"`Medusa`","description":"An instance of the Medusa JS Client. If you don't provide an instance, one will be created using the `baseUrl`, `apiKey`, `publishableApiKey`, `maxRetries`, and `customHeaders` props.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"apiKey","type":"`string`","description":"API key used for authenticating admin requests. Follow [this guide](https://docs.medusajs.com/api/admin#authentication) to learn how to create an API key for an admin user.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"publishableApiKey","type":"`string`","description":"Publishable API key used for storefront requests. You can create a publishable API key either using the \n[admin APIs](https://docs.medusajs.com/development/publishable-api-keys/admin/manage-publishable-api-keys) or the \n[Medusa admin](https://docs.medusajs.com/user-guide/settings/publishable-api-keys#create-publishable-api-key).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maxRetries","type":"`number`","description":"Number of times to retry a request if it fails.","optional":true,"defaultValue":"3","expandable":false,"children":[]},{"name":"customHeaders","type":"`Record<string, any>`","description":"An object of custom headers to pass with every request. Each key of the object is the name of the header, and its value is the header's value.","optional":true,"defaultValue":"`{}`","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="MedusaProviderProps"/>
<TypeList types={[{"name":"baseUrl","type":"`string`","description":"The URL to your Medusa backend.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryClientProviderProps","type":"`QueryClientProviderProps`","description":"An object used to set the Tanstack Query client. The object requires a `client` property, \nwhich should be an instance of [QueryClient](https://tanstack.com/query/v4/docs/react/reference/QueryClient).","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"medusaClient","type":"`Medusa`","description":"An instance of the Medusa JS Client. If you don't provide an instance, one will be created using the `baseUrl`, `apiKey`, `publishableApiKey`, `maxRetries`, and `customHeaders` props.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"apiKey","type":"`string`","description":"API key used for authenticating admin requests. Follow [this guide](https://docs.medusajs.com/api/admin#authentication) to learn how to create an API key for an admin user.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"publishableApiKey","type":"`string`","description":"Publishable API key used for storefront requests. You can create a publishable API key either using the \n[admin APIs](https://docs.medusajs.com/development/publishable-api-keys/admin/manage-publishable-api-keys) or the \n[Medusa admin](https://docs.medusajs.com/user-guide/settings/publishable-api-keys#create-publishable-api-key).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maxRetries","type":"`number`","description":"Number of times to retry a request if it fails.","optional":true,"defaultValue":"3","expandable":false,"children":[]},{"name":"customHeaders","type":"`Record<string, any>`","description":"An object of custom headers to pass with every request. Each key of the object is the name of the header, and its value is the header's value.","optional":true,"defaultValue":"`{}`","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="MedusaProviderProps"/>
File diff suppressed because one or more lines are too long
@@ -2,10 +2,10 @@
displayed_sidebar: medusaReactSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# SessionCartProviderProps
## Properties
<ParameterTypes parameters={[{"name":"initialState","type":"[SessionCartState](medusa_react.SessionCartState.mdx)","description":"An optional initial value to be used for the session cart.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"region","type":"[RegionInfo](../types/medusa_react.RegionInfo.mdx)","description":"The region of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The three character currency code used in the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_rate","type":"`number`","description":"The tax rate that should be charged on purchases in the Region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_code","type":"`string`","description":"The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"items","type":"[Item](medusa_react.Item.mdx)[]","description":"The items in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant","type":"ConvertDateToString&#60;Omit&#60;ProductVariant, \"beforeInsert\"&#62;&#62;","description":"The product variant represented by this item in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity added in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"`number`","description":"The total amount of the item in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"totalItems","type":"`number`","description":"The total items in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"`number`","description":"The total amount of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="SessionCartProviderProps"/>
<TypeList types={[{"name":"initialState","type":"[SessionCartState](medusa_react.SessionCartState.mdx)","description":"An optional initial value to be used for the session cart.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"region","type":"[RegionInfo](../types/medusa_react.RegionInfo.mdx)","description":"The region of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The three character currency code used in the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_rate","type":"`number`","description":"The tax rate that should be charged on purchases in the Region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_code","type":"`string`","description":"The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"items","type":"[Item](medusa_react.Item.mdx)[]","description":"The items in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant","type":"ConvertDateToString&#60;Omit&#60;ProductVariant, \"beforeInsert\"&#62;&#62;","description":"The product variant represented by this item in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity added in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"`number`","description":"The total amount of the item in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"totalItems","type":"`number`","description":"The total items in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"`number`","description":"The total amount of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/medusa-react/overview#expanding-fields" sectionTitle="SessionCartProviderProps"/>
File diff suppressed because one or more lines are too long