chore: fixed commit branch on generate reference action (#1857)

* fixed commit branch

* fixes after yarn upgrade
This commit is contained in:
Shahed Nasser
2022-07-15 18:08:07 +03:00
committed by GitHub
parent 32b066d923
commit e134f6d237
49 changed files with 13599 additions and 11325 deletions

View File

@@ -1,7 +1,5 @@
# Class: TaxProviderService
Finds tax providers and assists in tax related operations.
## Hierarchy
- `"medusa-interfaces"`
@@ -26,7 +24,7 @@ BaseService.constructor
#### Defined in
[services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L49)
[services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L49)
## Properties
@@ -36,7 +34,7 @@ BaseService.constructor
#### Defined in
[services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L40)
[services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L40)
___
@@ -46,7 +44,7 @@ ___
#### Defined in
[services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L41)
[services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L41)
___
@@ -56,7 +54,7 @@ ___
#### Defined in
[services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L47)
[services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L47)
___
@@ -66,7 +64,7 @@ ___
#### Defined in
[services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L45)
[services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L45)
___
@@ -76,7 +74,7 @@ ___
#### Defined in
[services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L44)
[services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L44)
___
@@ -86,7 +84,7 @@ ___
#### Defined in
[services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L46)
[services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L46)
___
@@ -96,7 +94,7 @@ ___
#### Defined in
[services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L43)
[services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L43)
___
@@ -106,7 +104,7 @@ ___
#### Defined in
[services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L42)
[services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L42)
## Methods
@@ -126,58 +124,49 @@ ___
#### Defined in
[services/tax-provider.ts:103](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L103)
[services/tax-provider.ts:103](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L103)
___
### createShippingTaxLines
**createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
Persists the tax lines relevant for a shipping method to the database. Used
for return shipping methods.
**createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `shippingMethod` | `ShippingMethod` | the shipping method to create tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
| `shippingMethod` | `ShippingMethod` | |
| `calculationContext` | `TaxCalculationContext` | |
#### Returns
`Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
the newly created tax lines
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Defined in
[services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L171)
[services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L171)
___
### createTaxLines
**createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
Persists the tax lines relevant for an order to the database.
**createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cartOrLineItems` | `Cart` \| `LineItem`[] | the cart or line items to create tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
| `cartOrLineItems` | `Cart` \| `LineItem`[] | |
| `calculationContext` | `TaxCalculationContext` | |
#### Returns
`Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
the newly created tax lines
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Defined in
[services/tax-provider.ts:121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L121)
[services/tax-provider.ts:121](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L121)
___
@@ -185,24 +174,20 @@ ___
`Private` **getCacheEntry**(`productId`, `regionId`): `Promise`<``null`` \| `TaxServiceRate`[]\>
Gets the cache results for a set of ids
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `productId` | `string` | the product id to cache |
| `regionId` | `string` | the region id to cache |
| `productId` | `string` | |
| `regionId` | `string` | |
#### Returns
`Promise`<``null`` \| `TaxServiceRate`[]\>
the cached result or null
#### Defined in
[services/tax-provider.ts:454](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L454)
[services/tax-provider.ts:454](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L454)
___
@@ -210,24 +195,20 @@ ___
▸ `Private` **getCacheKey**(`productId`, `regionId`): `string`
The cache key to get cache hits by.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `productId` | `string` | the product id to cache |
| `regionId` | `string` | the region id to cache |
| `productId` | `string` | |
| `regionId` | `string` | |
#### Returns
`string`
the cache key to use for the id set
#### Defined in
[services/tax-provider.ts:423](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L423)
[services/tax-provider.ts:423](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L423)
___
@@ -235,25 +216,20 @@ ___
▸ **getRegionRatesForProduct**(`productId`, `region`): `Promise`<`TaxServiceRate`[]\>
Gets the tax rates configured for a product. The rates are cached between
calls.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `productId` | `string` | the product id to get rates for |
| `region` | `RegionDetails` | the region to get configured rates for. |
| `productId` | `string` | |
| `region` | `RegionDetails` | |
#### Returns
`Promise`<`TaxServiceRate`[]\>
the tax rates configured for the shipping option.
#### Defined in
[services/tax-provider.ts:378](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L378)
[services/tax-provider.ts:378](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L378)
___
@@ -261,25 +237,20 @@ ___
▸ **getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\>
Gets the tax rates configured for a shipping option. The rates are cached
between calls.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `optionId` | `string` | the option id of the shipping method. |
| `regionDetails` | `RegionDetails` | the region to get configured rates for. |
| `optionId` | `string` | |
| `regionDetails` | `RegionDetails` | |
#### Returns
`Promise`<`TaxServiceRate`[]\>
the tax rates configured for the shipping option.
#### Defined in
[services/tax-provider.ts:332](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L332)
[services/tax-provider.ts:332](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L332)
___
@@ -287,55 +258,41 @@ ___
▸ **getShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<`ShippingMethodTaxLine`[]\>
Gets the relevant tax lines for a shipping method. Note: this method
doesn't persist the tax lines. Use createShippingTaxLines if you wish to
persist the tax lines to the DB layer.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `shippingMethod` | `ShippingMethod` | the shipping method to get tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
| `shippingMethod` | `ShippingMethod` | |
| `calculationContext` | `TaxCalculationContext` | |
#### Returns
`Promise`<`ShippingMethodTaxLine`[]\>
the computed tax lines
#### Defined in
[services/tax-provider.ts:190](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L190)
[services/tax-provider.ts:190](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L190)
___
### getTaxLines
▸ **getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
Gets the relevant tax lines for an order or cart. If an order is provided
the order's tax lines will be returned. If a cart is provided the tax lines
will be computed from the tax rules and potentially a 3rd party tax plugin.
Note: this method doesn't persist the tax lines. Use createTaxLines if you
wish to persist the tax lines to the DB layer.
▸ **getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `lineItems` | `LineItem`[] | the cart or order to get tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
| `lineItems` | `LineItem`[] | |
| `calculationContext` | `TaxCalculationContext` | |
#### Returns
`Promise`<(`ShippingMethodTaxLine` \| `LineItemTaxLine`)[]\>
the computed tax lines
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
#### Defined in
[services/tax-provider.ts:242](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L242)
[services/tax-provider.ts:242](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L242)
___
@@ -349,7 +306,7 @@ ___
#### Defined in
[services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L75)
[services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L75)
___
@@ -369,7 +326,7 @@ ___
#### Defined in
[services/tax-provider.ts:475](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L475)
[services/tax-provider.ts:475](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L475)
___
@@ -377,23 +334,19 @@ ___
▸ **retrieveProvider**(`region`): `ITaxService`
Retrieves the relevant tax provider for the given region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `region` | `Region` | the region to get tax provider for. |
| `region` | `Region` | |
#### Returns
`ITaxService`
the region specific tax provider
#### Defined in
[services/tax-provider.ts:85](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L85)
[services/tax-provider.ts:85](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L85)
___
@@ -401,25 +354,21 @@ ___
▸ `Private` **setCache**(`productId`, `regionId`, `value`): `Promise`<`void`\>
Sets the cache results for a set of ids
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `productId` | `string` | the product id to cache |
| `regionId` | `string` | the region id to cache |
| `value` | `TaxServiceRate`[] | tax rates to cache |
| `productId` | `string` | |
| `regionId` | `string` | |
| `value` | `TaxServiceRate`[] | |
#### Returns
`Promise`<`void`\>
promise that resolves after the cache has been set
#### Defined in
[services/tax-provider.ts:434](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L434)
[services/tax-provider.ts:434](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L434)
___
@@ -439,4 +388,4 @@ ___
#### Defined in
[services/tax-provider.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L62)
[services/tax-provider.ts:62](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/tax-provider.ts#L62)