docs: update Typedoc and regenerate references (#1994)
* generated new services reference * changed from automatic push to automated pull request * updated typedoc, regenerated JS Client reference * regenerated the reference after updating typedoc * added action for js client
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Class: FulfillmentService
|
||||
|
||||
Handles Fulfillments
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `TransactionBaseService`<[`FulfillmentService`](FulfillmentService.md)\>
|
||||
@@ -24,7 +26,7 @@ TransactionBaseService<FulfillmentService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L47)
|
||||
[packages/medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L47)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,6 +38,10 @@ TransactionBaseService<FulfillmentService\>.constructor
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
@@ -46,6 +52,10 @@ ___
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:12](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### fulfillmentProviderService\_
|
||||
@@ -54,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L42)
|
||||
[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L43)
|
||||
[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +84,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L45)
|
||||
[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -84,7 +94,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L40)
|
||||
[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +108,7 @@ TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:36](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L36)
|
||||
[packages/medusa/src/services/fulfillment.ts:36](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -108,7 +118,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L41)
|
||||
[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -118,7 +128,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L39)
|
||||
[packages/medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -128,7 +138,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L44)
|
||||
[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -142,7 +152,7 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L37)
|
||||
[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -150,6 +160,10 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
|
||||
|
||||
Wraps some work within a transactional block. If the service already has
|
||||
a transaction manager attached this will be reused, otherwise a new
|
||||
transaction manager is created.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
@@ -161,21 +175,23 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | |
|
||||
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | |
|
||||
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | |
|
||||
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
|
||||
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
|
||||
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`TResult`\>
|
||||
|
||||
the result of the transactional work
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.atomicPhase\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -183,19 +199,25 @@ ___
|
||||
|
||||
▸ **cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Cancels a fulfillment with the fulfillment provider. Will decrement the
|
||||
fulfillment_quantity on the line items associated with the fulfillment.
|
||||
Throws if the fulfillment has already been shipped.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fulfillmentOrId` | `string` \| `Fulfillment` | |
|
||||
| `fulfillmentOrId` | `string` \| `Fulfillment` | the fulfillment object or id. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the result of the save operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:254](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L254)
|
||||
[packages/medusa/src/services/fulfillment.ts:253](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L253)
|
||||
|
||||
___
|
||||
|
||||
@@ -203,43 +225,55 @@ ___
|
||||
|
||||
▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\>
|
||||
|
||||
Creates an order fulfillment
|
||||
If items needs to be fulfilled by different provider, we make
|
||||
sure to partition those items, and create fulfillment for
|
||||
those partitions.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `order` | `CreateFulfillmentOrder` | |
|
||||
| `itemsToFulfill` | `FulFillmentItemType`[] | |
|
||||
| `custom` | `Partial`<`Fulfillment`\> | |
|
||||
| `order` | `CreateFulfillmentOrder` | order to create fulfillment for |
|
||||
| `itemsToFulfill` | `FulFillmentItemType`[] | the items in the order to fulfill |
|
||||
| `custom` | `Partial`<`Fulfillment`\> | potential custom values to add |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Fulfillment`[]\>
|
||||
|
||||
the created fulfillments
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:199](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L199)
|
||||
[packages/medusa/src/services/fulfillment.ts:198](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L198)
|
||||
|
||||
___
|
||||
|
||||
### createShipment
|
||||
|
||||
▸ **createShipment**(`fulfillmentId`, `trackingLinks`, `config?`): `Promise`<`Fulfillment`\>
|
||||
▸ **createShipment**(`fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Creates a shipment by marking a fulfillment as shipped. Adds
|
||||
tracking links and potentially more metadata.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fulfillmentId` | `string` | |
|
||||
| `trackingLinks` | { `tracking_number`: `string` }[] | |
|
||||
| `config` | `CreateShipmentConfig` | |
|
||||
| `fulfillmentId` | `string` | the fulfillment to ship |
|
||||
| `trackingLinks?` | { `tracking_number`: `string` }[] | tracking links for the shipment |
|
||||
| `config` | `CreateShipmentConfig` | potential configuration settings, such as no_notification and metadata |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the shipped fulfillment
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:304](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L304)
|
||||
[packages/medusa/src/services/fulfillment.ts:303](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L303)
|
||||
|
||||
___
|
||||
|
||||
@@ -247,20 +281,24 @@ ___
|
||||
|
||||
▸ **getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\>
|
||||
|
||||
Retrieves the order line items, given an array of items.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `order` | `CreateFulfillmentOrder` | |
|
||||
| `items` | `FulFillmentItemType`[] | |
|
||||
| `order` | `CreateFulfillmentOrder` | the order to get line items from |
|
||||
| `items` | `FulFillmentItemType`[] | the items to get |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<(``null`` \| `LineItem`)[]\>
|
||||
|
||||
the line items generated by the transformer.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L109)
|
||||
[packages/medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L109)
|
||||
|
||||
___
|
||||
|
||||
@@ -281,7 +319,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:71](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L71)
|
||||
[packages/medusa/src/services/fulfillment.ts:71](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -289,20 +327,24 @@ ___
|
||||
|
||||
▸ **retrieve**(`id`, `config?`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Retrieves a fulfillment by its id.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | |
|
||||
| `config` | `FindConfig`<`Fulfillment`\> | |
|
||||
| `id` | `string` | the id of the fulfillment to retrieve |
|
||||
| `config` | `FindConfig`<`Fulfillment`\> | optional values to include with fulfillmentRepository query |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the fulfillment
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:166](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L166)
|
||||
[packages/medusa/src/services/fulfillment.ts:166](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
@@ -326,7 +368,7 @@ TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -334,20 +376,28 @@ ___
|
||||
|
||||
▸ **validateFulfillmentLineItem_**(`item`, `quantity`): ``null`` \| `LineItem`
|
||||
|
||||
Checks that a given quantity of a line item can be fulfilled. Fails if the
|
||||
fulfillable quantity is lower than the requested fulfillment quantity.
|
||||
Fulfillable quantity is calculated by subtracting the already fulfilled
|
||||
quantity from the quantity that was originally purchased.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `item` | `undefined` \| `LineItem` | |
|
||||
| `quantity` | `number` | |
|
||||
| `item` | `undefined` \| `LineItem` | the line item to check has sufficient fulfillable quantity. |
|
||||
| `quantity` | `number` | the quantity that is requested to be fulfilled. |
|
||||
|
||||
#### Returns
|
||||
|
||||
``null`` \| `LineItem`
|
||||
|
||||
a line item that has the requested fulfillment quantity
|
||||
set.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/fulfillment.ts#L134)
|
||||
[packages/medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/fulfillment.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
@@ -371,4 +421,4 @@ TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
Reference in New Issue
Block a user