docs: TSDoc + reference of fulfillment service (#5761)
This commit is contained in:
@@ -8,15 +8,13 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
Provides layer to manipulate profiles.
|
||||
|
||||
#### Implements
|
||||
## Implements
|
||||
|
||||
## Constructors
|
||||
|
||||
#### constructor
|
||||
## constructor
|
||||
|
||||
`**new ShippingProfileService**(«destructured»)`
|
||||
|
||||
##### Parameters
|
||||
### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -30,6 +28,8 @@ Provides layer to manipulate profiles.
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
@@ -134,19 +134,39 @@ Provides layer to manipulate profiles.
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Accessors
|
||||
|
||||
#### activeManager\_
|
||||
### activeManager\_
|
||||
|
||||
`Protected` **activeManager\_**: [object Object]
|
||||
`Protected get**activeManager_**(): EntityManager`
|
||||
|
||||
#### Returns
|
||||
|
||||
EntityManager
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EntityManager",
|
||||
"type": "EntityManager",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Methods
|
||||
|
||||
#### addProduct
|
||||
### addProduct
|
||||
|
||||
`**addProduct**(profileId, productId): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -169,7 +189,7 @@ Provides layer to manipulate profiles.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -191,13 +211,13 @@ use [addProducts](ShippingProfileService.mdx#addproducts) instead
|
||||
|
||||
___
|
||||
|
||||
#### addProducts
|
||||
### addProducts
|
||||
|
||||
`**addProducts**(profileId, productId): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Adds a product or an array of products to the profile.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -220,7 +240,7 @@ Adds a product or an array of products to the profile.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -238,14 +258,14 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### addShippingOption
|
||||
### addShippingOption
|
||||
|
||||
`**addShippingOption**(profileId, optionId): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Adds a shipping option to the profile. The shipping option can be used to
|
||||
fulfill the products in the products field.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -268,7 +288,7 @@ fulfill the products in the products field.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -286,7 +306,7 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### atomicPhase\_
|
||||
### atomicPhase\_
|
||||
|
||||
`Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>`
|
||||
|
||||
@@ -294,7 +314,7 @@ 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
|
||||
#### Type Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -317,7 +337,7 @@ transaction manager is created.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -349,7 +369,7 @@ transaction manager is created.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<TResult>
|
||||
|
||||
@@ -367,13 +387,13 @@ Promise<TResult>
|
||||
|
||||
___
|
||||
|
||||
#### create
|
||||
### create
|
||||
|
||||
`**create**(profile): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Creates a new shipping profile.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -387,7 +407,7 @@ Creates a new shipping profile.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -405,13 +425,13 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### createDefault
|
||||
### createDefault
|
||||
|
||||
`**createDefault**(): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Creates a default shipping profile, if this does not already exist.
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -429,14 +449,14 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### createGiftCardDefault
|
||||
### createGiftCardDefault
|
||||
|
||||
`**createGiftCardDefault**(): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Creates a default shipping profile, for gift cards if unless it already
|
||||
exists.
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -454,13 +474,13 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### delete
|
||||
### delete
|
||||
|
||||
`**delete**(profileId): Promise<void>`
|
||||
|
||||
Deletes a profile with a given profile id.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -474,7 +494,7 @@ Deletes a profile with a given profile id.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<void>
|
||||
|
||||
@@ -492,14 +512,14 @@ Promise<void>
|
||||
|
||||
___
|
||||
|
||||
#### fetchCartOptions
|
||||
### fetchCartOptions
|
||||
|
||||
`**fetchCartOptions**(cart): Promise<[ShippingOption](ShippingOption.mdx)[]>`
|
||||
|
||||
Finds all the shipping profiles that cover the products in a cart, and
|
||||
validates all options that are available for the cart.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -513,7 +533,7 @@ validates all options that are available for the cart.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
@@ -531,11 +551,11 @@ Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
___
|
||||
|
||||
#### getMapProfileIdsByProductIds
|
||||
### getMapProfileIdsByProductIds
|
||||
|
||||
`**getMapProfileIdsByProductIds**(productIds): Promise<Map<string, string>>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -549,7 +569,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<Map<string, string>>
|
||||
|
||||
@@ -567,13 +587,13 @@ Promise<Map<string, string>>
|
||||
|
||||
___
|
||||
|
||||
#### getProfilesInCart
|
||||
### getProfilesInCart
|
||||
|
||||
`Protected **getProfilesInCart**(cart): Promise<string[]>`
|
||||
|
||||
Returns a list of all the productIds in the cart.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -587,7 +607,7 @@ Returns a list of all the productIds in the cart.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<string[]>
|
||||
|
||||
@@ -605,11 +625,11 @@ Promise<string[]>
|
||||
|
||||
___
|
||||
|
||||
#### list
|
||||
### list
|
||||
|
||||
`**list**(selector?, config?): Promise<[ShippingProfile](ShippingProfile.mdx)[]>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -632,7 +652,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)[]>
|
||||
|
||||
@@ -650,13 +670,13 @@ Promise<[ShippingProfile](ShippingProfile.mdx)[]>
|
||||
|
||||
___
|
||||
|
||||
#### removeProducts
|
||||
### removeProducts
|
||||
|
||||
`**removeProducts**(profileId, productId): Promise<void \| [ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Removes a product or an array of products from the profile.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -679,7 +699,7 @@ Removes a product or an array of products from the profile.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<void \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -697,14 +717,14 @@ Promise<void \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### retrieve
|
||||
### retrieve
|
||||
|
||||
`**retrieve**(profileId, options?): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Gets a profile by id.
|
||||
Throws in case of DB Error and if profile was not found.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -727,7 +747,7 @@ Throws in case of DB Error and if profile was not found.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -745,11 +765,11 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### retrieveDefault
|
||||
### retrieveDefault
|
||||
|
||||
`**retrieveDefault**(): Promise<null \| [ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<null \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -767,11 +787,11 @@ Promise<null \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### retrieveForProducts
|
||||
### retrieveForProducts
|
||||
|
||||
`**retrieveForProducts**(productIds): Promise<{ [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[]; }>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -785,7 +805,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<{ [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[]; }>
|
||||
|
||||
@@ -803,13 +823,13 @@ Promise<{ [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[
|
||||
|
||||
___
|
||||
|
||||
#### retrieveGiftCardDefault
|
||||
### retrieveGiftCardDefault
|
||||
|
||||
`**retrieveGiftCardDefault**(): Promise<null \| [ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
Retrieves the default gift card profile
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<null \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -827,11 +847,11 @@ Promise<null \| [ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### shouldRetryTransaction\_
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
`Protected **shouldRetryTransaction_**(err): boolean`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -845,7 +865,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
@@ -863,7 +883,7 @@ ___
|
||||
|
||||
___
|
||||
|
||||
#### update
|
||||
### update
|
||||
|
||||
`**update**(profileId, update): Promise<[ShippingProfile](ShippingProfile.mdx)>`
|
||||
|
||||
@@ -871,7 +891,7 @@ Updates a profile. Metadata updates and product updates should use
|
||||
dedicated methods, e.g. `setMetadata`, `addProduct`, etc. The function
|
||||
will throw errors if metadata or product updates are attempted.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -894,7 +914,7 @@ will throw errors if metadata or product updates are attempted.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
@@ -912,11 +932,11 @@ Promise<[ShippingProfile](ShippingProfile.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### withTransaction
|
||||
### withTransaction
|
||||
|
||||
`**withTransaction**(transactionManager?): [ShippingProfileService](ShippingProfileService.mdx)`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -930,7 +950,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
[ShippingProfileService](ShippingProfileService.mdx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user