docs: TSDoc + reference of fulfillment service (#5761)

This commit is contained in:
Shahed Nasser
2023-11-29 11:58:08 +00:00
committed by GitHub
parent 8f25ed8a10
commit f802e2460f
1479 changed files with 30259 additions and 16135 deletions
@@ -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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -169,7 +189,7 @@ Provides layer to manipulate profiles.
}
]} />
##### Returns
#### Returns
Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -191,13 +211,13 @@ use [addProducts](ShippingProfileService.mdx#addproducts) instead
___
#### addProducts
### addProducts
`**addProducts**(profileId, productId): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -238,14 +258,14 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### addShippingOption
### addShippingOption
`**addShippingOption**(profileId, optionId): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -286,7 +306,7 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### atomicPhase\_
### atomicPhase\_
`Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise&#60;TResult&#62;`
@@ -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&#60;TResult&#62;
@@ -367,13 +387,13 @@ Promise&#60;TResult&#62;
___
#### create
### create
`**create**(profile): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
Creates a new shipping profile.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -387,7 +407,7 @@ Creates a new shipping profile.
}
]} />
##### Returns
#### Returns
Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -405,13 +425,13 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### createDefault
### createDefault
`**createDefault**(): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
Creates a default shipping profile, if this does not already exist.
##### Returns
#### Returns
Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -429,14 +449,14 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### createGiftCardDefault
### createGiftCardDefault
`**createGiftCardDefault**(): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
Creates a default shipping profile, for gift cards if unless it already
exists.
##### Returns
#### Returns
Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -454,13 +474,13 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### delete
### delete
`**delete**(profileId): Promise&#60;void&#62;`
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&#60;void&#62;
@@ -492,14 +512,14 @@ Promise&#60;void&#62;
___
#### fetchCartOptions
### fetchCartOptions
`**fetchCartOptions**(cart): Promise&#60;[ShippingOption](ShippingOption.mdx)[]&#62;`
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&#60;[ShippingOption](ShippingOption.mdx)[]&#62;
@@ -531,11 +551,11 @@ Promise&#60;[ShippingOption](ShippingOption.mdx)[]&#62;
___
#### getMapProfileIdsByProductIds
### getMapProfileIdsByProductIds
`**getMapProfileIdsByProductIds**(productIds): Promise&#60;Map&#60;string, string&#62;&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -549,7 +569,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;Map&#60;string, string&#62;&#62;
@@ -567,13 +587,13 @@ Promise&#60;Map&#60;string, string&#62;&#62;
___
#### getProfilesInCart
### getProfilesInCart
`Protected **getProfilesInCart**(cart): Promise&#60;string[]&#62;`
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&#60;string[]&#62;
@@ -605,11 +625,11 @@ Promise&#60;string[]&#62;
___
#### list
### list
`**list**(selector?, config?): Promise&#60;[ShippingProfile](ShippingProfile.mdx)[]&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -632,7 +652,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;[ShippingProfile](ShippingProfile.mdx)[]&#62;
@@ -650,13 +670,13 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)[]&#62;
___
#### removeProducts
### removeProducts
`**removeProducts**(profileId, productId): Promise&#60;void \| [ShippingProfile](ShippingProfile.mdx)&#62;`
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&#60;void \| [ShippingProfile](ShippingProfile.mdx)&#62;
@@ -697,14 +717,14 @@ Promise&#60;void \| [ShippingProfile](ShippingProfile.mdx)&#62;
___
#### retrieve
### retrieve
`**retrieve**(profileId, options?): Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -745,11 +765,11 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### retrieveDefault
### retrieveDefault
`**retrieveDefault**(): Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;`
##### Returns
#### Returns
Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;
@@ -767,11 +787,11 @@ Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;
___
#### retrieveForProducts
### retrieveForProducts
`**retrieveForProducts**(productIds): Promise&#60;&#123; [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[]; &#125;&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -785,7 +805,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;&#123; [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[]; &#125;&#62;
@@ -803,13 +823,13 @@ Promise&#60;&#123; [product_id: string]: [ShippingProfile](ShippingProfile.mdx)[
___
#### retrieveGiftCardDefault
### retrieveGiftCardDefault
`**retrieveGiftCardDefault**(): Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;`
Retrieves the default gift card profile
##### Returns
#### Returns
Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;
@@ -827,11 +847,11 @@ Promise&#60;null \| [ShippingProfile](ShippingProfile.mdx)&#62;
___
#### 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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;`
@@ -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&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
@@ -912,11 +932,11 @@ Promise&#60;[ShippingProfile](ShippingProfile.mdx)&#62;
___
#### withTransaction
### withTransaction
`**withTransaction**(transactionManager?): [ShippingProfileService](ShippingProfileService.mdx)`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -930,7 +950,7 @@ ___
}
]} />
##### Returns
#### Returns
[ShippingProfileService](ShippingProfileService.mdx)