docs: generate events reference (#12341)

* docs: generate events reference

* change link in navbar

* fix redirect
This commit is contained in:
Shahed Nasser
2025-05-01 19:39:53 +03:00
committed by GitHub
parent 332e46d1db
commit 70a99a2434
94 changed files with 31164 additions and 18109 deletions
+1 -5
View File
@@ -19,11 +19,7 @@ const compat = new FlatCompat({
export default [
{
ignores: [
"**/references/**/*",
"**/events-reference/**/*",
"**/_events-table/**/*",
],
ignores: ["**/references/**/*"],
},
{
plugins: {
@@ -66,4 +66,4 @@ This logs the product ID received in the `product.created` events data payloa
## List of Events with Data Payload
Refer to [this reference](!resources!/events-reference) for a full list of events emitted by Medusa and their data payloads. */}
Refer to [this reference](!resources!/references/events) for a full list of events emitted by Medusa and their data payloads. */}
@@ -26,7 +26,7 @@ If the action you're performing is integral to the main flow of the core commerc
### List of Emitted Events
Find a list of all emitted events in [this reference](!resources!/events-reference).
Find a list of all emitted events in [this reference](!resources!/references/events).
---
+1 -1
View File
@@ -132,7 +132,7 @@ This documentation is split into the following sections:
[References](!resources!/references-overview)
</Table.Cell>
<Table.Cell>
Useful during your development with Medusa to learn about different APIs and how to use them. Its references include the [Events Reference](!resources!/events-reference), [Core Workflows Reference](!resources!/medusa-workflows-reference), and more.
Useful during your development with Medusa to learn about different APIs and how to use them. Its references include the [Events Reference](!resources!/references/events), [Core Workflows Reference](!resources!/medusa-workflows-reference), and more.
</Table.Cell>
</Table.Row>
<Table.Row>
+3 -3
View File
@@ -2,7 +2,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/scheduled-jobs/page.mdx": "2024-12-09T10:51:40.570Z",
"app/learn/fundamentals/workflows/page.mdx": "2024-12-09T14:45:17.837Z",
"app/learn/deployment/page.mdx": "2025-03-11T14:53:25.540Z",
"app/learn/page.mdx": "2025-04-17T08:50:17.036Z",
"app/learn/page.mdx": "2025-05-01T15:30:08.238Z",
"app/learn/fundamentals/modules/commerce-modules/page.mdx": "2025-04-17T08:51:32.723Z",
"app/learn/fundamentals/workflows/retry-failed-steps/page.mdx": "2025-03-28T07:15:19.388Z",
"app/learn/fundamentals/workflows/workflow-hooks/page.mdx": "2024-12-09T10:44:33.781Z",
@@ -15,7 +15,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/medusa-container/page.mdx": "2024-12-09T11:02:38.225Z",
"app/learn/fundamentals/api-routes/page.mdx": "2024-12-04T11:02:57.134Z",
"app/learn/fundamentals/modules/modules-directory-structure/page.mdx": "2024-12-09T10:32:46.839Z",
"app/learn/fundamentals/events-and-subscribers/page.mdx": "2025-04-18T10:42:32.803Z",
"app/learn/fundamentals/events-and-subscribers/page.mdx": "2025-05-01T15:30:08.333Z",
"app/learn/fundamentals/modules/container/page.mdx": "2025-03-18T15:10:03.574Z",
"app/learn/fundamentals/workflows/execute-another-workflow/page.mdx": "2024-12-09T15:56:22.895Z",
"app/learn/fundamentals/modules/loaders/page.mdx": "2025-04-22T15:32:00.430Z",
@@ -24,7 +24,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/modules/remote-link/page.mdx": "2024-09-30T08:43:53.127Z",
"app/learn/fundamentals/api-routes/protected-routes/page.mdx": "2025-03-17T11:47:10.101Z",
"app/learn/fundamentals/workflows/add-workflow-hook/page.mdx": "2024-12-09T14:42:39.693Z",
"app/learn/fundamentals/events-and-subscribers/data-payload/page.mdx": "2024-10-21T13:30:21.369Z",
"app/learn/fundamentals/events-and-subscribers/data-payload/page.mdx": "2025-05-01T15:30:08.421Z",
"app/learn/fundamentals/workflows/advanced-example/page.mdx": "2024-09-11T10:46:59.975Z",
"app/learn/fundamentals/events-and-subscribers/emit-event/page.mdx": "2025-03-18T15:09:40.243Z",
"app/learn/fundamentals/workflows/conditions/page.mdx": "2025-01-27T08:45:19.027Z",
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -274,7 +274,7 @@ Businesses of all sizes can use Medusa, from small start ups to large enterprise
- [Troubleshooting Guides](https://docs.medusajs.com/resources/troubleshooting/index.html.md): Find solutions for common problems you face during your development.
- [Admin Widget Injection Zones](https://docs.medusajs.com/resources/admin-widget-injection-zones/index.html.md): List of zones you can inject admin widgets into.
- [Medusa Container Resources](https://docs.medusajs.com/resources/medusa-container-resources/index.html.md): List of resources or dependencies you can resolve from the Medusa container.
- [Events List](https://docs.medusajs.com/resources/events-reference/index.html.md): List of events you can listen to in a subscriber.
- [Events List](https://docs.medusajs.com/resources/references/events/index.html.md): List of events you can listen to in a subscriber.
- [Workflows SDK Reference](https://docs.medusajs.com/resources/references/workflows/index.html.md): A reference to the SDK to create workflows in your Medusa application.
- [DML Reference](https://docs.medusajs.com/resources/references/data-model/index.html.md): A reference to Medusa's data-modeling language.
- [Service Factory Reference](https://docs.medusajs.com/resources/service-factory-reference/index.html.md): A reference to the methods generated by the service factory.
+1 -1
View File
@@ -281,7 +281,7 @@ const redirects = async () => {
},
{
source: "/v1/development/events/events-list",
destination: "/resources/events-reference",
destination: "/resources/references/events",
permanent: true,
},
{
+1 -6
View File
@@ -19,12 +19,7 @@ const compat = new FlatCompat({
export default [
{
ignores: [
"**/references/**/*",
"**/events-reference/**/*",
"**/events/_content/**/*",
"**/events/_content.mdx",
],
ignores: ["**/references/**/*"],
},
{
plugins: {
@@ -1,36 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`auth.password_reset`
</Table.Cell>
<Table.Cell>
Emitted when a password of a user, customer, or other actor types is reset.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
entity_id, // The user's identifier, such as their email
token, // The reset token
actor_type // `user`, `customer`, or custom type
}
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Auth Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Auth Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`cart.created`
</Table.Cell>
<Table.Cell>
Emitted when a cart is created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the cart
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`cart.updated`
</Table.Cell>
<Table.Cell>
Emitted when a cart is updated. This includes updates to its items, shipping methods, or information.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the cart
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`cart.region_updated`
</Table.Cell>
<Table.Cell>
Emitted when the region of a cart is updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the cart
}
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Cart Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Cart Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`customer.created`
</Table.Cell>
<Table.Cell>
Emitted when customers are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the customer
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`customer.updated`
</Table.Cell>
<Table.Cell>
Emitted when customers are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the customer
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`customer.deleted`
</Table.Cell>
<Table.Cell>
Emitted when customers are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the customer
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Customer Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Customer Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,55 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`shipment.created`
</Table.Cell>
<Table.Cell>
Emitted when an admin user creates a shipment.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the shipment
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`delivery.created`
</Table.Cell>
<Table.Cell>
Emitted when the admin user marks an order fulfillment as delivered.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the fulfillment
}
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Fulfillment Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Fulfillment Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,272 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`order.updated`
</Table.Cell>
<Table.Cell>
Emitted when an admin user updates an order's details.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the order
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.placed`
</Table.Cell>
<Table.Cell>
Emitted when the customer completes a cart and an order is placed.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the order
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.canceled`
</Table.Cell>
<Table.Cell>
Emitted when an order is canceled.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the order
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.completed`
</Table.Cell>
<Table.Cell>
Emitted when orders are completed.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the order
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.archived`
</Table.Cell>
<Table.Cell>
Emitted when orders are archived.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the order
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.fulfillment_created`
</Table.Cell>
<Table.Cell>
Emitted when a fulfillment is created for an order.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
fulfillment_id, // The ID of the fulfillment
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.fulfillment_canceled`
</Table.Cell>
<Table.Cell>
Emitted when a fulfillment is canceled for an order.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
fulfillment_id, // The ID of the fulfillment
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.return_requested`
</Table.Cell>
<Table.Cell>
Emitted when a return is requested.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
return_id, // The ID of the return
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.return_received`
</Table.Cell>
<Table.Cell>
Emitted when a return is received.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
return_id, // The ID of the return
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.claim_created`
</Table.Cell>
<Table.Cell>
Emitted when a claim is created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
claim_id, // The ID of the claim
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.exchange_created`
</Table.Cell>
<Table.Cell>
Emitted when an exchange is created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
exchange_id, // The ID of the exchange
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`order.transfer_requested`
</Table.Cell>
<Table.Cell>
Emitted when an order transfer is requested. This is available from [Medusa v2.0.5+](https://github.com/medusajs/medusa/releases/tag/v2.0.5).
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
exchange_id, // The ID of the exchange
}
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Order Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Order Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,55 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`payment.captured`
</Table.Cell>
<Table.Cell>
Emitted when a payment is captured.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the payment
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`payment.refunded`
</Table.Cell>
<Table.Cell>
Emitted when a payment is refunded.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the payment
}
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Payment Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Payment Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-category.created`
</Table.Cell>
<Table.Cell>
Emitted when product categories are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the category
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-category.updated`
</Table.Cell>
<Table.Cell>
Emitted when product categories are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the category
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-category.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product categories are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the category
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-collection.created`
</Table.Cell>
<Table.Cell>
Emitted when product collections are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the collection
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-collection.updated`
</Table.Cell>
<Table.Cell>
Emitted when product collections are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the collection
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-collection.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product collections are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the collection
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-option.created`
</Table.Cell>
<Table.Cell>
Emitted when product options are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the option
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-option.updated`
</Table.Cell>
<Table.Cell>
Emitted when product options are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the option
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-option.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product options are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the option
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-tag.created`
</Table.Cell>
<Table.Cell>
Emitted when product tags are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the tag
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-tag.updated`
</Table.Cell>
<Table.Cell>
Emitted when product tags are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the tag
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-tag.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product tags are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the tag
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-type.created`
</Table.Cell>
<Table.Cell>
Emitted when product types are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the type
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-type.updated`
</Table.Cell>
<Table.Cell>
Emitted when product types are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the type
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-type.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product types are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the type
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product-variant.created`
</Table.Cell>
<Table.Cell>
Emitted when product variants are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the variant
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-variant.updated`
</Table.Cell>
<Table.Cell>
Emitted when product variants are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the variant
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product-variant.deleted`
</Table.Cell>
<Table.Cell>
Emitted when product variants are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the variant
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`product.created`
</Table.Cell>
<Table.Cell>
Emitted when products are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the product
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product.updated`
</Table.Cell>
<Table.Cell>
Emitted when products are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the product
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`product.deleted`
</Table.Cell>
<Table.Cell>
Emitted when products are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the product
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,55 +0,0 @@
import ProductEvents from "./_content/product.mdx"
import ProductCategoryEvents from "./_content/product-category.mdx"
import ProductCollectionEvents from "./_content/product-collection.mdx"
import ProductOptionEvents from "./_content/product-option.mdx"
import ProductTagEvents from "./_content/product-tag.mdx"
import ProductTypeEvents from "./_content/product-type.mdx"
import ProductVariantEvents from "./_content/product-variant.mdx"
export const metadata = {
title: `Product Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Product Module. If you use the module outside the Medusa application, these events aren't emitted.
## Product Events
<ProductEvents />
---
## Product Category Events
<ProductCategoryEvents />
---
## Product Collection Events
<ProductCollectionEvents />
---
## Product Option Events
<ProductOptionEvents />
---
## Product Tag Events
<ProductTagEvents />
---
## Product Type Events
<ProductTypeEvents />
---
## Product Variant Events
<ProductVariantEvents />
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`region.created`
</Table.Cell>
<Table.Cell>
Emitted when regions are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the region
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`region.updated`
</Table.Cell>
<Table.Cell>
Emitted when regions are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the region
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`region.deleted`
</Table.Cell>
<Table.Cell>
Emitted when regions are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the region
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Region Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Region Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`sales-channel.created`
</Table.Cell>
<Table.Cell>
Emitted when sales channels are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the sales channel
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`sales-channel.updated`
</Table.Cell>
<Table.Cell>
Emitted when sales channels are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the sales channel
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`sales-channel.deleted`
</Table.Cell>
<Table.Cell>
Emitted when sales channels are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the sales channel
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,11 +0,0 @@
import Content from "./_content.mdx"
export const metadata = {
title: `Sales Channel Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the Sales Channel Module. If you use the module outside the Medusa application, these events aren't emitted.
<Content />
@@ -1,97 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`invite.accepted`
</Table.Cell>
<Table.Cell>
Emitted when an invite is accepted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the invite
}
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`invite.created`
</Table.Cell>
<Table.Cell>
Emitted when invites are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the invite
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`invite.deleted`
</Table.Cell>
<Table.Cell>
Emitted when invites are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the invite
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`invite.resent`
</Table.Cell>
<Table.Cell>
Emitted when invites are resent.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the invite
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,76 +0,0 @@
import { Table } from "docs-ui"
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Event Name</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell className="w-1/3">Payload</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`user.created`
</Table.Cell>
<Table.Cell>
Emitted when users are created.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the user
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`user.updated`
</Table.Cell>
<Table.Cell>
Emitted when users are updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the user
}]
```
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`user.deleted`
</Table.Cell>
<Table.Cell>
Emitted when users are deleted.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
[{
id, // The ID of the user
}]
```
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -1,20 +0,0 @@
import InviteEvents from "./_content/invite.mdx"
import UserEvents from "./_content/user.mdx"
export const metadata = {
title: `User Module Events Reference`,
}
# {metadata.title}
This reference shows all the events emitted by the Medusa application related to the User Module. If you use the module outside the Medusa application, these events aren't emitted.
## Invite Events
<InviteEvents />
---
## User Events
<UserEvents />
@@ -1,126 +0,0 @@
import { Table } from "docs-ui"
import AuthEvents from "../commerce-modules/auth/events/_content.mdx"
import CartEvents from "../commerce-modules/cart/events/_content.mdx"
import CustomerEvents from "../commerce-modules/customer/events/_content.mdx"
import FulfillmentEvents from "../commerce-modules/fulfillment/events/_content.mdx"
import InviteEvents from "../commerce-modules/user/events/_content/invite.mdx"
import OrderEvents from "../commerce-modules/order/events/_content.mdx"
import PaymentEvents from "../commerce-modules/payment/events/_content.mdx"
import ProductEvents from "../commerce-modules/product/events/_content/product.mdx"
import ProductCategoryEvents from "../commerce-modules/product/events/_content/product-category.mdx"
import ProductCollectionEvents from "../commerce-modules/product/events/_content/product-collection.mdx"
import ProductOptionEvents from "../commerce-modules/product/events/_content/product-option.mdx"
import ProductTagEvents from "../commerce-modules/product/events/_content/product-tag.mdx"
import ProductTypeEvents from "../commerce-modules/product/events/_content/product-type.mdx"
import ProductVariantEvents from "../commerce-modules/product/events/_content/product-variant.mdx"
import RegionEvents from "../commerce-modules/region/events/_content.mdx"
import SalesChannelEvents from "../commerce-modules/sales-channel/events/_content.mdx"
import UserEvents from "../commerce-modules/user/events/_content/user.mdx"
export const metadata = {
title: `Events Reference`,
}
# {metadata.title}
This documentation page includes the list of all events emitted by [Medusa's workflows](../medusa-workflows-reference/page.mdx).
## Auth Events
<AuthEvents />
---
## Cart Events
<CartEvents />
---
## Customer Events
<CustomerEvents />
---
## Fulfillment Events
<FulfillmentEvents />
---
## Invite Events
<InviteEvents />
---
## Order Events
<OrderEvents />
---
## Payment Events
<PaymentEvents />
---
## Product Events
<ProductEvents />
---
## Product Category Events
<ProductCategoryEvents />
---
## Product Collection Events
<ProductCollectionEvents />
---
## Product Option Events
<ProductOptionEvents />
---
## Product Tag Events
<ProductTagEvents />
---
## Product Type Events
<ProductTypeEvents />
---
## Product Variant Events
<ProductVariantEvents />
---
## Region Events
<RegionEvents />
---
## Sales Channel Events
<SalesChannelEvents />
---
## User Events
<UserEvents />
@@ -2124,7 +2124,7 @@ You can confirm that the loyalty points were deducted either by sending a reques
You've now implement a loyalty points system in Medusa. There's still more that you can implement based on your use case:
- Add loyalty points on registration or other events. Refer to the [Events Reference](../../../events-reference/page.mdx) for a full list of available events you can listen to.
- Add loyalty points on registration or other events. Refer to the [Events Reference](/references/events) for a full list of available events you can listen to.
- Show the customer their loyalty point usage history. This will require adding another data model in the Loyalty Module that records the usage history. You can create records of that data model when an order that has a loyalty promotion is placed, then customize the storefront to show a new page for loyalty points history.
- Customize the Medusa Admin to show a new page or [UI Route](!docs!/learn/fundamentals/admin/ui-routes) for loyalty points information and analytics.
@@ -3116,7 +3116,7 @@ You've now integrated Contentful with Medusa and supported localized product det
1. Add support for other data types, such as product categories or collections.
- Refer to the data model references for each [Commerce Module](../../../commerce-modules/page.mdx) to figure out the content types you need to create in Contentful.
2. Listen to other product events and update the Contentful entries accordingly.
- Refer to the [Events Reference](../../../events-reference/page.mdx) for details on all events emitted in Medusa.
- Refer to the [Events Reference](/references/events) for details on all events emitted in Medusa.
3. Add localization for the entire Next.js Starter Storefront. You can either:
- Create content types in Contentful for different sections in the storefront, then use them to retrieve the localized content;
- Or use the approaches recommended in the [Next.js documentation](https://nextjs.org/docs/app/building-your-application/routing/internationalization).
@@ -1385,7 +1385,7 @@ If you check the inbox of the email address you specified in the shipping addres
## Next Steps
You've now integrated Medusa with Resend. You can add more templates for other emails, such as customer registration confirmation, user invites, and more. Check out the [Events Reference](../../../events-reference/page.mdx) for a list of all events that the Medusa application emits.
You've now integrated Medusa with Resend. You can add more templates for other emails, such as customer registration confirmation, user invites, and more. Check out the [Events Reference](/references/events) for a list of all events that the Medusa application emits.
If you're new to Medusa, check out the [main documentation](!docs!/learn), where you'll get a more in-depth learning of all the concepts you've used in this guide and more.
@@ -915,7 +915,7 @@ Subscribers are useful when you want to perform an action that isn't an integral
<Note>
Learn more about events and subscribers in [this documentation](!docs!/learn/fundamentals/events-and-subscribers). You can also find the list of emitted events in [this reference](../../../events-reference/page.mdx).
Learn more about events and subscribers in [this documentation](!docs!/learn/fundamentals/events-and-subscribers). You can also find the list of emitted events in [this reference](/references/events).
</Note>
@@ -20,7 +20,7 @@ You're free to choose the approach that works for your use case, custom requirem
<Note title="Tip">
Refer to the [Events Reference](../../../events-reference/page.mdx) for a full list of events that the Medusa application emits.
Refer to the [Events Reference](/references/events) for a full list of events that the Medusa application emits.
</Note>
@@ -37,7 +37,7 @@ You can use the Notification Module to send notifications when an action is trig
<Note title="Tip">
The [Events reference](../../events-reference/page.mdx) shows an extensive list of events triggered for each Commerce Module.
The [Events reference](/references/events) shows an extensive list of events triggered for each Commerce Module.
</Note>
@@ -92,7 +92,7 @@ To handle events within an order flow and automate actions, create a subscriber.
icon: AcademicCapSolid,
},
{
href: "/events-reference",
href: "/references/events",
title: "Events Reference",
text: "Check out triggered events by each Commerce Module.",
icon: AcademicCapSolid,
@@ -162,7 +162,7 @@ For example, to group customers with over twenty orders:
icon: AcademicCapSolid,
},
{
href: "/events-reference",
href: "/references/events",
title: "Events Reference",
text: "Check out triggered events by each Commerce Module.",
icon: AcademicCapSolid,
@@ -7,6 +7,7 @@ import {
SourceCodeLink,
CodeTabs,
CodeTab,
Table,
} from "docs-ui"
import { CommerceModuleSections } from "../CommerceModuleSections"
@@ -19,6 +20,7 @@ const MDXComponents: MDXComponentsType = {
SourceCodeLink,
CodeTabs,
CodeTab,
Table,
}
export default MDXComponents
File diff suppressed because it is too large Load Diff
+44 -44
View File
@@ -107,10 +107,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx",
"pathname": "/commerce-modules/auth/create-actor-type"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/auth/events/page.mdx",
"pathname": "/commerce-modules/auth/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/auth/js-sdk/page.mdx",
"pathname": "/commerce-modules/auth/js-sdk"
@@ -135,10 +131,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/cart/concepts/page.mdx",
"pathname": "/commerce-modules/cart/concepts"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/cart/events/page.mdx",
"pathname": "/commerce-modules/cart/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/cart/extend/page.mdx",
"pathname": "/commerce-modules/cart/extend"
@@ -187,10 +179,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/customer/customer-accounts/page.mdx",
"pathname": "/commerce-modules/customer/customer-accounts"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/customer/events/page.mdx",
"pathname": "/commerce-modules/customer/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/customer/extend/page.mdx",
"pathname": "/commerce-modules/customer/extend"
@@ -219,10 +207,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/fulfillment/concepts/page.mdx",
"pathname": "/commerce-modules/fulfillment/concepts"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/fulfillment/events/page.mdx",
"pathname": "/commerce-modules/fulfillment/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/fulfillment/fulfillment-provider/page.mdx",
"pathname": "/commerce-modules/fulfillment/fulfillment-provider"
@@ -303,10 +287,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/order/edit/page.mdx",
"pathname": "/commerce-modules/order/edit"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/order/events/page.mdx",
"pathname": "/commerce-modules/order/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/order/exchange/page.mdx",
"pathname": "/commerce-modules/order/exchange"
@@ -359,10 +339,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/payment/account-holder/page.mdx",
"pathname": "/commerce-modules/payment/account-holder"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/payment/events/page.mdx",
"pathname": "/commerce-modules/payment/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/payment/js-sdk/page.mdx",
"pathname": "/commerce-modules/payment/js-sdk"
@@ -451,10 +427,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/product/admin-widget-zones/page.mdx",
"pathname": "/commerce-modules/product/admin-widget-zones"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/product/events/page.mdx",
"pathname": "/commerce-modules/product/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/product/extend/page.mdx",
"pathname": "/commerce-modules/product/extend"
@@ -539,10 +511,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/region/admin-widget-zones/page.mdx",
"pathname": "/commerce-modules/region/admin-widget-zones"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/region/events/page.mdx",
"pathname": "/commerce-modules/region/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/region/js-sdk/page.mdx",
"pathname": "/commerce-modules/region/js-sdk"
@@ -563,10 +531,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/sales-channel/admin-widget-zones/page.mdx",
"pathname": "/commerce-modules/sales-channel/admin-widget-zones"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx",
"pathname": "/commerce-modules/sales-channel/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/sales-channel/js-sdk/page.mdx",
"pathname": "/commerce-modules/sales-channel/js-sdk"
@@ -667,10 +631,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/commerce-modules/user/admin-widget-zones/page.mdx",
"pathname": "/commerce-modules/user/admin-widget-zones"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/user/events/page.mdx",
"pathname": "/commerce-modules/user/events"
},
{
"filePath": "/www/apps/resources/app/commerce-modules/user/js-sdk/page.mdx",
"pathname": "/commerce-modules/user/js-sdk"
@@ -751,10 +711,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/deployment/storefront/vercel/page.mdx",
"pathname": "/deployment/storefront/vercel"
},
{
"filePath": "/www/apps/resources/app/events-reference/page.mdx",
"pathname": "/events-reference"
},
{
"filePath": "/www/apps/resources/app/examples/guides/custom-item-price/page.mdx",
"pathname": "/examples/guides/custom-item-price"
@@ -13443,6 +13399,42 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/medusa_config/types/medusa_config.PluginDetails/page.mdx",
"pathname": "/references/medusa_config/types/medusa_config.PluginDetails"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Auth/page.mdx",
"pathname": "/references/module_events/module_events.Auth"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Cart/page.mdx",
"pathname": "/references/module_events/module_events.Cart"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Customer/page.mdx",
"pathname": "/references/module_events/module_events.Customer"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Fulfillment/page.mdx",
"pathname": "/references/module_events/module_events.Fulfillment"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Order/page.mdx",
"pathname": "/references/module_events/module_events.Order"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Product/page.mdx",
"pathname": "/references/module_events/module_events.Product"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Region/page.mdx",
"pathname": "/references/module_events/module_events.Region"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.Sales_Channel/page.mdx",
"pathname": "/references/module_events/module_events.Sales_Channel"
},
{
"filePath": "/www/apps/resources/references/module_events/module_events.User/page.mdx",
"pathname": "/references/module_events/module_events.User"
},
{
"filePath": "/www/apps/resources/references/modules/api_key/page.mdx",
"pathname": "/references/modules/api_key"
@@ -13503,6 +13495,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/modules/event/page.mdx",
"pathname": "/references/modules/event"
},
{
"filePath": "/www/apps/resources/references/modules/events/page.mdx",
"pathname": "/references/modules/events"
},
{
"filePath": "/www/apps/resources/references/modules/file/page.mdx",
"pathname": "/references/modules/file"
@@ -13551,6 +13547,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/modules/medusa_config/page.mdx",
"pathname": "/references/modules/medusa_config"
},
{
"filePath": "/www/apps/resources/references/modules/module_events/page.mdx",
"pathname": "/references/modules/module_events"
},
{
"filePath": "/www/apps/resources/references/modules/modules_sdk/page.mdx",
"pathname": "/references/modules/modules_sdk"
@@ -774,7 +774,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/auth/events",
"path": "/references/auth/events",
"title": "Events Reference",
"children": []
},
@@ -1518,7 +1518,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/cart/events",
"path": "/references/cart/events",
"title": "Events Reference",
"children": []
},
@@ -2932,7 +2932,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/customer/events",
"path": "/references/customer/events",
"title": "Events Reference",
"children": []
},
@@ -4081,7 +4081,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/fulfillment/events",
"path": "/references/fulfillment/events",
"title": "Events Reference",
"children": []
},
@@ -7453,7 +7453,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/order/events",
"path": "/references/order/events",
"title": "Events Reference",
"children": []
},
@@ -9636,7 +9636,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/payment/events",
"path": "/references/payment/events",
"title": "Events Reference",
"children": []
},
@@ -12164,7 +12164,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/product/events",
"path": "/references/product/events",
"title": "Events Reference",
"children": []
},
@@ -14203,7 +14203,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/region/events",
"path": "/references/region/events",
"title": "Events Reference",
"children": []
},
@@ -14758,7 +14758,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/sales-channel/events",
"path": "/references/sales-channel/events",
"title": "Events Reference",
"children": []
},
@@ -16889,7 +16889,7 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/commerce-modules/user/events",
"path": "/references/user/events",
"title": "Events Reference",
"children": []
},
@@ -6733,7 +6733,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/events-reference",
"path": "/references/events",
"title": "Events",
"description": "List of events emitted by Medusa's Commerce Modules.",
"children": []
@@ -4854,6 +4854,51 @@ export const slugChanges = [
"newSlug": "/references/medusa-config",
"filePath": "/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Auth",
"newSlug": "/references/auth/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Auth/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Cart",
"newSlug": "/references/cart/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Cart/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Customer",
"newSlug": "/references/customer/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Customer/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Fulfillment",
"newSlug": "/references/fulfillment/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Fulfillment/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Order",
"newSlug": "/references/order/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Order/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Product",
"newSlug": "/references/product/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Product/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Region",
"newSlug": "/references/region/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Region/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.Sales_Channel",
"newSlug": "/references/sales-channel/events",
"filePath": "/www/apps/resources/references/module_events/module_events.Sales_Channel/page.mdx"
},
{
"origSlug": "/references/module_events/module_events.User",
"newSlug": "/references/user/events",
"filePath": "/www/apps/resources/references/module_events/module_events.User/page.mdx"
},
{
"origSlug": "/references/modules/api_key_models",
"newSlug": "/references/api-key/models",
@@ -4884,6 +4929,11 @@ export const slugChanges = [
"newSlug": "/references/data-model",
"filePath": "/www/apps/resources/references/modules/dml/page.mdx"
},
{
"origSlug": "/references/modules/events",
"newSlug": "/references/events",
"filePath": "/www/apps/resources/references/modules/events/page.mdx"
},
{
"origSlug": "/references/modules/fulfillment_models",
"newSlug": "/references/fulfillment/models",
+55
View File
@@ -173,6 +173,61 @@ const nextConfig = {
destination: "/infrastructure-modules/:path*",
permanent: true,
},
{
source: "/events-reference",
destination: "/references/events",
permanent: true,
},
{
source: "/commerce-modules/auth/events",
destination: "/references/auth/events",
permanent: true,
},
{
source: "/commerce-modules/cart/events",
destination: "/references/cart/events",
permanent: true,
},
{
source: "/commerce-modules/customer/events",
destination: "/references/customer/events",
permanent: true,
},
{
source: "/commerce-modules/fulfillment/events",
destination: "/references/fulfillment/events",
permanent: true,
},
{
source: "/commerce-modules/order/events",
destination: "/references/order/events",
permanent: true,
},
{
source: "/commerce-modules/payment/events",
destination: "/references/payment/events",
permanent: true,
},
{
source: "/commerce-modules/product/events",
destination: "/references/product/events",
permanent: true,
},
{
source: "/commerce-modules/region/events",
destination: "/references/region/events",
permanent: true,
},
{
source: "/commerce-modules/sales-channel/events",
destination: "/references/sales-channel/events",
permanent: true,
},
{
source: "/commerce-modules/user/events",
destination: "/references/user/events",
permanent: true,
},
]
},
outputFileTracingExcludes: {
@@ -0,0 +1,55 @@
---
slug: /references/auth/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Auth Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Auth Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[auth.password_reset](#authpassword_reset)
</Table.Cell>
<Table.Cell>
Emitted when a reset password token is generated. You can listen to this event
to send a reset password email to the user or customer, for example.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `auth.password_reset`
Emitted when a reset password token is generated. You can listen to this event
to send a reset password email to the user or customer, for example.
### Payload
```ts
{
entity_id, // The identifier of the user or customer. For example, an email address.
actor_type, // The type of actor. For example, "customer", "user", or custom.
token, // The generated token.
}
```
### Workflows Emitting this Event
- [generateResetPasswordTokenWorkflow](/references/medusa-workflows/generateResetPasswordTokenWorkflow)
@@ -0,0 +1,134 @@
---
slug: /references/cart/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Cart Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Cart Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[cart.created](#cartcreated)
</Table.Cell>
<Table.Cell>
Emitted when a cart is created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[cart.updated](#cartupdated)
</Table.Cell>
<Table.Cell>
Emitted when a cart's details are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[cart.customer_updated](#cartcustomer_updated)
</Table.Cell>
<Table.Cell>
Emitted when the customer in the cart is updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[cart.region_updated](#cartregion_updated)
</Table.Cell>
<Table.Cell>
Emitted when the cart's region is updated. This
event is emitted alongside the CartWorkflowEvents.UPDATED event.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `cart.created`
Emitted when a cart is created.
### Payload
```ts
{
id, // The ID of the cart
}
```
### Workflows Emitting this Event
- [createCartWorkflow](/references/medusa-workflows/createCartWorkflow)
---
## `cart.updated`
Emitted when a cart's details are updated.
### Payload
```ts
{
id, // The ID of the cart
}
```
### Workflows Emitting this Event
- [updateLineItemInCartWorkflow](/references/medusa-workflows/updateLineItemInCartWorkflow)
- [updateCartWorkflow](/references/medusa-workflows/updateCartWorkflow)
- [addToCartWorkflow](/references/medusa-workflows/addToCartWorkflow)
- [addShippingMethodToCartWorkflow](/references/medusa-workflows/addShippingMethodToCartWorkflow)
---
## `cart.customer_updated`
Emitted when the customer in the cart is updated.
### Payload
```ts
{
id, // The ID of the cart
}
```
### Workflows Emitting this Event
- [updateCartWorkflow](/references/medusa-workflows/updateCartWorkflow)
---
## `cart.region_updated`
Emitted when the cart's region is updated. This
event is emitted alongside the CartWorkflowEvents.UPDATED event.
### Payload
```ts
{
id, // The ID of the cart
}
```
### Workflows Emitting this Event
- [updateCartWorkflow](/references/medusa-workflows/updateCartWorkflow)
@@ -0,0 +1,105 @@
---
slug: /references/customer/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Customer Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Customer Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[customer.created](#customercreated)
</Table.Cell>
<Table.Cell>
Emitted when a customer is created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[customer.updated](#customerupdated)
</Table.Cell>
<Table.Cell>
Emitted when a customer is updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[customer.deleted](#customerdeleted)
</Table.Cell>
<Table.Cell>
Emitted when a customer is deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `customer.created`
Emitted when a customer is created.
### Payload
```ts
[{
id, // The ID of the customer
}]
```
### Workflows Emitting this Event
- [createCustomersWorkflow](/references/medusa-workflows/createCustomersWorkflow)
- [createCustomerAccountWorkflow](/references/medusa-workflows/createCustomerAccountWorkflow)
---
## `customer.updated`
Emitted when a customer is updated.
### Payload
```ts
[{
id, // The ID of the customer
}]
```
### Workflows Emitting this Event
- [updateCustomersWorkflow](/references/medusa-workflows/updateCustomersWorkflow)
---
## `customer.deleted`
Emitted when a customer is deleted.
### Payload
```ts
[{
id, // The ID of the customer
}]
```
### Workflows Emitting this Event
- [deleteCustomersWorkflow](/references/medusa-workflows/deleteCustomersWorkflow)
- [removeCustomerAccountWorkflow](/references/medusa-workflows/removeCustomerAccountWorkflow)
@@ -0,0 +1,78 @@
---
slug: /references/fulfillment/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Fulfillment Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Fulfillment Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[shipment.created](#shipmentcreated)
</Table.Cell>
<Table.Cell>
Emitted when a shipment is created for an order.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[delivery.created](#deliverycreated)
</Table.Cell>
<Table.Cell>
Emitted when a fulfillment is marked as delivered.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `shipment.created`
Emitted when a shipment is created for an order.
### Payload
```ts
{
id, // the ID of the shipment
no_notification, // whether to notify the customer
}
```
### Workflows Emitting this Event
- [createOrderShipmentWorkflow](/references/medusa-workflows/createOrderShipmentWorkflow)
---
## `delivery.created`
Emitted when a fulfillment is marked as delivered.
### Payload
```ts
{
id, // the ID of the fulfillment
}
```
### Workflows Emitting this Event
- [markOrderFulfillmentAsDeliveredWorkflow](/references/medusa-workflows/markOrderFulfillmentAsDeliveredWorkflow)
@@ -0,0 +1,459 @@
---
slug: /references/order/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Order Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Order Module. If you use the module outside the Medusa application, these events aren't emitted.
## Order Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[order.updated](#orderupdated)
</Table.Cell>
<Table.Cell>
Emitted when the details of an order or draft order is updated. This
doesn't include updates made by an edit.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.placed](#orderplaced)
</Table.Cell>
<Table.Cell>
Emitted when an order is placed, or when a draft order is converted to an
order.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.canceled](#ordercanceled)
</Table.Cell>
<Table.Cell>
Emitted when an order is canceld.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.completed](#ordercompleted)
</Table.Cell>
<Table.Cell>
Emitted when orders are completed.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.archived](#orderarchived)
</Table.Cell>
<Table.Cell>
Emitted when an order is archived.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.fulfillment_created](#orderfulfillment_created)
</Table.Cell>
<Table.Cell>
Emitted when a fulfillment is created for an order.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.fulfillment_canceled](#orderfulfillment_canceled)
</Table.Cell>
<Table.Cell>
Emitted when an order's fulfillment is canceled.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.return_requested](#orderreturn_requested)
</Table.Cell>
<Table.Cell>
Emitted when a return request is confirmed.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.return_received](#orderreturn_received)
</Table.Cell>
<Table.Cell>
Emitted when a return is marked as received.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.claim_created](#orderclaim_created)
</Table.Cell>
<Table.Cell>
Emitted when a claim is created for an order.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.exchange_created](#orderexchange_created)
</Table.Cell>
<Table.Cell>
Emitted when an exchange is created for an order.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order.transfer_requested](#ordertransfer_requested)
</Table.Cell>
<Table.Cell>
Emitted when an order is requested to be transferred to
another customer.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `order.updated`
Emitted when the details of an order or draft order is updated. This
doesn't include updates made by an edit.
#### Payload
```ts
{
id, // The ID of the order
}
```
#### Workflows Emitting this Event
- [updateOrderWorkflow](/references/medusa-workflows/updateOrderWorkflow)
- [updateDraftOrderWorkflow](/references/medusa-workflows/updateDraftOrderWorkflow)
---
### `order.placed`
Emitted when an order is placed, or when a draft order is converted to an
order.
#### Payload
```ts
{
id, // The ID of the order
}
```
#### Workflows Emitting this Event
- [completeCartWorkflow](/references/medusa-workflows/completeCartWorkflow)
- [convertDraftOrderWorkflow](/references/medusa-workflows/convertDraftOrderWorkflow)
- [processPaymentWorkflow](/references/medusa-workflows/processPaymentWorkflow)
---
### `order.canceled`
Emitted when an order is canceld.
#### Payload
```ts
{
id, // The ID of the order
}
```
#### Workflows Emitting this Event
- [cancelOrderWorkflow](/references/medusa-workflows/cancelOrderWorkflow)
---
### `order.completed`
Emitted when orders are completed.
#### Payload
```ts
[{
id, // The ID of the order
}]
```
#### Workflows Emitting this Event
- [completeOrderWorkflow](/references/medusa-workflows/completeOrderWorkflow)
---
### `order.archived`
Emitted when an order is archived.
#### Payload
```ts
[{
id, // The ID of the order
}]
```
#### Workflows Emitting this Event
- [archiveOrderWorkflow](/references/medusa-workflows/archiveOrderWorkflow)
---
### `order.fulfillment_created`
Emitted when a fulfillment is created for an order.
#### Payload
```ts
{
order_id, // The ID of the order
fulfillment_id, // The ID of the fulfillment
no_notification, // Whether to notify the customer
}
```
#### Workflows Emitting this Event
- [createOrderFulfillmentWorkflow](/references/medusa-workflows/createOrderFulfillmentWorkflow)
---
### `order.fulfillment_canceled`
Emitted when an order's fulfillment is canceled.
#### Payload
```ts
{
order_id, // The ID of the order
fulfillment_id, // The ID of the fulfillment
no_notification, // Whether to notify the customer
}
```
#### Workflows Emitting this Event
- [cancelOrderFulfillmentWorkflow](/references/medusa-workflows/cancelOrderFulfillmentWorkflow)
---
### `order.return_requested`
Emitted when a return request is confirmed.
#### Payload
```ts
{
order_id, // The ID of the order
return_id, // The ID of the return
}
```
#### Workflows Emitting this Event
- [createAndCompleteReturnOrderWorkflow](/references/medusa-workflows/createAndCompleteReturnOrderWorkflow)
- [confirmReturnRequestWorkflow](/references/medusa-workflows/confirmReturnRequestWorkflow)
---
### `order.return_received`
Emitted when a return is marked as received.
#### Payload
```ts
{
order_id, // The ID of the order
return_id, // The ID of the return
}
```
#### Workflows Emitting this Event
- [createAndCompleteReturnOrderWorkflow](/references/medusa-workflows/createAndCompleteReturnOrderWorkflow)
- [confirmReturnReceiveWorkflow](/references/medusa-workflows/confirmReturnReceiveWorkflow)
---
### `order.claim_created`
Emitted when a claim is created for an order.
#### Payload
```ts
{
order_id, // The ID of the order
claim_id, // The ID of the claim
}
```
#### Workflows Emitting this Event
- [confirmClaimRequestWorkflow](/references/medusa-workflows/confirmClaimRequestWorkflow)
---
### `order.exchange_created`
Emitted when an exchange is created for an order.
#### Payload
```ts
{
order_id, // The ID of the order
exchange_id, // The ID of the exchange
}
```
#### Workflows Emitting this Event
- [confirmExchangeRequestWorkflow](/references/medusa-workflows/confirmExchangeRequestWorkflow)
---
### `order.transfer_requested`
Emitted when an order is requested to be transferred to
another customer.
#### Payload
```ts
{
id, // The ID of the order
order_change_id, // The ID of the order change created for the transfer
}
```
#### Workflows Emitting this Event
- [requestOrderTransferWorkflow](/references/medusa-workflows/requestOrderTransferWorkflow)
---
## Order Edit Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[order-edit.requested](#order-editrequested)
</Table.Cell>
<Table.Cell>
Emitted when an order edit is requested.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order-edit.confirmed](#order-editconfirmed)
</Table.Cell>
<Table.Cell>
Emitted when an order edit request is confirmed.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[order-edit.canceled](#order-editcanceled)
</Table.Cell>
<Table.Cell>
Emitted when an order edit request is canceled.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `order-edit.requested`
Emitted when an order edit is requested.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // The actions to edit the order
}
```
#### Workflows Emitting this Event
- [requestOrderEditRequestWorkflow](/references/medusa-workflows/requestOrderEditRequestWorkflow)
---
### `order-edit.confirmed`
Emitted when an order edit request is confirmed.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // The actions to edit the order
}
```
#### Workflows Emitting this Event
- [confirmOrderEditRequestWorkflow](/references/medusa-workflows/confirmOrderEditRequestWorkflow)
---
### `order-edit.canceled`
Emitted when an order edit request is canceled.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // The actions to edit the order
}
```
#### Workflows Emitting this Event
- [cancelBeginOrderEditWorkflow](/references/medusa-workflows/cancelBeginOrderEditWorkflow)
@@ -0,0 +1,699 @@
---
slug: /references/product/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Product Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Product Module. If you use the module outside the Medusa application, these events aren't emitted.
## Product Category Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-category.created](#product-categorycreated)
</Table.Cell>
<Table.Cell>
Emitted when product categories are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-category.updated](#product-categoryupdated)
</Table.Cell>
<Table.Cell>
Emitted when product categories are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-category.deleted](#product-categorydeleted)
</Table.Cell>
<Table.Cell>
Emitted when product categories are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-category.created`
Emitted when product categories are created.
#### Payload
```ts
[{
id, // The ID of the product category
}]
```
#### Workflows Emitting this Event
- [createProductCategoriesWorkflow](/references/medusa-workflows/createProductCategoriesWorkflow)
---
### `product-category.updated`
Emitted when product categories are updated.
#### Payload
```ts
[{
id, // The ID of the product category
}]
```
#### Workflows Emitting this Event
- [updateProductCategoriesWorkflow](/references/medusa-workflows/updateProductCategoriesWorkflow)
---
### `product-category.deleted`
Emitted when product categories are deleted.
#### Payload
```ts
[{
id, // The ID of the product category
}]
```
#### Workflows Emitting this Event
- [deleteProductCategoriesWorkflow](/references/medusa-workflows/deleteProductCategoriesWorkflow)
---
## Product Collection Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-collection.created](#product-collectioncreated)
</Table.Cell>
<Table.Cell>
Emitted when product collections are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-collection.updated](#product-collectionupdated)
</Table.Cell>
<Table.Cell>
Emitted when product collections are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-collection.deleted](#product-collectiondeleted)
</Table.Cell>
<Table.Cell>
Emitted when product collections are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-collection.created`
Emitted when product collections are created.
#### Payload
```ts
[{
id, // The ID of the product collection
}]
```
#### Workflows Emitting this Event
- [createCollectionsWorkflow](/references/medusa-workflows/createCollectionsWorkflow)
---
### `product-collection.updated`
Emitted when product collections are updated.
#### Payload
```ts
[{
id, // The ID of the product collection
}]
```
#### Workflows Emitting this Event
- [updateCollectionsWorkflow](/references/medusa-workflows/updateCollectionsWorkflow)
---
### `product-collection.deleted`
Emitted when product collections are deleted.
#### Payload
```ts
[{
id, // The ID of the product collection
}]
```
#### Workflows Emitting this Event
- [deleteCollectionsWorkflow](/references/medusa-workflows/deleteCollectionsWorkflow)
---
## Product Variant Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-variant.updated](#product-variantupdated)
</Table.Cell>
<Table.Cell>
Emitted when product variants are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-variant.created](#product-variantcreated)
</Table.Cell>
<Table.Cell>
Emitted when product variants are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-variant.deleted](#product-variantdeleted)
</Table.Cell>
<Table.Cell>
Emitted when product variants are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-variant.updated`
Emitted when product variants are updated.
#### Payload
```ts
[{
id, // The ID of the product variant
}]
```
#### Workflows Emitting this Event
- [updateProductVariantsWorkflow](/references/medusa-workflows/updateProductVariantsWorkflow)
- [batchProductVariantsWorkflow](/references/medusa-workflows/batchProductVariantsWorkflow)
---
### `product-variant.created`
Emitted when product variants are created.
#### Payload
```ts
[{
id, // The ID of the product variant
}]
```
#### Workflows Emitting this Event
- [createProductVariantsWorkflow](/references/medusa-workflows/createProductVariantsWorkflow)
- [createProductsWorkflow](/references/medusa-workflows/createProductsWorkflow)
- [batchProductVariantsWorkflow](/references/medusa-workflows/batchProductVariantsWorkflow)
- [batchProductsWorkflow](/references/medusa-workflows/batchProductsWorkflow)
- [importProductsWorkflow](/references/medusa-workflows/importProductsWorkflow)
---
### `product-variant.deleted`
Emitted when product variants are deleted.
#### Payload
```ts
[{
id, // The ID of the product variant
}]
```
#### Workflows Emitting this Event
- [deleteProductVariantsWorkflow](/references/medusa-workflows/deleteProductVariantsWorkflow)
- [batchProductVariantsWorkflow](/references/medusa-workflows/batchProductVariantsWorkflow)
---
## Product Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product.updated](#productupdated)
</Table.Cell>
<Table.Cell>
Emitted when products are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product.created](#productcreated)
</Table.Cell>
<Table.Cell>
Emitted when products are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product.deleted](#productdeleted)
</Table.Cell>
<Table.Cell>
Emitted when products are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product.updated`
Emitted when products are updated.
#### Payload
```ts
[{
id, // The ID of the product
}]
```
#### Workflows Emitting this Event
- [updateProductsWorkflow](/references/medusa-workflows/updateProductsWorkflow)
- [batchProductsWorkflow](/references/medusa-workflows/batchProductsWorkflow)
- [importProductsWorkflow](/references/medusa-workflows/importProductsWorkflow)
---
### `product.created`
Emitted when products are created.
#### Payload
```ts
[{
id, // The ID of the product
}]
```
#### Workflows Emitting this Event
- [createProductsWorkflow](/references/medusa-workflows/createProductsWorkflow)
- [batchProductsWorkflow](/references/medusa-workflows/batchProductsWorkflow)
- [importProductsWorkflow](/references/medusa-workflows/importProductsWorkflow)
---
### `product.deleted`
Emitted when products are deleted.
#### Payload
```ts
[{
id, // The ID of the product
}]
```
#### Workflows Emitting this Event
- [deleteProductsWorkflow](/references/medusa-workflows/deleteProductsWorkflow)
- [batchProductsWorkflow](/references/medusa-workflows/batchProductsWorkflow)
- [importProductsWorkflow](/references/medusa-workflows/importProductsWorkflow)
---
## Product Type Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-type.updated](#product-typeupdated)
</Table.Cell>
<Table.Cell>
Emitted when product types are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-type.created](#product-typecreated)
</Table.Cell>
<Table.Cell>
Emitted when product types are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-type.deleted](#product-typedeleted)
</Table.Cell>
<Table.Cell>
Emitted when product types are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-type.updated`
Emitted when product types are updated.
#### Payload
```ts
[{
id, // The ID of the product type
}]
```
#### Workflows Emitting this Event
- [updateProductTypesWorkflow](/references/medusa-workflows/updateProductTypesWorkflow)
---
### `product-type.created`
Emitted when product types are created.
#### Payload
```ts
[{
id, // The ID of the product type
}]
```
#### Workflows Emitting this Event
- [createProductTypesWorkflow](/references/medusa-workflows/createProductTypesWorkflow)
---
### `product-type.deleted`
Emitted when product types are deleted.
#### Payload
```ts
[{
id, // The ID of the product type
}]
```
#### Workflows Emitting this Event
- [deleteProductTypesWorkflow](/references/medusa-workflows/deleteProductTypesWorkflow)
---
## Product Tag Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-tag.updated](#product-tagupdated)
</Table.Cell>
<Table.Cell>
Emitted when product tags are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-tag.created](#product-tagcreated)
</Table.Cell>
<Table.Cell>
Emitted when product tags are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-tag.deleted](#product-tagdeleted)
</Table.Cell>
<Table.Cell>
Emitted when product tags are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-tag.updated`
Emitted when product tags are updated.
#### Payload
```ts
[{
id, // The ID of the product tag
}]
```
#### Workflows Emitting this Event
- [updateProductTagsWorkflow](/references/medusa-workflows/updateProductTagsWorkflow)
---
### `product-tag.created`
Emitted when product tags are created.
#### Payload
```ts
[{
id, // The ID of the product tag
}]
```
#### Workflows Emitting this Event
- [createProductTagsWorkflow](/references/medusa-workflows/createProductTagsWorkflow)
---
### `product-tag.deleted`
Emitted when product tags are deleted.
#### Payload
```ts
[{
id, // The ID of the product tag
}]
```
#### Workflows Emitting this Event
- [deleteProductTagsWorkflow](/references/medusa-workflows/deleteProductTagsWorkflow)
---
## Product Option Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[product-option.updated](#product-optionupdated)
</Table.Cell>
<Table.Cell>
Emitted when product options are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-option.created](#product-optioncreated)
</Table.Cell>
<Table.Cell>
Emitted when product options are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[product-option.deleted](#product-optiondeleted)
</Table.Cell>
<Table.Cell>
Emitted when product options are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `product-option.updated`
Emitted when product options are updated.
#### Payload
```ts
[{
id, // The ID of the product option
}]
```
#### Workflows Emitting this Event
- [updateProductOptionsWorkflow](/references/medusa-workflows/updateProductOptionsWorkflow)
---
### `product-option.created`
Emitted when product options are created.
#### Payload
```ts
[{
id, // The ID of the product option
}]
```
#### Workflows Emitting this Event
- [createProductOptionsWorkflow](/references/medusa-workflows/createProductOptionsWorkflow)
---
### `product-option.deleted`
Emitted when product options are deleted.
#### Payload
```ts
[{
id, // The ID of the product option
}]
```
#### Workflows Emitting this Event
- [deleteProductOptionsWorkflow](/references/medusa-workflows/deleteProductOptionsWorkflow)
@@ -0,0 +1,103 @@
---
slug: /references/region/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Region Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Region Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[region.updated](#regionupdated)
</Table.Cell>
<Table.Cell>
Emitted when regions are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[region.created](#regioncreated)
</Table.Cell>
<Table.Cell>
Emitted when regions are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[region.deleted](#regiondeleted)
</Table.Cell>
<Table.Cell>
Emitted when regions are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `region.updated`
Emitted when regions are updated.
### Payload
```ts
[{
id, // The ID of the region
}]
```
### Workflows Emitting this Event
- [updateRegionsWorkflow](/references/medusa-workflows/updateRegionsWorkflow)
---
## `region.created`
Emitted when regions are created.
### Payload
```ts
[{
id, // The ID of the region
}]
```
### Workflows Emitting this Event
- [createRegionsWorkflow](/references/medusa-workflows/createRegionsWorkflow)
---
## `region.deleted`
Emitted when regions are deleted.
### Payload
```ts
[{
id, // The ID of the region
}]
```
### Workflows Emitting this Event
- [deleteRegionsWorkflow](/references/medusa-workflows/deleteRegionsWorkflow)
@@ -0,0 +1,103 @@
---
slug: /references/sales-channel/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# Sales Channel Module Events Reference
This reference shows all the events emitted by the Medusa application related to the Sales Channel Module. If you use the module outside the Medusa application, these events aren't emitted.
## Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[sales-channel.created](#sales-channelcreated)
</Table.Cell>
<Table.Cell>
Emitted when sales channels are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[sales-channel.updated](#sales-channelupdated)
</Table.Cell>
<Table.Cell>
Emitted when sales channels are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[sales-channel.deleted](#sales-channeldeleted)
</Table.Cell>
<Table.Cell>
Emitted when sales channels are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
## `sales-channel.created`
Emitted when sales channels are created.
### Payload
```ts
[{
id, // The ID of the sales channel
}]
```
### Workflows Emitting this Event
- [createSalesChannelsWorkflow](/references/medusa-workflows/createSalesChannelsWorkflow)
---
## `sales-channel.updated`
Emitted when sales channels are updated.
### Payload
```ts
[{
id, // The ID of the sales channel
}]
```
### Workflows Emitting this Event
- [updateSalesChannelsWorkflow](/references/medusa-workflows/updateSalesChannelsWorkflow)
---
## `sales-channel.deleted`
Emitted when sales channels are deleted.
### Payload
```ts
[{
id, // The ID of the sales channel
}]
```
### Workflows Emitting this Event
- [deleteSalesChannelsWorkflow](/references/medusa-workflows/deleteSalesChannelsWorkflow)
@@ -0,0 +1,237 @@
---
slug: /references/user/events
sidebar_label: Events Reference
---
import { TypeList } from "docs-ui"
# User Module Events Reference
This reference shows all the events emitted by the Medusa application related to the User Module. If you use the module outside the Medusa application, these events aren't emitted.
## User Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[user.created](#usercreated)
</Table.Cell>
<Table.Cell>
Emitted when users are created.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[user.updated](#userupdated)
</Table.Cell>
<Table.Cell>
Emitted when users are updated.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[user.deleted](#userdeleted)
</Table.Cell>
<Table.Cell>
Emitted when users are deleted.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `user.created`
Emitted when users are created.
#### Payload
```ts
[{
id, // The ID of the user
}]
```
#### Workflows Emitting this Event
- [createUsersWorkflow](/references/medusa-workflows/createUsersWorkflow)
- [createUserAccountWorkflow](/references/medusa-workflows/createUserAccountWorkflow)
- [acceptInviteWorkflow](/references/medusa-workflows/acceptInviteWorkflow)
---
### `user.updated`
Emitted when users are updated.
#### Payload
```ts
[{
id, // The ID of the user
}]
```
#### Workflows Emitting this Event
- [updateUsersWorkflow](/references/medusa-workflows/updateUsersWorkflow)
---
### `user.deleted`
Emitted when users are deleted.
#### Payload
```ts
[{
id, // The ID of the user
}]
```
#### Workflows Emitting this Event
- [deleteUsersWorkflow](/references/medusa-workflows/deleteUsersWorkflow)
- [removeUserAccountWorkflow](/references/medusa-workflows/removeUserAccountWorkflow)
---
## Invite Events
### Summary
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
[invite.accepted](#inviteaccepted)
</Table.Cell>
<Table.Cell>
Emitted when an invite is accepted.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[invite.created](#invitecreated)
</Table.Cell>
<Table.Cell>
Emitted when invites are created. You can listen to this event
to send an email to the invited users, for example.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[invite.deleted](#invitedeleted)
</Table.Cell>
<Table.Cell>
Emitted when invites are deleted.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
[invite.resent](#inviteresent)
</Table.Cell>
<Table.Cell>
Emitted when invites should be resent because their token was
refreshed. You can listen to this event to send an email to the invited users,
for example.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
### `invite.accepted`
Emitted when an invite is accepted.
#### Payload
```ts
{
id, // The ID of the invite
}
```
#### Workflows Emitting this Event
- [acceptInviteWorkflow](/references/medusa-workflows/acceptInviteWorkflow)
---
### `invite.created`
Emitted when invites are created. You can listen to this event
to send an email to the invited users, for example.
#### Payload
```ts
[{
id, // The ID of the invite
}]
```
#### Workflows Emitting this Event
- [createInvitesWorkflow](/references/medusa-workflows/createInvitesWorkflow)
---
### `invite.deleted`
Emitted when invites are deleted.
#### Payload
```ts
[{
id, // The ID of the invite
}]
```
#### Workflows Emitting this Event
- [deleteInvitesWorkflow](/references/medusa-workflows/deleteInvitesWorkflow)
---
### `invite.resent`
Emitted when invites should be resent because their token was
refreshed. You can listen to this event to send an email to the invited users,
for example.
#### Payload
```ts
[{
id, // The ID of the invite
}]
```
#### Workflows Emitting this Event
- [refreshInviteTokensWorkflow](/references/medusa-workflows/refreshInviteTokensWorkflow)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,239 @@
import { TypeList } from "docs-ui"
# module-events
## Namespaces
- [Auth](../../module_events/module_events.Auth/page.mdx)
- [Cart](../../module_events/module_events.Cart/page.mdx)
- [Customer](../../module_events/module_events.Customer/page.mdx)
- [Fulfillment](../../module_events/module_events.Fulfillment/page.mdx)
- [Order](../../module_events/module_events.Order/page.mdx)
- [Product](../../module_events/module_events.Product/page.mdx)
- [Region](../../module_events/module_events.Region/page.mdx)
- [Sales Channel](../../module_events/module_events.Sales_Channel/page.mdx)
- [User](../../module_events/module_events.User/page.mdx)
## Variables
- [AuthWorkflowEvents](../../module_events/module_events.Auth/page.mdx#authworkflowevents)
- [CartWorkflowEvents](../../module_events/module_events.Cart/page.mdx#cartworkflowevents)
- [CustomerWorkflowEvents](../../module_events/module_events.Customer/page.mdx#customerworkflowevents)
- [FulfillmentWorkflowEvents](../../module_events/module_events.Fulfillment/page.mdx#fulfillmentworkflowevents)
- [InviteWorkflowEvents](../../module_events/module_events.User/page.mdx#inviteworkflowevents)
- [OrderEditWorkflowEvents](../../module_events/module_events.Order/page.mdx#ordereditworkflowevents)
- [OrderWorkflowEvents](../../module_events/module_events.Order/page.mdx#orderworkflowevents)
- [ProductCategoryWorkflowEvents](../../module_events/module_events.Product/page.mdx#productcategoryworkflowevents)
- [ProductCollectionWorkflowEvents](../../module_events/module_events.Product/page.mdx#productcollectionworkflowevents)
- [ProductOptionWorkflowEvents](../../module_events/module_events.Product/page.mdx#productoptionworkflowevents)
- [ProductTagWorkflowEvents](../../module_events/module_events.Product/page.mdx#producttagworkflowevents)
- [ProductTypeWorkflowEvents](../../module_events/module_events.Product/page.mdx#producttypeworkflowevents)
- [ProductVariantWorkflowEvents](../../module_events/module_events.Product/page.mdx#productvariantworkflowevents)
- [ProductWorkflowEvents](../../module_events/module_events.Product/page.mdx#productworkflowevents)
- [RegionWorkflowEvents](../../module_events/module_events.Region/page.mdx#regionworkflowevents)
- [SalesChannelWorkflowEvents](../../module_events/module_events.Sales_Channel/page.mdx#saleschannelworkflowevents)
- [UserWorkflowEvents](../../module_events/module_events.User/page.mdx#userworkflowevents)
## Auth
### AuthWorkflowEvents
`Const` **AuthWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"PASSWORD_RESET","type":"`string`","description":"Emitted when a reset password token is generated. You can listen to this event\nto send a reset password email to the user or customer, for example.","optional":false,"defaultValue":"\"auth.password_reset\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AuthWorkflowEvents"/>
___
## Cart
### CartWorkflowEvents
`Const` **CartWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when a cart is created.","optional":false,"defaultValue":"\"cart.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when a cart's details are updated.","optional":false,"defaultValue":"\"cart.updated\"","expandable":false,"children":[]},{"name":"CUSTOMER_UPDATED","type":"`string`","description":"Emitted when the customer in the cart is updated.","optional":false,"defaultValue":"\"cart.customer_updated\"","expandable":false,"children":[]},{"name":"REGION_UPDATED","type":"`string`","description":"Emitted when the cart's region is updated. This\nevent is emitted alongside the [CartWorkflowEvents.UPDATED](../../module_events/module_events.Cart/page.mdx#updated) event.","optional":false,"defaultValue":"\"cart.region_updated\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CartWorkflowEvents"/>
___
## Customer
### CustomerWorkflowEvents
`Const` **CustomerWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when a customer is created.","optional":false,"defaultValue":"\"customer.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when a customer is updated.","optional":false,"defaultValue":"\"customer.updated\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when a customer is deleted.","optional":false,"defaultValue":"\"customer.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CustomerWorkflowEvents"/>
___
## Fulfillment
### FulfillmentWorkflowEvents
`Const` **FulfillmentWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"SHIPMENT_CREATED","type":"`string`","description":"Emitted when a shipment is created for an order.","optional":false,"defaultValue":"\"shipment.created\"","expandable":false,"children":[]},{"name":"DELIVERY_CREATED","type":"`string`","description":"Emitted when a fulfillment is marked as delivered.","optional":false,"defaultValue":"\"delivery.created\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="FulfillmentWorkflowEvents"/>
___
## Invite
### InviteWorkflowEvents
`Const` **InviteWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"ACCEPTED","type":"`string`","description":"Emitted when an invite is accepted.","optional":false,"defaultValue":"\"invite.accepted\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when invites are created. You can listen to this event\nto send an email to the invited users, for example.","optional":false,"defaultValue":"\"invite.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when invites are deleted.","optional":false,"defaultValue":"\"invite.deleted\"","expandable":false,"children":[]},{"name":"RESENT","type":"`string`","description":"Emitted when invites should be resent because their token was\nrefreshed. You can listen to this event to send an email to the invited users,\nfor example.","optional":false,"defaultValue":"\"invite.resent\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="InviteWorkflowEvents"/>
___
## Order
### OrderWorkflowEvents
`Const` **OrderWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when the details of an order or draft order is updated. This\ndoesn't include updates made by an edit.","optional":false,"defaultValue":"\"order.updated\"","expandable":false,"children":[]},{"name":"PLACED","type":"`string`","description":"Emitted when an order is placed, or when a draft order is converted to an\norder.","optional":false,"defaultValue":"\"order.placed\"","expandable":false,"children":[]},{"name":"CANCELED","type":"`string`","description":"Emitted when an order is canceld.","optional":false,"defaultValue":"\"order.canceled\"","expandable":false,"children":[]},{"name":"COMPLETED","type":"`string`","description":"Emitted when orders are completed.","optional":false,"defaultValue":"\"order.completed\"","expandable":false,"children":[]},{"name":"ARCHIVED","type":"`string`","description":"Emitted when an order is archived.","optional":false,"defaultValue":"\"order.archived\"","expandable":false,"children":[]},{"name":"FULFILLMENT_CREATED","type":"`string`","description":"Emitted when a fulfillment is created for an order.","optional":false,"defaultValue":"\"order.fulfillment_created\"","expandable":false,"children":[]},{"name":"FULFILLMENT_CANCELED","type":"`string`","description":"Emitted when an order's fulfillment is canceled.","optional":false,"defaultValue":"\"order.fulfillment_canceled\"","expandable":false,"children":[]},{"name":"RETURN_REQUESTED","type":"`string`","description":"Emitted when a return request is confirmed.","optional":false,"defaultValue":"\"order.return_requested\"","expandable":false,"children":[]},{"name":"RETURN_RECEIVED","type":"`string`","description":"Emitted when a return is marked as received.","optional":false,"defaultValue":"\"order.return_received\"","expandable":false,"children":[]},{"name":"CLAIM_CREATED","type":"`string`","description":"Emitted when a claim is created for an order.","optional":false,"defaultValue":"\"order.claim_created\"","expandable":false,"children":[]},{"name":"EXCHANGE_CREATED","type":"`string`","description":"Emitted when an exchange is created for an order.","optional":false,"defaultValue":"\"order.exchange_created\"","expandable":false,"children":[]},{"name":"TRANSFER_REQUESTED","type":"`string`","description":"Emitted when an order is requested to be transferred to\nanother customer.","optional":false,"defaultValue":"\"order.transfer_requested\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="OrderWorkflowEvents"/>
___
## Order Edit
### OrderEditWorkflowEvents
`Const` **OrderEditWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"REQUESTED","type":"`string`","description":"Emitted when an order edit is requested.","optional":false,"defaultValue":"\"order-edit.requested\"","expandable":false,"children":[]},{"name":"CONFIRMED","type":"`string`","description":"Emitted when an order edit request is confirmed.","optional":false,"defaultValue":"\"order-edit.confirmed\"","expandable":false,"children":[]},{"name":"CANCELED","type":"`string`","description":"Emitted when an order edit request is canceled.","optional":false,"defaultValue":"\"order-edit.canceled\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="OrderEditWorkflowEvents"/>
___
___
## Product
### ProductWorkflowEvents
`Const` **ProductWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when products are updated.","optional":false,"defaultValue":"\"product.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when products are created.","optional":false,"defaultValue":"\"product.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when products are deleted.","optional":false,"defaultValue":"\"product.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductWorkflowEvents"/>
___
## Product Category
### ProductCategoryWorkflowEvents
`Const` **ProductCategoryWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when product categories are created.","optional":false,"defaultValue":"\"product-category.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when product categories are updated.","optional":false,"defaultValue":"\"product-category.updated\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product categories are deleted.","optional":false,"defaultValue":"\"product-category.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductCategoryWorkflowEvents"/>
___
## Product Collection
### ProductCollectionWorkflowEvents
`Const` **ProductCollectionWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when product collections are created.","optional":false,"defaultValue":"\"product-collection.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when product collections are updated.","optional":false,"defaultValue":"\"product-collection.updated\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product collections are deleted.","optional":false,"defaultValue":"\"product-collection.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductCollectionWorkflowEvents"/>
___
## Product Option
### ProductOptionWorkflowEvents
`Const` **ProductOptionWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when product options are updated.","optional":false,"defaultValue":"\"product-option.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when product options are created.","optional":false,"defaultValue":"\"product-option.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product options are deleted.","optional":false,"defaultValue":"\"product-option.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductOptionWorkflowEvents"/>
___
## Product Tag
### ProductTagWorkflowEvents
`Const` **ProductTagWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when product tags are updated.","optional":false,"defaultValue":"\"product-tag.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when product tags are created.","optional":false,"defaultValue":"\"product-tag.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product tags are deleted.","optional":false,"defaultValue":"\"product-tag.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductTagWorkflowEvents"/>
___
## Product Type
### ProductTypeWorkflowEvents
`Const` **ProductTypeWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when product types are updated.","optional":false,"defaultValue":"\"product-type.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when product types are created.","optional":false,"defaultValue":"\"product-type.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product types are deleted.","optional":false,"defaultValue":"\"product-type.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductTypeWorkflowEvents"/>
___
## Product Variant
### ProductVariantWorkflowEvents
`Const` **ProductVariantWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when product variants are updated.","optional":false,"defaultValue":"\"product-variant.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when product variants are created.","optional":false,"defaultValue":"\"product-variant.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when product variants are deleted.","optional":false,"defaultValue":"\"product-variant.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProductVariantWorkflowEvents"/>
___
## Region
### RegionWorkflowEvents
`Const` **RegionWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"UPDATED","type":"`string`","description":"Emitted when regions are updated.","optional":false,"defaultValue":"\"region.updated\"","expandable":false,"children":[]},{"name":"CREATED","type":"`string`","description":"Emitted when regions are created.","optional":false,"defaultValue":"\"region.created\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when regions are deleted.","optional":false,"defaultValue":"\"region.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="RegionWorkflowEvents"/>
___
## Sales Channel
### SalesChannelWorkflowEvents
`Const` **SalesChannelWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when sales channels are created.","optional":false,"defaultValue":"\"sales-channel.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when sales channels are updated.","optional":false,"defaultValue":"\"sales-channel.updated\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when sales channels are deleted.","optional":false,"defaultValue":"\"sales-channel.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="SalesChannelWorkflowEvents"/>
___
## User
### UserWorkflowEvents
`Const` **UserWorkflowEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CREATED","type":"`string`","description":"Emitted when users are created.","optional":false,"defaultValue":"\"user.created\"","expandable":false,"children":[]},{"name":"UPDATED","type":"`string`","description":"Emitted when users are updated.","optional":false,"defaultValue":"\"user.updated\"","expandable":false,"children":[]},{"name":"DELETED","type":"`string`","description":"Emitted when users are deleted.","optional":false,"defaultValue":"\"user.deleted\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UserWorkflowEvents"/>
+1 -1
View File
@@ -157,7 +157,7 @@ export const authSidebar = [
},
{
type: "link",
path: "/commerce-modules/auth/events",
path: "/references/auth/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -138,7 +138,7 @@ export const cartSidebar = [
},
{
type: "link",
path: "/commerce-modules/cart/events",
path: "/references/cart/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -128,7 +128,7 @@ export const customerSidebar = [
},
{
type: "link",
path: "/commerce-modules/customer/events",
path: "/references/customer/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -155,7 +155,7 @@ export const fulfillmentSidebar = [
},
{
type: "link",
path: "/commerce-modules/fulfillment/events",
path: "/references/fulfillment/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -166,7 +166,7 @@ export const orderSidebar = [
},
{
type: "link",
path: "/commerce-modules/order/events",
path: "/references/order/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -174,7 +174,7 @@ export const paymentSidebar = [
},
{
type: "link",
path: "/commerce-modules/payment/events",
path: "/references/payment/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -150,7 +150,7 @@ export const productSidebar = [
},
{
type: "link",
path: "/commerce-modules/product/events",
path: "/references/product/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -106,7 +106,7 @@ export const referencesSidebar = [
},
{
type: "link",
path: "/events-reference",
path: "/references/events",
title: "Events",
description: "List of events emitted by Medusa's Commerce Modules.",
},
+1 -1
View File
@@ -116,7 +116,7 @@ export const regionSidebar = [
},
{
type: "link",
path: "/commerce-modules/region/events",
path: "/references/region/events",
title: "Events Reference",
},
{
@@ -123,7 +123,7 @@ export const salesChannelSidebar = [
},
{
type: "link",
path: "/commerce-modules/sales-channel/events",
path: "/references/sales-channel/events",
title: "Events Reference",
},
{
+1 -1
View File
@@ -117,7 +117,7 @@ export const userSidebar = [
},
{
type: "link",
path: "/commerce-modules/user/events",
path: "/references/user/events",
title: "Events Reference",
},
{
@@ -116,7 +116,7 @@ const sidebarMappings: {
"/medusa-workflows-reference",
"/references/core-flows",
"/references/data-model",
"/events-reference",
"/references/events",
"/references/helper-steps",
"/service-factory-reference",
"/test-tools-reference",
+1 -5
View File
@@ -19,11 +19,7 @@ const compat = new FlatCompat({
export default [
{
ignores: [
"**/references/**/*",
"**/events-reference/**/*",
"**/_events-table/**/*",
],
ignores: ["**/references/**/*"],
},
{
plugins: {
+1 -5
View File
@@ -19,11 +19,7 @@ const compat = new FlatCompat({
export default [
{
ignores: [
"**/references/**/*",
"**/events-reference/**/*",
"**/_events-table/**/*",
],
ignores: ["**/references/**/*"],
},
{
plugins: {
+1 -1
View File
@@ -321,7 +321,7 @@ export const navDropdownItems: NavigationItem[] = [
{
type: "link",
title: "Events Reference",
link: "/resources/events-reference",
link: "/resources/references/events",
},
{
type: "link",
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,6 +3,7 @@ import DefaultKindGenerator, { GetDocBlockOptions } from "./default.js"
import { glob } from "glob"
import getMonorepoRoot from "../../utils/get-monorepo-root.js"
import { readFile } from "fs/promises"
import { MedusaEvent } from "types"
class EventsKindGenerator extends DefaultKindGenerator<ts.VariableDeclaration> {
protected allowedKinds: ts.SyntaxKind[] = [ts.SyntaxKind.VariableDeclaration]
@@ -33,17 +34,7 @@ class EventsKindGenerator extends DefaultKindGenerator<ts.VariableDeclaration> {
const properties = (node.initializer as ts.ObjectLiteralExpression)
.properties
const events: {
name: string
parentName: string
propertyName: string
payload: string
description?: string
workflows: string[]
version?: string
deprecated?: boolean
deprecated_message?: string
}[] = properties
const events: MedusaEvent[] = properties
.filter((property) => ts.isPropertyAssignment(property))
.map((property) => {
const propertyAssignment = property as ts.PropertyAssignment
@@ -57,6 +57,18 @@
{
"tagName": "@tags",
"syntaxKind": "block"
},
{
"tagName": "@eventName",
"syntaxKind": "block"
},
{
"tagName": "@workflows",
"syntaxKind": "block"
},
{
"tagName": "@eventPayload",
"syntaxKind": "block"
}
]
}
@@ -47,6 +47,19 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
tsConfigName: "types.json",
name: "event",
}),
events: getOptions({
entryPointPath: "packages/core/utils/src/core-flows/events.ts",
tsConfigName: "utils.json",
name: "events",
enableEventsResolver: true,
}),
"module-events": getOptions({
entryPointPath: "packages/core/utils/src/core-flows/events.ts",
tsConfigName: "utils.json",
name: "module-events",
enableEventsResolver: true,
generateCustomNamespaces: true,
}),
file: getOptions({
entryPointPath: "packages/core/utils/src/file/abstract-file-provider.ts",
tsConfigName: "utils.json",
@@ -0,0 +1,29 @@
import { FormattingOptionsType } from "types"
const eventsOptions: FormattingOptionsType = {
"^modules/events/": {
reflectionDescription: `This documentation page includes the list of all events emitted by [Medusa's workflows](https://docs.medusajs.com/resources/medusa-workflows-reference).`,
frontmatterData: {
slug: "/references/events",
sidebar_label: "Events Reference",
},
isEventsReference: true,
reflectionTitle: {
fullReplacement: "Events Reference",
},
},
"^module_events": {
expandMembers: true,
isEventsReference: true,
reflectionDescription: `This reference shows all the events emitted by the Medusa application related to the {{alias}} Module. If you use the module outside the Medusa application, these events aren't emitted.`,
reflectionTitle: {
suffix: "Module Events Reference",
},
frontmatterData: {
slug: "/references/{{alias-slug}}/events",
sidebar_label: "Events Reference",
},
},
}
export default eventsOptions
@@ -18,6 +18,7 @@ import cacheOptions from "./cache.js"
import eventOptions from "./event.js"
import fileServiceOptions from "./file-service.js"
import notificationServiceOptions from "./notification-service.js"
import eventsOptions from "./events.js"
const mergerCustomOptions: FormattingOptionsType = {
...authProviderOptions,
@@ -25,6 +26,7 @@ const mergerCustomOptions: FormattingOptionsType = {
...coreFlowsOptions,
...dmlOptions,
...eventOptions,
...eventsOptions,
...fileServiceOptions,
...fileOptions,
...fulfillmentProviderOptions,
@@ -30,6 +30,9 @@ const allowedProjectDocuments: AllowedProjectDocumentsOption = {
[ReflectionKind.Method]: true,
[ReflectionKind.Property]: true,
},
"module-events": {
[ReflectionKind.Namespace]: true,
},
}
modules.forEach((module) => {
@@ -0,0 +1,106 @@
import { readFileSync } from "fs"
import path from "path"
import {
Application,
Comment,
CommentTag,
Context,
Converter,
DeclarationReflection,
ParameterType,
ReflectionKind,
} from "typedoc"
import { MedusaEvent } from "types"
import { getDirname } from "utils"
export class EventsResolver {
private app: Application
private events: MedusaEvent[] = []
constructor(app: Application) {
this.app = app
this.app.options.addDeclaration({
name: "enableEventsResolver",
help: "Whether to resolve events.",
type: ParameterType.Boolean,
defaultValue: false,
})
this.app.converter.on(
Converter.EVENT_RESOLVE_BEGIN,
this.resolveEvents.bind(this)
)
}
resolveEvents(context: Context) {
if (!this.app.options.getValue("enableEventsResolver")) {
return
}
if (!this.events.length) {
const __dirname = getDirname(import.meta.url)
const jsonFilePath = path.resolve(
__dirname,
path.join("..", "..", "..", "generated", "events-output.json")
)
// read events file
const eventsJSON = readFileSync(jsonFilePath, "utf-8")
this.events = JSON.parse(eventsJSON)
}
for (const reflection of context.project.getReflectionsByKind(
ReflectionKind.Variable
)) {
if (
!(reflection instanceof DeclarationReflection) ||
reflection.type?.type !== "reflection" ||
!reflection.type.declaration.children
) {
continue
}
const relatedEvents = this.events.filter(
(event) => event.parentName === reflection.name
)
if (!relatedEvents.length) {
continue
}
// loop over variable properties
for (const property of reflection.type.declaration.children) {
const propertyEvent = relatedEvents.find(
(event) => event.propertyName === property.name
)
if (!propertyEvent) {
continue
}
if (!property.comment) {
property.comment = new Comment()
}
property.comment.blockTags.push(
new CommentTag("@eventName", [
{
kind: "code",
text: propertyEvent.name,
},
])
)
property.comment.blockTags.push(
new CommentTag("@workflows", [
{
kind: "text",
text: propertyEvent.workflows.join(", "),
},
])
)
}
}
}
}
@@ -13,6 +13,7 @@ import { load as dmlTypesNormalizer } from "./dml-types-normalizer.js"
import { MermaidDiagramDMLGenerator } from "./mermaid-diagram-dml-generator.js"
import { load as dmlJsonParser } from "./dml-json-parser.js"
import { GenerateCustomNamespacePlugin } from "./generate-custom-namespaces.js"
import { EventsResolver } from "./events-resolver.js"
export function load(app: Application) {
resolveReferencesPluginLoad(app)
@@ -30,4 +31,5 @@ export function load(app: Application) {
new DmlRelationsResolver(app)
new MermaidDiagramDMLGenerator(app)
new GenerateCustomNamespacePlugin(app)
new EventsResolver(app)
}
@@ -38,6 +38,7 @@
"dependencies": {
"handlebars": "^4.7.8",
"js-beautify": "^1.15.1",
"slugify": "^1.6.6",
"utils": "*"
}
}
@@ -80,6 +80,8 @@ import versionHelper from "./resources/helpers/version.js"
import sourceCodeLinkHelper from "./resources/helpers/source-code-link.js"
import workflowExamplesHelper from "./resources/helpers/workflow-examples.js"
import stepExamplesHelper from "./resources/helpers/step-examples.js"
import ifEventsReferenceHelper from "./resources/helpers/if-events-reference.js"
import eventsListingHelper from "./resources/helpers/events-listing.js"
import { MarkdownTheme } from "./theme.js"
import { getDirname } from "utils"
@@ -191,4 +193,6 @@ export function registerHelpers(theme: MarkdownTheme) {
sourceCodeLinkHelper()
workflowExamplesHelper()
stepExamplesHelper()
ifEventsReferenceHelper(theme)
eventsListingHelper()
}
@@ -0,0 +1,142 @@
import Handlebars from "handlebars"
import pkg from "slugify"
import { DeclarationReflection } from "typedoc"
import { pascalToWords } from "utils"
const slugify = pkg.default
export default function () {
Handlebars.registerHelper(
"eventsListing",
function (this: DeclarationReflection) {
const content: string[] = []
const subtitleLevel = (this.children?.length ?? 0) > 1 ? 3 : 2
const showHeader = (this.children?.length ?? 0) > 1
this.children?.forEach((child, index) => {
content.push(
formatEventsType(child as DeclarationReflection, {
subtitleLevel,
showHeader,
})
)
if (index < this.children!.length - 1) {
content.push("")
content.push("---")
content.push("")
}
})
return content.join("\n")
}
)
}
function formatEventsType(
eventVariable: DeclarationReflection,
{
subtitleLevel = 3,
showHeader = true,
}: {
subtitleLevel?: number
showHeader?: boolean
}
) {
if (eventVariable.type?.type !== "reflection") {
return ""
}
const content: string[] = []
const subHeaderPrefix = "#".repeat(subtitleLevel)
const header = pascalToWords(
eventVariable.name.replaceAll("WorkflowEvents", "")
)
if (showHeader) {
content.push(`## ${header} Events`)
}
content.push("")
const eventProperties = eventVariable.type.declaration.children || []
content.push(`${subHeaderPrefix} Summary`)
content.push("")
// table start
content.push(`<Table>`)
// table header start
content.push(` <Table.Header>`)
content.push(` <Table.Row>`)
content.push(` <Table.HeaderCell>\nEvent\n</Table.HeaderCell>`)
content.push(` <Table.HeaderCell>\nDescription\n</Table.HeaderCell>`)
// table header end
content.push(` </Table.Row>`)
content.push(` </Table.Header>`)
// table body start
content.push(` <Table.Body>`)
eventProperties.forEach((event) => {
const eventName =
event.comment?.blockTags
.find((tag) => tag.tag === "@eventName")
?.content.map((content) => content.text)
.join("") || ""
const eventDescription = event.comment?.summary
.map((content) => content.text)
.join("")
content.push(` <Table.Row>`)
content.push(
` <Table.Cell>\n[${eventName}](#${slugify(
eventName.replace(".", ""),
{
lower: true,
}
)})\n</Table.Cell>`
)
content.push(` <Table.Cell>\n${eventDescription}\n</Table.Cell>`)
content.push(` </Table.Row>`)
})
// table body end
content.push(` </Table.Body>`)
// table end
content.push(`</Table>`)
content.push("")
eventProperties.forEach((event, index) => {
const eventName = event.comment?.blockTags
.find((tag) => tag.tag === "@eventName")
?.content.map((content) => content.text)
.join("")
const eventDescription = event.comment?.summary
.map((content) => content.text)
.join("")
const eventPayload = event.comment?.blockTags
.find((tag) => tag.tag === "@eventPayload")
?.content.map((content) => content.text)
.join("")
const workflows = event.comment?.blockTags
.find((tag) => tag.tag === "@workflows")
?.content.map((content) => content.text)
.join("")
.split(", ")
content.push(`${subHeaderPrefix} \`${eventName}\``)
content.push("")
content.push(eventDescription || "")
content.push("")
content.push(`${subHeaderPrefix}# Payload`)
content.push("")
content.push(eventPayload || "")
content.push("")
content.push(`${subHeaderPrefix}# Workflows Emitting this Event`)
content.push("")
workflows?.forEach((workflow) => {
content.push(`- [${workflow}](/references/medusa-workflows/${workflow})`)
})
content.push("")
if (index < eventProperties.length - 1) {
content.push("---")
content.push("")
}
})
return content.join("\n")
}
@@ -0,0 +1,15 @@
import Handlebars from "handlebars"
import { Reflection } from "typedoc"
import { MarkdownTheme } from "../../theme.js"
export default function (theme: MarkdownTheme) {
Handlebars.registerHelper(
"ifEventsReference",
function (this: Reflection, options: Handlebars.HelperOptions) {
const { isEventsReference = false } =
theme.getFormattingOptionsForLocation()
return isEventsReference ? options.fn(this) : options.inverse(this)
}
)
}
@@ -6,6 +6,16 @@
{{{ startSections }}}
{{#ifEventsReference}}
{{#with model}}
{{{ eventsListing }}}
{{/with}}
{{else}}
{{#with model}}
{{#if (sectionEnabled "reflection_comment")}}
@@ -148,4 +158,6 @@
{{/with}}
{{/ifEventsReference}}
{{{ endSections }}}
@@ -1,4 +1,7 @@
import { Reflection, ReflectionKind } from "typedoc"
import pkg from "slugify"
const slugify = pkg.default
export function replaceTemplateVariables(
reflection: Reflection,
@@ -11,6 +14,12 @@ export function replaceTemplateVariables(
return text
.replaceAll("{{alias}}", reflection.name)
.replaceAll("{{alias-lower}}", reflection.name.toLowerCase())
.replaceAll(
"{{alias-slug}}",
slugify(reflection.name, {
lower: true,
})
)
.replaceAll("{{parent.alias}}", reflection.parent?.name || "")
.replaceAll(
"{{parent.alias-lower}}",
+18
View File
@@ -100,6 +100,7 @@ export type FormattingOptionType = {
shouldIncrementAfterStartSections?: boolean
hideTocHeaders?: boolean
workflowDiagramComponent?: string
isEventsReference?: boolean
}
export type AllowedProjectDocumentsOption = {
@@ -289,6 +290,11 @@ export declare module "typedoc" {
* Optionally specify a name prefix for all custom namespaces.
*/
customNamespaceNamePrefix: string
/**
* Whether to resolve events.
* @defaultValue false
*/
enableEventsResolver: boolean
}
}
@@ -328,3 +334,15 @@ export declare type NamespaceGenerateDetails = {
*/
children?: NamespaceGenerateDetails[]
}
export declare type MedusaEvent = {
name: string
parentName: string
propertyName: string
payload: string
description?: string
workflows: string[]
version?: string
deprecated?: boolean
deprecated_message?: string
}
+8
View File
@@ -5556,6 +5556,13 @@ __metadata:
languageName: node
linkType: hard
"slugify@npm:^1.6.6":
version: 1.6.6
resolution: "slugify@npm:1.6.6"
checksum: e7e63f08f389a371d6228bc19d64ec84360bf0a538333446cc49dbbf3971751a6d180d2f31551188dd007a65ca771e69f574e0283290a7825a818e90b75ef44d
languageName: node
linkType: hard
"source-map@npm:^0.6.1":
version: 0.6.1
resolution: "source-map@npm:0.6.1"
@@ -6035,6 +6042,7 @@ __metadata:
copyfiles: ^2.4.1
handlebars: ^4.7.8
js-beautify: ^1.15.1
slugify: ^1.6.6
typedoc: ^0.27.5
types: "*"
typescript: ^5.6.2