docs: migrate guides to TSDoc references (#6100)
This commit is contained in:
+6
-28
@@ -43,6 +43,12 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[{"name":"__container__","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manager_","type":"`EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionManager_","type":"`undefined` \\| `EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__configModule__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} />
|
||||
|
||||
___
|
||||
|
||||
## Accessors
|
||||
|
||||
### activeManager\_
|
||||
@@ -73,8 +79,6 @@ transaction manager is created.
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<TResult>","optional":false,"defaultValue":"","description":"the result of the transactional work","expandable":false,"children":[{"name":"TResult","type":"TResult","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### calculatePrice
|
||||
|
||||
This method is used in different places, including:
|
||||
@@ -123,8 +127,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<number>","optional":false,"defaultValue":"","description":"Used to set the price of the shipping method or option, based on the context the method is used in.","expandable":false,"children":[{"name":"number","type":"`number`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### canCalculate
|
||||
|
||||
This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to calculated.
|
||||
@@ -150,8 +152,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<boolean>","optional":false,"defaultValue":"","description":"If this method returns `true`, that means that the price can be calculated dynamically and the shipping option can have the `price_type` set to calculated.\nThe amount property of the shipping option will then be set to null. The amount will be created later when the shipping method is created on checkout using the [calculatePrice](fulfillment.FulfillmentService.mdx#calculateprice) method.\nIf the method returns `false`, an error is thrown as it means the selected shipping option is invalid and it can only have the `flat_rate` price type.","expandable":false,"children":[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### cancelFulfillment
|
||||
|
||||
This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
|
||||
@@ -179,8 +179,6 @@ class MyFulfillmentService extends FulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"The method isn't expected to return any specific data.","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### createFulfillment
|
||||
|
||||
This method is used when a fulfillment is created for an order, a claim, or a swap.
|
||||
@@ -213,8 +211,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<[FulfillmentProviderData](../../medusa/types/medusa.FulfillmentProviderData.mdx)>","optional":false,"defaultValue":"","description":"The data that will be stored in the `data` attribute of the created fulfillment.","expandable":false,"children":[{"name":"FulfillmentProviderData","type":"`Record<string, unknown>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### createReturn
|
||||
|
||||
Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is true or if an admin creates a Return Shipping Option from the settings.
|
||||
@@ -245,8 +241,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<Record<string, unknown>>","optional":false,"defaultValue":"","description":"Used to set the value of the `shipping_data` attribute of the return being created.","expandable":false,"children":[{"name":"Record","type":"`Record<string, unknown>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### getFulfillmentDocuments
|
||||
|
||||
This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
|
||||
@@ -274,8 +268,6 @@ class MyFulfillmentService extends FulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### getFulfillmentOptions
|
||||
|
||||
This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions\_getregionsregionfulfillmentoptions).
|
||||
@@ -303,8 +295,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any[]>","optional":false,"defaultValue":"","description":"The list of fulfillment options. These options don't have any required format. Later on, these options can be used when creating a shipping option,\nsuch as when using the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options\\_postshippingoptions). The chosen fulfillment option, which is one of the\nitems in the array returned by this method, will be set in the `data` object of the shipping option.","expandable":false,"children":[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### getReturnDocuments
|
||||
|
||||
This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
|
||||
@@ -332,8 +322,6 @@ class MyFulfillmentService extends FulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### getShipmentDocuments
|
||||
|
||||
This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
|
||||
@@ -361,8 +349,6 @@ class MyFulfillmentService extends FulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### retrieveDocuments
|
||||
|
||||
This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for
|
||||
@@ -392,8 +378,6 @@ class MyFulfillmentService extends FulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<any>","optional":false,"defaultValue":"","description":"There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
#### Parameters
|
||||
@@ -404,8 +388,6 @@ ___
|
||||
|
||||
<ParameterTypes parameters={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} />
|
||||
|
||||
___
|
||||
|
||||
### validateFulfillmentData
|
||||
|
||||
This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created
|
||||
@@ -445,8 +427,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<Record<string, unknown>>","optional":false,"defaultValue":"","description":"The data that will be stored in the `data` property of the shipping method to be created.\nMake sure the value you return contains everything you need to fulfill the shipment later on. The returned value may also be used to calculate the price of the shipping method\nif it doesn't have a set price. It will be passed along to the [calculatePrice](fulfillment.FulfillmentService.mdx#calculateprice) method.","expandable":false,"children":[{"name":"Record","type":"`Record<string, unknown>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### validateOption
|
||||
|
||||
Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options\_postshippingoptions) is used.
|
||||
@@ -474,8 +454,6 @@ class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<boolean>","optional":false,"defaultValue":"","description":"Whether the fulfillment option is valid. If the returned value is false, an error is thrown and the shipping option will not be saved.","expandable":false,"children":[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} />
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
#### Parameters
|
||||
|
||||
Reference in New Issue
Block a user