docs: migrate guides to TSDoc references (#6100)

This commit is contained in:
Shahed Nasser
2024-01-22 18:38:35 +01:00
committed by GitHub
parent 85dad169bb
commit 4792c55226
980 changed files with 195537 additions and 160619 deletions
@@ -52,8 +52,6 @@ transaction manager is created.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;TResult&#62;","optional":false,"defaultValue":"","description":"the result of the transactional work","expandable":false,"children":[]}]} />
___
### clearLineItemsTaxLines
#### Parameters
@@ -64,8 +62,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### clearTaxLines
#### Parameters
@@ -76,8 +72,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### createShippingTaxLines
Persists the tax lines relevant for a shipping method to the database. Used
@@ -91,8 +85,6 @@ for return shipping methods.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;([LineItemTaxLine](../../entities/classes/entities.LineItemTaxLine.mdx) \\| [ShippingMethodTaxLine](../../entities/classes/entities.ShippingMethodTaxLine.mdx))[]&#62;","optional":false,"defaultValue":"","description":"the newly created tax lines","expandable":false,"children":[]}]} />
___
### createTaxLines
Persists the tax lines relevant for an order to the database.
@@ -105,8 +97,6 @@ Persists the tax lines relevant for an order to the database.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;([LineItemTaxLine](../../entities/classes/entities.LineItemTaxLine.mdx) \\| [ShippingMethodTaxLine](../../entities/classes/entities.ShippingMethodTaxLine.mdx))[]&#62;","optional":false,"defaultValue":"","description":"the newly created tax lines","expandable":false,"children":[]}]} />
___
### getCacheKey
The cache key to get cache hits by.
@@ -119,8 +109,6 @@ The cache key to get cache hits by.
<ParameterTypes parameters={[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"the cache key to use for the id set","expandable":false,"children":[]}]} />
___
### getRegionRatesForProduct
Gets the tax rates configured for a product. The rates are cached between
@@ -134,8 +122,6 @@ calls.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Map&#60;string, [TaxServiceRate](../../medusa/types/medusa.TaxServiceRate.mdx)[]&#62;&#62;","optional":false,"defaultValue":"","description":"the tax rates configured for the shipping option. A map by product id","expandable":false,"children":[]}]} />
___
### getRegionRatesForShipping
Gets the tax rates configured for a shipping option. The rates are cached
@@ -149,8 +135,6 @@ between calls.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[TaxServiceRate](../../medusa/types/medusa.TaxServiceRate.mdx)[]&#62;","optional":false,"defaultValue":"","description":"the tax rates configured for the shipping option.","expandable":false,"children":[]}]} />
___
### getShippingTaxLines
Gets the relevant tax lines for a shipping method. Note: this method
@@ -165,8 +149,6 @@ persist the tax lines to the DB layer.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[ShippingMethodTaxLine](../../entities/classes/entities.ShippingMethodTaxLine.mdx)[]&#62;","optional":false,"defaultValue":"","description":"the computed tax lines","expandable":false,"children":[]}]} />
___
### getTaxLines
Gets the relevant tax lines for an order or cart. If an order is provided
@@ -183,8 +165,6 @@ wish to persist the tax lines to the DB layer.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;([LineItemTaxLine](../../entities/classes/entities.LineItemTaxLine.mdx) \\| [ShippingMethodTaxLine](../../entities/classes/entities.ShippingMethodTaxLine.mdx))[]&#62;","optional":false,"defaultValue":"","description":"the computed tax lines","expandable":false,"children":[]}]} />
___
### getTaxLinesMap
Return a map of tax lines for line items and shipping methods
@@ -195,9 +175,7 @@ Return a map of tax lines for line items and shipping methods
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;TaxLinesMaps&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;TaxLinesMaps&#62;","optional":false,"defaultValue":"","description":"Return a map of tax lines for line items and shipping methods","expandable":false,"children":[]}]} />
### list
@@ -205,8 +183,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[TaxProvider](../../entities/classes/entities.TaxProvider.mdx)[]&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### registerInstalledProviders
#### Parameters
@@ -217,8 +193,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### retrieveProvider
Retrieves the relevant tax provider for the given region.
@@ -229,9 +203,7 @@ Retrieves the relevant tax provider for the given region.
#### Returns
<ParameterTypes parameters={[{"name":"ITaxService","type":"`object`","description":"Interface to be implemented by tax provider plugins. The interface defines a\nsingle method `getTaxLines` that returns numerical rates to apply to line\nitems and shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} />
___
<ParameterTypes parameters={[{"name":"ITaxService","type":"`object`","description":"## Overview\n\nA tax provider is used to retrieve the tax lines in a cart. The Medusa backend provides a default `system` provider. You can create your own tax provider,\neither in a plugin or directly in your Medusa backend, then use it in any region.\n\nA tax provider class is defined in a TypeScript or JavaScript file under the `src/services` directory and the class must extend the\n`AbstractTaxService` class imported from `@medusajs/medusa`. The file's name is the tax provider's class name as a slug and without the word `Service`.\n\nFor example, you can create the file `src/services/my-tax.ts` with the following content:\n\n```ts title=\"src/services/my-tax.ts\"\nimport {\n AbstractTaxService,\n ItemTaxCalculationLine,\n ShippingTaxCalculationLine,\n TaxCalculationContext,\n} from \"@medusajs/medusa\"\nimport {\n ProviderTaxLine,\n} from \"@medusajs/medusa/dist/types/tax-service\"\n\nclass MyTaxService extends AbstractTaxService {\n async getTaxLines(\n itemLines: ItemTaxCalculationLine[],\n shippingLines: ShippingTaxCalculationLine[],\n context: TaxCalculationContext):\n Promise<ProviderTaxLine[]> {\n throw new Error(\"Method not implemented.\")\n }\n}\n\nexport default MyTaxService\n```\n\n---\n\n## Identifier Property\n\nThe `TaxProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the tax provider service is used when the tax provider is added to the database.\n\nThe value of this property is also used to reference the tax provider throughout Medusa. For example, it is used to [change the tax provider](https://docs.medusajs.com/modules/taxes/admin/manage-tax-settings#change-tax-provider-of-a-region) to a region.\n\n```ts title=\"src/services/my-tax.ts\"\nclass MyTaxService extends AbstractTaxService {\n static identifier = \"my-tax\"\n // ...\n}\n```\n\n---","optional":false,"defaultValue":"","expandable":false,"children":[]}]} />
### shouldRetryTransaction\_
@@ -243,8 +215,6 @@ ___
<ParameterTypes parameters={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### withTransaction
#### Parameters