chore(docs): Generated References (#5516)

Generated the following references:
- `js-client`
- `pricing`
- `services`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-11-02 09:16:47 +00:00
committed by GitHub
parent 80fe362f33
commit aa2bb7a31b
271 changed files with 38146 additions and 9809 deletions

View File

@@ -1,4 +1,4 @@
# Class: GiftCardService
# GiftCardService
Provides layer to manipulate gift cards.
@@ -12,12 +12,12 @@ Provides layer to manipulate gift cards.
### constructor
**new GiftCardService**(`«destructured»`)
**new GiftCardService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L39)
[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L39)
## Properties
### \_\_configModule\_\_
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
`Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBus\_
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L33)
[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L33)
___
### giftCardRepository\_
`Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> }
`Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: Method listGiftCardsAndCount }
#### Defined in
[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L29)
[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L29)
___
### giftCardTransactionRepo\_
`Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\>
`Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\>
#### Defined in
[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L31)
[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L31)
___
### manager\_
`Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -112,23 +112,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### regionService\_
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L32)
[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L32)
___
### transactionManager\_
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -136,13 +136,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
`Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -152,47 +152,47 @@ ___
#### Defined in
[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L35)
[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L35)
## Accessors
### activeManager\_
`Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`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` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | 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 |
@@ -201,7 +201,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -209,86 +209,91 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
**create**(`giftCard`): `Promise`<`GiftCard`\>
**create**(`giftCard`): `Promise`<`GiftCard`\>
Creates a gift card with provided data given that the data is validated.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCard` | `CreateGiftCardInput` | the gift card data to create |
#### Returns
`Promise`<`GiftCard`\>
the result of the create operation
-`Promise`: the result of the create operation
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L122)
[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L122)
___
### createTransaction
**createTransaction**(`data`): `Promise`<`string`\>
**createTransaction**(`data`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateGiftCardTransactionInput` |
#### Returns
`Promise`<`string`\>
-`Promise`:
-`string`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L106)
[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L106)
___
### delete
**delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\>
**delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\>
Deletes a gift card idempotently
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | id of gift card to delete |
#### Returns
`Promise`<`void` \| `GiftCard`\>
the result of the delete operation
-`Promise`: the result of the delete operation
-`void \| GiftCard`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L295)
[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L295)
___
### list
**list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\>
**list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -296,22 +301,24 @@ ___
`Promise`<`GiftCard`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`GiftCard[]`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L98)
[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L98)
___
### listAndCount
**listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -319,24 +326,26 @@ ___
`Promise`<[`GiftCard`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`GiftCard[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L74)
[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L74)
___
### retrieve
**retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\>
**retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\>
Gets a gift card by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | id of gift card to retrieve |
| `config` | `FindConfig`<`GiftCard`\> | optional values to include with gift card query |
@@ -344,22 +353,23 @@ Gets a gift card by id.
`Promise`<`GiftCard`\>
the gift card
-`Promise`: the gift card
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L215)
[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L215)
___
### retrieveByCode
**retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\>
**retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `code` | `string` |
| `config` | `FindConfig`<`GiftCard`\> |
@@ -367,20 +377,23 @@ ___
`Promise`<`GiftCard`\>
-`Promise`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L229)
[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L229)
___
### retrieve\_
`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\>
`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`GiftCard`\> |
| `config` | `FindConfig`<`GiftCard`\> |
@@ -388,46 +401,51 @@ ___
`Promise`<`GiftCard`\>
-`Promise`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L182)
[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L182)
___
### shouldRetryTransaction\_
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
**update**(`giftCardId`, `update`): `Promise`<`GiftCard`\>
**update**(`giftCardId`, `update`): `Promise`<`GiftCard`\>
Updates a giftCard.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | giftCard id of giftCard to update |
| `update` | `UpdateGiftCardInput` | the data to update the giftCard with |
@@ -435,41 +453,44 @@ Updates a giftCard.
`Promise`<`GiftCard`\>
the result of the update operation
-`Promise`: the result of the update operation
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L249)
[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L249)
___
### withTransaction
**withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md)
**withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`GiftCardService`](GiftCardService.md)
-`GiftCardService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
___
### generateCode
`Static` **generateCode**(): `string`
`Static` **generateCode**(): `string`
Generates a 16 character gift card code
@@ -477,25 +498,25 @@ Generates a 16 character gift card code
`string`
the generated gift card code
-`string`: (optional) the generated gift card code
#### Defined in
[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L58)
[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L58)
___
### resolveTaxRate
`Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number`
`Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number`
The tax_rate of the giftcard can depend on whether regions tax gift cards, an input
provided by the user or the tax rate. Based on these conditions, tax_rate changes.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `giftCardTaxRate` | ``null`` \| `number` |
| `region` | `Region` |
@@ -503,8 +524,8 @@ provided by the user or the tax rate. Based on these conditions, tax_rate change
``null`` \| `number`
the tax rate for the gift card
-```null`` \| number`: (optional) the tax rate for the gift card
#### Defined in
[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L161)
[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L161)