docs: update Typedoc and regenerate references (#1994)
* generated new services reference * changed from automatic push to automated pull request * updated typedoc, regenerated JS Client reference * regenerated the reference after updating typedoc * added action for js client
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `"medusa-interfaces"`
|
||||
- `TransactionBaseService`<[`InventoryService`](InventoryService.md)\>
|
||||
|
||||
↳ **`InventoryService`**
|
||||
|
||||
@@ -16,36 +16,145 @@
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `__namedParameters` | `Object` |
|
||||
| `__namedParameters` | `InventoryServiceProps` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
BaseService.constructor
|
||||
TransactionBaseService<InventoryService\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:5](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/inventory.js#L5)
|
||||
[packages/medusa/src/services/inventory.ts:18](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L18)
|
||||
|
||||
## Properties
|
||||
|
||||
### configModule
|
||||
|
||||
• `Protected` `Optional` `Readonly` **configModule**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.configModule
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### container
|
||||
|
||||
• `Protected` `Readonly` **container**: `unknown`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.container
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:12](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### manager\_
|
||||
|
||||
• `Protected` **manager\_**: `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.manager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/services/inventory.ts:15](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### productVariantService\_
|
||||
|
||||
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/services/inventory.ts:13](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### transactionManager\_
|
||||
|
||||
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
|
||||
|
||||
#### Overrides
|
||||
|
||||
TransactionBaseService.transactionManager\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/services/inventory.ts:16](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L16)
|
||||
|
||||
## Methods
|
||||
|
||||
### adjustInventory
|
||||
|
||||
▸ **adjustInventory**(`variantId`, `adjustment`): `Promise`<`any`\>
|
||||
▸ **adjustInventory**(`variantId`, `adjustment`): `Promise`<`undefined` \| `ProductVariant`\>
|
||||
|
||||
Updates the inventory of a variant based on a given adjustment.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variantId` | `string` | |
|
||||
| `adjustment` | `number` | |
|
||||
| `variantId` | `string` | the id of the variant to update |
|
||||
| `adjustment` | `number` | the number to adjust the inventory quantity by |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
`Promise`<`undefined` \| `ProductVariant`\>
|
||||
|
||||
resolves to the update result.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:36](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/inventory.js#L36)
|
||||
[packages/medusa/src/services/inventory.ts:31](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### 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
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:53](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -53,37 +162,71 @@ ___
|
||||
|
||||
▸ **confirmInventory**(`variantId`, `quantity`): `Promise`<`boolean`\>
|
||||
|
||||
Checks if the inventory of a variant can cover a given quantity. Will
|
||||
return true if the variant doesn't have managed inventory or if the variant
|
||||
allows backorders or if the inventory quantity is greater than `quantity`.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `variantId` | `string` | |
|
||||
| `quantity` | `number` | |
|
||||
| `variantId` | `undefined` \| ``null`` \| `string` | the id of the variant to check |
|
||||
| `quantity` | `number` | the number of units to check availability for |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
true if the inventory covers the quantity
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:62](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/inventory.js#L62)
|
||||
[packages/medusa/src/services/inventory.ts:63](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/services/inventory.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
▸ **withTransaction**(`transactionManager`): [`InventoryService`](InventoryService.md)
|
||||
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager` | `any` |
|
||||
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.shouldRetryTransaction\_
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:34](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### withTransaction
|
||||
|
||||
▸ **withTransaction**(`transactionManager?`): [`InventoryService`](InventoryService.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `transactionManager?` | `EntityManager` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`InventoryService`](InventoryService.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TransactionBaseService.withTransaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/inventory.js:15](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/inventory.js#L15)
|
||||
[packages/medusa/src/interfaces/transaction-base-service.ts:16](https://github.com/medusajs/medusa/blob/f406c8d4/packages/medusa/src/interfaces/transaction-base-service.ts#L16)
|
||||
|
||||
Reference in New Issue
Block a user