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
@@ -48,8 +48,6 @@ Adds a line item to the cart.
Use [addOrUpdateLineItems](services.CartService.mdx#addorupdatelineitems) instead.
___
### addOrUpdateLineItems
Adds or update one or multiple line items to the cart. It also update all existing items in the cart
@@ -63,8 +61,6 @@ to have has\_shipping to false. Finally, the adjustments will be updated.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### addShippingMethod
Adds the shipping method to the list of shipping methods associated with
@@ -81,8 +77,6 @@ shop.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### adjustFreeShipping\_
Ensures shipping total on cart is correct in regards to a potential free
@@ -98,8 +92,6 @@ if a free shipping was present, we set shipping methods to original amount
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"void","expandable":false,"children":[]}]} />
___
### applyDiscount
Updates the cart's discounts.
@@ -113,9 +105,7 @@ Throws if discount regions does not include the cart region
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Updates the cart's discounts.\nIf discount besides free shipping is already applied, this\nwill be overwritten\nThrows if discount regions does not include the cart region","expandable":false,"children":[]}]} />
### applyDiscounts
@@ -130,9 +120,7 @@ Throws if discount regions does not include the cart region
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Updates the cart's discounts.\nIf discount besides free shipping is already applied, this\nwill be overwritten\nThrows if discount regions does not include the cart region","expandable":false,"children":[]}]} />
### applyGiftCard\_
@@ -144,8 +132,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### atomicPhase\_
Wraps some work within a transactional block. If the service already has
@@ -164,8 +150,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":[]}]} />
___
### authorizePayment
Authorizes a payment for a cart.
@@ -182,8 +166,6 @@ set the payment on the cart.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the resulting cart","expandable":false,"children":[]}]} />
___
### create
Creates a cart.
@@ -196,8 +178,6 @@ Creates a cart.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the result of the create operation","expandable":false,"children":[]}]} />
___
### createOrFetchGuestCustomerFromEmail\_
Creates or fetches a user based on an email.
@@ -210,8 +190,6 @@ Creates or fetches a user based on an email.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Customer](../../entities/classes/entities.Customer.mdx)&#62;","optional":false,"defaultValue":"","description":"the resultign customer object","expandable":false,"children":[]}]} />
___
### createTaxLines
#### Parameters
@@ -222,8 +200,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### decorateTotals
#### Parameters
@@ -234,8 +210,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[WithRequiredProperty](../../medusa/types/medusa.WithRequiredProperty.mdx)&#60;[Cart](../../entities/classes/entities.Cart.mdx), \"total\"&#62;&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### decorateTotals\_
#### Parameters
@@ -250,8 +224,6 @@ ___
Use decorateTotals instead
___
### delete
Deletes a cart from the database. Completed carts cannot be deleted.
@@ -264,8 +236,6 @@ Deletes a cart from the database. Completed carts cannot be deleted.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the deleted cart or undefined if the cart was not found.","expandable":false,"children":[]}]} />
___
### deletePaymentSession
Removes a payment session from the cart.
@@ -278,8 +248,6 @@ Removes a payment session from the cart.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the resulting cart.","expandable":false,"children":[]}]} />
___
### deleteTaxLines
#### Parameters
@@ -290,8 +258,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### findCustomShippingOption
Finds the cart's custom shipping options based on the passed option id.
@@ -305,8 +271,6 @@ throws if custom options is not empty and no shipping option corresponds to opti
<ParameterTypes parameters={[{"name":"undefined \\| CustomShippingOption","type":"`undefined` \\| [CustomShippingOption](../../entities/classes/entities.CustomShippingOption.mdx)","optional":false,"defaultValue":"","description":"custom shipping option","expandable":false,"children":[]}]} />
___
### getTotalsRelations
#### Parameters
@@ -317,8 +281,6 @@ ___
<ParameterTypes parameters={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### getValidatedSalesChannel
#### Parameters
@@ -329,8 +291,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### list
#### Parameters
@@ -341,8 +301,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)[]&#62;","optional":false,"defaultValue":"","description":"the result of the find operation","expandable":false,"children":[]}]} />
___
### onSalesChannelChange
Remove the cart line item that does not belongs to the newly assigned sales channel
@@ -355,8 +313,6 @@ Remove the cart line item that does not belongs to the newly assigned sales chan
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"void","expandable":false,"children":[]}]} />
___
### refreshAdjustments\_
#### Parameters
@@ -367,8 +323,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### refreshPaymentSession
Refreshes a payment session on a cart
@@ -381,8 +335,6 @@ Refreshes a payment session on a cart
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the resulting cart.","expandable":false,"children":[]}]} />
___
### removeDiscount
Removes a discount based on a discount code.
@@ -395,8 +347,6 @@ Removes a discount based on a discount code.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the resulting cart","expandable":false,"children":[]}]} />
___
### removeLineItem
Removes a line item from the cart.
@@ -409,8 +359,6 @@ Removes a line item from the cart.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### retrieve
Gets a cart by id.
@@ -423,8 +371,6 @@ Gets a cart by id.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the cart document.","expandable":false,"children":[]}]} />
___
### retrieveLegacy
#### Parameters
@@ -437,8 +383,6 @@ ___
#### Deprecated
___
### retrieveWithTotals
#### Parameters
@@ -449,8 +393,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[WithRequiredProperty](../../medusa/types/medusa.WithRequiredProperty.mdx)&#60;[Cart](../../entities/classes/entities.Cart.mdx), \"total\"&#62;&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### setMetadata
Dedicated method to set metadata for a cart.
@@ -465,8 +407,6 @@ others metadata fields, setMetadata is provided.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"resolves to the updated result.","expandable":false,"children":[]}]} />
___
### setPaymentSession
Selects a payment session for a cart and creates a payment object in the external provider system
@@ -477,9 +417,7 @@ Selects a payment session for a cart and creates a payment object in the externa
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Selects a payment session for a cart and creates a payment object in the external provider system","expandable":false,"children":[]}]} />
### setPaymentSessions
@@ -497,8 +435,6 @@ that are not available for the cart's region.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation.","expandable":false,"children":[]}]} />
___
### setRegion\_
Set's the region of a cart.
@@ -511,8 +447,6 @@ Set's the region of a cart.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### shouldRetryTransaction\_
#### Parameters
@@ -523,8 +457,6 @@ ___
<ParameterTypes parameters={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### transformQueryForTotals\_
#### Parameters
@@ -535,8 +467,6 @@ ___
<ParameterTypes parameters={[{"name":"FindConfig","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"totalsToSelect","type":"[TotalField](../../medusa/types/medusa.TotalField.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} />
___
### update
#### Parameters
@@ -547,8 +477,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### updateBillingAddress\_
Updates the cart's billing address.
@@ -561,8 +489,6 @@ Updates the cart's billing address.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### updateCustomerId\_
Sets the customer id of a cart
@@ -575,8 +501,6 @@ Sets the customer id of a cart
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### updateLineItem
Updates a cart's existing line item.
@@ -589,8 +513,6 @@ Updates a cart's existing line item.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### updatePaymentSession
Updates the currently selected payment session.
@@ -603,8 +525,6 @@ Updates the currently selected payment session.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[Cart](../../entities/classes/entities.Cart.mdx)&#62;","optional":false,"defaultValue":"","description":"the resulting cart","expandable":false,"children":[]}]} />
___
### updateShippingAddress\_
Updates the cart's shipping address.
@@ -617,8 +537,6 @@ Updates the cart's shipping address.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"the result of the update operation","expandable":false,"children":[]}]} />
___
### updateUnitPrices\_
#### Parameters
@@ -629,8 +547,6 @@ ___
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
___
### validateLineItem
Check if line item's variant belongs to the cart's sales channel.
@@ -643,8 +559,6 @@ Check if line item's variant belongs to the cart's sales channel.
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;boolean&#62;","optional":false,"defaultValue":"","description":"a boolean indicating validation result","expandable":false,"children":[]}]} />
___
### validateLineItemShipping\_
Checks if a given line item has a shipping method that can fulfill it.
@@ -659,8 +573,6 @@ shipping methods.
<ParameterTypes parameters={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"boolean representing whether shipping method is validated","expandable":false,"children":[]}]} />
___
### withTransaction
#### Parameters