chore: fixed commit branch on generate reference action (#1857)
* fixed commit branch * fixes after yarn upgrade
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
# Class: EventBusService
|
||||
|
||||
Can keep track of multiple subscribers to different events and run the
|
||||
subscribers when events happen. Events will run asynchronously.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
@@ -19,7 +16,7 @@ subscribers when events happen. Events will run asynchronously.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:38](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L38)
|
||||
[services/event-bus.ts:38](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L38)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -29,7 +26,7 @@ subscribers when events happen. Events will run asynchronously.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:24](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L24)
|
||||
[services/event-bus.ts:24](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -39,7 +36,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:29](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L29)
|
||||
[services/event-bus.ts:29](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -49,7 +46,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:32](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L32)
|
||||
[services/event-bus.ts:32](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,7 +56,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L36)
|
||||
[services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -69,7 +66,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:26](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L26)
|
||||
[services/event-bus.ts:26](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -79,7 +76,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:25](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L25)
|
||||
[services/event-bus.ts:25](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
@@ -89,7 +86,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L28)
|
||||
[services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -99,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L33)
|
||||
[services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -109,7 +106,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L30)
|
||||
[services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
@@ -119,7 +116,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L31)
|
||||
[services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
@@ -129,7 +126,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L34)
|
||||
[services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
@@ -139,7 +136,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L27)
|
||||
[services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -149,7 +146,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:35](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L35)
|
||||
[services/event-bus.ts:35](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L35)
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -157,8 +154,6 @@ ___
|
||||
|
||||
▸ **createCronJob**<`T`\>(`eventName`, `data`, `cron`, `handler`): `void`
|
||||
|
||||
Registers a cron job.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
@@ -169,20 +164,18 @@ Registers a cron job.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `string` | the name of the event |
|
||||
| `data` | `T` | the data to be sent with the event |
|
||||
| `cron` | `string` | the cron pattern |
|
||||
| `handler` | `Subscriber`<`unknown`\> | the handler to call on each cron job |
|
||||
| `eventName` | `string` | |
|
||||
| `data` | `T` | |
|
||||
| `cron` | `string` | |
|
||||
| `handler` | `Subscriber`<`unknown`\> | |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
void
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:308](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L308)
|
||||
[services/event-bus.ts:308](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L308)
|
||||
|
||||
___
|
||||
|
||||
@@ -190,8 +183,6 @@ ___
|
||||
|
||||
▸ **cronWorker_**<`T`\>(`job`): `Promise`<`unknown`[]\>
|
||||
|
||||
Handles incoming jobs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
@@ -202,7 +193,7 @@ Handles incoming jobs.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `job` | `Object` | The job object |
|
||||
| `job` | `Object` | |
|
||||
| `job.data` | `Object` | - |
|
||||
| `job.data.data` | `T` | - |
|
||||
| `job.data.eventName` | `string` | - |
|
||||
@@ -211,11 +202,9 @@ Handles incoming jobs.
|
||||
|
||||
`Promise`<`unknown`[]\>
|
||||
|
||||
resolves to the results of the subscriber calls.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:281](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L281)
|
||||
[services/event-bus.ts:281](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L281)
|
||||
|
||||
___
|
||||
|
||||
@@ -223,8 +212,6 @@ ___
|
||||
|
||||
▸ **emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\>
|
||||
|
||||
Calls all subscribers when an event occurs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
@@ -235,20 +222,18 @@ Calls all subscribers when an event occurs.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `string` | the name of the event to be process. |
|
||||
| `data` | `T` | the data to send to the subscriber. |
|
||||
| `options` | `Object` | options to add the job with |
|
||||
| `eventName` | `string` | |
|
||||
| `data` | `T` | |
|
||||
| `options` | `Object` | |
|
||||
| `options.delay?` | `number` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void` \| `StagedJob`\>
|
||||
|
||||
the job from our queue
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:179](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L179)
|
||||
[services/event-bus.ts:179](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L179)
|
||||
|
||||
___
|
||||
|
||||
@@ -262,7 +247,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:215](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L215)
|
||||
[services/event-bus.ts:215](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
@@ -270,24 +255,20 @@ ___
|
||||
|
||||
▸ `Protected` **registerCronHandler_**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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. |
|
||||
| `event` | `string` \| `symbol` | |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | |
|
||||
|
||||
#### 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)
|
||||
[services/event-bus.ts:158](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L158)
|
||||
|
||||
___
|
||||
|
||||
@@ -301,7 +282,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:205](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L205)
|
||||
[services/event-bus.ts:205](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
@@ -315,7 +296,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:210](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L210)
|
||||
[services/event-bus.ts:210](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L210)
|
||||
|
||||
___
|
||||
|
||||
@@ -323,24 +304,20 @@ ___
|
||||
|
||||
▸ **subscribe**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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. |
|
||||
| `event` | `string` \| `symbol` | |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`EventBusService`](EventBusService.md)
|
||||
|
||||
this
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:118](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L118)
|
||||
[services/event-bus.ts:118](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L118)
|
||||
|
||||
___
|
||||
|
||||
@@ -348,24 +325,20 @@ ___
|
||||
|
||||
▸ **unsubscribe**(`event`, `subscriber`): [`EventBusService`](EventBusService.md)
|
||||
|
||||
Adds a function to a list of event subscribers.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `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. |
|
||||
| `event` | `string` \| `symbol` | |
|
||||
| `subscriber` | `Subscriber`<`unknown`\> | |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`EventBusService`](EventBusService.md)
|
||||
|
||||
this
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:136](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L136)
|
||||
[services/event-bus.ts:136](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
@@ -385,7 +358,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:88](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L88)
|
||||
[services/event-bus.ts:88](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L88)
|
||||
|
||||
___
|
||||
|
||||
@@ -393,8 +366,6 @@ ___
|
||||
|
||||
▸ **worker_**<`T`\>(`job`): `Promise`<`unknown`[]\>
|
||||
|
||||
Handles incoming jobs.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
@@ -405,7 +376,7 @@ Handles incoming jobs.
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `job` | `Object` | The job object |
|
||||
| `job` | `Object` | |
|
||||
| `job.data` | `Object` | - |
|
||||
| `job.data.data` | `T` | - |
|
||||
| `job.data.eventName` | `string` | - |
|
||||
@@ -414,8 +385,6 @@ Handles incoming jobs.
|
||||
|
||||
`Promise`<`unknown`[]\>
|
||||
|
||||
resolves to the results of the subscriber calls.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[services/event-bus.ts:250](https://github.com/medusajs/medusa/blob/ae5c88b89/packages/medusa/src/services/event-bus.ts#L250)
|
||||
[services/event-bus.ts:250](https://github.com/medusajs/medusa/blob/32b066d92/packages/medusa/src/services/event-bus.ts#L250)
|
||||
|
||||
Reference in New Issue
Block a user