docs: added dividers + see also section (#2899)
This commit is contained in:
@@ -8,6 +8,8 @@ Medusa's event system works by pushing data to a Queue that each handler then ge
|
||||
|
||||
You can learn how to [install Redis](../../../tutorial/0-set-up-your-development-environment.mdx#redis) and [configure it with Medusa](../../../usage/configurations.md#redis) before you get started.
|
||||
|
||||
---
|
||||
|
||||
## Implementation
|
||||
|
||||
A subscriber is a TypeScript or JavaScript file that is created under `src/subscribers`. Its file name, by convension, should be the class name of the subscriber without the word `Subscriber`. For example, if the subscriber is `HelloSubscriber`, the file name should be `hello.ts`.
|
||||
@@ -40,6 +42,8 @@ The `data` object won't contain other order data. Only the ID of the order. You
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Using Services in Subscribers
|
||||
|
||||
You can access any service through the dependencies injected to your subscriber’s constructor.
|
||||
@@ -69,7 +73,9 @@ When using attributes defined in the subscriber, such as the `productService` in
|
||||
|
||||
:::
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
- [View the list of all events](events-list.md)
|
||||
- [Learn how to create a service.](/advanced/backend/services/create-service)
|
||||
## See Also
|
||||
|
||||
- [Events reference](events-list.md)
|
||||
- [Create a Service](../services/create-service)
|
||||
|
||||
@@ -6,6 +6,8 @@ This document details all events in Medusa, when they are triggered, and what da
|
||||
|
||||
It is assumed you’re already familiar with [Subscribers in Medusa and how to listen to events](create-subscriber.md). You can then use the name of events from this documentation in your subscriber to listen to events.
|
||||
|
||||
---
|
||||
|
||||
## Legend
|
||||
|
||||
Events in this document are listed under the entity they’re associated with. They’re listed in a table of three columns:
|
||||
@@ -14,6 +16,8 @@ Events in this document are listed under the entity they’re associated with. T
|
||||
2. **Description:** When this event is triggered.
|
||||
3. **Event Data Payload**: The data your handler receives as a parameter.
|
||||
|
||||
---
|
||||
|
||||
## Batch Jobs Events
|
||||
|
||||
This section holds all events related to batch jobs.
|
||||
@@ -208,6 +212,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Cart Events
|
||||
|
||||
This section holds all events related to a cart.
|
||||
@@ -284,6 +290,8 @@ An object with at least the ID of the cart, however, in most cases the entire ca
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Claim Events
|
||||
|
||||
This section holds all events related to claims.
|
||||
@@ -459,6 +467,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Claim Item Events
|
||||
|
||||
This section holds all events related to claim items.
|
||||
@@ -553,6 +563,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Currency Events
|
||||
|
||||
This section holds all events related to currencies.
|
||||
@@ -599,6 +611,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Customer Events
|
||||
|
||||
This section holds all events related to customers.
|
||||
@@ -685,6 +699,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Draft Order Events
|
||||
|
||||
This section holds all events related to draft orders.
|
||||
@@ -755,6 +771,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Gift Card Events
|
||||
|
||||
This section holds all events related to gift cards.
|
||||
@@ -802,6 +820,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Invite Events
|
||||
|
||||
This section holds all events related to invites.
|
||||
@@ -849,6 +869,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Note Events
|
||||
|
||||
This section holds all events related to notes.
|
||||
@@ -943,6 +965,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## App Authentication Events
|
||||
|
||||
This section holds all events related to app authentications.
|
||||
@@ -1008,6 +1032,8 @@ The returned data from the method `refreshToken` in the auth handler service of
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Order Events
|
||||
|
||||
This section holds all events related to orders.
|
||||
@@ -1460,6 +1486,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Order Edit Events
|
||||
|
||||
This section holds all events related to order edits.
|
||||
@@ -1637,6 +1665,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Order Edit Item Changes Events
|
||||
|
||||
This section holds all events related to order edit item changes.
|
||||
@@ -1714,6 +1744,8 @@ Triggered when an order edit item change is deleted.
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Payment Events
|
||||
|
||||
This section holds all events related to payment.
|
||||
@@ -1859,6 +1891,8 @@ The entire payment passed as an object. You can refer to the [Payment entity](..
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Payment Collection Events
|
||||
|
||||
This section holds all events related to payment collections.
|
||||
@@ -1954,6 +1988,8 @@ The entire payment collection passed as an object. You can refer to the [Payment
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Product Events
|
||||
|
||||
This section holds all events related to products.
|
||||
@@ -2052,6 +2088,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Product Variant Events
|
||||
|
||||
This section holds all events related to product variants.
|
||||
@@ -2151,6 +2189,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Publishable API Key Events
|
||||
|
||||
This section holds all events related to publishable API keys.
|
||||
@@ -2233,6 +2273,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Region Events
|
||||
|
||||
This section holds all events related to regions.
|
||||
@@ -2327,6 +2369,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Sales Channel Events
|
||||
|
||||
This section holds all events related to sales channels.
|
||||
@@ -2431,6 +2475,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Swap Events
|
||||
|
||||
This section holds all events related to swaps.
|
||||
@@ -2681,6 +2727,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Token Events
|
||||
|
||||
This section holds all events related to tokens.
|
||||
@@ -2730,6 +2778,8 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## User Events
|
||||
|
||||
This section holds all events related to users.
|
||||
@@ -2848,7 +2898,9 @@ Object of the following format:
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
- Learn how you can [use services in subscribers](create-subscriber.md#using-services-in-subscribers).
|
||||
- Learn how to [create notifications](../notification/overview.md) in Medusa.
|
||||
## See Also
|
||||
|
||||
- [Use services in subscribers](create-subscriber.md#using-services-in-subscribers)
|
||||
- [Create a notification provider](../notification/overview.md)
|
||||
|
||||
@@ -10,6 +10,8 @@ The purpose of these events is to allow other parts of the platform, or third-pa
|
||||
|
||||
Medusa's queuing and events system is handled by Redis. So, you must have [Redis configured](../../../tutorial/0-set-up-your-development-environment.mdx#redis) on your server to use subscribers.
|
||||
|
||||
---
|
||||
|
||||
## What are Subscribers
|
||||
|
||||
Subscribers register handlers for an events and allows you to perform an action when that event occurs. For example, if you want to send your customer an email when they place an order, then you can listen to the `order.placed` event and send the email when the event is emitted.
|
||||
@@ -20,7 +22,9 @@ Custom subscribers are TypeScript or JavaScript files in your project's `src/sub
|
||||
|
||||
Whenever an event is emitted, the subscriber’s registered handler method is executed. The handler method receives as a parameter an object that holds data related to the event. For example, if an order is placed the `order.placed` event will be emitted and all the handlers will receive the order id in the parameter object.
|
||||
|
||||
## What's Next
|
||||
---
|
||||
|
||||
- Learn [how to create a Subscriber](create-subscriber.md).
|
||||
- [View the list of all events](events-list.md).
|
||||
## See Also
|
||||
|
||||
- [Create a Subscriber](create-subscriber.md).
|
||||
- [Events reference](events-list.md).
|
||||
|
||||
Reference in New Issue
Block a user