docs: updated services reference (#1809)
This commit is contained in:
@@ -4,7 +4,7 @@ Can authenticate a user based on email password combination
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`AuthService`](AuthService.md)\>
|
||||
|
||||
↳ **`AuthService`**
|
||||
|
||||
@@ -18,18 +18,125 @@ Can authenticate a user based on email password combination
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<AuthService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:12](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/auth.ts#L12)
|
||||
[services/auth.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L25)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### customerService\_
|
||||
|
||||
• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:20](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:21](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### userService\_
|
||||
|
||||
• `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L22)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### authenticate
|
||||
|
||||
▸ **authenticate**(`email`, `password`): `Promise`<`AuthenticateResult`\>
|
||||
@@ -54,7 +161,7 @@ scrypt to match password with hashed value.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:78](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/auth.ts#L78)
|
||||
[services/auth.ts:98](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -80,7 +187,7 @@ Authenticates a given user with an API token
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:41](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/auth.ts#L41)
|
||||
[services/auth.ts:55](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
@@ -108,13 +215,13 @@ scrypt to match password with hashed value.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:123](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/auth.ts#L123)
|
||||
[services/auth.ts:147](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L147)
|
||||
|
||||
___
|
||||
|
||||
### comparePassword\_
|
||||
|
||||
▸ **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\>
|
||||
▸ `Protected` **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\>
|
||||
|
||||
Verifies if a password is valid given the provided password hash
|
||||
|
||||
@@ -133,4 +240,52 @@ the result of the comparison
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/auth.ts:28](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/auth.ts#L28)
|
||||
[services/auth.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/auth.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager?`): [`AuthService`](AuthService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`AuthService`](AuthService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
471
docs/content/references/services/classes/BatchJobService.md
Normal file
471
docs/content/references/services/classes/BatchJobService.md
Normal file
@@ -0,0 +1,471 @@
|
||||
# Class: BatchJobService
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `TransactionBaseService`<[`BatchJobService`](BatchJobService.md)\>
|
||||
|
||||
↳ **`BatchJobService`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BatchJobService**(`__namedParameters`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService<BatchJobService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:93](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L93)
|
||||
|
||||
## Properties
|
||||
|
||||
### batchJobRepository\_
|
||||
|
||||
• `Protected` `Readonly` **batchJobRepository\_**: typeof `BatchJobRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### batchJobStatusMapToProps
|
||||
|
||||
• `Protected` **batchJobStatusMapToProps**: `Map`<`BatchJobStatus`, { `entityColumnName`: `string` ; `eventType`: `string` }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### strategyResolver\_
|
||||
|
||||
• `Protected` `Readonly` **strategyResolver\_**: [`StrategyResolverService`](StrategyResolverService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` `Readonly` **Events**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `CANCELED` | `string` |
|
||||
| `COMPLETED` | `string` |
|
||||
| `CONFIRMED` | `string` |
|
||||
| `CREATED` | `string` |
|
||||
| `FAILED` | `string` |
|
||||
| `PRE_PROCESSED` | `string` |
|
||||
| `PROCESSING` | `string` |
|
||||
| `UPDATED` | `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L27)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### cancel
|
||||
|
||||
▸ **cancel**(`batchJobOrId`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:284](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L284)
|
||||
|
||||
___
|
||||
|
||||
### complete
|
||||
|
||||
▸ **complete**(`batchJobOrId`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:266](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L266)
|
||||
|
||||
___
|
||||
|
||||
### confirm
|
||||
|
||||
▸ **confirm**(`batchJobOrId`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:248](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L248)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`data`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data` | `BatchJobCreateProps` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:153](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`BatchJob`[], `number`]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `selector` | `FilterableBatchJobProps` |
|
||||
| `config` | `FindConfig`<`BatchJob`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`BatchJob`[], `number`]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:137](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L137)
|
||||
|
||||
___
|
||||
|
||||
### prepareBatchJobForProcessing
|
||||
|
||||
▸ **prepareBatchJobForProcessing**(`data`, `req`): `Promise`<`CreateBatchJobInput`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data` | `CreateBatchJobInput` |
|
||||
| `req` | `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`CreateBatchJobInput`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:380](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L380)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`batchJobId`, `config?`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobId` | `string` |
|
||||
| `config` | `FindConfig`<`BatchJob`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:112](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
### setFailed
|
||||
|
||||
▸ **setFailed**(`batchJobOrId`, `error?`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
| `error?` | `BatchJobResultError` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:354](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L354)
|
||||
|
||||
___
|
||||
|
||||
### setPreProcessingDone
|
||||
|
||||
▸ **setPreProcessingDone**(`batchJobOrId`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:302](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L302)
|
||||
|
||||
___
|
||||
|
||||
### setProcessing
|
||||
|
||||
▸ **setProcessing**(`batchJobOrId`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:334](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L334)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`batchJobOrId`, `data`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
| `data` | `Partial`<`Pick`<`BatchJob`, ``"context"`` \| ``"result"``\>\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:172](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L172)
|
||||
|
||||
___
|
||||
|
||||
### updateStatus
|
||||
|
||||
▸ `Protected` **updateStatus**(`batchJobOrId`, `status`): `Promise`<`BatchJob`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `batchJobOrId` | `string` \| `BatchJob` |
|
||||
| `status` | `BatchJobStatus` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`BatchJob`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/batch-job.ts:213](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/batch-job.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager?`): [`BatchJobService`](BatchJobService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BatchJobService`](BatchJobService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
@@ -24,7 +24,7 @@ TransactionBaseService<CartService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:106](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L106)
|
||||
[services/cart.ts:107](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L107)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -34,7 +34,7 @@ TransactionBaseService<CartService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:86](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L86)
|
||||
[services/cart.ts:87](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L87)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:85](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L85)
|
||||
[services/cart.ts:86](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:102](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L102)
|
||||
[services/cart.ts:103](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
@@ -84,7 +84,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:95](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L95)
|
||||
[services/cart.ts:96](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -94,7 +94,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:97](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L97)
|
||||
[services/cart.ts:98](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -104,7 +104,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:89](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L89)
|
||||
[services/cart.ts:90](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L90)
|
||||
|
||||
___
|
||||
|
||||
@@ -114,7 +114,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:98](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L98)
|
||||
[services/cart.ts:99](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L99)
|
||||
|
||||
___
|
||||
|
||||
@@ -124,7 +124,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:101](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L101)
|
||||
[services/cart.ts:102](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:104](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L104)
|
||||
[services/cart.ts:105](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
@@ -144,7 +144,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:88](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L88)
|
||||
[services/cart.ts:89](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:93](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L93)
|
||||
[services/cart.ts:94](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,7 +168,7 @@ TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:81](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L81)
|
||||
[services/cart.ts:82](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L82)
|
||||
|
||||
___
|
||||
|
||||
@@ -178,7 +178,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:94](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L94)
|
||||
[services/cart.ts:95](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L95)
|
||||
|
||||
___
|
||||
|
||||
@@ -188,7 +188,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:87](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L87)
|
||||
[services/cart.ts:88](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -198,7 +198,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:103](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L103)
|
||||
[services/cart.ts:104](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -208,7 +208,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:91](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L91)
|
||||
[services/cart.ts:92](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L92)
|
||||
|
||||
___
|
||||
|
||||
@@ -218,7 +218,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:90](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L90)
|
||||
[services/cart.ts:91](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -228,7 +228,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:92](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L92)
|
||||
[services/cart.ts:93](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
@@ -238,7 +238,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L84)
|
||||
[services/cart.ts:85](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
@@ -248,7 +248,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:96](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L96)
|
||||
[services/cart.ts:97](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -258,7 +258,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:99](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L99)
|
||||
[services/cart.ts:100](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L100)
|
||||
|
||||
___
|
||||
|
||||
@@ -268,7 +268,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:100](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L100)
|
||||
[services/cart.ts:101](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -282,7 +282,7 @@ TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:82](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L82)
|
||||
[services/cart.ts:83](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L83)
|
||||
|
||||
___
|
||||
|
||||
@@ -300,7 +300,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:75](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L75)
|
||||
[services/cart.ts:76](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L76)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -325,7 +325,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:528](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L528)
|
||||
[services/cart.ts:529](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L529)
|
||||
|
||||
___
|
||||
|
||||
@@ -355,7 +355,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1522](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1522)
|
||||
[services/cart.ts:1535](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1535)
|
||||
|
||||
___
|
||||
|
||||
@@ -383,7 +383,7 @@ void
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:680](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L680)
|
||||
[services/cart.ts:681](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L681)
|
||||
|
||||
___
|
||||
|
||||
@@ -411,7 +411,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1044](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1044)
|
||||
[services/cart.ts:1052](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1052)
|
||||
|
||||
___
|
||||
|
||||
@@ -432,7 +432,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1008](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1008)
|
||||
[services/cart.ts:1016](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1016)
|
||||
|
||||
___
|
||||
|
||||
@@ -471,7 +471,7 @@ TransactionBaseService.atomicPhase\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
[interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -500,7 +500,7 @@ the resulting cart
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1183](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1183)
|
||||
[services/cart.ts:1191](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1191)
|
||||
|
||||
___
|
||||
|
||||
@@ -524,7 +524,7 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:329](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L329)
|
||||
[services/cart.ts:330](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L330)
|
||||
|
||||
___
|
||||
|
||||
@@ -548,7 +548,7 @@ the resultign customer object
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:886](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L886)
|
||||
[services/cart.ts:894](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L894)
|
||||
|
||||
___
|
||||
|
||||
@@ -568,7 +568,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1919](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1919)
|
||||
[services/cart.ts:1932](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1932)
|
||||
|
||||
___
|
||||
|
||||
@@ -590,7 +590,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:207](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L207)
|
||||
[services/cart.ts:208](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L208)
|
||||
|
||||
___
|
||||
|
||||
@@ -614,7 +614,7 @@ the deleted cart or undefined if the cart was not found.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1834](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1834)
|
||||
[services/cart.ts:1847](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1847)
|
||||
|
||||
___
|
||||
|
||||
@@ -639,7 +639,7 @@ resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1972](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1972)
|
||||
[services/cart.ts:1986](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1986)
|
||||
|
||||
___
|
||||
|
||||
@@ -664,7 +664,7 @@ the resulting cart.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1430](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1430)
|
||||
[services/cart.ts:1443](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1443)
|
||||
|
||||
___
|
||||
|
||||
@@ -690,7 +690,7 @@ custom shipping option
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1626](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1626)
|
||||
[services/cart.ts:1639](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1639)
|
||||
|
||||
___
|
||||
|
||||
@@ -713,7 +713,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:254](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L254)
|
||||
[services/cart.ts:255](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L255)
|
||||
|
||||
___
|
||||
|
||||
@@ -733,7 +733,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1946](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1946)
|
||||
[services/cart.ts:1960](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1960)
|
||||
|
||||
___
|
||||
|
||||
@@ -758,7 +758,7 @@ the resulting cart.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1478](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1478)
|
||||
[services/cart.ts:1491](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1491)
|
||||
|
||||
___
|
||||
|
||||
@@ -783,7 +783,7 @@ the resulting cart
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1104](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1104)
|
||||
[services/cart.ts:1112](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1112)
|
||||
|
||||
___
|
||||
|
||||
@@ -808,7 +808,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:432](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L432)
|
||||
[services/cart.ts:433](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L433)
|
||||
|
||||
___
|
||||
|
||||
@@ -834,7 +834,7 @@ the cart document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:277](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L277)
|
||||
[services/cart.ts:278](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L278)
|
||||
|
||||
___
|
||||
|
||||
@@ -862,7 +862,7 @@ resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1877](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1877)
|
||||
[services/cart.ts:1890](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1890)
|
||||
|
||||
___
|
||||
|
||||
@@ -887,7 +887,7 @@ result of update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1249](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1249)
|
||||
[services/cart.ts:1262](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1262)
|
||||
|
||||
___
|
||||
|
||||
@@ -915,7 +915,7 @@ the result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1322](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1322)
|
||||
[services/cart.ts:1335](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1335)
|
||||
|
||||
___
|
||||
|
||||
@@ -941,7 +941,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1705](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1705)
|
||||
[services/cart.ts:1718](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1718)
|
||||
|
||||
___
|
||||
|
||||
@@ -965,7 +965,7 @@ TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -985,7 +985,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:157](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L157)
|
||||
[services/cart.ts:158](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L158)
|
||||
|
||||
___
|
||||
|
||||
@@ -1006,7 +1006,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:716](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L716)
|
||||
[services/cart.ts:724](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L724)
|
||||
|
||||
___
|
||||
|
||||
@@ -1032,7 +1032,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:919](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L919)
|
||||
[services/cart.ts:927](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L927)
|
||||
|
||||
___
|
||||
|
||||
@@ -1057,7 +1057,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:868](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L868)
|
||||
[services/cart.ts:876](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L876)
|
||||
|
||||
___
|
||||
|
||||
@@ -1083,7 +1083,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:615](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L615)
|
||||
[services/cart.ts:616](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L616)
|
||||
|
||||
___
|
||||
|
||||
@@ -1108,7 +1108,7 @@ the resulting cart
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1148](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1148)
|
||||
[services/cart.ts:1156](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1156)
|
||||
|
||||
___
|
||||
|
||||
@@ -1134,7 +1134,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:959](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L959)
|
||||
[services/cart.ts:967](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L967)
|
||||
|
||||
___
|
||||
|
||||
@@ -1156,7 +1156,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:1645](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L1645)
|
||||
[services/cart.ts:1658](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L1658)
|
||||
|
||||
___
|
||||
|
||||
@@ -1183,7 +1183,7 @@ boolean representing wheter shipping method is validated
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/cart.ts:498](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/cart.ts#L498)
|
||||
[services/cart.ts:499](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/cart.ts#L499)
|
||||
|
||||
___
|
||||
|
||||
@@ -1207,4 +1207,4 @@ TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`ClaimItemService`](ClaimItemService.md)\>
|
||||
|
||||
↳ **`ClaimItemService`**
|
||||
|
||||
@@ -20,31 +20,109 @@
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
BaseService<ClaimItemService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:11](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L11)
|
||||
[services/claim-item.ts:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L30)
|
||||
|
||||
## Properties
|
||||
|
||||
### claimImageRepository\_
|
||||
|
||||
• **claimImageRepository\_**: `any`
|
||||
• `Protected` `Readonly` **claimImageRepository\_**: typeof `ClaimImageRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L27)
|
||||
[services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### claimItemRepository\_
|
||||
|
||||
• `Protected` `Readonly` **claimItemRepository\_**: typeof `ClaimItemRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### claimTagRepository\_
|
||||
|
||||
• **claimTagRepository\_**: `any`
|
||||
• `Protected` `Readonly` **claimTagRepository\_**: typeof `ClaimTagRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:26](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L26)
|
||||
[services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### lineItemService\_
|
||||
|
||||
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,101 +140,95 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L5)
|
||||
[services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L15)
|
||||
|
||||
## Methods
|
||||
|
||||
### cancel
|
||||
### atomicPhase\_
|
||||
|
||||
▸ **cancel**(`id`): `Promise`<`void`\>
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `any` |
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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`<`void`\>
|
||||
`Promise`<`TResult`\>
|
||||
|
||||
the result of the transactional work
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseService.atomicPhase\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:212](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L212)
|
||||
[interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`data`): `any`
|
||||
▸ **create**(`data`): `Promise`<`ClaimItem`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data` | `any` |
|
||||
| `data` | `CreateClaimItemInput` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
`Promise`<`ClaimItem`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:55](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L55)
|
||||
|
||||
___
|
||||
|
||||
### deleteMetadata
|
||||
|
||||
▸ **deleteMetadata**(`orderId`, `key`): `Promise`<`any`\>
|
||||
|
||||
Dedicated method to delete metadata for an order.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `orderId` | `string` | the order to delete metadata from. |
|
||||
| `key` | `string` | key for metadata field |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:259](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L259)
|
||||
[services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`any`\>
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`ClaimItem`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | the config object for find |
|
||||
| `selector` | `Selector`<`ClaimItem`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`ClaimItem`\> | the config object for find |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimItem`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:219](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L219)
|
||||
[services/claim-item.ts:214](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L214)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`id`, `config?`): `Promise`<`Order`\>
|
||||
▸ **retrieve**(`id`, `config?`): `Promise`<`ClaimItem`\>
|
||||
|
||||
Gets a claim item by id.
|
||||
|
||||
@@ -165,23 +237,47 @@ Gets a claim item by id.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | id of ClaimItem to retrieve |
|
||||
| `config` | `any` | configuration for the find operation |
|
||||
| `config` | `FindConfig`<`ClaimItem`\> | configuration for the find operation |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Order`\>
|
||||
`Promise`<`ClaimItem`\>
|
||||
|
||||
the ClaimItem
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:234](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L234)
|
||||
[services/claim-item.ts:233](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L233)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`id`, `data`): `any`
|
||||
▸ **update**(`id`, `data`): `Promise`<`ClaimItem`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -192,28 +288,32 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
`Promise`<`ClaimItem`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:135](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L135)
|
||||
[services/claim-item.ts:132](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim-item.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`manager`): [`ClaimItemService`](ClaimItemService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`ClaimItemService`](ClaimItemService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `manager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ClaimItemService`](ClaimItemService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim-item.js:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim-item.js#L36)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`ClaimService`](ClaimService.md), `InjectedDependencies`\>
|
||||
|
||||
↳ **`ClaimService`**
|
||||
|
||||
@@ -16,161 +16,232 @@
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<
|
||||
ClaimService,
|
||||
InjectedDependencies
|
||||
\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L14)
|
||||
[services/claim.ts:85](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L85)
|
||||
|
||||
## Properties
|
||||
|
||||
### addressRepo\_
|
||||
### addressRepository\_
|
||||
|
||||
• **addressRepo\_**: `any`
|
||||
• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L36)
|
||||
[services/claim.ts:68](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### claimItemService\_
|
||||
|
||||
• **claimItemService\_**: `any`
|
||||
• `Protected` `Readonly` **claimItemService\_**: [`ClaimItemService`](ClaimItemService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:37](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L37)
|
||||
[services/claim.ts:72](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### claimRepository\_
|
||||
|
||||
• **claimRepository\_**: `any`
|
||||
• `Protected` `Readonly` **claimRepository\_**: typeof `ClaimRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L38)
|
||||
[services/claim.ts:69](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L69)
|
||||
|
||||
___
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `InjectedDependencies`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• **eventBus\_**: `any`
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:39](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L39)
|
||||
[services/claim.ts:73](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### fulfillmentProviderService\_
|
||||
|
||||
• **fulfillmentProviderService\_**: `any`
|
||||
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:40](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L40)
|
||||
[services/claim.ts:74](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### fulfillmentService\_
|
||||
|
||||
• **fulfillmentService\_**: `any`
|
||||
• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:41](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L41)
|
||||
[services/claim.ts:75](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
### inventoryService\_
|
||||
|
||||
• **inventoryService\_**: `any`
|
||||
• `Protected` `Readonly` **inventoryService\_**: [`InventoryService`](InventoryService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:42](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L42)
|
||||
[services/claim.ts:76](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
### lineItemRepository\_
|
||||
|
||||
• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.ts:71](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
### lineItemService\_
|
||||
|
||||
• **lineItemService\_**: `any`
|
||||
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:43](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L43)
|
||||
[services/claim.ts:77](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.ts:65](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### paymentProviderService\_
|
||||
|
||||
• **paymentProviderService\_**: `any`
|
||||
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:44](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L44)
|
||||
[services/claim.ts:78](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L78)
|
||||
|
||||
___
|
||||
|
||||
### regionService\_
|
||||
|
||||
• **regionService\_**: `any`
|
||||
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:45](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L45)
|
||||
[services/claim.ts:79](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L79)
|
||||
|
||||
___
|
||||
|
||||
### returnService\_
|
||||
|
||||
• **returnService\_**: `any`
|
||||
• `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:46](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L46)
|
||||
[services/claim.ts:80](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L80)
|
||||
|
||||
___
|
||||
|
||||
### shippingMethodRepository\_
|
||||
|
||||
• `Protected` `Readonly` **shippingMethodRepository\_**: typeof `ShippingMethodRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.ts:70](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### shippingOptionService\_
|
||||
|
||||
• **shippingOptionService\_**: `any`
|
||||
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L47)
|
||||
[services/claim.ts:81](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L81)
|
||||
|
||||
___
|
||||
|
||||
### taxProviderService\_
|
||||
|
||||
• **taxProviderService\_**: `any`
|
||||
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:48](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L48)
|
||||
[services/claim.ts:82](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L82)
|
||||
|
||||
___
|
||||
|
||||
### totalsService\_
|
||||
|
||||
• **totalsService\_**: `any`
|
||||
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:49](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L49)
|
||||
[services/claim.ts:83](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L83)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.ts:66](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` **Events**: `Object`
|
||||
▪ `Static` `Readonly` **Events**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -185,53 +256,92 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L5)
|
||||
[services/claim.ts:56](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L56)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### cancel
|
||||
|
||||
▸ **cancel**(`id`): `Promise`<`any`\>
|
||||
▸ **cancel**(`id`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `any` |
|
||||
| `id` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:644](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L644)
|
||||
[services/claim.ts:753](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L753)
|
||||
|
||||
___
|
||||
|
||||
### cancelFulfillment
|
||||
|
||||
▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`any`\>
|
||||
▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `fulfillmentId` | `any` |
|
||||
| `fulfillmentId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:512](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L512)
|
||||
[services/claim.ts:602](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L602)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`data`): `any`
|
||||
▸ **create**(`data`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
Creates a Claim on an Order. Claims consists of items that are claimed and
|
||||
optionally items to be sent as replacement for the claimed items. The
|
||||
@@ -241,23 +351,23 @@ shipping address that the new items will be shipped to
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `any` | the object containing all data required to create a claim |
|
||||
| `data` | `CreateClaimInput` | the object containing all data required to create a claim |
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
created claim
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:159](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L159)
|
||||
[services/claim.ts:217](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L217)
|
||||
|
||||
___
|
||||
|
||||
### createFulfillment
|
||||
|
||||
▸ **createFulfillment**(`id`, `config?`): `Claim`
|
||||
▸ **createFulfillment**(`id`, `config?`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -265,117 +375,92 @@ ___
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | the object containing all data required to create a claim |
|
||||
| `config` | `Object` | config object |
|
||||
| `config.metadata` | `any` | config metadata |
|
||||
| `config.no_notification` | `undefined` \| `boolean` | config no notification |
|
||||
| `config.metadata?` | `Record`<`string`, `unknown`\> | config metadata |
|
||||
| `config.no_notification?` | `boolean` | config no notification |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Claim`
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
created claim
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:378](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L378)
|
||||
[services/claim.ts:456](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L456)
|
||||
|
||||
___
|
||||
|
||||
### createShipment
|
||||
|
||||
▸ **createShipment**(`id`, `fulfillmentId`, `trackingLinks`, `config?`): `Promise`<`any`\>
|
||||
▸ **createShipment**(`id`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `any` | `undefined` |
|
||||
| `fulfillmentId` | `any` | `undefined` |
|
||||
| `trackingLinks` | `any` | `undefined` |
|
||||
| `id` | `string` | `undefined` |
|
||||
| `fulfillmentId` | `string` | `undefined` |
|
||||
| `trackingLinks` | { `tracking_number`: `string` }[] | `[]` |
|
||||
| `config` | `Object` | `undefined` |
|
||||
| `config.metadata` | `Object` | `{}` |
|
||||
| `config.no_notification` | `undefined` | `undefined` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:577](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L577)
|
||||
|
||||
___
|
||||
|
||||
### deleteMetadata
|
||||
|
||||
▸ **deleteMetadata**(`orderId`, `key`): `Promise`<`any`\>
|
||||
|
||||
Dedicated method to delete metadata for an order.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `orderId` | `string` | the order to delete metadata from. |
|
||||
| `key` | `string` | key for metadata field |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:734](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L734)
|
||||
[services/claim.ts:674](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L674)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`any`\>
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`ClaimOrder`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimOrder`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:696](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L696)
|
||||
[services/claim.ts:809](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L809)
|
||||
|
||||
___
|
||||
|
||||
### processRefund
|
||||
|
||||
▸ **processRefund**(`id`): `Promise`<`any`\>
|
||||
▸ **processRefund**(`id`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `any` |
|
||||
| `id` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:535](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L535)
|
||||
[services/claim.ts:628](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L628)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`claimId`, `config?`): `Promise`<`Order`\>
|
||||
▸ **retrieve**(`id`, `config?`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
Gets an order by id.
|
||||
|
||||
@@ -383,56 +468,84 @@ Gets an order by id.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `claimId` | `string` | id of order to retrieve |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `id` | `string` | id of the claim order to retrieve |
|
||||
| `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Order`\>
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:711](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L711)
|
||||
[services/claim.ts:834](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L834)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`id`, `data`): `any`
|
||||
▸ **update**(`id`, `data`): `Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `any` |
|
||||
| `data` | `any` |
|
||||
| `id` | `string` |
|
||||
| `data` | `UpdateClaimInput` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
`Promise`<`ClaimOrder`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:80](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L80)
|
||||
[services/claim.ts:127](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/claim.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`manager`): [`ClaimService`](ClaimService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`ClaimService`](ClaimService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `manager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ClaimService`](ClaimService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/claim.js:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/claim.js#L52)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`CustomShippingOptionService`](CustomShippingOptionService.md)\>
|
||||
|
||||
↳ **`CustomShippingOptionService`**
|
||||
|
||||
@@ -16,30 +16,126 @@
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<CustomShippingOptionService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/custom-shipping-option.js#L5)
|
||||
[services/custom-shipping-option.ts:19](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L19)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### customShippingOptionRepository\_
|
||||
|
||||
• `Protected` **customShippingOptionRepository\_**: typeof `CustomShippingOptionRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.ts:17](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L16)
|
||||
|
||||
## Methods
|
||||
|
||||
### create
|
||||
### atomicPhase\_
|
||||
|
||||
▸ **create**(`data`, `config?`): `Promise`<`CustomShippingOption`\>
|
||||
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
|
||||
|
||||
Creates a custom shipping option associated with a given author
|
||||
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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `any` | the custom shipping option to create |
|
||||
| `config` | `any` | any configurations if needed, including meta data |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`data`): `Promise`<`CustomShippingOption`\>
|
||||
|
||||
Creates a custom shipping option
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `CreateCustomShippingOptionInput` | the custom shipping option to create |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -49,7 +145,7 @@ resolves to the creation result
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.js:88](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/custom-shipping-option.js#L88)
|
||||
[services/custom-shipping-option.ts:90](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L90)
|
||||
|
||||
___
|
||||
|
||||
@@ -57,14 +153,14 @@ ___
|
||||
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`CustomShippingOption`[]\>
|
||||
|
||||
Fetches all custom shipping options related to the given selector
|
||||
Fetches all custom shipping options based on the given selector
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | the configuration used to find the objects. contains relations, skip, and take. |
|
||||
| `selector` | `Selector`<`CustomShippingOption`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`CustomShippingOption`\> | the configuration used to find the objects. contains relations, skip, and take. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -74,7 +170,7 @@ custom shipping options matching the query
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.js:65](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/custom-shipping-option.js#L65)
|
||||
[services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
@@ -89,38 +185,62 @@ Retrieves a specific shipping option.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | the id of the custom shipping option to retrieve. |
|
||||
| `config` | `any` | any options needed to query for the result. |
|
||||
| `config` | `FindConfig`<`CustomShippingOption`\> | any options needed to query for the result. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`CustomShippingOption`\>
|
||||
|
||||
which resolves to the requested custom shipping option.
|
||||
the requested custom shipping option.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.js:40](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/custom-shipping-option.js#L40)
|
||||
[services/custom-shipping-option.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/custom-shipping-option.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`manager`): [`CustomShippingOptionService`](CustomShippingOptionService.md)
|
||||
|
||||
Sets the service's manager to a given transaction manager
|
||||
▸ **withTransaction**(`transactionManager?`): [`CustomShippingOptionService`](CustomShippingOptionService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `manager` | `EntityManager` | the manager to use |
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CustomShippingOptionService`](CustomShippingOptionService.md)
|
||||
|
||||
a cloned CustomShippingOption service
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/custom-shipping-option.js:20](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/custom-shipping-option.js#L20)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -28,7 +28,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:31](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L31)
|
||||
[services/customer-group.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L31)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -38,7 +38,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L27)
|
||||
[services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:29](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L29)
|
||||
[services/customer-group.ts:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L25)
|
||||
[services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L25)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -83,7 +83,7 @@ the customer group after insertion
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:113](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L113)
|
||||
[services/customer-group.ts:113](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
@@ -107,7 +107,7 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:86](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L86)
|
||||
[services/customer-group.ts:86](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
@@ -131,7 +131,7 @@ a promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L194)
|
||||
[services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L194)
|
||||
|
||||
___
|
||||
|
||||
@@ -156,7 +156,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:217](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L217)
|
||||
[services/customer-group.ts:217](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L217)
|
||||
|
||||
___
|
||||
|
||||
@@ -181,7 +181,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L236)
|
||||
[services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L236)
|
||||
|
||||
___
|
||||
|
||||
@@ -206,7 +206,7 @@ the customergroup with the provided id
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:271](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L271)
|
||||
[services/customer-group.ts:271](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L271)
|
||||
|
||||
___
|
||||
|
||||
@@ -227,7 +227,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:62](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L62)
|
||||
[services/customer-group.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -252,7 +252,7 @@ resulting customer group
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:162](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L162)
|
||||
[services/customer-group.ts:162](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
@@ -272,4 +272,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer-group.ts:46](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer-group.ts#L46)
|
||||
[services/customer-group.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer-group.ts#L46)
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
Provides layer to manipulate customers.
|
||||
|
||||
**`implements`** {BaseService}
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`CustomerService`](CustomerService.md)\>
|
||||
|
||||
↳ **`CustomerService`**
|
||||
|
||||
@@ -20,18 +18,96 @@ Provides layer to manipulate customers.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<CustomerService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:20](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L20)
|
||||
[services/customer.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### addressRepository\_
|
||||
|
||||
• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### customerRepository\_
|
||||
|
||||
• `Protected` `Readonly` **customerRepository\_**: typeof `CustomerRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### eventBusService\_
|
||||
|
||||
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` `Readonly` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` `Readonly` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` **Events**: `Object`
|
||||
@@ -46,52 +122,91 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L14)
|
||||
[services/customer.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L34)
|
||||
|
||||
## Methods
|
||||
|
||||
### addAddress
|
||||
|
||||
▸ **addAddress**(`customerId`, `address`): `Promise`<`any`\>
|
||||
▸ **addAddress**(`customerId`, `address`): `Promise`<`Customer` \| `Address`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customerId` | `any` |
|
||||
| `address` | `any` |
|
||||
| `customerId` | `string` |
|
||||
| `address` | `AddressCreatePayload` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Customer` \| `Address`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:479](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L479)
|
||||
[services/customer.ts:471](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L471)
|
||||
|
||||
___
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### count
|
||||
|
||||
▸ **count**(): `Promise`<`any`\>
|
||||
▸ **count**(): `Promise`<`number`\>
|
||||
|
||||
Return the total number of documents in database
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`number`\>
|
||||
|
||||
the result of the count operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:192](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L192)
|
||||
[services/customer.ts:161](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L161)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`customer`): `Promise`<`any`\>
|
||||
▸ **create**(`customer`): `Promise`<`Customer`\>
|
||||
|
||||
Creates a customer from an email - customers can have accounts associated,
|
||||
e.g. to login and view order history, etc. If a password is provided the
|
||||
@@ -102,49 +217,23 @@ used to hold details of customers.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `customer` | `any` | the customer to create |
|
||||
| `customer` | `CreateCustomerInput` | the customer to create |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Customer`\>
|
||||
|
||||
the result of create
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:290](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L290)
|
||||
|
||||
___
|
||||
|
||||
### decorate
|
||||
|
||||
▸ **decorate**(`customer`, `fields?`, `expandFields?`): `Customer`
|
||||
|
||||
Decorates a customer.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `customer` | `Customer` | `undefined` | the cart to decorate. |
|
||||
| `fields` | `string`[] | `[]` | the fields to include. |
|
||||
| `expandFields` | `string`[] | `[]` | fields to expand. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Customer`
|
||||
|
||||
return the decorated customer.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:547](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L547)
|
||||
[services/customer.ts:255](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L255)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`customerId`): `Promise`<`any`\>
|
||||
▸ **delete**(`customerId`): `Promise`<`void` \| `Customer`\>
|
||||
|
||||
Deletes a customer from a given customer id.
|
||||
|
||||
@@ -156,19 +245,19 @@ Deletes a customer from a given customer id.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void` \| `Customer`\>
|
||||
|
||||
the result of the delete operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:523](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L523)
|
||||
[services/customer.ts:519](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L519)
|
||||
|
||||
___
|
||||
|
||||
### generateResetPasswordToken
|
||||
|
||||
▸ **generateResetPasswordToken**(`customerId`): `string`
|
||||
▸ **generateResetPasswordToken**(`customerId`): `Promise`<`string`\>
|
||||
|
||||
Generate a JSON Web token, that will be sent to a customer, that wishes to
|
||||
reset password.
|
||||
@@ -184,13 +273,13 @@ which is always 15 minutes.
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
`Promise`<`string`\>
|
||||
|
||||
the generated JSON web token
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:67](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L67)
|
||||
[services/customer.ts:65](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
@@ -214,74 +303,74 @@ hashed password
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:277](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L277)
|
||||
[services/customer.ts:242](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L242)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector?`, `config?`): `Promise`<`any`\>
|
||||
▸ **list**(`selector?`, `config?`): `Promise`<`Customer`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `selector` | `Selector`<`Customer`\> & { `q?`: `string` } | the query object for find |
|
||||
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Customer`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:106](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L106)
|
||||
[services/customer.ts:108](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L108)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<`any`\>
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Customer`[], `number`]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `selector` | `Selector`<`Customer`\> & { `q?`: `string` } | the query object for find |
|
||||
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<[`Customer`[], `number`]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:147](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L147)
|
||||
[services/customer.ts:133](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
### removeAddress
|
||||
|
||||
▸ **removeAddress**(`customerId`, `addressId`): `Promise`<`any`\>
|
||||
▸ **removeAddress**(`customerId`, `addressId`): `Promise`<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customerId` | `any` |
|
||||
| `addressId` | `any` |
|
||||
| `customerId` | `string` |
|
||||
| `addressId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:460](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L460)
|
||||
[services/customer.ts:454](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L454)
|
||||
|
||||
___
|
||||
|
||||
@@ -296,7 +385,7 @@ Gets a customer by id.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `customerId` | `string` | the id of the customer to get. |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -306,7 +395,7 @@ the customer document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:205](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L205)
|
||||
[services/customer.ts:228](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L228)
|
||||
|
||||
___
|
||||
|
||||
@@ -321,7 +410,7 @@ Gets a customer by email.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `email` | `string` | the email of the customer to get. |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -331,7 +420,7 @@ the customer document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:230](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L230)
|
||||
[services/customer.ts:198](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L198)
|
||||
|
||||
___
|
||||
|
||||
@@ -346,7 +435,7 @@ Gets a customer by phone.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `phone` | `string` | the phone of the customer to get. |
|
||||
| `config` | `any` | the config object containing query settings |
|
||||
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -356,13 +445,58 @@ the customer document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:254](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L254)
|
||||
[services/customer.ts:213](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### retrieve\_
|
||||
|
||||
▸ `Private` **retrieve_**(`selector`, `config?`): `Promise`<`Customer`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `selector` | `Selector`<`Customer`\> |
|
||||
| `config` | `FindConfig`<`Customer`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Customer`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.ts:168](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L168)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`customerId`, `update`): `Promise`<`any`\>
|
||||
▸ **update**(`customerId`, `update`): `Promise`<`Customer`\>
|
||||
|
||||
Updates a customer.
|
||||
|
||||
@@ -371,45 +505,45 @@ Updates a customer.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `customerId` | `string` | the id of the variant. Must be a string that can be casted to an ObjectId |
|
||||
| `update` | `any` | an object with the update values. |
|
||||
| `update` | `UpdateCustomerInput` | an object with the update values. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Customer`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:346](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L346)
|
||||
[services/customer.ts:310](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L310)
|
||||
|
||||
___
|
||||
|
||||
### updateAddress
|
||||
|
||||
▸ **updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`any`\>
|
||||
▸ **updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`Address`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customerId` | `any` |
|
||||
| `addressId` | `any` |
|
||||
| `address` | `any` |
|
||||
| `customerId` | `string` |
|
||||
| `addressId` | `string` |
|
||||
| `address` | `StorePostCustomersCustomerAddressesAddressReq` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Address`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:441](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L441)
|
||||
[services/customer.ts:426](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L426)
|
||||
|
||||
___
|
||||
|
||||
### updateBillingAddress\_
|
||||
|
||||
▸ **updateBillingAddress_**(`customer`, `addressOrId`, `addrRepo`): `Promise`<`any`\>
|
||||
▸ **updateBillingAddress_**(`customer`, `addressOrId`): `Promise`<`void`\>
|
||||
|
||||
Updates the customers' billing address.
|
||||
|
||||
@@ -418,35 +552,38 @@ Updates the customers' billing address.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `customer` | `Customer` | the Customer to update |
|
||||
| `addressOrId` | `any` | the value to set the billing address to |
|
||||
| `addrRepo` | `any` | address repository |
|
||||
| `addressOrId` | `undefined` \| `string` \| `DeepPartial`<`Address`\> | the value to set the billing address to |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void`\>
|
||||
|
||||
the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:408](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L408)
|
||||
[services/customer.ts:374](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/customer.ts#L374)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`CustomerService`](CustomerService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`CustomerService`](CustomerService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CustomerService`](CustomerService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/customer.js:41](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/customer.js#L41)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -6,7 +6,7 @@ Provides layer to manipulate discounts.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`DiscountService`](DiscountService.md)\>
|
||||
|
||||
↳ **`DiscountService`**
|
||||
|
||||
@@ -24,111 +24,159 @@ Provides layer to manipulate discounts.
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<DiscountService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:59](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L59)
|
||||
[services/discount.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L62)
|
||||
|
||||
## Properties
|
||||
|
||||
### discountConditionRepository\_
|
||||
### configModule
|
||||
|
||||
• `Private` **discountConditionRepository\_**: typeof `DiscountConditionRepository`
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### customerService\_
|
||||
|
||||
• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L52)
|
||||
[services/discount.ts:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### discountConditionRepository\_
|
||||
|
||||
• `Protected` `Readonly` **discountConditionRepository\_**: typeof `DiscountConditionRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:55](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### discountConditionService\_
|
||||
|
||||
• `Private` **discountConditionService\_**: `DiscountConditionService`
|
||||
• `Protected` `Readonly` **discountConditionService\_**: `DiscountConditionService`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:53](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L53)
|
||||
[services/discount.ts:56](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
### discountRepository\_
|
||||
|
||||
• `Private` **discountRepository\_**: typeof `DiscountRepository`
|
||||
• `Protected` `Readonly` **discountRepository\_**: typeof `DiscountRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:49](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L49)
|
||||
[services/discount.ts:51](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### discountRuleRepository\_
|
||||
|
||||
• `Private` **discountRuleRepository\_**: typeof `DiscountRuleRepository`
|
||||
• `Protected` `Readonly` **discountRuleRepository\_**: typeof `DiscountRuleRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:50](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L50)
|
||||
[services/discount.ts:53](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Private` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:57](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L57)
|
||||
[services/discount.ts:60](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
### giftCardRepository\_
|
||||
|
||||
• `Private` **giftCardRepository\_**: typeof `GiftCardRepository`
|
||||
• `Protected` `Readonly` **giftCardRepository\_**: typeof `GiftCardRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:51](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L51)
|
||||
[services/discount.ts:54](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Private` **manager\_**: `EntityManager`
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:48](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L48)
|
||||
[services/discount.ts:48](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### productService\_
|
||||
|
||||
• `Private` **productService\_**: [`ProductService`](ProductService.md)
|
||||
• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:55](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L55)
|
||||
[services/discount.ts:58](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### regionService\_
|
||||
|
||||
• `Private` **regionService\_**: [`RegionService`](RegionService.md)
|
||||
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:56](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L56)
|
||||
[services/discount.ts:59](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
### totalsService\_
|
||||
|
||||
• `Private` **totalsService\_**: [`TotalsService`](TotalsService.md)
|
||||
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:54](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L54)
|
||||
[services/discount.ts:57](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L49)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -153,7 +201,46 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:521](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L521)
|
||||
[services/discount.ts:477](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L477)
|
||||
|
||||
___
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -175,7 +262,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:624](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L624)
|
||||
[services/discount.ts:576](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L576)
|
||||
|
||||
___
|
||||
|
||||
@@ -196,7 +283,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:762](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L762)
|
||||
[services/discount.ts:720](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L720)
|
||||
|
||||
___
|
||||
|
||||
@@ -221,7 +308,7 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:220](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L220)
|
||||
[services/discount.ts:182](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L182)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,7 +333,7 @@ the newly created dynamic code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:446](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L446)
|
||||
[services/discount.ts:405](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L405)
|
||||
|
||||
___
|
||||
|
||||
@@ -270,7 +357,7 @@ the result of the delete operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:583](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L583)
|
||||
[services/discount.ts:537](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L537)
|
||||
|
||||
___
|
||||
|
||||
@@ -295,7 +382,7 @@ the newly created dynamic code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:498](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L498)
|
||||
[services/discount.ts:456](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L456)
|
||||
|
||||
___
|
||||
|
||||
@@ -315,7 +402,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:733](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L733)
|
||||
[services/discount.ts:689](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L689)
|
||||
|
||||
___
|
||||
|
||||
@@ -335,7 +422,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:729](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L729)
|
||||
[services/discount.ts:685](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L685)
|
||||
|
||||
___
|
||||
|
||||
@@ -355,7 +442,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:723](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L723)
|
||||
[services/discount.ts:679](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L679)
|
||||
|
||||
___
|
||||
|
||||
@@ -375,7 +462,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:741](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L741)
|
||||
[services/discount.ts:697](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L697)
|
||||
|
||||
___
|
||||
|
||||
@@ -396,7 +483,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:745](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L745)
|
||||
[services/discount.ts:701](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L701)
|
||||
|
||||
___
|
||||
|
||||
@@ -419,7 +506,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:156](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L156)
|
||||
[services/discount.ts:114](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -442,7 +529,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:173](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L173)
|
||||
[services/discount.ts:133](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
@@ -467,7 +554,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:557](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L557)
|
||||
[services/discount.ts:512](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L512)
|
||||
|
||||
___
|
||||
|
||||
@@ -492,7 +579,7 @@ the discount
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:285](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L285)
|
||||
[services/discount.ts:247](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
@@ -517,7 +604,31 @@ the discount document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:313](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L313)
|
||||
[services/discount.ts:276](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L276)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -542,7 +653,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:348](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L348)
|
||||
[services/discount.ts:310](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L310)
|
||||
|
||||
___
|
||||
|
||||
@@ -563,7 +674,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:665](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L665)
|
||||
[services/discount.ts:619](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L619)
|
||||
|
||||
___
|
||||
|
||||
@@ -584,7 +695,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:599](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L599)
|
||||
[services/discount.ts:551](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L551)
|
||||
|
||||
___
|
||||
|
||||
@@ -614,24 +725,28 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:138](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L138)
|
||||
[services/discount.ts:96](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/discount.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`DiscountService`](DiscountService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`DiscountService`](DiscountService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `EntityManager` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`DiscountService`](DiscountService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/discount.ts:108](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/discount.ts#L108)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -6,7 +6,7 @@ Handles draft orders
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`DraftOrderService`](DraftOrderService.md)\>
|
||||
|
||||
↳ **`DraftOrderService`**
|
||||
|
||||
@@ -20,21 +20,149 @@ Handles draft orders
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<DraftOrderService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L15)
|
||||
[services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L51)
|
||||
|
||||
## Properties
|
||||
|
||||
### cartService\_
|
||||
|
||||
• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### draftOrderRepository\_
|
||||
|
||||
• `Protected` `Readonly` **draftOrderRepository\_**: typeof `DraftOrderRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### lineItemService\_
|
||||
|
||||
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### orderRepository\_
|
||||
|
||||
• `Protected` `Readonly` **orderRepository\_**: typeof `OrderRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### paymentRepository\_
|
||||
|
||||
• `Protected` `Readonly` **paymentRepository\_**: typeof `PaymentRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### productVariantService\_
|
||||
|
||||
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### shippingOptionService\_
|
||||
|
||||
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` **Events**: `Object`
|
||||
▪ `Static` `Readonly` **Events**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -45,10 +173,49 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L10)
|
||||
[services/draft-order.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L34)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`data`): `Promise`<`DraftOrder`\>
|
||||
@@ -59,7 +226,7 @@ Creates a draft order.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `any` | data to create draft order from |
|
||||
| `data` | `AdminPostDraftOrdersReq` | data to create draft order from |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -69,13 +236,13 @@ the created draft order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:233](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L233)
|
||||
[services/draft-order.ts:257](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L257)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`draftOrderId`): `Promise`<`any`\>
|
||||
▸ **delete**(`draftOrderId`): `Promise`<`undefined` \| `DraftOrder`\>
|
||||
|
||||
Deletes draft order idempotently.
|
||||
|
||||
@@ -87,19 +254,19 @@ Deletes draft order idempotently.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`undefined` \| `DraftOrder`\>
|
||||
|
||||
empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:135](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L135)
|
||||
[services/draft-order.ts:150](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L150)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`DraftOrder`\>
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`DraftOrder`[]\>
|
||||
|
||||
Lists draft orders
|
||||
|
||||
@@ -108,23 +275,23 @@ Lists draft orders
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | query object for find |
|
||||
| `config` | `any` | configurable attributes for find |
|
||||
| `config` | `FindConfig`<`DraftOrder`\> | configurable attributes for find |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`DraftOrder`\>
|
||||
`Promise`<`DraftOrder`[]\>
|
||||
|
||||
list of draft orders
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:215](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L215)
|
||||
[services/draft-order.ts:231](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L231)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<`DraftOrder`[]\>
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`DraftOrder`[], `number`]\>
|
||||
|
||||
Lists draft orders alongside the count
|
||||
|
||||
@@ -133,23 +300,23 @@ Lists draft orders alongside the count
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | query selector to filter draft orders |
|
||||
| `config` | `any` | query config |
|
||||
| `config` | `FindConfig`<`DraftOrder`\> | query config |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`DraftOrder`[]\>
|
||||
`Promise`<[`DraftOrder`[], `number`]\>
|
||||
|
||||
draft orders
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:161](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L161)
|
||||
[services/draft-order.ts:174](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L174)
|
||||
|
||||
___
|
||||
|
||||
### registerCartCompletion
|
||||
|
||||
▸ **registerCartCompletion**(`doId`, `orderId`): `Promise`<`any`\>
|
||||
▸ **registerCartCompletion**(`draftOrderId`, `orderId`): `Promise`<`UpdateResult`\>
|
||||
|
||||
Registers a draft order as completed, when an order has been completed.
|
||||
|
||||
@@ -157,18 +324,18 @@ Registers a draft order as completed, when an order has been completed.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `doId` | `string` | id of draft order to complete |
|
||||
| `draftOrderId` | `string` | id of draft order to complete |
|
||||
| `orderId` | `string` | id of order completed from draft order cart |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`UpdateResult`\>
|
||||
|
||||
the created order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:336](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L336)
|
||||
[services/draft-order.ts:363](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L363)
|
||||
|
||||
___
|
||||
|
||||
@@ -183,7 +350,7 @@ Retrieves a draft order with the given id.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | id of the draft order to retrieve |
|
||||
| `config` | `any` | query object for findOne |
|
||||
| `config` | `FindConfig`<`DraftOrder`\> | query object for findOne |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -193,7 +360,7 @@ the draft order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L84)
|
||||
[services/draft-order.ts:91](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -208,7 +375,7 @@ Retrieves a draft order based on its associated cart id
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `cartId` | `string` | cart id that the draft orders's cart has |
|
||||
| `config` | `any` | query object for findOne |
|
||||
| `config` | `FindConfig`<`DraftOrder`\> | query object for findOne |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -218,13 +385,37 @@ the draft order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:111](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L111)
|
||||
[services/draft-order.ts:121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`doId`, `data`): `Promise`<`DraftOrder`\>
|
||||
▸ **update**(`id`, `data`): `Promise`<`DraftOrder`\>
|
||||
|
||||
Updates a draft order with the given data
|
||||
|
||||
@@ -232,8 +423,9 @@ Updates a draft order with the given data
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `doId` | `string` | id of the draft order |
|
||||
| `data` | `DraftOrder` | values to update the order with |
|
||||
| `id` | `string` | id of the draft order |
|
||||
| `data` | `Object` | values to update the order with |
|
||||
| `data.no_notification_order` | `boolean` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -243,24 +435,28 @@ the updated draft order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:357](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L357)
|
||||
[services/draft-order.ts:392](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/draft-order.ts#L392)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`DraftOrderService`](DraftOrderService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`DraftOrderService`](DraftOrderService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`DraftOrderService`](DraftOrderService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/draft-order.js:56](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/draft-order.js#L56)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -13,148 +13,242 @@ subscribers when events happen. Events will run asynchronously.
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `__namedParameters` | `Object` | `undefined` |
|
||||
| `config` | `any` | `undefined` |
|
||||
| `__namedParameters` | `InjectedDependencies` | `undefined` |
|
||||
| `config` | `ConfigModule` | `undefined` |
|
||||
| `singleton` | `boolean` | `true` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L10)
|
||||
[services/event-bus.ts:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L38)
|
||||
|
||||
## Properties
|
||||
|
||||
### config\_
|
||||
|
||||
• **config\_**: `any`
|
||||
• `Protected` `Readonly` **config\_**: `ConfigModule`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:31](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L31)
|
||||
[services/event-bus.ts:24](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### enRun\_
|
||||
### cronHandlers\_
|
||||
|
||||
• **enRun\_**: `undefined` \| `boolean`
|
||||
• `Protected` `Readonly` **cronHandlers\_**: `Map`<`string` \| `symbol`, `Subscriber`<`unknown`\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:182](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L182)
|
||||
[services/event-bus.ts:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### cronQueue\_
|
||||
|
||||
• `Protected` `Readonly` **cronQueue\_**: `Bull`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### enqueue\_
|
||||
|
||||
• **enqueue\_**: `undefined` \| `Promise`<`void`\>
|
||||
• `Protected` **enqueue\_**: `Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:183](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L183)
|
||||
[services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### logger\_
|
||||
|
||||
• `Protected` `Readonly` **logger\_**: `Logger`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:26](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` `Readonly` **manager\_**: `EntityManager`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### observers\_
|
||||
|
||||
• `Protected` `Readonly` **observers\_**: `Map`<`string` \| `symbol`, `Subscriber`<`unknown`\>[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### queue\_
|
||||
|
||||
• `Protected` **queue\_**: `Bull`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### redisClient\_
|
||||
|
||||
• **redisClient\_**: `any`
|
||||
• `Protected` `Readonly` **redisClient\_**: `Redis`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:51](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L51)
|
||||
[services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### redisSubscriber\_
|
||||
|
||||
• **redisSubscriber\_**: `any`
|
||||
• `Protected` `Readonly` **redisSubscriber\_**: `Redis`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L52)
|
||||
[services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### shouldEnqueuerRun
|
||||
|
||||
• `Protected` **shouldEnqueuerRun**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### stagedJobRepository\_
|
||||
|
||||
• **stagedJobRepository\_**: `any`
|
||||
• `Protected` `Readonly` **stagedJobRepository\_**: typeof `StagedJobRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:39](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L39)
|
||||
[services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L35)
|
||||
|
||||
## Methods
|
||||
|
||||
### createCronJob
|
||||
|
||||
▸ **createCronJob**(`eventName`, `data`, `cron`, `handler`): `void`
|
||||
▸ **createCronJob**<`T`\>(`eventName`, `data`, `cron`, `handler`): `void`
|
||||
|
||||
Registers a cron job.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `string` | the name of the event |
|
||||
| `data` | `any` | the data to be sent with the event |
|
||||
| `data` | `T` | the data to be sent with the event |
|
||||
| `cron` | `string` | the cron pattern |
|
||||
| `handler` | `Function` | the handler to call on each cron job |
|
||||
| `handler` | `Subscriber`<`unknown`\> | the handler to call on each cron job |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
void
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:280](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L280)
|
||||
[services/event-bus.ts:308](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L308)
|
||||
|
||||
___
|
||||
|
||||
### cronWorker\_
|
||||
|
||||
▸ **cronWorker_**(`job`): `Promise`<`any`\>
|
||||
▸ **cronWorker_**<`T`\>(`job`): `Promise`<`unknown`[]\>
|
||||
|
||||
Handles incoming jobs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `job` | `any` | The job object |
|
||||
| `job` | `Object` | The job object |
|
||||
| `job.data` | `Object` | - |
|
||||
| `job.data.data` | `T` | - |
|
||||
| `job.data.eventName` | `string` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`unknown`[]\>
|
||||
|
||||
resolves to the results of the subscriber calls.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:255](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L255)
|
||||
[services/event-bus.ts:281](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L281)
|
||||
|
||||
___
|
||||
|
||||
### emit
|
||||
|
||||
▸ **emit**(`eventName`, `data`, `options?`): `BullJob`
|
||||
▸ **emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\>
|
||||
|
||||
Calls all subscribers when an event occurs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `string` | the name of the event to be process. |
|
||||
| `data` | `any` | the data to send to the subscriber. |
|
||||
| `options` | `any` | options to add the job with |
|
||||
| `data` | `T` | the data to send to the subscriber. |
|
||||
| `options` | `Object` | options to add the job with |
|
||||
| `options.delay?` | `number` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`BullJob`
|
||||
`Promise`<`void` \| `StagedJob`\>
|
||||
|
||||
- the job from our queue
|
||||
the job from our queue
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:154](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L154)
|
||||
[services/event-bus.ts:179](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L179)
|
||||
|
||||
___
|
||||
|
||||
@@ -168,13 +262,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:191](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L191)
|
||||
[services/event-bus.ts:215](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
### registerCronHandler\_
|
||||
|
||||
▸ **registerCronHandler_**(`event`, `subscriber`): `void`
|
||||
▸ `Protected` **registerCronHandler_**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
@@ -182,8 +276,24 @@ Adds a function to a list of event subscribers.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `event` | `string` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `func` | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
| `event` | `string` \| `symbol` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`EventBusService`](EventBusService.md)
|
||||
|
||||
this
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:158](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L158)
|
||||
|
||||
___
|
||||
|
||||
### startEnqueuer
|
||||
|
||||
▸ **startEnqueuer**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -191,41 +301,7 @@ Adds a function to a list of event subscribers.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:135](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L135)
|
||||
|
||||
___
|
||||
|
||||
### sleep
|
||||
|
||||
▸ **sleep**(`ms`): `Promise`<`any`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `ms` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:175](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L175)
|
||||
|
||||
___
|
||||
|
||||
### startEnqueuer
|
||||
|
||||
▸ **startEnqueuer**(): `Promise`<`void`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:181](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L181)
|
||||
[services/event-bus.ts:205](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
@@ -239,13 +315,13 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:186](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L186)
|
||||
[services/event-bus.ts:210](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L210)
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
|
||||
▸ **subscribe**(`event`, `subscriber`): `void`
|
||||
▸ **subscribe**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
@@ -253,22 +329,24 @@ Adds a function to a list of event subscribers.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `event` | `string` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `func` | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
| `event` | `string` \| `symbol` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
[`EventBusService`](EventBusService.md)
|
||||
|
||||
this
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:98](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L98)
|
||||
[services/event-bus.ts:118](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L118)
|
||||
|
||||
___
|
||||
|
||||
### unsubscribe
|
||||
|
||||
▸ **unsubscribe**(`event`, `subscriber`): `void`
|
||||
▸ **unsubscribe**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
@@ -276,16 +354,18 @@ Adds a function to a list of event subscribers.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `event` | `string` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `func` | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
| `event` | `string` \| `symbol` | the event that the subscriber will listen for. |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
[`EventBusService`](EventBusService.md)
|
||||
|
||||
this
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:116](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L116)
|
||||
[services/event-bus.ts:136](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
@@ -305,28 +385,37 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:69](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L69)
|
||||
[services/event-bus.ts:88](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
### worker\_
|
||||
|
||||
▸ **worker_**(`job`): `Promise`<`any`\>
|
||||
▸ **worker_**<`T`\>(`job`): `Promise`<`unknown`[]\>
|
||||
|
||||
Handles incoming jobs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `job` | `any` | The job object |
|
||||
| `job` | `Object` | The job object |
|
||||
| `job.data` | `Object` | - |
|
||||
| `job.data.data` | `T` | - |
|
||||
| `job.data.eventName` | `string` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`unknown`[]\>
|
||||
|
||||
resolves to the results of the subscriber calls.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.js:226](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/event-bus.js#L226)
|
||||
[services/event-bus.ts:250](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L250)
|
||||
|
||||
@@ -16,7 +16,7 @@ Helps retrive fulfillment providers
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:7](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L7)
|
||||
[services/fulfillment-provider.js:7](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L7)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -38,7 +38,7 @@ Helps retrive fulfillment providers
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:79](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L79)
|
||||
[services/fulfillment-provider.js:79](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L79)
|
||||
|
||||
___
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:64](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L64)
|
||||
[services/fulfillment-provider.js:64](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,7 +78,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:74](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L74)
|
||||
[services/fulfillment-provider.js:74](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L74)
|
||||
|
||||
___
|
||||
|
||||
@@ -101,7 +101,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:59](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L59)
|
||||
[services/fulfillment-provider.js:59](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -121,7 +121,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:89](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L89)
|
||||
[services/fulfillment-provider.js:89](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -135,7 +135,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:23](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L23)
|
||||
[services/fulfillment-provider.js:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -155,7 +155,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L30)
|
||||
[services/fulfillment-provider.js:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -175,7 +175,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:12](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L12)
|
||||
[services/fulfillment-provider.js:12](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L12)
|
||||
|
||||
___
|
||||
|
||||
@@ -199,7 +199,7 @@ Fetches documents from the fulfillment provider
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:102](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L102)
|
||||
[services/fulfillment-provider.js:102](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -221,7 +221,7 @@ the payment fulfillment provider
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:48](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L48)
|
||||
[services/fulfillment-provider.js:48](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L48)
|
||||
|
||||
___
|
||||
|
||||
@@ -243,7 +243,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:69](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L69)
|
||||
[services/fulfillment-provider.js:69](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L69)
|
||||
|
||||
___
|
||||
|
||||
@@ -263,4 +263,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment-provider.js:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment-provider.js#L84)
|
||||
[services/fulfillment-provider.js:84](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment-provider.js#L84)
|
||||
|
||||
@@ -4,7 +4,7 @@ Handles Fulfillments
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`FulfillmentService`](FulfillmentService.md)\>
|
||||
|
||||
↳ **`FulfillmentService`**
|
||||
|
||||
@@ -18,21 +18,178 @@ Handles Fulfillments
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<FulfillmentService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L9)
|
||||
[services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L47)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### fulfillmentProviderService\_
|
||||
|
||||
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### fulfillmentRepository\_
|
||||
|
||||
• `Protected` `Readonly` **fulfillmentRepository\_**: typeof `FulfillmentRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### lineItemRepository\_
|
||||
|
||||
• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### lineItemService\_
|
||||
|
||||
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### shippingProfileService\_
|
||||
|
||||
• `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### totalsService\_
|
||||
|
||||
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### trackingLinkRepository\_
|
||||
|
||||
• `Protected` `Readonly` **trackingLinkRepository\_**: typeof `TrackingLinkRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### cancelFulfillment
|
||||
|
||||
▸ **cancelFulfillment**(`fulfillmentOrId`): `Promise`<`any`\>
|
||||
▸ **cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Cancels a fulfillment with the fulfillment provider. Will decrement the
|
||||
fulfillment_quantity on the line items associated with the fulfillment.
|
||||
@@ -42,23 +199,23 @@ Throws if the fulfillment has already been shipped.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fulfillmentOrId` | `any` | the fulfillment object or id. |
|
||||
| `fulfillmentOrId` | `string` \| `Fulfillment` | the fulfillment object or id. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the result of the save operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:223](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L223)
|
||||
[services/fulfillment.ts:254](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L254)
|
||||
|
||||
___
|
||||
|
||||
### createFulfillment
|
||||
|
||||
▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Fulfillment`[]
|
||||
▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\>
|
||||
|
||||
Creates an order fulfillment
|
||||
If items needs to be fulfilled by different provider, we make
|
||||
@@ -69,25 +226,25 @@ those partitions.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `order` | `Order` | order to create fulfillment for |
|
||||
| `itemsToFulfill` | { `item_id`: `string` ; `quantity`: `number` }[] | - |
|
||||
| `custom` | `any` | potential custom values to add |
|
||||
| `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
|
||||
|
||||
`Fulfillment`[]
|
||||
`Promise`<`Fulfillment`[]\>
|
||||
|
||||
the created fulfillments
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:171](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L171)
|
||||
[services/fulfillment.ts:199](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L199)
|
||||
|
||||
___
|
||||
|
||||
### createShipment
|
||||
|
||||
▸ **createShipment**(`fulfillmentId`, `trackingLinks`, `config?`): `Fulfillment`
|
||||
▸ **createShipment**(`fulfillmentId`, `trackingLinks`, `config?`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Creates a shipment by marking a fulfillment as shipped. Adds
|
||||
tracking links and potentially more metadata.
|
||||
@@ -96,25 +253,25 @@ tracking links and potentially more metadata.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fulfillmentId` | `Order` | the fulfillment to ship |
|
||||
| `trackingLinks` | `TrackingLink`[] | tracking links for the shipment |
|
||||
| `config` | `any` | potential configuration settings, such as no_notification and metadata |
|
||||
| `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
|
||||
|
||||
`Fulfillment`
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the shipped fulfillment
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:270](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L270)
|
||||
[services/fulfillment.ts:304](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L304)
|
||||
|
||||
___
|
||||
|
||||
### getFulfillmentItems\_
|
||||
|
||||
▸ **getFulfillmentItems_**(`order`, `items`, `transformer`): `Promise`<`LineItem`[]\>
|
||||
▸ **getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\>
|
||||
|
||||
Retrieves the order line items, given an array of items.
|
||||
|
||||
@@ -122,48 +279,45 @@ Retrieves the order line items, given an array of items.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `order` | `Order` | the order to get line items from |
|
||||
| `items` | `Object` | the items to get |
|
||||
| `items.item_id` | `string` | - |
|
||||
| `items.quantity` | `number` | - |
|
||||
| `transformer` | `Function` | a function to apply to each of the items retrieved from the order, should return a line item. If the transformer returns an undefined value the line item will be filtered from the returned array. |
|
||||
| `order` | `CreateFulfillmentOrder` | the order to get line items from |
|
||||
| `items` | `FulFillmentItemType`[] | the items to get |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`LineItem`[]\>
|
||||
`Promise`<(``null`` \| `LineItem`)[]\>
|
||||
|
||||
the line items generated by the transformer.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:94](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L94)
|
||||
[services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L109)
|
||||
|
||||
___
|
||||
|
||||
### partitionItems\_
|
||||
|
||||
▸ **partitionItems_**(`shippingMethods`, `items`): { `shipping_method`: `any` = method }[]
|
||||
▸ **partitionItems_**(`shippingMethods`, `items`): `FulfillmentItemPartition`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `shippingMethods` | `any` |
|
||||
| `items` | `any` |
|
||||
| `shippingMethods` | `ShippingMethod`[] |
|
||||
| `items` | `LineItem`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
{ `shipping_method`: `any` = method }[]
|
||||
`FulfillmentItemPartition`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:62](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L62)
|
||||
[services/fulfillment.ts:71](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`id`, `config?`): `Fulfillment`
|
||||
▸ **retrieve**(`id`, `config?`): `Promise`<`Fulfillment`\>
|
||||
|
||||
Retrieves a fulfillment by its id.
|
||||
|
||||
@@ -172,23 +326,47 @@ Retrieves a fulfillment by its id.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | the id of the fulfillment to retrieve |
|
||||
| `config` | `any` | optional values to include with fulfillmentRepository query |
|
||||
| `config` | `FindConfig`<`Fulfillment`\> | optional values to include with fulfillmentRepository query |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Fulfillment`
|
||||
`Promise`<`Fulfillment`\>
|
||||
|
||||
the fulfillment
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:142](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L142)
|
||||
[services/fulfillment.ts:166](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### validateFulfillmentLineItem\_
|
||||
|
||||
▸ **validateFulfillmentLineItem_**(`item`, `quantity`): `LineItem`
|
||||
▸ **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.
|
||||
@@ -199,36 +377,40 @@ quantity from the quantity that was originally purchased.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `item` | `LineItem` | the line item to check has sufficient fulfillable quantity. |
|
||||
| `item` | `undefined` \| `LineItem` | the line item to check has sufficient fulfillable quantity. |
|
||||
| `quantity` | `number` | the quantity that is requested to be fulfilled. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`LineItem`
|
||||
``null`` \| `LineItem`
|
||||
|
||||
a line item that has the requested fulfillment quantity
|
||||
set.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:116](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L116)
|
||||
[services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/fulfillment.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`FulfillmentService`](FulfillmentService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`FulfillmentService`](FulfillmentService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`FulfillmentService`](FulfillmentService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/fulfillment.js:42](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/fulfillment.js#L42)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -4,7 +4,7 @@ Provides layer to manipulate gift cards.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`GiftCardService`](GiftCardService.md)\>
|
||||
|
||||
↳ **`GiftCardService`**
|
||||
|
||||
@@ -18,18 +18,106 @@ Provides layer to manipulate gift cards.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<GiftCardService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L15)
|
||||
[services/gift-card.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L46)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### giftCardRepository\_
|
||||
|
||||
• `Protected` `Readonly` **giftCardRepository\_**: typeof `GiftCardRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### giftCardTransactionRepo\_
|
||||
|
||||
• `Protected` `Readonly` **giftCardTransactionRepo\_**: typeof `GiftCardTransactionRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### regionService\_
|
||||
|
||||
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` **Events**: `Object`
|
||||
@@ -42,10 +130,49 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:11](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L11)
|
||||
[services/gift-card.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L42)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`giftCard`): `Promise`<`GiftCard`\>
|
||||
@@ -56,7 +183,7 @@ Creates a gift card with provided data given that the data is validated.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `giftCard` | `GiftCard` | the gift card data to create |
|
||||
| `giftCard` | `CreateGiftCardInput` | the gift card data to create |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -66,33 +193,33 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:134](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L134)
|
||||
[services/gift-card.ts:155](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
### createTransaction
|
||||
|
||||
▸ **createTransaction**(`data`): `Promise`<`any`\>
|
||||
▸ **createTransaction**(`data`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `data` | `any` |
|
||||
| `data` | `CreateGiftCardTransactionInput` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:120](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L120)
|
||||
[services/gift-card.ts:139](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`giftCardId`): `Promise`<`any`\>
|
||||
▸ **delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\>
|
||||
|
||||
Deletes a gift card idempotently
|
||||
|
||||
@@ -104,54 +231,59 @@ Deletes a gift card idempotently
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void` \| `GiftCard`\>
|
||||
|
||||
the result of the delete operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:288](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L288)
|
||||
|
||||
___
|
||||
|
||||
### generateCode\_
|
||||
|
||||
▸ **generateCode_**(): `string`
|
||||
|
||||
Generates a 16 character gift card code
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
the generated gift card code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:62](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L62)
|
||||
[services/gift-card.ts:288](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L288)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector?`, `config?`): `Promise`<`any`\>
|
||||
▸ **list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | the configuration used to find the objects. contains relations, skip, and take. |
|
||||
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`GiftCard`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:78](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L78)
|
||||
[services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`GiftCard`[], `number`]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:84](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -166,7 +298,7 @@ Gets a gift card by id.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `giftCardId` | `string` | id of gift card to retrieve |
|
||||
| `config` | `any` | optional values to include with gift card query |
|
||||
| `config` | `FindConfig`<`GiftCard`\> | optional values to include with gift card query |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -176,34 +308,79 @@ the gift card
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:175](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L175)
|
||||
[services/gift-card.ts:220](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L220)
|
||||
|
||||
___
|
||||
|
||||
### retrieveByCode
|
||||
|
||||
▸ **retrieveByCode**(`code`, `config?`): `Promise`<`any`\>
|
||||
▸ **retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `code` | `any` |
|
||||
| `config` | `Object` |
|
||||
| `code` | `string` |
|
||||
| `config` | `FindConfig`<`GiftCard`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`GiftCard`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:209](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L209)
|
||||
[services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L229)
|
||||
|
||||
___
|
||||
|
||||
### retrieve\_
|
||||
|
||||
▸ `Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `selector` | `Selector`<`GiftCard`\> |
|
||||
| `config` | `FindConfig`<`GiftCard`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`GiftCard`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:185](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L185)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`giftCardId`, `update`): `Promise`<`any`\>
|
||||
▸ **update**(`giftCardId`, `update`): `Promise`<`GiftCard`\>
|
||||
|
||||
Updates a giftCard.
|
||||
|
||||
@@ -212,34 +389,56 @@ Updates a giftCard.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `giftCardId` | `string` | giftCard id of giftCard to update |
|
||||
| `update` | `GiftCard` | the data to update the giftCard with |
|
||||
| `update` | `UpdateGiftCardInput` | the data to update the giftCard with |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`GiftCard`\>
|
||||
|
||||
the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:247](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L247)
|
||||
[services/gift-card.ts:244](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L244)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`GiftCardService`](GiftCardService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`GiftCardService`](GiftCardService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.js:40](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/gift-card.js#L40)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### generateCode
|
||||
|
||||
▸ `Static` **generateCode**(): `string`
|
||||
|
||||
Generates a 16 character gift card code
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
the generated gift card code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/gift-card.ts:68](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/gift-card.ts#L68)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:8](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L8)
|
||||
[services/idempotency-key.js:8](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -50,7 +50,7 @@ the created idempotency key
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:55](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L55)
|
||||
[services/idempotency-key.js:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -77,7 +77,7 @@ the existing or created idempotency key
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:29](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L29)
|
||||
[services/idempotency-key.js:26](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -101,7 +101,7 @@ result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:94](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L94)
|
||||
[services/idempotency-key.js:90](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L90)
|
||||
|
||||
___
|
||||
|
||||
@@ -125,7 +125,7 @@ idempotency key
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:76](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L76)
|
||||
[services/idempotency-key.js:73](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -150,7 +150,7 @@ result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:121](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L121)
|
||||
[services/idempotency-key.js:117](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L117)
|
||||
|
||||
___
|
||||
|
||||
@@ -179,4 +179,4 @@ new updated idempotency key
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/idempotency-key.js:148](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/idempotency-key.js#L148)
|
||||
[services/idempotency-key.js:144](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/idempotency-key.js#L144)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/inventory.js#L5)
|
||||
[services/inventory.js:5](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/inventory.js#L5)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -49,7 +49,7 @@ resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/inventory.js#L36)
|
||||
[services/inventory.js:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/inventory.js#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ true if the inventory covers the quantity
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:62](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/inventory.js#L62)
|
||||
[services/inventory.js:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/inventory.js#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,4 +96,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/inventory.js#L15)
|
||||
[services/inventory.js:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/inventory.js#L15)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L38)
|
||||
[services/line-item.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L44)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:32](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L32)
|
||||
[services/line-item.ts:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:31](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L31)
|
||||
[services/line-item.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L36)
|
||||
[services/line-item.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L30)
|
||||
[services/line-item.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:29](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L29)
|
||||
[services/line-item.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
@@ -86,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:34](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L34)
|
||||
[services/line-item.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:33](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L33)
|
||||
[services/line-item.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +106,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:35](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L35)
|
||||
[services/line-item.ts:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L41)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -130,7 +130,7 @@ the created line item
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:261](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L261)
|
||||
[services/line-item.ts:270](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L270)
|
||||
|
||||
___
|
||||
|
||||
@@ -156,7 +156,7 @@ the created line items
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:133](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L133)
|
||||
[services/line-item.ts:142](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
@@ -180,7 +180,7 @@ the result of the delete operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:309](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L309)
|
||||
[services/line-item.ts:318](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L318)
|
||||
|
||||
___
|
||||
|
||||
@@ -207,7 +207,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:186](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L186)
|
||||
[services/line-item.ts:195](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L195)
|
||||
|
||||
___
|
||||
|
||||
@@ -232,7 +232,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:81](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L81)
|
||||
[services/line-item.ts:90](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L90)
|
||||
|
||||
___
|
||||
|
||||
@@ -257,7 +257,7 @@ the line item
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:102](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L102)
|
||||
[services/line-item.ts:111](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
@@ -282,7 +282,7 @@ the update line item
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:280](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L280)
|
||||
[services/line-item.ts:289](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L289)
|
||||
|
||||
___
|
||||
|
||||
@@ -302,4 +302,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/line-item.ts:60](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/line-item.ts#L60)
|
||||
[services/line-item.ts:68](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/line-item.ts#L68)
|
||||
|
||||
@@ -16,7 +16,7 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:7](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L7)
|
||||
[services/middleware.js:7](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L7)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -26,7 +26,7 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:8](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L8)
|
||||
[services/middleware.js:8](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -36,7 +36,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L9)
|
||||
[services/middleware.js:9](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L9)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L10)
|
||||
[services/middleware.js:10](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L10)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:11](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L11)
|
||||
[services/middleware.js:11](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L11)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -79,7 +79,7 @@ Adds a middleware function to be called after authentication is completed.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:45](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L45)
|
||||
[services/middleware.js:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -102,7 +102,7 @@ Adds a middleware function to be called before authentication is completed.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:61](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L61)
|
||||
[services/middleware.js:61](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -124,7 +124,7 @@ Adds a middleware function to be called before cart creation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:75](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L75)
|
||||
[services/middleware.js:75](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -145,7 +145,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L14)
|
||||
[services/middleware.js:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -165,7 +165,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:19](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L19)
|
||||
[services/middleware.js:19](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -187,7 +187,7 @@ Adds post authentication middleware to an express app.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:85](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L85)
|
||||
[services/middleware.js:85](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L85)
|
||||
|
||||
___
|
||||
|
||||
@@ -209,7 +209,7 @@ Adds pre authentication middleware to an express app.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:96](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L96)
|
||||
[services/middleware.js:96](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -223,7 +223,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:102](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L102)
|
||||
[services/middleware.js:102](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L102)
|
||||
|
||||
___
|
||||
|
||||
@@ -245,4 +245,4 @@ Validates a middleware function, throws if fn is not of type function.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/middleware.js:28](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/middleware.js#L28)
|
||||
[services/middleware.js:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/middleware.js#L28)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:12](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L12)
|
||||
[services/note.js:12](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L12)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -42,7 +42,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:6](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L6)
|
||||
[services/note.js:6](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L6)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -67,7 +67,7 @@ resolves to the creation result
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:98](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L98)
|
||||
[services/note.js:98](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -89,7 +89,7 @@ Deletes a given note
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:154](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L154)
|
||||
[services/note.js:154](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L154)
|
||||
|
||||
___
|
||||
|
||||
@@ -117,7 +117,7 @@ notes related to the given search.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:77](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L77)
|
||||
[services/note.js:77](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L77)
|
||||
|
||||
___
|
||||
|
||||
@@ -142,7 +142,7 @@ which resolves to the requested note.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:51](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L51)
|
||||
[services/note.js:51](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -167,7 +167,7 @@ resolves to the updated element
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:131](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L131)
|
||||
[services/note.js:131](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L131)
|
||||
|
||||
___
|
||||
|
||||
@@ -191,4 +191,4 @@ a cloned note service
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/note.js:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/note.js#L30)
|
||||
[services/note.js:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/note.js#L30)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L9)
|
||||
[services/notification.js:9](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L9)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L30)
|
||||
[services/notification.js:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:19](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L19)
|
||||
[services/notification.js:19](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:23](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L23)
|
||||
[services/notification.js:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L27)
|
||||
[services/notification.js:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:29](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L29)
|
||||
[services/notification.js:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L29)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -103,7 +103,7 @@ order to allow for resends. Will log any errors that are encountered.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:166](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L166)
|
||||
[services/notification.js:166](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L166)
|
||||
|
||||
___
|
||||
|
||||
@@ -128,7 +128,7 @@ the notifications that satisfy the query.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L84)
|
||||
[services/notification.js:84](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -151,7 +151,7 @@ used to generate on demand invoices or other documents.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L38)
|
||||
[services/notification.js:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -173,7 +173,7 @@ Takes a list of notification provider ids and persists them in the database.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:68](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L68)
|
||||
[services/notification.js:68](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L68)
|
||||
|
||||
___
|
||||
|
||||
@@ -199,7 +199,7 @@ the newly created notification
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:237](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L237)
|
||||
[services/notification.js:237](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L237)
|
||||
|
||||
___
|
||||
|
||||
@@ -224,7 +224,7 @@ the notification
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:101](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L101)
|
||||
[services/notification.js:101](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -249,7 +249,7 @@ the notification provider
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:147](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L147)
|
||||
[services/notification.js:147](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L147)
|
||||
|
||||
___
|
||||
|
||||
@@ -276,7 +276,7 @@ the created notification
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:195](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L195)
|
||||
[services/notification.js:195](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L195)
|
||||
|
||||
___
|
||||
|
||||
@@ -299,7 +299,7 @@ Subscribes a given provider to an event.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:126](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L126)
|
||||
[services/notification.js:126](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L126)
|
||||
|
||||
___
|
||||
|
||||
@@ -323,4 +323,4 @@ a cloned notification service
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/notification.js:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/notification.js#L47)
|
||||
[services/notification.js:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/notification.js#L47)
|
||||
|
||||
@@ -24,7 +24,7 @@ OauthService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L10)
|
||||
[services/oauth.js:10](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -34,7 +34,7 @@ OauthService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L15)
|
||||
[services/oauth.js:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:17](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L17)
|
||||
[services/oauth.js:17](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L14)
|
||||
[services/oauth.js:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L16)
|
||||
[services/oauth.js:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -81,7 +81,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L5)
|
||||
[services/oauth.js:5](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L5)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -101,7 +101,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:32](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L32)
|
||||
[services/oauth.js:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -123,7 +123,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:66](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L66)
|
||||
[services/oauth.js:66](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L66)
|
||||
|
||||
___
|
||||
|
||||
@@ -143,7 +143,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L27)
|
||||
[services/oauth.js:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -163,7 +163,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:96](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L96)
|
||||
[services/oauth.js:96](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -183,7 +183,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:56](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L56)
|
||||
[services/oauth.js:56](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L56)
|
||||
|
||||
___
|
||||
|
||||
@@ -203,7 +203,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:20](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L20)
|
||||
[services/oauth.js:20](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -224,4 +224,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/oauth.js:45](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/oauth.js#L45)
|
||||
[services/oauth.js:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/oauth.js#L45)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:25](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L25)
|
||||
[services/order.js:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L25)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -55,7 +55,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:6](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L6)
|
||||
[services/order.js:6](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L6)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -78,7 +78,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:806](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L806)
|
||||
[services/order.js:806](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L806)
|
||||
|
||||
___
|
||||
|
||||
@@ -103,7 +103,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1301](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1301)
|
||||
[services/order.js:1301](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1301)
|
||||
|
||||
___
|
||||
|
||||
@@ -129,7 +129,7 @@ result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:952](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L952)
|
||||
[services/order.js:952](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L952)
|
||||
|
||||
___
|
||||
|
||||
@@ -153,7 +153,7 @@ updated order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1242](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1242)
|
||||
[services/order.js:1242](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1242)
|
||||
|
||||
___
|
||||
|
||||
@@ -177,7 +177,7 @@ result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1021](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1021)
|
||||
[services/order.js:1021](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1021)
|
||||
|
||||
___
|
||||
|
||||
@@ -199,7 +199,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:429](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L429)
|
||||
[services/order.js:429](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L429)
|
||||
|
||||
___
|
||||
|
||||
@@ -223,7 +223,7 @@ resolves to the creation result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:723](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L723)
|
||||
[services/order.js:723](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L723)
|
||||
|
||||
___
|
||||
|
||||
@@ -247,7 +247,7 @@ resolves to the creation result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:465](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L465)
|
||||
[services/order.js:465](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L465)
|
||||
|
||||
___
|
||||
|
||||
@@ -276,7 +276,7 @@ result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1121](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1121)
|
||||
[services/order.js:1121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1121)
|
||||
|
||||
___
|
||||
|
||||
@@ -304,7 +304,7 @@ the result of the refund operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1328](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1328)
|
||||
[services/order.js:1328](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1328)
|
||||
|
||||
___
|
||||
|
||||
@@ -333,7 +333,7 @@ the resulting order following the update.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:643](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L643)
|
||||
[services/order.js:643](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L643)
|
||||
|
||||
___
|
||||
|
||||
@@ -354,7 +354,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1377](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1377)
|
||||
[services/order.js:1377](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1377)
|
||||
|
||||
___
|
||||
|
||||
@@ -379,7 +379,7 @@ resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1550](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1550)
|
||||
[services/order.js:1550](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1550)
|
||||
|
||||
___
|
||||
|
||||
@@ -403,7 +403,7 @@ the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:417](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L417)
|
||||
[services/order.js:417](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L417)
|
||||
|
||||
___
|
||||
|
||||
@@ -431,7 +431,7 @@ the line items generated by the transformer.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1284](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1284)
|
||||
[services/order.js:1284](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1284)
|
||||
|
||||
___
|
||||
|
||||
@@ -454,7 +454,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:148](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L148)
|
||||
[services/order.js:148](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L148)
|
||||
|
||||
___
|
||||
|
||||
@@ -479,7 +479,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:173](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L173)
|
||||
[services/order.js:173](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L173)
|
||||
|
||||
___
|
||||
|
||||
@@ -511,7 +511,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1473](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1473)
|
||||
[services/order.js:1473](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1473)
|
||||
|
||||
___
|
||||
|
||||
@@ -536,7 +536,7 @@ the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:305](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L305)
|
||||
[services/order.js:305](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L305)
|
||||
|
||||
___
|
||||
|
||||
@@ -561,7 +561,7 @@ the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:343](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L343)
|
||||
[services/order.js:343](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L343)
|
||||
|
||||
___
|
||||
|
||||
@@ -586,7 +586,7 @@ the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:380](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L380)
|
||||
[services/order.js:380](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L380)
|
||||
|
||||
___
|
||||
|
||||
@@ -606,7 +606,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:234](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L234)
|
||||
[services/order.js:234](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L234)
|
||||
|
||||
___
|
||||
|
||||
@@ -633,7 +633,7 @@ resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:864](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L864)
|
||||
[services/order.js:864](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L864)
|
||||
|
||||
___
|
||||
|
||||
@@ -658,7 +658,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:744](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L744)
|
||||
[services/order.js:744](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L744)
|
||||
|
||||
___
|
||||
|
||||
@@ -683,7 +683,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:779](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L779)
|
||||
[services/order.js:779](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L779)
|
||||
|
||||
___
|
||||
|
||||
@@ -712,7 +712,7 @@ a line item that has the requested fulfillment quantity
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:1091](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L1091)
|
||||
[services/order.js:1091](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L1091)
|
||||
|
||||
___
|
||||
|
||||
@@ -736,7 +736,7 @@ the validated id
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:139](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L139)
|
||||
[services/order.js:139](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L139)
|
||||
|
||||
___
|
||||
|
||||
@@ -756,4 +756,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/order.js:102](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/order.js#L102)
|
||||
[services/order.js:102](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/order.js#L102)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:8](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L8)
|
||||
[services/payment-provider.js:8](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L8)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L14)
|
||||
[services/payment-provider.js:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:18](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L18)
|
||||
[services/payment-provider.js:18](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L16)
|
||||
[services/payment-provider.js:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:20](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L20)
|
||||
[services/payment-provider.js:20](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L20)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -87,7 +87,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:283](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L283)
|
||||
[services/payment-provider.js:283](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L283)
|
||||
|
||||
___
|
||||
|
||||
@@ -107,7 +107,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:324](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L324)
|
||||
[services/payment-provider.js:324](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L324)
|
||||
|
||||
___
|
||||
|
||||
@@ -127,7 +127,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:343](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L343)
|
||||
[services/payment-provider.js:343](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L343)
|
||||
|
||||
___
|
||||
|
||||
@@ -147,7 +147,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:246](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L246)
|
||||
[services/payment-provider.js:246](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L246)
|
||||
|
||||
___
|
||||
|
||||
@@ -172,7 +172,7 @@ the payment session
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:121](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L121)
|
||||
[services/payment-provider.js:121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -192,7 +192,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:202](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L202)
|
||||
[services/payment-provider.js:202](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L202)
|
||||
|
||||
___
|
||||
|
||||
@@ -212,7 +212,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:338](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L338)
|
||||
[services/payment-provider.js:338](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L338)
|
||||
|
||||
___
|
||||
|
||||
@@ -226,7 +226,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L47)
|
||||
[services/payment-provider.js:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -251,7 +251,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:80](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L80)
|
||||
[services/payment-provider.js:80](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L80)
|
||||
|
||||
___
|
||||
|
||||
@@ -277,7 +277,7 @@ the payment session
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:152](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L152)
|
||||
[services/payment-provider.js:152](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -300,7 +300,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:358](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L358)
|
||||
[services/payment-provider.js:358](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L358)
|
||||
|
||||
___
|
||||
|
||||
@@ -320,7 +320,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:35](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L35)
|
||||
[services/payment-provider.js:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L35)
|
||||
|
||||
___
|
||||
|
||||
@@ -341,7 +341,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:54](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L54)
|
||||
[services/payment-provider.js:54](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L54)
|
||||
|
||||
___
|
||||
|
||||
@@ -365,7 +365,7 @@ the payment provider
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:228](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L228)
|
||||
[services/payment-provider.js:228](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L228)
|
||||
|
||||
___
|
||||
|
||||
@@ -386,7 +386,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:422](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L422)
|
||||
[services/payment-provider.js:422](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L422)
|
||||
|
||||
___
|
||||
|
||||
@@ -407,7 +407,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:89](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L89)
|
||||
[services/payment-provider.js:89](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -428,7 +428,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:266](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L266)
|
||||
[services/payment-provider.js:266](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L266)
|
||||
|
||||
___
|
||||
|
||||
@@ -453,7 +453,7 @@ the updated payment session
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:188](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L188)
|
||||
[services/payment-provider.js:188](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L188)
|
||||
|
||||
___
|
||||
|
||||
@@ -474,7 +474,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:308](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L308)
|
||||
[services/payment-provider.js:308](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L308)
|
||||
|
||||
___
|
||||
|
||||
@@ -494,4 +494,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/payment-provider.js:23](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/payment-provider.js#L23)
|
||||
[services/payment-provider.js:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/payment-provider.js#L23)
|
||||
|
||||
499
docs/content/references/services/classes/PricingService.md
Normal file
499
docs/content/references/services/classes/PricingService.md
Normal file
@@ -0,0 +1,499 @@
|
||||
# Class: PricingService
|
||||
|
||||
Allows retrieval of prices.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `TransactionBaseService`<[`PricingService`](PricingService.md)\>
|
||||
|
||||
↳ **`PricingService`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new PricingService**(`__namedParameters`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService<PricingService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### priceSelectionStrategy
|
||||
|
||||
• `Protected` `Readonly` **priceSelectionStrategy**: `IPriceSelectionStrategy`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### productVariantService
|
||||
|
||||
• `Protected` `Readonly` **productVariantService**: [`ProductVariantService`](ProductVariantService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### regionService
|
||||
|
||||
• `Protected` `Readonly` **regionService**: [`RegionService`](RegionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### taxProviderService
|
||||
|
||||
• `Protected` `Readonly` **taxProviderService**: [`TaxProviderService`](TaxProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L34)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### calculateTaxes
|
||||
|
||||
▸ **calculateTaxes**(`variantPricing`, `productRates`): `Promise`<`TaxedPricing`\>
|
||||
|
||||
Gets the prices for a product variant
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variantPricing` | `ProductVariantPricing` | the prices retrieved from a variant |
|
||||
| `productRates` | `TaxServiceRate`[] | the tax rates that the product has applied |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`TaxedPricing`\>
|
||||
|
||||
The tax related variant prices.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:102](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
### collectPricingContext
|
||||
|
||||
▸ **collectPricingContext**(`context`): `Promise`<`PricingContext`\>
|
||||
|
||||
Collects additional information neccessary for completing the price
|
||||
selection.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `context` | `PriceSelectionContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`PricingContext`\>
|
||||
|
||||
The pricing context
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:63](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### getProductPricing
|
||||
|
||||
▸ **getProductPricing**(`product`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
Gets all the variant prices for a product. All the product's variants will
|
||||
be fetched.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `product` | `Pick`<`Product`, ``"id"`` \| ``"variants"``\> | the product to get pricing for. |
|
||||
| `context` | `PriceSelectionContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
A map of variant ids to their corresponding prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:292](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L292)
|
||||
|
||||
___
|
||||
|
||||
### getProductPricingById
|
||||
|
||||
▸ **getProductPricingById**(`productId`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
Gets all the variant prices for a product by the product id
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the id of the product to get prices for |
|
||||
| `context` | `PriceSelectionContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
A map of variant ids to their corresponding prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:310](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L310)
|
||||
|
||||
___
|
||||
|
||||
### getProductPricing\_
|
||||
|
||||
▸ `Private` **getProductPricing_**(`productId`, `variants`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `productId` | `string` |
|
||||
| `variants` | `ProductVariant`[] |
|
||||
| `context` | `PricingContext` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:254](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L254)
|
||||
|
||||
___
|
||||
|
||||
### getProductVariantPricing
|
||||
|
||||
▸ **getProductVariantPricing**(`variant`, `context`): `Promise`<`ProductVariantPricing`\>
|
||||
|
||||
Gets the prices for a product variant.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variant` | `Pick`<`ProductVariant`, ``"id"`` \| ``"product_id"``\> | the id of the variant to get prices for |
|
||||
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ProductVariantPricing`\>
|
||||
|
||||
The product variant prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:180](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L180)
|
||||
|
||||
___
|
||||
|
||||
### getProductVariantPricingById
|
||||
|
||||
▸ **getProductVariantPricingById**(`variantId`, `context`): `Promise`<`ProductVariantPricing`\>
|
||||
|
||||
Gets the prices for a product variant by a variant id.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variantId` | `string` | the id of the variant to get prices for |
|
||||
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ProductVariantPricing`\>
|
||||
|
||||
The product variant prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:218](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L218)
|
||||
|
||||
___
|
||||
|
||||
### getProductVariantPricing\_
|
||||
|
||||
▸ `Private` **getProductVariantPricing_**(`variantId`, `taxRates`, `context`): `Promise`<`ProductVariantPricing`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `variantId` | `string` |
|
||||
| `taxRates` | `TaxServiceRate`[] |
|
||||
| `context` | `PricingContext` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ProductVariantPricing`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:138](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
### getShippingOptionPricing
|
||||
|
||||
▸ **getShippingOptionPricing**(`shippingOption`, `context`): `Promise`<`PricedShippingOption`\>
|
||||
|
||||
Gets the prices for a shipping option.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `shippingOption` | `ShippingOption` | the shipping option to get prices for |
|
||||
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`PricedShippingOption`\>
|
||||
|
||||
The shipping option prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:396](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L396)
|
||||
|
||||
___
|
||||
|
||||
### setProductPrices
|
||||
|
||||
▸ **setProductPrices**(`products`, `context?`): `Promise`<(`Product` \| `PricedProduct`)[]\>
|
||||
|
||||
Set additional prices on a list of products.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `products` | `Product`[] | list of products on which to set additional prices |
|
||||
| `context` | `PriceSelectionContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<(`Product` \| `PricedProduct`)[]\>
|
||||
|
||||
A list of products with variants decorated with prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:353](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L353)
|
||||
|
||||
___
|
||||
|
||||
### setShippingOptionPrices
|
||||
|
||||
▸ **setShippingOptionPrices**(`shippingOptions`, `context?`): `Promise`<`PricedShippingOption`[]\>
|
||||
|
||||
Set additional prices on a list of shipping options.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `shippingOptions` | `ShippingOption`[] | list of shipping options on which to set additional prices |
|
||||
| `context` | `Omit`<`PriceSelectionContext`, ``"region_id"``\> | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`PricedShippingOption`[]\>
|
||||
|
||||
A list of shipping options with prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:445](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L445)
|
||||
|
||||
___
|
||||
|
||||
### setVariantPrices
|
||||
|
||||
▸ **setVariantPrices**(`variants`, `context`): `Promise`<`PricedVariant`[]\>
|
||||
|
||||
Set additional prices on a list of product variants.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variants` | `ProductVariant`[] | list of variants on which to set additional prices |
|
||||
| `context` | `PriceSelectionContext` | the price selection context to use |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`PricedVariant`[]\>
|
||||
|
||||
A list of products with variants decorated with prices
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/pricing.ts:328](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/pricing.ts#L328)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager?`): [`PricingService`](PricingService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`PricingService`](PricingService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:11](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L11)
|
||||
[services/product-collection.js:11](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L11)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -47,7 +47,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:170](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L170)
|
||||
[services/product-collection.js:170](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L170)
|
||||
|
||||
___
|
||||
|
||||
@@ -71,7 +71,7 @@ created collection
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:104](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L104)
|
||||
[services/product-collection.js:104](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -95,7 +95,7 @@ empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:152](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L152)
|
||||
[services/product-collection.js:152](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L152)
|
||||
|
||||
___
|
||||
|
||||
@@ -120,7 +120,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:206](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L206)
|
||||
[services/product-collection.js:206](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L206)
|
||||
|
||||
___
|
||||
|
||||
@@ -145,7 +145,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:221](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L221)
|
||||
[services/product-collection.js:221](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L221)
|
||||
|
||||
___
|
||||
|
||||
@@ -166,7 +166,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:188](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L188)
|
||||
[services/product-collection.js:188](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L188)
|
||||
|
||||
___
|
||||
|
||||
@@ -191,7 +191,7 @@ the collection.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:55](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L55)
|
||||
[services/product-collection.js:55](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L55)
|
||||
|
||||
___
|
||||
|
||||
@@ -216,7 +216,7 @@ the collection.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:81](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L81)
|
||||
[services/product-collection.js:81](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L81)
|
||||
|
||||
___
|
||||
|
||||
@@ -241,7 +241,7 @@ update collection
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:125](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L125)
|
||||
[services/product-collection.js:125](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -261,4 +261,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-collection.js:32](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-collection.js#L32)
|
||||
[services/product-collection.js:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-collection.js#L32)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Class: ProductService
|
||||
|
||||
Provides layer to manipulate products.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`ProductService`](ProductService.md)\>
|
||||
|
||||
↳ **`ProductService`**
|
||||
|
||||
@@ -18,21 +16,159 @@ Provides layer to manipulate products.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<ProductService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:19](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L19)
|
||||
[services/product.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L62)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:53](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### imageRepository\_
|
||||
|
||||
• `Protected` `Readonly` **imageRepository\_**: typeof `ImageRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:50](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### productOptionRepository\_
|
||||
|
||||
• `Protected` `Readonly` **productOptionRepository\_**: typeof `ProductOptionRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### productRepository\_
|
||||
|
||||
• `Protected` `Readonly` **productRepository\_**: typeof `ProductRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### productTagRepository\_
|
||||
|
||||
• `Protected` `Readonly` **productTagRepository\_**: typeof `ProductTagRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### productTypeRepository\_
|
||||
|
||||
• `Protected` `Readonly` **productTypeRepository\_**: typeof `ProductTypeRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:48](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### productVariantRepository\_
|
||||
|
||||
• `Protected` `Readonly` **productVariantRepository\_**: typeof `ProductVariantRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
### productVariantService\_
|
||||
|
||||
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:51](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### searchService\_
|
||||
|
||||
• `Protected` `Readonly` **searchService\_**: [`SearchService`](SearchService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### Events
|
||||
|
||||
▪ `Static` **Events**: `Object`
|
||||
▪ `Static` `Readonly` **Events**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -44,23 +180,23 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:13](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L13)
|
||||
[services/product.ts:56](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
### IndexName
|
||||
|
||||
▪ `Static` **IndexName**: `string`
|
||||
▪ `Static` `Readonly` **IndexName**: ``"products"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:12](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L12)
|
||||
[services/product.ts:55](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L55)
|
||||
|
||||
## Methods
|
||||
|
||||
### addOption
|
||||
|
||||
▸ **addOption**(`productId`, `optionTitle`): `Promise`<`any`\>
|
||||
▸ **addOption**(`productId`, `optionTitle`): `Promise`<`Product`\>
|
||||
|
||||
Adds an option to a product. Options can, for example, be "Size", "Color",
|
||||
etc. Will update all the products variants with a dummy value for the newly
|
||||
@@ -75,19 +211,58 @@ created option. The same option cannot be added more than once.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
the result of the model update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:707](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L707)
|
||||
[services/product.ts:552](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L552)
|
||||
|
||||
___
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### count
|
||||
|
||||
▸ **count**(`selector?`): `Promise`<`any`\>
|
||||
▸ **count**(`selector?`): `Promise`<`number`\>
|
||||
|
||||
Return the total number of documents in database
|
||||
|
||||
@@ -95,23 +270,23 @@ Return the total number of documents in database
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the selector to choose products by |
|
||||
| `selector` | `Selector`<`Product`\> | the selector to choose products by |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`number`\>
|
||||
|
||||
the result of the count operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:223](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L223)
|
||||
[services/product.ts:175](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L175)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`productObject`): `Promise`<`any`\>
|
||||
▸ **create**(`productObject`): `Promise`<`Product`\>
|
||||
|
||||
Creates a product.
|
||||
|
||||
@@ -119,50 +294,23 @@ Creates a product.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productObject` | `any` | the product to create |
|
||||
| `productObject` | `CreateProductInput` | the product to create |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
resolves to the creation result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:483](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L483)
|
||||
|
||||
___
|
||||
|
||||
### decorate
|
||||
|
||||
▸ **decorate**(`productId`, `fields?`, `expandFields?`, `config?`): `Product`
|
||||
|
||||
Decorates a product with product variants.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `productId` | `string` | `undefined` | the productId to decorate. |
|
||||
| `fields` | `string`[] | `[]` | the fields to include. |
|
||||
| `expandFields` | `string`[] | `[]` | fields to expand. |
|
||||
| `config` | `any` | `{}` | retrieve config for price calculation. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Product`
|
||||
|
||||
return the decorated product.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:945](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L945)
|
||||
[services/product.ts:324](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L324)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`productId`): `Promise`<`any`\>
|
||||
▸ **delete**(`productId`): `Promise`<`void`\>
|
||||
|
||||
Deletes a product from a given product id. The product's associated
|
||||
variants will also be deleted.
|
||||
@@ -175,19 +323,19 @@ variants will also be deleted.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void`\>
|
||||
|
||||
empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:673](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L673)
|
||||
[services/product.ts:518](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L518)
|
||||
|
||||
___
|
||||
|
||||
### deleteOption
|
||||
|
||||
▸ **deleteOption**(`productId`, `optionId`): `Promise`<`any`\>
|
||||
▸ **deleteOption**(`productId`, `optionId`): `Promise`<`void` \| `Product`\>
|
||||
|
||||
Delete an option from a product.
|
||||
|
||||
@@ -200,39 +348,13 @@ Delete an option from a product.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void` \| `Product`\>
|
||||
|
||||
the updated product
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:881](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L881)
|
||||
|
||||
___
|
||||
|
||||
### getFreeTextQueryBuilder\_
|
||||
|
||||
▸ **getFreeTextQueryBuilder_**(`productRepo`, `query`, `q`): `QueryBuilder`<`Product`\>
|
||||
|
||||
Creates a QueryBuilder that can fetch products based on free text.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productRepo` | `ProductRepository` | an instance of a ProductRepositry |
|
||||
| `query` | `FindOptions`<`Product`\> | the query to get products by |
|
||||
| `q` | `string` | the text to perform free text search from |
|
||||
|
||||
#### Returns
|
||||
|
||||
`QueryBuilder`<`Product`\>
|
||||
|
||||
a query builder that can fetch products
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:1014](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L1014)
|
||||
[services/product.ts:693](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L693)
|
||||
|
||||
___
|
||||
|
||||
@@ -246,8 +368,8 @@ Lists products based on the provided parameters.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | an object that defines rules to filter products by |
|
||||
| `config` | `any` | object that defines the scope for what should be returned |
|
||||
| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | an object that defines rules to filter products by |
|
||||
| `config` | `FindProductConfig` | object that defines the scope for what should be returned |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -257,13 +379,13 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:109](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L109)
|
||||
[services/product.ts:107](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`Product`[], `number`]\>
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Product`[], `number`]\>
|
||||
|
||||
Lists products based on the provided parameters and includes the count of
|
||||
products that match the query.
|
||||
@@ -272,8 +394,8 @@ products that match the query.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | an object that defines rules to filter products by |
|
||||
| `config` | `any` | object that defines the scope for what should be returned |
|
||||
| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | an object that defines rules to filter products by |
|
||||
| `config` | `FindProductConfig` | object that defines the scope for what should be returned |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -285,13 +407,13 @@ an array containing the products as
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:164](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L164)
|
||||
[services/product.ts:144](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L144)
|
||||
|
||||
___
|
||||
|
||||
### listTagsByUsage
|
||||
|
||||
▸ **listTagsByUsage**(`count?`): `Promise`<`any`\>
|
||||
▸ **listTagsByUsage**(`count?`): `Promise`<`ProductTag`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -301,31 +423,31 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ProductTag`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:412](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L412)
|
||||
[services/product.ts:309](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L309)
|
||||
|
||||
___
|
||||
|
||||
### listTypes
|
||||
|
||||
▸ **listTypes**(): `Promise`<`any`\>
|
||||
▸ **listTypes**(): `Promise`<`ProductType`[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ProductType`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:404](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L404)
|
||||
[services/product.ts:299](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L299)
|
||||
|
||||
___
|
||||
|
||||
### prepareListQuery\_
|
||||
|
||||
▸ **prepareListQuery_**(`selector`, `config`): `any`
|
||||
▸ `Protected` **prepareListQuery_**(`selector`, `config`): `Object`
|
||||
|
||||
Creates a query object to be used for list queries.
|
||||
|
||||
@@ -333,67 +455,46 @@ Creates a query object to be used for list queries.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the selector to create the query from |
|
||||
| `config` | `any` | the config to use for the query |
|
||||
| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | the selector to create the query from |
|
||||
| `config` | `FindProductConfig` | the config to use for the query |
|
||||
|
||||
#### Returns
|
||||
|
||||
`any`
|
||||
`Object`
|
||||
|
||||
an object containing the query, relations and free-text
|
||||
search param.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:980](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L980)
|
||||
|
||||
___
|
||||
|
||||
### reorderOptions
|
||||
|
||||
▸ **reorderOptions**(`productId`, `optionOrder`): `Promise`<`any`\>
|
||||
|
||||
Changes the order of a product's options. Will throw if the length of
|
||||
optionOrder and the length of the product's options are different. Will
|
||||
throw optionOrder contains an id not associated with the product.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the product whose options we are reordering |
|
||||
| `optionOrder` | `string`[] | the ids of the product's options in the new order |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
the result of the update operation
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `q` | `string` |
|
||||
| `query` | `FindWithoutRelationsOptions` |
|
||||
| `relations` | keyof `Product`[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:790](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L790)
|
||||
[services/product.ts:759](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L759)
|
||||
|
||||
___
|
||||
|
||||
### reorderVariants
|
||||
|
||||
▸ **reorderVariants**(`productId`, `variantOrder`): `Promise`<`any`\>
|
||||
▸ **reorderVariants**(`productId`, `variantOrder`): `Promise`<`Product`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `productId` | `any` |
|
||||
| `variantOrder` | `any` |
|
||||
| `productId` | `string` |
|
||||
| `variantOrder` | `string`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:746](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L746)
|
||||
[services/product.ts:591](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L591)
|
||||
|
||||
___
|
||||
|
||||
@@ -409,7 +510,7 @@ Throws in case of DB Error and if product was not found.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | id of the product to get. |
|
||||
| `config` | `any` | object that defines what should be included in the query response |
|
||||
| `config` | `FindProductConfig` | object that defines what should be included in the query response |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -419,7 +520,7 @@ the result of the find one operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:239](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L239)
|
||||
[services/product.ts:191](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
@@ -435,7 +536,7 @@ Throws in case of DB Error and if product was not found.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `externalId` | `string` | handle of the product to get. |
|
||||
| `config` | `any` | details about what to get from the product |
|
||||
| `config` | `FindProductConfig` | details about what to get from the product |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -445,7 +546,7 @@ the result of the find one operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:342](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L342)
|
||||
[services/product.ts:225](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L225)
|
||||
|
||||
___
|
||||
|
||||
@@ -461,7 +562,7 @@ Throws in case of DB Error and if product was not found.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productHandle` | `string` | handle of the product to get. |
|
||||
| `config` | `any` | details about what to get from the product |
|
||||
| `config` | `FindProductConfig` | details about what to get from the product |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -471,13 +572,13 @@ the result of the find one operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:291](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L291)
|
||||
[services/product.ts:209](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L209)
|
||||
|
||||
___
|
||||
|
||||
### retrieveVariants
|
||||
|
||||
▸ **retrieveVariants**(`productId`, `config?`): `Promise`<`any`\>
|
||||
▸ **retrieveVariants**(`productId`, `config?`): `Promise`<`ProductVariant`[]\>
|
||||
|
||||
Gets all variants belonging to a product.
|
||||
|
||||
@@ -486,52 +587,73 @@ Gets all variants belonging to a product.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the id of the product to get variants from. |
|
||||
| `config` | `FindConfig`<`Product`\> | The config to select and configure relations etc... |
|
||||
| `config` | `FindProductConfig` | The config to select and configure relations etc... |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ProductVariant`[]\>
|
||||
|
||||
an array of variants
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:392](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L392)
|
||||
[services/product.ts:279](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L279)
|
||||
|
||||
___
|
||||
|
||||
### setAdditionalPrices
|
||||
### retrieve\_
|
||||
|
||||
▸ **setAdditionalPrices**(`products`, `currency_code`, `region_id`, `cart_id`, `customer_id`, `include_discount_prices?`): `Promise`<`Product`[]\>
|
||||
▸ **retrieve_**(`selector`, `config?`): `Promise`<`Product`\>
|
||||
|
||||
Set additional prices on a list of products.
|
||||
Gets a product by selector.
|
||||
Throws in case of DB Error and if product was not found.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `products` | `any` | `undefined` | list of products on which to set additional prices |
|
||||
| `currency_code` | `string` | `undefined` | currency code to fetch prices for |
|
||||
| `region_id` | `string` | `undefined` | region to fetch prices for |
|
||||
| `cart_id` | `string` | `undefined` | string of cart to use as a basis for getting currency and region |
|
||||
| `customer_id` | `string` | `undefined` | id of potentially logged in customer, used to get prices valid for their customer groups |
|
||||
| `include_discount_prices` | `boolean` | `false` | indication wether or not to include sales prices in result |
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `Selector`<`Product`\> | selector object |
|
||||
| `config` | `FindProductConfig` | object that defines what should be included in the query response |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Product`[]\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
A list of products with variants decorated with "additional_prices"
|
||||
the result of the find one operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:1055](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L1055)
|
||||
[services/product.ts:242](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L242)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`productId`, `update`): `Promise`<`any`\>
|
||||
▸ **update**(`productId`, `update`): `Promise`<`Product`\>
|
||||
|
||||
Updates a product. Product variant updates should use dedicated methods,
|
||||
e.g. `addVariant`, etc. The function will throw errors if metadata or
|
||||
@@ -542,23 +664,23 @@ product variant updates are attempted.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the id of the product. Must be a string that can be casted to an ObjectId |
|
||||
| `update` | `any` | an object with the update values. |
|
||||
| `update` | `UpdateProductInput` | an object with the update values. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:573](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L573)
|
||||
[services/product.ts:399](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L399)
|
||||
|
||||
___
|
||||
|
||||
### updateOption
|
||||
|
||||
▸ **updateOption**(`productId`, `optionId`, `data`): `Promise`<`any`\>
|
||||
▸ **updateOption**(`productId`, `optionId`, `data`): `Promise`<`Product`\>
|
||||
|
||||
Updates a product's option. Throws if the call tries to update an option
|
||||
not associated with the product. Throws if the updated title already exists.
|
||||
@@ -569,94 +691,38 @@ not associated with the product. Throws if the updated title already exists.
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the product whose option we are updating |
|
||||
| `optionId` | `string` | the id of the option we are updating |
|
||||
| `data` | `any` | the data to update the option with |
|
||||
| `data` | `ProductOptionInput` | the data to update the option with |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Product`\>
|
||||
|
||||
the updated product
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:831](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L831)
|
||||
|
||||
___
|
||||
|
||||
### upsertImages\_
|
||||
|
||||
▸ **upsertImages_**(`images`): `Promise`<`any`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `images` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:542](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L542)
|
||||
|
||||
___
|
||||
|
||||
### upsertProductTags\_
|
||||
|
||||
▸ **upsertProductTags_**(`tags`): `Promise`<`any`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `tags` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:455](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L455)
|
||||
|
||||
___
|
||||
|
||||
### upsertProductType\_
|
||||
|
||||
▸ **upsertProductType_**(`type`): `Promise`<`any`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `type` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:430](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L430)
|
||||
[services/product.ts:637](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product.ts#L637)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`ProductService`](ProductService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`ProductService`](ProductService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ProductService`](ProductService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product.js:76](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product.js#L76)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L16)
|
||||
[services/product-type.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L16)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L14)
|
||||
[services/product-type.ts:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L15)
|
||||
[services/product-type.ts:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L15)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -71,7 +71,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:72](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L72)
|
||||
[services/product-type.ts:72](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:88](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L88)
|
||||
[services/product-type.ts:88](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -122,7 +122,7 @@ the result of the find one operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L47)
|
||||
[services/product-type.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -142,4 +142,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-type.ts:23](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-type.ts#L23)
|
||||
[services/product-type.ts:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-type.ts#L23)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L52)
|
||||
[services/product-variant.ts:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L52)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:50](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L50)
|
||||
[services/product-variant.ts:50](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L45)
|
||||
[services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L42)
|
||||
[services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L48)
|
||||
[services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L47)
|
||||
[services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -86,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L49)
|
||||
[services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L44)
|
||||
[services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +106,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:43](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L43)
|
||||
[services/product-variant.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L46)
|
||||
[services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L36)
|
||||
[services/product-variant.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L36)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -164,7 +164,7 @@ the result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:553](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L553)
|
||||
[services/product-variant.ts:529](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L529)
|
||||
|
||||
___
|
||||
|
||||
@@ -190,7 +190,7 @@ resolves to the creation result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:207](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L207)
|
||||
[services/product-variant.ts:183](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L183)
|
||||
|
||||
___
|
||||
|
||||
@@ -215,7 +215,7 @@ empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:746](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L746)
|
||||
[services/product-variant.ts:682](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L682)
|
||||
|
||||
___
|
||||
|
||||
@@ -241,7 +241,7 @@ empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:580](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L580)
|
||||
[services/product-variant.ts:556](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L556)
|
||||
|
||||
___
|
||||
|
||||
@@ -269,7 +269,7 @@ an array containing the products as the first element and the total
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:852](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L852)
|
||||
[services/product-variant.ts:788](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L788)
|
||||
|
||||
___
|
||||
|
||||
@@ -296,7 +296,7 @@ the price specific to the region
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:428](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L428)
|
||||
[services/product-variant.ts:404](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L404)
|
||||
|
||||
___
|
||||
|
||||
@@ -319,7 +319,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:677](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L677)
|
||||
[services/product-variant.ts:624](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L624)
|
||||
|
||||
___
|
||||
|
||||
@@ -342,7 +342,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:607](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L607)
|
||||
[services/product-variant.ts:583](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L583)
|
||||
|
||||
___
|
||||
|
||||
@@ -374,7 +374,7 @@ an object containing the query, relations and free-text
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:813](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L813)
|
||||
[services/product-variant.ts:749](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L749)
|
||||
|
||||
___
|
||||
|
||||
@@ -399,7 +399,7 @@ the product document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:117](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L117)
|
||||
[services/product-variant.ts:117](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L117)
|
||||
|
||||
___
|
||||
|
||||
@@ -424,36 +424,7 @@ the product document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:162](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
### setAdditionalPrices
|
||||
|
||||
▸ **setAdditionalPrices**(`variant`, `currency_code`, `region_id`, `cart_id`, `customer_id`, `include_discount_prices?`): `Promise`<`ProductVariant` \| `ProductVariant`[]\>
|
||||
|
||||
Set additional prices on a list of variants.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `variant` | `any` | `undefined` | variant on which to set additional prices |
|
||||
| `currency_code` | `any` | `undefined` | currency code to fetch prices for |
|
||||
| `region_id` | `any` | `undefined` | region to fetch prices for |
|
||||
| `cart_id` | `any` | `undefined` | string of cart to use as a basis for getting currency and region |
|
||||
| `customer_id` | `any` | `undefined` | id of potentially logged in customer, used to get prices valid for their customer groups |
|
||||
| `include_discount_prices` | `boolean` | `false` | should result include discount pricing |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ProductVariant` \| `ProductVariant`[]\>
|
||||
|
||||
A list of variants with variants decorated with "additional_prices"
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:897](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L897)
|
||||
[services/product-variant.ts:147](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L147)
|
||||
|
||||
___
|
||||
|
||||
@@ -478,7 +449,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:494](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L494)
|
||||
[services/product-variant.ts:470](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L470)
|
||||
|
||||
___
|
||||
|
||||
@@ -503,7 +474,7 @@ updated metadata object
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:781](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L781)
|
||||
[services/product-variant.ts:717](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L717)
|
||||
|
||||
___
|
||||
|
||||
@@ -528,7 +499,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:457](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L457)
|
||||
[services/product-variant.ts:433](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L433)
|
||||
|
||||
___
|
||||
|
||||
@@ -555,7 +526,7 @@ resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:312](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L312)
|
||||
[services/product-variant.ts:288](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L288)
|
||||
|
||||
___
|
||||
|
||||
@@ -582,7 +553,7 @@ the result of the update operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:515](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L515)
|
||||
[services/product-variant.ts:491](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L491)
|
||||
|
||||
___
|
||||
|
||||
@@ -608,7 +579,7 @@ empty promise
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:390](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L390)
|
||||
[services/product-variant.ts:366](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L366)
|
||||
|
||||
___
|
||||
|
||||
@@ -628,4 +599,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/product-variant.ts:89](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/product-variant.ts#L89)
|
||||
[services/product-variant.ts:89](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/product-variant.ts#L89)
|
||||
|
||||
@@ -34,7 +34,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/query-builder.js:25](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/query-builder.js#L25)
|
||||
[services/query-builder.js:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/query-builder.js#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -55,7 +55,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/query-builder.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/query-builder.js#L5)
|
||||
[services/query-builder.js:5](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/query-builder.js#L5)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,4 +76,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/query-builder.js:39](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/query-builder.js#L39)
|
||||
[services/query-builder.js:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/query-builder.js#L39)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L16)
|
||||
[services/region.js:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L16)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -44,7 +44,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L10)
|
||||
[services/region.js:10](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L10)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -69,7 +69,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:460](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L460)
|
||||
[services/region.js:462](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L462)
|
||||
|
||||
___
|
||||
|
||||
@@ -95,7 +95,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:580](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L580)
|
||||
[services/region.js:582](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L582)
|
||||
|
||||
___
|
||||
|
||||
@@ -121,7 +121,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:533](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L533)
|
||||
[services/region.js:535](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L535)
|
||||
|
||||
___
|
||||
|
||||
@@ -145,7 +145,7 @@ the newly created region
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:95](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L95)
|
||||
[services/region.js:95](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L95)
|
||||
|
||||
___
|
||||
|
||||
@@ -169,7 +169,7 @@ the result of the delete operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:430](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L430)
|
||||
[services/region.js:432](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L432)
|
||||
|
||||
___
|
||||
|
||||
@@ -194,7 +194,7 @@ result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:418](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L418)
|
||||
[services/region.js:420](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L420)
|
||||
|
||||
___
|
||||
|
||||
@@ -219,7 +219,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:497](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L497)
|
||||
[services/region.js:499](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L499)
|
||||
|
||||
___
|
||||
|
||||
@@ -244,7 +244,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:658](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L658)
|
||||
[services/region.js:660](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L660)
|
||||
|
||||
___
|
||||
|
||||
@@ -269,7 +269,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:624](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L624)
|
||||
[services/region.js:626](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L626)
|
||||
|
||||
___
|
||||
|
||||
@@ -294,7 +294,7 @@ the region
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:394](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L394)
|
||||
[services/region.js:396](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L396)
|
||||
|
||||
___
|
||||
|
||||
@@ -315,7 +315,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:360](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L360)
|
||||
[services/region.js:362](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L362)
|
||||
|
||||
___
|
||||
|
||||
@@ -340,7 +340,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:153](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L153)
|
||||
[services/region.js:153](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L153)
|
||||
|
||||
___
|
||||
|
||||
@@ -364,7 +364,7 @@ existence.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:323](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L323)
|
||||
[services/region.js:323](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L323)
|
||||
|
||||
___
|
||||
|
||||
@@ -386,7 +386,7 @@ Validates a currency code. Will throw if the currency code doesn't exist.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:302](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L302)
|
||||
[services/region.js:302](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L302)
|
||||
|
||||
___
|
||||
|
||||
@@ -412,7 +412,7 @@ the validated region data
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:213](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L213)
|
||||
[services/region.js:213](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L213)
|
||||
|
||||
___
|
||||
|
||||
@@ -434,7 +434,7 @@ Validates a tax rate. Will throw if the tax rate is not between 0 and 1.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:289](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L289)
|
||||
[services/region.js:289](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L289)
|
||||
|
||||
___
|
||||
|
||||
@@ -454,4 +454,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/region.js:65](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/region.js#L65)
|
||||
[services/region.js:65](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/region.js#L65)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L5)
|
||||
[services/return-reason.js:5](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L5)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -44,7 +44,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L30)
|
||||
[services/return-reason.js:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:114](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L114)
|
||||
[services/return-reason.js:114](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -87,7 +87,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:82](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L82)
|
||||
[services/return-reason.js:82](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L82)
|
||||
|
||||
___
|
||||
|
||||
@@ -112,7 +112,7 @@ the order document
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:97](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L97)
|
||||
[services/return-reason.js:97](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L97)
|
||||
|
||||
___
|
||||
|
||||
@@ -133,7 +133,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L52)
|
||||
[services/return-reason.js:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -153,4 +153,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return-reason.js:15](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return-reason.js#L15)
|
||||
[services/return-reason.js:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return-reason.js#L15)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L9)
|
||||
[services/return.js:9](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L9)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:49](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L49)
|
||||
[services/return.js:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L49)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:47](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L47)
|
||||
[services/return.js:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:39](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L39)
|
||||
[services/return.js:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L39)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -80,7 +80,7 @@ the updated Return
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:134](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L134)
|
||||
[services/return.js:134](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L134)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +106,7 @@ the created return
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:307](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L307)
|
||||
[services/return.js:307](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L307)
|
||||
|
||||
___
|
||||
|
||||
@@ -126,7 +126,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:450](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L450)
|
||||
[services/return.js:450](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L450)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ the line items generated by the transformer.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:89](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L89)
|
||||
[services/return.js:89](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L89)
|
||||
|
||||
___
|
||||
|
||||
@@ -177,7 +177,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:120](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L120)
|
||||
[services/return.js:120](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L120)
|
||||
|
||||
___
|
||||
|
||||
@@ -210,7 +210,7 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:524](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L524)
|
||||
[services/return.js:524](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L524)
|
||||
|
||||
___
|
||||
|
||||
@@ -235,7 +235,7 @@ the return
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:229](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L229)
|
||||
[services/return.js:229](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L229)
|
||||
|
||||
___
|
||||
|
||||
@@ -256,7 +256,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:248](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L248)
|
||||
[services/return.js:248](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L248)
|
||||
|
||||
___
|
||||
|
||||
@@ -277,7 +277,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:271](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L271)
|
||||
[services/return.js:271](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L271)
|
||||
|
||||
___
|
||||
|
||||
@@ -306,7 +306,7 @@ a line item where the quantity is set to the requested
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:191](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L191)
|
||||
[services/return.js:191](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L191)
|
||||
|
||||
___
|
||||
|
||||
@@ -332,7 +332,7 @@ payment_status must be captured.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:161](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L161)
|
||||
[services/return.js:161](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L161)
|
||||
|
||||
___
|
||||
|
||||
@@ -352,4 +352,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/return.js:55](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/return.js#L55)
|
||||
[services/return.js:55](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/return.js#L55)
|
||||
|
||||
@@ -26,7 +26,7 @@ SearchService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:8](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L8)
|
||||
[services/search.js:8](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L8)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ SearchService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:11](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L11)
|
||||
[services/search.js:11](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:13](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L13)
|
||||
[services/search.js:13](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L13)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -68,7 +68,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:28](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L28)
|
||||
[services/search.js:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -89,7 +89,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:16](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L16)
|
||||
[services/search.js:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -109,7 +109,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:46](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L46)
|
||||
[services/search.js:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -130,7 +130,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:40](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L40)
|
||||
[services/search.js:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -150,7 +150,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:22](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L22)
|
||||
[services/search.js:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -172,7 +172,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:34](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L34)
|
||||
[services/search.js:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -198,7 +198,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L52)
|
||||
[services/search.js:52](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L52)
|
||||
|
||||
___
|
||||
|
||||
@@ -219,4 +219,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/search.js:59](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/search.js#L59)
|
||||
[services/search.js:59](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/search.js#L59)
|
||||
|
||||
@@ -4,7 +4,7 @@ Provides layer to manipulate profiles.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`ShippingOptionService`](ShippingOptionService.md)\>
|
||||
|
||||
↳ **`ShippingOptionService`**
|
||||
|
||||
@@ -22,17 +22,115 @@ Provides layer to manipulate profiles.
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<ShippingOptionService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L9)
|
||||
[services/shipping-option.ts:39](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L39)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### methodRepository\_
|
||||
|
||||
• `Protected` `Readonly` **methodRepository\_**: typeof `ShippingMethodRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### optionRepository\_
|
||||
|
||||
• `Protected` `Readonly` **optionRepository\_**: typeof `ShippingOptionRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### providerService\_
|
||||
|
||||
• `Protected` `Readonly` **providerService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### regionService\_
|
||||
|
||||
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### requirementRepository\_
|
||||
|
||||
• `Protected` `Readonly` **requirementRepository\_**: typeof `ShippingOptionRequirementRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L37)
|
||||
|
||||
## Methods
|
||||
|
||||
### addRequirement
|
||||
|
||||
▸ **addRequirement**(`optionId`, `requirement`): `Promise`<`any`\>
|
||||
▸ **addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Adds a requirement to a shipping option. Only 1 requirement of each type
|
||||
is allowed.
|
||||
@@ -42,17 +140,56 @@ is allowed.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | the option to add the requirement to. |
|
||||
| `requirement` | `ShippingRequirement` | the requirement for the option. |
|
||||
| `requirement` | `ShippingOptionRequirement` | the requirement for the option. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
the result of update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:594](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L594)
|
||||
[services/shipping-option.ts:627](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L627)
|
||||
|
||||
___
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +205,7 @@ defaults to false.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `data` | `ShippingOption` | the data to create shipping options |
|
||||
| `data` | `CreateShippingOptionInput` | the data to create shipping options |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -78,13 +215,13 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:350](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L350)
|
||||
[services/shipping-option.ts:384](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L384)
|
||||
|
||||
___
|
||||
|
||||
### createShippingMethod
|
||||
|
||||
▸ **createShippingMethod**(`optionId`, `data`, `config`): `ShippingMethod`
|
||||
▸ **createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\>
|
||||
|
||||
Creates a shipping method for a given cart.
|
||||
|
||||
@@ -93,50 +230,24 @@ Creates a shipping method for a given cart.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | the id of the option to use for the method. |
|
||||
| `data` | `any` | the optional provider data to use. |
|
||||
| `config` | `any` | the cart to create the shipping method for. |
|
||||
| `data` | `object` | the optional provider data to use. |
|
||||
| `config` | `CreateShippingMethodDto` | the cart to create the shipping method for. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ShippingMethod`
|
||||
`Promise`<`ShippingMethod`\>
|
||||
|
||||
the resulting shipping method.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:231](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L231)
|
||||
|
||||
___
|
||||
|
||||
### decorate
|
||||
|
||||
▸ **decorate**(`optionId`, `fields?`, `expandFields?`): `ShippingOption`
|
||||
|
||||
Decorates a shipping option.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `optionId` | `ShippingOption` | `undefined` | the shipping option to decorate using optionId. |
|
||||
| `fields` | `string`[] | `[]` | the fields to include. |
|
||||
| `expandFields` | `string`[] | `[]` | fields to expand. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ShippingOption`
|
||||
|
||||
the decorated ShippingOption.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:645](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L645)
|
||||
[services/shipping-option.ts:259](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L259)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`optionId`): `Promise`<`any`\>
|
||||
▸ **delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\>
|
||||
|
||||
Deletes a profile with a given profile id.
|
||||
|
||||
@@ -148,19 +259,19 @@ Deletes a profile with a given profile id.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void` \| `ShippingOption`\>
|
||||
|
||||
the result of the delete operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:566](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L566)
|
||||
[services/shipping-option.ts:605](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L605)
|
||||
|
||||
___
|
||||
|
||||
### deleteShippingMethods
|
||||
|
||||
▸ **deleteShippingMethods**(`shippingMethods`): `Promise`<`any`\>
|
||||
▸ **deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\>
|
||||
|
||||
Removes a given shipping method
|
||||
|
||||
@@ -168,15 +279,17 @@ Removes a given shipping method
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `shippingMethods` | `any` | the shipping method to remove |
|
||||
| `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | the shipping method to remove |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ShippingMethod`[]\>
|
||||
|
||||
removed shipping methods
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:213](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L213)
|
||||
[services/shipping-option.ts:239](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L239)
|
||||
|
||||
___
|
||||
|
||||
@@ -193,8 +306,8 @@ price type "calculated".
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `option` | `ShippingOption` | the shipping option to retrieve the price for. |
|
||||
| `data` | `ShippingData` | the shipping data to retrieve the price. |
|
||||
| `cart` | `any` | the context in which the price should be retrieved. |
|
||||
| `data` | `object` | the shipping data to retrieve the price. |
|
||||
| `cart` | `undefined` \| `Cart` \| `Order` | the context in which the price should be retrieved. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -204,59 +317,59 @@ the price of the shipping option.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:697](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L697)
|
||||
[services/shipping-option.ts:686](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L686)
|
||||
|
||||
___
|
||||
|
||||
### list
|
||||
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`any`\>
|
||||
▸ **list**(`selector`, `config?`): `Promise`<`ShippingOption`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | config object |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | config object |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ShippingOption`[]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:123](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L123)
|
||||
[services/shipping-option.ts:130](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
### listAndCount
|
||||
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<`any`\>
|
||||
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`ShippingOption`[], `number`]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `selector` | `any` | the query object for find |
|
||||
| `config` | `any` | config object |
|
||||
| `selector` | `Selector`<`ShippingMethod`\> | the query object for find |
|
||||
| `config` | `FindConfig`<`ShippingOption`\> | config object |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<[`ShippingOption`[], `number`]\>
|
||||
|
||||
the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:135](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L135)
|
||||
[services/shipping-option.ts:149](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### removeRequirement
|
||||
|
||||
▸ **removeRequirement**(`requirementId`): `Promise`<`any`\>
|
||||
▸ **removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\>
|
||||
|
||||
Removes a requirement from a shipping option
|
||||
|
||||
@@ -264,23 +377,23 @@ Removes a requirement from a shipping option
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `requirementId` | `string` | the id of the requirement to remove |
|
||||
| `requirementId` | `any` | the id of the requirement to remove |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`void` \| `ShippingOptionRequirement`\>
|
||||
|
||||
the result of update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:620](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L620)
|
||||
[services/shipping-option.ts:656](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L656)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`optionId`, `options?`): `Promise`<`Product`\>
|
||||
▸ **retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Gets a profile by id.
|
||||
Throws in case of DB Error and if profile was not found.
|
||||
@@ -289,49 +402,50 @@ Throws in case of DB Error and if profile was not found.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | the id of the profile to get. |
|
||||
| `options` | `any` | the options to get a profile |
|
||||
| `optionId` | `any` | the id of the profile to get. |
|
||||
| `options` | `Object` | the options to get a profile |
|
||||
| `options.relations?` | `string`[] | - |
|
||||
| `options.select?` | keyof `ShippingOption`[] | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Product`\>
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
the profile document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:149](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L149)
|
||||
[services/shipping-option.ts:170](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L170)
|
||||
|
||||
___
|
||||
|
||||
### setMetadata\_
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ **setMetadata_**(`option`, `metadata`): `Promise`<`any`\>
|
||||
|
||||
Dedicated method to set metadata for a shipping option.
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `option` | `any` | the option to set metadata for. |
|
||||
| `metadata` | `any` | object for metadata field |
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`boolean`
|
||||
|
||||
resolves to the updated result.
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:664](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L664)
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`optionId`, `update`): `Promise`<`any`\>
|
||||
▸ **update**(`optionId`, `update`): `Promise`<`ShippingOption`\>
|
||||
|
||||
Updates a profile. Metadata updates and product updates should use
|
||||
dedicated methods, e.g. `setMetadata`, etc. The function
|
||||
@@ -342,23 +456,23 @@ will throw errors if metadata or product updates are attempted.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | the id of the option. Must be a string that can be casted to an ObjectId |
|
||||
| `update` | `any` | an object with the update values. |
|
||||
| `update` | `UpdateShippingOptionInput` | an object with the update values. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`ShippingOption`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:464](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L464)
|
||||
[services/shipping-option.ts:498](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L498)
|
||||
|
||||
___
|
||||
|
||||
### updateShippingMethod
|
||||
|
||||
▸ **updateShippingMethod**(`id`, `update`): `Promise`<`ShippingMethod`\>
|
||||
▸ **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.
|
||||
@@ -368,23 +482,23 @@ and its methods should be copied to an order/swap entity.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `id` | `string` | the id of the shipping method to update |
|
||||
| `update` | `any` | the values to update the method with |
|
||||
| `update` | `ShippingMethodUpdate` | the values to update the method with |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingMethod`\>
|
||||
`Promise`<`undefined` \| `ShippingMethod`\>
|
||||
|
||||
the resulting shipping method
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:184](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L184)
|
||||
[services/shipping-option.ts:210](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L210)
|
||||
|
||||
___
|
||||
|
||||
### validateCartOption
|
||||
|
||||
▸ **validateCartOption**(`option`, `cart`): `ShippingOption`
|
||||
▸ **validateCartOption**(`option`, `cart`): ``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
|
||||
@@ -394,24 +508,24 @@ match, or when the shipping option requirements are not satisfied.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `option` | `any` | the option object to check |
|
||||
| `option` | `ShippingOption` | the option object to check |
|
||||
| `cart` | `Cart` | the cart object to check against |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ShippingOption`
|
||||
``null`` \| `ShippingOption`
|
||||
|
||||
the validated shipping option
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:309](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L309)
|
||||
[services/shipping-option.ts:337](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L337)
|
||||
|
||||
___
|
||||
|
||||
### validatePriceType\_
|
||||
|
||||
▸ **validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPrice`\>
|
||||
▸ **validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\>
|
||||
|
||||
Validates a shipping option price
|
||||
|
||||
@@ -419,60 +533,64 @@ Validates a shipping option price
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `priceType` | `ShippingOptionPrice` | the price to validate |
|
||||
| `priceType` | `ShippingOptionPriceType` | the price to validate |
|
||||
| `option` | `ShippingOption` | the option to validate against |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ShippingOptionPrice`\>
|
||||
`Promise`<`ShippingOptionPriceType`\>
|
||||
|
||||
the validated price
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:431](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L431)
|
||||
[services/shipping-option.ts:462](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L462)
|
||||
|
||||
___
|
||||
|
||||
### validateRequirement\_
|
||||
|
||||
▸ **validateRequirement_**(`requirement`, `optionId`): `ShippingRequirement`
|
||||
▸ **validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\>
|
||||
|
||||
Validates a requirement
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `requirement` | `ShippingRequirement` | the requirement to validate |
|
||||
| `optionId` | `string` | the id to validate the requirement |
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `requirement` | `ShippingOptionRequirement` | `undefined` | the requirement to validate |
|
||||
| `optionId` | `undefined` \| `string` | `undefined` | the id to validate the requirement |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ShippingRequirement`
|
||||
`Promise`<`ShippingOptionRequirement`\>
|
||||
|
||||
a validated shipping requirement
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:63](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L63)
|
||||
[services/shipping-option.ts:64](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-option.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`ShippingOptionService`](ShippingOptionService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`ShippingOptionService`](ShippingOptionService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ShippingOptionService`](ShippingOptionService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-option.js:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-option.js#L38)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -28,7 +28,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:12](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L12)
|
||||
[services/shipping-profile.js:12](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L12)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -54,7 +54,7 @@ the result of update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:343](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L343)
|
||||
[services/shipping-profile.js:343](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L343)
|
||||
|
||||
___
|
||||
|
||||
@@ -80,7 +80,7 @@ the result of the model update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:361](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L361)
|
||||
[services/shipping-profile.js:361](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L361)
|
||||
|
||||
___
|
||||
|
||||
@@ -104,7 +104,7 @@ the result of the create operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:235](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L235)
|
||||
[services/shipping-profile.js:235](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L235)
|
||||
|
||||
___
|
||||
|
||||
@@ -122,7 +122,7 @@ the shipping profile
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:167](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L167)
|
||||
[services/shipping-profile.js:167](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L167)
|
||||
|
||||
___
|
||||
|
||||
@@ -141,7 +141,7 @@ the shipping profile
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:209](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L209)
|
||||
[services/shipping-profile.js:209](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L209)
|
||||
|
||||
___
|
||||
|
||||
@@ -167,7 +167,7 @@ return the decorated profile.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:379](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L379)
|
||||
[services/shipping-profile.js:379](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L379)
|
||||
|
||||
___
|
||||
|
||||
@@ -191,13 +191,13 @@ the result of the delete operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:317](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L317)
|
||||
[services/shipping-profile.js:317](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L317)
|
||||
|
||||
___
|
||||
|
||||
### fetchCartOptions
|
||||
|
||||
▸ **fetchCartOptions**(`cart`): [`ShippingOption`]
|
||||
▸ **fetchCartOptions**(`cart`): `Promise`<[`ShippingOption`]\>
|
||||
|
||||
Finds all the shipping profiles that cover the products in a cart, and
|
||||
validates all options that are available for the cart.
|
||||
@@ -210,13 +210,13 @@ validates all options that are available for the cart.
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ShippingOption`]
|
||||
`Promise`<[`ShippingOption`]\>
|
||||
|
||||
a list of the available shipping options
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:425](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L425)
|
||||
[services/shipping-profile.js:425](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L425)
|
||||
|
||||
___
|
||||
|
||||
@@ -237,7 +237,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:73](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L73)
|
||||
[services/shipping-profile.js:73](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -261,7 +261,7 @@ a list of product ids
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:406](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L406)
|
||||
[services/shipping-profile.js:406](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L406)
|
||||
|
||||
___
|
||||
|
||||
@@ -284,7 +284,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:64](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L64)
|
||||
[services/shipping-profile.js:64](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -310,7 +310,7 @@ the profile document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:121](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L121)
|
||||
[services/shipping-profile.js:121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -324,7 +324,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:151](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L151)
|
||||
[services/shipping-profile.js:151](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L151)
|
||||
|
||||
___
|
||||
|
||||
@@ -342,7 +342,7 @@ the shipping profile for gift cards
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:192](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L192)
|
||||
[services/shipping-profile.js:192](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L192)
|
||||
|
||||
___
|
||||
|
||||
@@ -369,7 +369,7 @@ resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:263](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L263)
|
||||
[services/shipping-profile.js:263](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L263)
|
||||
|
||||
___
|
||||
|
||||
@@ -389,4 +389,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/shipping-profile.js:41](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/shipping-profile.js#L41)
|
||||
[services/shipping-profile.js:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/shipping-profile.js#L41)
|
||||
|
||||
@@ -4,7 +4,7 @@ Provides layer to manipulate store settings.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`StoreService`](StoreService.md)\>
|
||||
|
||||
↳ **`StoreService`**
|
||||
|
||||
@@ -18,21 +18,99 @@ Provides layer to manipulate store settings.
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<StoreService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L10)
|
||||
[services/store.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L33)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### currencyRepository\_
|
||||
|
||||
• `Protected` `Readonly` **currencyRepository\_**: typeof `CurrencyRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.ts:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.ts:26](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### storeRepository\_
|
||||
|
||||
• `Protected` `Readonly` **storeRepository\_**: typeof `StoreRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.ts:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L27)
|
||||
|
||||
## Methods
|
||||
|
||||
### addCurrency
|
||||
|
||||
▸ **addCurrency**(`code`): `Promise`<`any`\>
|
||||
▸ **addCurrency**(`code`): `Promise`<`Store`\>
|
||||
|
||||
Add a currency to the store
|
||||
|
||||
@@ -44,13 +122,52 @@ Add a currency to the store
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Store`\>
|
||||
|
||||
result after update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:203](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L203)
|
||||
[services/store.ts:219](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L219)
|
||||
|
||||
___
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,64 +181,31 @@ Creates a store if it doesn't already exist.
|
||||
|
||||
`Promise`<`Store`\>
|
||||
|
||||
the store.
|
||||
The store.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:52](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L52)
|
||||
|
||||
___
|
||||
|
||||
### decorate
|
||||
|
||||
▸ **decorate**(`store`, `fields`, `expandFields?`): `Store`
|
||||
|
||||
Decorates a store object.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `store` | `Store` | `undefined` | the store to decorate. |
|
||||
| `fields` | `string`[] | `undefined` | the fields to include. |
|
||||
| `expandFields` | `string`[] | `[]` | fields to expand. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Store`
|
||||
|
||||
return the decorated Store.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:266](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L266)
|
||||
[services/store.ts:56](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
### getDefaultCurrency\_
|
||||
|
||||
▸ **getDefaultCurrency_**(`code`): `Object`
|
||||
▸ `Protected` **getDefaultCurrency_**(`code`): `Partial`<`Currency`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `code` | `any` |
|
||||
| `code` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `code` | `any` |
|
||||
| `name` | `any` |
|
||||
| `symbol` | `any` |
|
||||
| `symbol_native` | `any` |
|
||||
`Partial`<`Currency`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:92](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L92)
|
||||
[services/store.ts:113](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
@@ -145,21 +229,21 @@ result after update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:242](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L242)
|
||||
[services/store.ts:263](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L263)
|
||||
|
||||
___
|
||||
|
||||
### retrieve
|
||||
|
||||
▸ **retrieve**(`relations?`): `Promise`<`Store`\>
|
||||
▸ **retrieve**(`config?`): `Promise`<`Store`\>
|
||||
|
||||
Retrieve the store settings. There is always a maximum of one store.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `relations` | `string`[] | `[]` | relations to fetch with store |
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `config` | `FindConfig`<`Store`\> | The config object from which the query will be built |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -169,13 +253,37 @@ the store
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L84)
|
||||
[services/store.ts:92](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L92)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### update
|
||||
|
||||
▸ **update**(`update`): `Promise`<`any`\>
|
||||
▸ **update**(`data`): `Promise`<`Store`\>
|
||||
|
||||
Updates a store
|
||||
|
||||
@@ -183,34 +291,38 @@ Updates a store
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `update` | `any` | an object with the update values. |
|
||||
| `data` | `UpdateStoreInput` | an object with the update values. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`Store`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:108](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L108)
|
||||
[services/store.ts:129](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/store.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`StoreService`](StoreService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`StoreService`](StoreService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`StoreService`](StoreService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/store.js:31](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/store.js#L31)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
# Class: StrategyResolverService
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `TransactionBaseService`<[`StrategyResolverService`](StrategyResolverService.md), `InjectedDependencies`\>
|
||||
|
||||
↳ **`StrategyResolverService`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new StrategyResolverService**(`container`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `container` | `InjectedDependencies` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService<
|
||||
StrategyResolver,
|
||||
InjectedDependencies
|
||||
\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/strategy-resolver.ts:17](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/strategy-resolver.ts#L17)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `InjectedDependencies`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/strategy-resolver.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/strategy-resolver.ts#L15)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### resolveBatchJobByType
|
||||
|
||||
▸ **resolveBatchJobByType**<`T`\>(`type`): `AbstractBatchJobStrategy`<`T`, `unknown`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends `TransactionBaseService`<`never`, `unknown`, `T`\> |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `type` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AbstractBatchJobStrategy`<`T`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/strategy-resolver.ts:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/strategy-resolver.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager?`): [`StrategyResolverService`](StrategyResolverService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`StrategyResolverService`](StrategyResolverService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:21](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L21)
|
||||
[services/swap.js:21](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L21)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -50,7 +50,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L9)
|
||||
[services/swap.js:9](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L9)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -76,7 +76,7 @@ the canceled swap.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:790](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L790)
|
||||
[services/swap.js:790](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L790)
|
||||
|
||||
___
|
||||
|
||||
@@ -100,7 +100,7 @@ updated swap
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:983](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L983)
|
||||
[services/swap.js:983](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L983)
|
||||
|
||||
___
|
||||
|
||||
@@ -129,7 +129,7 @@ the newly created swap.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:313](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L313)
|
||||
[services/swap.js:313](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L313)
|
||||
|
||||
___
|
||||
|
||||
@@ -158,7 +158,7 @@ the swap with its cart_id prop set to the id of
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:544](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L544)
|
||||
[services/swap.js:544](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L544)
|
||||
|
||||
___
|
||||
|
||||
@@ -184,7 +184,7 @@ the updated swap with new status and fulfillments.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:848](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L848)
|
||||
[services/swap.js:848](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L848)
|
||||
|
||||
___
|
||||
|
||||
@@ -211,7 +211,7 @@ the updated swap with new fulfillments and status.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:1016](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L1016)
|
||||
[services/swap.js:1016](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L1016)
|
||||
|
||||
___
|
||||
|
||||
@@ -236,7 +236,7 @@ resolves to the updated result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:1089](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L1089)
|
||||
[services/swap.js:1089](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L1089)
|
||||
|
||||
___
|
||||
|
||||
@@ -259,7 +259,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:238](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L238)
|
||||
[services/swap.js:238](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L238)
|
||||
|
||||
___
|
||||
|
||||
@@ -279,7 +279,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:395](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L395)
|
||||
[services/swap.js:395](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L395)
|
||||
|
||||
___
|
||||
|
||||
@@ -299,7 +299,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:659](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L659)
|
||||
[services/swap.js:659](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L659)
|
||||
|
||||
___
|
||||
|
||||
@@ -324,7 +324,7 @@ the resulting order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:1114](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L1114)
|
||||
[services/swap.js:1114](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L1114)
|
||||
|
||||
___
|
||||
|
||||
@@ -349,7 +349,7 @@ the swap
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:181](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L181)
|
||||
[services/swap.js:181](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L181)
|
||||
|
||||
___
|
||||
|
||||
@@ -374,7 +374,7 @@ the swap
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:216](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L216)
|
||||
[services/swap.js:216](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L216)
|
||||
|
||||
___
|
||||
|
||||
@@ -394,7 +394,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:114](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L114)
|
||||
[services/swap.js:114](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -415,7 +415,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:511](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L511)
|
||||
[services/swap.js:511](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L511)
|
||||
|
||||
___
|
||||
|
||||
@@ -442,7 +442,7 @@ the validated returnItems
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:269](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L269)
|
||||
[services/swap.js:269](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L269)
|
||||
|
||||
___
|
||||
|
||||
@@ -462,4 +462,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/swap.js:86](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/swap.js#L86)
|
||||
[services/swap.js:86](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/swap.js#L86)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:6](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L6)
|
||||
[services/system-payment-provider.js:6](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L6)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -34,7 +34,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:4](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L4)
|
||||
[services/system-payment-provider.js:4](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L4)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -54,7 +54,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:22](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L22)
|
||||
[services/system-payment-provider.js:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:46](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L46)
|
||||
[services/system-payment-provider.js:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -94,7 +94,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L38)
|
||||
[services/system-payment-provider.js:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -114,7 +114,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:10](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L10)
|
||||
[services/system-payment-provider.js:10](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L10)
|
||||
|
||||
___
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:34](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L34)
|
||||
[services/system-payment-provider.js:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -154,7 +154,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:18](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L18)
|
||||
[services/system-payment-provider.js:18](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -174,7 +174,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:14](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L14)
|
||||
[services/system-payment-provider.js:14](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -194,7 +194,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:42](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L42)
|
||||
[services/system-payment-provider.js:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -214,7 +214,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:30](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L30)
|
||||
[services/system-payment-provider.js:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -234,4 +234,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/system-payment-provider.js:26](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/system-payment-provider.js#L26)
|
||||
[services/system-payment-provider.js:26](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/system-payment-provider.js#L26)
|
||||
|
||||
@@ -26,7 +26,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L44)
|
||||
[services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L49)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -36,7 +36,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:35](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L35)
|
||||
[services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L36)
|
||||
[services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L42)
|
||||
[services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L40)
|
||||
[services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L39)
|
||||
[services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -86,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L41)
|
||||
[services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L38)
|
||||
[services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
@@ -106,7 +106,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L37)
|
||||
[services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L42)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -126,7 +126,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:98](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L98)
|
||||
[services/tax-provider.ts:103](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
@@ -152,7 +152,7 @@ the newly created tax lines
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:166](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L166)
|
||||
[services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L171)
|
||||
|
||||
___
|
||||
|
||||
@@ -177,7 +177,7 @@ the newly created tax lines
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:116](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L116)
|
||||
[services/tax-provider.ts:121](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -202,7 +202,7 @@ the cached result or null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:450](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L450)
|
||||
[services/tax-provider.ts:454](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L454)
|
||||
|
||||
___
|
||||
|
||||
@@ -227,7 +227,7 @@ the cache key to use for the id set
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:419](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L419)
|
||||
[services/tax-provider.ts:423](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L423)
|
||||
|
||||
___
|
||||
|
||||
@@ -243,7 +243,7 @@ calls.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `productId` | `string` | the product id to get rates for |
|
||||
| `region` | `Region` | the region to get configured rates for. |
|
||||
| `region` | `RegionDetails` | the region to get configured rates for. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -253,13 +253,13 @@ the tax rates configured for the shipping option.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:374](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L374)
|
||||
[services/tax-provider.ts:378](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L378)
|
||||
|
||||
___
|
||||
|
||||
### getRegionRatesForShipping
|
||||
|
||||
▸ **getRegionRatesForShipping**(`optionId`, `region`): `Promise`<`TaxServiceRate`[]\>
|
||||
▸ **getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\>
|
||||
|
||||
Gets the tax rates configured for a shipping option. The rates are cached
|
||||
between calls.
|
||||
@@ -269,7 +269,7 @@ between calls.
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `optionId` | `string` | the option id of the shipping method. |
|
||||
| `region` | `Region` | the region to get configured rates for. |
|
||||
| `regionDetails` | `RegionDetails` | the region to get configured rates for. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -279,7 +279,7 @@ the tax rates configured for the shipping option.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:327](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L327)
|
||||
[services/tax-provider.ts:332](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L332)
|
||||
|
||||
___
|
||||
|
||||
@@ -306,7 +306,7 @@ the computed tax lines
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:185](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L185)
|
||||
[services/tax-provider.ts:190](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L190)
|
||||
|
||||
___
|
||||
|
||||
@@ -335,7 +335,7 @@ the computed tax lines
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:237](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L237)
|
||||
[services/tax-provider.ts:242](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L242)
|
||||
|
||||
___
|
||||
|
||||
@@ -349,7 +349,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:70](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L70)
|
||||
[services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
@@ -369,7 +369,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:471](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L471)
|
||||
[services/tax-provider.ts:475](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L475)
|
||||
|
||||
___
|
||||
|
||||
@@ -393,7 +393,7 @@ the region specific tax provider
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:80](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L80)
|
||||
[services/tax-provider.ts:85](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
@@ -419,7 +419,7 @@ promise that resolves after the cache has been set
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:430](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L430)
|
||||
[services/tax-provider.ts:434](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L434)
|
||||
|
||||
___
|
||||
|
||||
@@ -439,4 +439,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-provider.ts#L57)
|
||||
[services/tax-provider.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-provider.ts#L62)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L27)
|
||||
[services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L27)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -34,7 +34,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:21](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L21)
|
||||
[services/tax-rate.ts:21](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:22](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L22)
|
||||
[services/tax-rate.ts:22](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:23](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L23)
|
||||
[services/tax-rate.ts:23](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L24)
|
||||
[services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +74,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L25)
|
||||
[services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L25)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:197](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L197)
|
||||
[services/tax-rate.ts:197](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
@@ -118,7 +118,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:233](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L233)
|
||||
[services/tax-rate.ts:233](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L233)
|
||||
|
||||
___
|
||||
|
||||
@@ -140,7 +140,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:273](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L273)
|
||||
[services/tax-rate.ts:273](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L273)
|
||||
|
||||
___
|
||||
|
||||
@@ -160,7 +160,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:104](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L104)
|
||||
[services/tax-rate.ts:104](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
@@ -180,7 +180,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:135](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L135)
|
||||
[services/tax-rate.ts:135](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L135)
|
||||
|
||||
___
|
||||
|
||||
@@ -201,7 +201,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:62](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L62)
|
||||
[services/tax-rate.ts:62](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
@@ -222,7 +222,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:73](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L73)
|
||||
[services/tax-rate.ts:73](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
@@ -243,20 +243,19 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:321](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L321)
|
||||
[services/tax-rate.ts:321](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L321)
|
||||
|
||||
___
|
||||
|
||||
### listByShippingOption
|
||||
|
||||
▸ **listByShippingOption**(`shippingOptionId`, `config`): `Promise`<`TaxRate`[]\>
|
||||
▸ **listByShippingOption**(`shippingOptionId`): `Promise`<`TaxRate`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `shippingOptionId` | `string` |
|
||||
| `config` | `TaxRateListByConfig` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -264,7 +263,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:332](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L332)
|
||||
[services/tax-rate.ts:332](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L332)
|
||||
|
||||
___
|
||||
|
||||
@@ -285,7 +284,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:143](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L143)
|
||||
[services/tax-rate.ts:143](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L143)
|
||||
|
||||
___
|
||||
|
||||
@@ -306,7 +305,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:161](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L161)
|
||||
[services/tax-rate.ts:161](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L161)
|
||||
|
||||
___
|
||||
|
||||
@@ -327,7 +326,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:179](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L179)
|
||||
[services/tax-rate.ts:179](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L179)
|
||||
|
||||
___
|
||||
|
||||
@@ -348,7 +347,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:84](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L84)
|
||||
[services/tax-rate.ts:84](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -369,7 +368,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:120](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L120)
|
||||
[services/tax-rate.ts:120](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L120)
|
||||
|
||||
___
|
||||
|
||||
@@ -389,4 +388,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/tax-rate.ts:43](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/tax-rate.ts#L43)
|
||||
[services/tax-rate.ts:43](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/tax-rate.ts#L43)
|
||||
|
||||
@@ -28,7 +28,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:90](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L90)
|
||||
[services/totals.ts:90](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L90)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -38,7 +38,7 @@ BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:88](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L88)
|
||||
[services/totals.ts:88](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,7 +48,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:87](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L87)
|
||||
[services/totals.ts:87](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L87)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -76,7 +76,7 @@ triples of lineitem, variant and applied discount
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:545](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L545)
|
||||
[services/totals.ts:545](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L545)
|
||||
|
||||
___
|
||||
|
||||
@@ -105,7 +105,7 @@ array of triples of lineitem, variant and applied discount
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:587](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L587)
|
||||
[services/totals.ts:587](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L587)
|
||||
|
||||
___
|
||||
|
||||
@@ -132,7 +132,7 @@ the allocation map for the line items in the cart or order.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:368](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L368)
|
||||
[services/totals.ts:368](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L368)
|
||||
|
||||
___
|
||||
|
||||
@@ -157,7 +157,7 @@ the tax calculation context
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:892](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L892)
|
||||
[services/totals.ts:891](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L891)
|
||||
|
||||
___
|
||||
|
||||
@@ -182,7 +182,7 @@ the total discounts amount
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:858](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L858)
|
||||
[services/totals.ts:857](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L857)
|
||||
|
||||
___
|
||||
|
||||
@@ -206,7 +206,7 @@ the gift card amount applied to the cart or order
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:830](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L830)
|
||||
[services/totals.ts:829](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L829)
|
||||
|
||||
___
|
||||
|
||||
@@ -232,7 +232,7 @@ the allocations that the discount has on the items in the cart or
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:638](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L638)
|
||||
[services/totals.ts:638](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L638)
|
||||
|
||||
___
|
||||
|
||||
@@ -252,7 +252,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:615](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L615)
|
||||
[services/totals.ts:615](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L615)
|
||||
|
||||
___
|
||||
|
||||
@@ -273,7 +273,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:600](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L600)
|
||||
[services/totals.ts:600](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L600)
|
||||
|
||||
___
|
||||
|
||||
@@ -298,7 +298,7 @@ the line item refund amount.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:460](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L460)
|
||||
[services/totals.ts:460](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L460)
|
||||
|
||||
___
|
||||
|
||||
@@ -325,7 +325,7 @@ the line item total
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:800](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L800)
|
||||
[services/totals.ts:799](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L799)
|
||||
|
||||
___
|
||||
|
||||
@@ -353,7 +353,7 @@ the breakdown of the line item totals
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:684](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L684)
|
||||
[services/totals.ts:684](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L684)
|
||||
|
||||
___
|
||||
|
||||
@@ -377,7 +377,7 @@ the total paid amount
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:125](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L125)
|
||||
[services/totals.ts:125](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
@@ -404,7 +404,7 @@ the calculated subtotal
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:504](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L504)
|
||||
[services/totals.ts:504](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L504)
|
||||
|
||||
___
|
||||
|
||||
@@ -428,7 +428,7 @@ the total refunded amount for an order.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:445](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L445)
|
||||
[services/totals.ts:445](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L445)
|
||||
|
||||
___
|
||||
|
||||
@@ -455,7 +455,7 @@ An object that breaks down the totals for the shipping method
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:159](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L159)
|
||||
[services/totals.ts:159](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
@@ -479,7 +479,7 @@ shipping total
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:267](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L267)
|
||||
[services/totals.ts:267](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L267)
|
||||
|
||||
___
|
||||
|
||||
@@ -504,7 +504,7 @@ the calculated subtotal
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:243](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L243)
|
||||
[services/totals.ts:243](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L243)
|
||||
|
||||
___
|
||||
|
||||
@@ -529,7 +529,7 @@ the swap total
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:140](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L140)
|
||||
[services/totals.ts:140](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L140)
|
||||
|
||||
___
|
||||
|
||||
@@ -555,7 +555,7 @@ tax total
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:282](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L282)
|
||||
[services/totals.ts:282](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L282)
|
||||
|
||||
___
|
||||
|
||||
@@ -580,7 +580,7 @@ the calculated subtotal
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:106](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L106)
|
||||
[services/totals.ts:106](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L106)
|
||||
|
||||
___
|
||||
|
||||
@@ -604,4 +604,4 @@ the rounded value
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/totals.ts:922](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/totals.ts#L922)
|
||||
[services/totals.ts:921](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/totals.ts#L921)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Class: TransactionService
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
|
||||
↳ **`TransactionService`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TransactionService**()
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/transaction.js:5](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/transaction.js#L5)
|
||||
|
||||
## Methods
|
||||
|
||||
### createSession
|
||||
|
||||
▸ **createSession**(): `Promise`<`ClientSession`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`ClientSession`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/transaction.js:9](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/transaction.js#L9)
|
||||
@@ -4,7 +4,7 @@ Provides layer to manipulate users.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`UserService`](UserService.md)\>
|
||||
|
||||
↳ **`UserService`**
|
||||
|
||||
@@ -22,51 +22,79 @@ Provides layer to manipulate users.
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<UserService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:36](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L36)
|
||||
[services/user.ts:37](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
___
|
||||
|
||||
### eventBus\_
|
||||
|
||||
• `Private` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:32](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L32)
|
||||
[services/user.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Private` **manager\_**: `EntityManager`
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:33](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L33)
|
||||
[services/user.ts:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Private` **transactionManager\_**: `EntityManager`
|
||||
• `Protected` **transactionManager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:34](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L34)
|
||||
[services/user.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### userRepository\_
|
||||
|
||||
• `Private` **userRepository\_**: typeof `UserRepository`
|
||||
• `Protected` `Readonly` **userRepository\_**: typeof `UserRepository`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:31](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L31)
|
||||
[services/user.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -82,10 +110,49 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:27](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L27)
|
||||
[services/user.ts:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L28)
|
||||
|
||||
## Methods
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
▸ `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 |
|
||||
| :------ |
|
||||
| `TResult` |
|
||||
| `TError` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ **create**(`user`, `password`): `Promise`<`User`\>
|
||||
@@ -108,13 +175,13 @@ the result of create
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:188](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L188)
|
||||
[services/user.ts:183](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L183)
|
||||
|
||||
___
|
||||
|
||||
### delete
|
||||
|
||||
▸ **delete**(`userId`): `Promise`<``null``\>
|
||||
▸ **delete**(`userId`): `Promise`<`void`\>
|
||||
|
||||
Deletes a user from a given user id.
|
||||
|
||||
@@ -126,13 +193,13 @@ Deletes a user from a given user id.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<``null``\>
|
||||
`Promise`<`void`\>
|
||||
|
||||
the result of the delete operation.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:257](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L257)
|
||||
[services/user.ts:251](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L251)
|
||||
|
||||
___
|
||||
|
||||
@@ -160,7 +227,7 @@ the generated JSON web token
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:311](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L311)
|
||||
[services/user.ts:305](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L305)
|
||||
|
||||
___
|
||||
|
||||
@@ -184,7 +251,7 @@ hashed password
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:176](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L176)
|
||||
[services/user.ts:171](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L171)
|
||||
|
||||
___
|
||||
|
||||
@@ -207,7 +274,7 @@ the result of the find operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:88](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L88)
|
||||
[services/user.ts:68](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
@@ -233,7 +300,7 @@ the user document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:100](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L100)
|
||||
[services/user.ts:84](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
@@ -259,7 +326,7 @@ the user document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:124](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L124)
|
||||
[services/user.ts:111](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
@@ -285,7 +352,7 @@ the user document.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:152](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L152)
|
||||
[services/user.ts:143](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L143)
|
||||
|
||||
___
|
||||
|
||||
@@ -312,7 +379,31 @@ the result of the update operation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:282](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L282)
|
||||
[services/user.ts:276](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L276)
|
||||
|
||||
___
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -337,7 +428,7 @@ the result of create
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:216](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L216)
|
||||
[services/user.ts:211](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L211)
|
||||
|
||||
___
|
||||
|
||||
@@ -361,24 +452,28 @@ the validated email
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:70](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L70)
|
||||
[services/user.ts:50](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/user.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`UserService`](UserService.md)
|
||||
▸ **withTransaction**(`transactionManager?`): [`UserService`](UserService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `EntityManager` |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`UserService`](UserService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/user.ts:49](https://github.com/medusajs/medusa/blob/2d3e404f/packages/medusa/src/services/user.ts#L49)
|
||||
[interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
## Classes
|
||||
|
||||
- [AuthService](classes/AuthService.md)
|
||||
- [BatchJobService](classes/BatchJobService.md)
|
||||
- [CartService](classes/CartService.md)
|
||||
- [ClaimItemService](classes/ClaimItemService.md)
|
||||
- [ClaimService](classes/ClaimService.md)
|
||||
@@ -24,6 +25,7 @@
|
||||
- [OauthService](classes/OauthService.md)
|
||||
- [OrderService](classes/OrderService.md)
|
||||
- [PaymentProviderService](classes/PaymentProviderService.md)
|
||||
- [PricingService](classes/PricingService.md)
|
||||
- [ProductCollectionService](classes/ProductCollectionService.md)
|
||||
- [ProductService](classes/ProductService.md)
|
||||
- [ProductTypeService](classes/ProductTypeService.md)
|
||||
@@ -36,10 +38,10 @@
|
||||
- [ShippingOptionService](classes/ShippingOptionService.md)
|
||||
- [ShippingProfileService](classes/ShippingProfileService.md)
|
||||
- [StoreService](classes/StoreService.md)
|
||||
- [StrategyResolverService](classes/StrategyResolverService.md)
|
||||
- [SwapService](classes/SwapService.md)
|
||||
- [SystemPaymentProviderService](classes/SystemPaymentProviderService.md)
|
||||
- [TaxProviderService](classes/TaxProviderService.md)
|
||||
- [TaxRateService](classes/TaxRateService.md)
|
||||
- [TotalsService](classes/TotalsService.md)
|
||||
- [TransactionService](classes/TransactionService.md)
|
||||
- [UserService](classes/UserService.md)
|
||||
|
||||
Reference in New Issue
Block a user