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: ShippingOptionService
|
||||
|
||||
Provides layer to manipulate profiles.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `TransactionBaseService`<[`ShippingOptionService`](ShippingOptionService.md)\>
|
||||
@@ -24,7 +26,7 @@ TransactionBaseService<ShippingOptionService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:39](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L39)
|
||||
[packages/medusa/src/services/shipping-option.ts:39](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L39)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,6 +38,10 @@ TransactionBaseService<ShippingOptionService\>.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)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
@@ -58,7 +68,7 @@ TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:36](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L36)
|
||||
[packages/medusa/src/services/shipping-option.ts:36](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +78,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:34](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L34)
|
||||
[packages/medusa/src/services/shipping-option.ts:34](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,7 +88,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:33](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L33)
|
||||
[packages/medusa/src/services/shipping-option.ts:33](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +98,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:30](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L30)
|
||||
[packages/medusa/src/services/shipping-option.ts:30](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +108,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:31](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L31)
|
||||
[packages/medusa/src/services/shipping-option.ts:31](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
@@ -108,7 +118,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:32](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L32)
|
||||
[packages/medusa/src/services/shipping-option.ts:32](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -122,7 +132,7 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:37](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L37)
|
||||
[packages/medusa/src/services/shipping-option.ts:37](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -130,20 +140,25 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
▸ **addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Adds a requirement to a shipping option. Only 1 requirement of each type
|
||||
is allowed.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | |
|
||||
| `requirement` | `ShippingOptionRequirement` | |
|
||||
| `optionId` | `string` | the option to add the requirement to. |
|
||||
| `requirement` | `ShippingOptionRequirement` | the requirement for the option. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
the result of update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:627](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L627)
|
||||
[packages/medusa/src/services/shipping-option.ts:623](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L623)
|
||||
|
||||
___
|
||||
|
||||
@@ -151,6 +166,10 @@ ___
|
||||
|
||||
▸ `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 |
|
||||
@@ -162,21 +181,23 @@ ___
|
||||
|
||||
| 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)
|
||||
|
||||
___
|
||||
|
||||
@@ -184,19 +205,25 @@ ___
|
||||
|
||||
▸ **create**(`data`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Creates a new shipping option. Used both for outbound and inbound shipping
|
||||
options. The difference is registered by the `is_return` field which
|
||||
defaults to false.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `CreateShippingOptionInput` | |
|
||||
| `data` | `CreateShippingOptionInput` | the data to create shipping options |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:384](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L384)
|
||||
[packages/medusa/src/services/shipping-option.ts:380](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L380)
|
||||
|
||||
___
|
||||
|
||||
@@ -204,21 +231,25 @@ ___
|
||||
|
||||
▸ **createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\>
|
||||
|
||||
Creates a shipping method for a given cart.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | |
|
||||
| `data` | `object` | |
|
||||
| `config` | `CreateShippingMethodDto` | |
|
||||
| `optionId` | `string` | the id of the option to use for the method. |
|
||||
| `data` | `object` | the optional provider data to use. |
|
||||
| `config` | `CreateShippingMethodDto` | the cart to create the shipping method for. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingMethod`\>
|
||||
|
||||
the resulting shipping method.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:259](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L259)
|
||||
[packages/medusa/src/services/shipping-option.ts:253](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L253)
|
||||
|
||||
___
|
||||
|
||||
@@ -226,19 +257,23 @@ ___
|
||||
|
||||
▸ **delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\>
|
||||
|
||||
Deletes a profile with a given profile id.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | |
|
||||
| `optionId` | `string` | the id of the profile to delete. Must be castable as an ObjectId |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void` \| `ShippingOption`\>
|
||||
|
||||
the result of the delete operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:605](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L605)
|
||||
[packages/medusa/src/services/shipping-option.ts:601](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L601)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,19 +281,23 @@ ___
|
||||
|
||||
▸ **deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\>
|
||||
|
||||
Removes a given shipping method
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | |
|
||||
| `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | the shipping method to remove |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingMethod`[]\>
|
||||
|
||||
removed shipping methods
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:239](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L239)
|
||||
[packages/medusa/src/services/shipping-option.ts:233](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L233)
|
||||
|
||||
___
|
||||
|
||||
@@ -266,21 +305,27 @@ ___
|
||||
|
||||
▸ **getPrice_**(`option`, `data`, `cart`): `Promise`<`number`\>
|
||||
|
||||
Returns the amount to be paid for a shipping method. Will ask the
|
||||
fulfillment provider to calculate the price if the shipping option has the
|
||||
price type "calculated".
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `option` | `ShippingOption` | |
|
||||
| `data` | `object` | |
|
||||
| `cart` | `undefined` \| `Order` \| `Cart` | |
|
||||
| `option` | `ShippingOption` | the shipping option to retrieve the price for. |
|
||||
| `data` | `object` | the shipping data to retrieve the price. |
|
||||
| `cart` | `undefined` \| `Order` \| `Cart` | the context in which the price should be retrieved. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`\>
|
||||
|
||||
the price of the shipping option.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:686](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L686)
|
||||
[packages/medusa/src/services/shipping-option.ts:682](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L682)
|
||||
|
||||
___
|
||||
|
||||
@@ -292,16 +337,18 @@ ___
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | config object |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOption`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:130](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L130)
|
||||
[packages/medusa/src/services/shipping-option.ts:130](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
@@ -313,16 +360,18 @@ ___
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | config object |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ShippingOption`[], `number`]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:149](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L149)
|
||||
[packages/medusa/src/services/shipping-option.ts:146](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L146)
|
||||
|
||||
___
|
||||
|
||||
@@ -330,19 +379,23 @@ ___
|
||||
|
||||
▸ **removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\>
|
||||
|
||||
Removes a requirement from a shipping option
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `requirementId` | `any` | |
|
||||
| `requirementId` | `any` | the id of the requirement to remove |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void` \| `ShippingOptionRequirement`\>
|
||||
|
||||
the result of update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:656](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L656)
|
||||
[packages/medusa/src/services/shipping-option.ts:652](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L652)
|
||||
|
||||
___
|
||||
|
||||
@@ -350,12 +403,15 @@ ___
|
||||
|
||||
▸ **retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Gets a profile by id.
|
||||
Throws in case of DB Error and if profile was not found.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `any` | |
|
||||
| `options` | `Object` | |
|
||||
| `optionId` | `any` | the id of the profile to get. |
|
||||
| `options` | `Object` | the options to get a profile |
|
||||
| `options.relations?` | `string`[] | - |
|
||||
| `options.select?` | keyof `ShippingOption`[] | - |
|
||||
|
||||
@@ -363,9 +419,11 @@ ___
|
||||
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
the profile document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:170](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L170)
|
||||
[packages/medusa/src/services/shipping-option.ts:164](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L164)
|
||||
|
||||
___
|
||||
|
||||
@@ -389,7 +447,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)
|
||||
|
||||
___
|
||||
|
||||
@@ -397,20 +455,26 @@ ___
|
||||
|
||||
▸ **update**(`optionId`, `update`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Updates a profile. Metadata updates and product updates should use
|
||||
dedicated methods, e.g. `setMetadata`, etc. The function
|
||||
will throw errors if metadata or product updates are attempted.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | |
|
||||
| `update` | `UpdateShippingOptionInput` | |
|
||||
| `optionId` | `string` | the id of the option. Must be a string that can be casted to an ObjectId |
|
||||
| `update` | `UpdateShippingOptionInput` | an object with the update values. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:498](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L498)
|
||||
[packages/medusa/src/services/shipping-option.ts:494](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L494)
|
||||
|
||||
___
|
||||
|
||||
@@ -418,41 +482,52 @@ ___
|
||||
|
||||
▸ **updateShippingMethod**(`id`, `update`): `Promise`<`undefined` \| `ShippingMethod`\>
|
||||
|
||||
Updates a shipping method's associations. Useful when a cart is completed
|
||||
and its methods should be copied to an order/swap entity.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | |
|
||||
| `update` | `ShippingMethodUpdate` | |
|
||||
| `id` | `string` | the id of the shipping method to update |
|
||||
| `update` | `ShippingMethodUpdate` | the values to update the method with |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| `ShippingMethod`\>
|
||||
|
||||
the resulting shipping method
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:210](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L210)
|
||||
[packages/medusa/src/services/shipping-option.ts:204](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L204)
|
||||
|
||||
___
|
||||
|
||||
### validateCartOption
|
||||
|
||||
▸ **validateCartOption**(`option`, `cart`): ``null`` \| `ShippingOption`
|
||||
▸ **validateCartOption**(`option`, `cart`): `Promise`<``null`` \| `ShippingOption`\>
|
||||
|
||||
Checks if a given option id is a valid option for a cart. If it is the
|
||||
option is returned with the correct price. Throws when region_ids do not
|
||||
match, or when the shipping option requirements are not satisfied.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `option` | `ShippingOption` | |
|
||||
| `cart` | `Cart` | |
|
||||
| `option` | `ShippingOption` | the option object to check |
|
||||
| `cart` | `Cart` | the cart object to check against |
|
||||
|
||||
#### Returns
|
||||
|
||||
``null`` \| `ShippingOption`
|
||||
`Promise`<``null`` \| `ShippingOption`\>
|
||||
|
||||
the validated shipping option
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:337](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L337)
|
||||
[packages/medusa/src/services/shipping-option.ts:331](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L331)
|
||||
|
||||
___
|
||||
|
||||
@@ -460,20 +535,24 @@ ___
|
||||
|
||||
▸ **validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\>
|
||||
|
||||
Validates a shipping option price
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `priceType` | `ShippingOptionPriceType` | |
|
||||
| `option` | `ShippingOption` | |
|
||||
| `priceType` | `ShippingOptionPriceType` | the price to validate |
|
||||
| `option` | `ShippingOption` | the option to validate against |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOptionPriceType`\>
|
||||
|
||||
the validated price
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:462](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L462)
|
||||
[packages/medusa/src/services/shipping-option.ts:458](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L458)
|
||||
|
||||
___
|
||||
|
||||
@@ -481,20 +560,24 @@ ___
|
||||
|
||||
▸ **validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\>
|
||||
|
||||
Validates a requirement
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `requirement` | `ShippingOptionRequirement` | `undefined` | |
|
||||
| `optionId` | `undefined` \| `string` | `undefined` | |
|
||||
| `requirement` | `ShippingOptionRequirement` | `undefined` | the requirement to validate |
|
||||
| `optionId` | `undefined` \| `string` | `undefined` | the id to validate the requirement |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOptionRequirement`\>
|
||||
|
||||
a validated shipping requirement
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:64](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/shipping-option.ts#L64)
|
||||
[packages/medusa/src/services/shipping-option.ts:64](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/shipping-option.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -518,4 +601,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