docs: support version in events reference (#12422)

* docs: support version in events reference

* remove changes in events output

* remove events emitted in comments

* remove customer updated event

* check for emitEventStep usage

* fixes
This commit is contained in:
Shahed Nasser
2025-05-09 14:34:15 +03:00
committed by GitHub
parent 091041f2da
commit e09b2a4db5
24 changed files with 91 additions and 636 deletions
@@ -46,7 +46,7 @@ export const EventHeader = ({
return (
<div className="flex items-center justify-between flex-wrap">
<Header {...headerProps}>{eventName}</Header>
<Header {...headerProps}>{headerProps.children ?? eventName}</Header>
<DropdownMenu
dropdownButtonContent={
<>
@@ -301,31 +301,6 @@ Emitted when a cart's details are updated.
{
id, // The ID of the cart
}
\`\`\``
}}/>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`cart.customer_updated`
</Table.Cell>
<Table.Cell>
Emitted when the customer in the cart is updated.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
id, // The ID of the cart
}
```
</Table.Cell>
<Table.Cell>
<CopyGeneratedSnippetButton tooltipText="Copy subscriber for event" type="subscriber" options={{
event: "cart.customer_updated",
payload: `\`\`\`ts
{
id, // The ID of the cart
}
\`\`\``
}}/>
</Table.Cell>
@@ -130,62 +130,8 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"cancelBeginOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"type":"step","name":"cancelBeginOrderEditValidationStep","description":"This step validates that a requested order edit can be canceled.\nIf the order is canceled or the order change is not active, the step will throw an error.\n\n:::note\n\nYou can retrieve an order and order change details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../core_flows.Order.Workflows_Order.cancelBeginOrderEditValidationStep/page.mdx","depth":3},{"type":"step","name":"deleteOrderChangesStep","description":"This step deletes order changes.","link":"../../../Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangesStep/page.mdx","depth":4},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":4},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4}]}} />
<WorkflowDiagram workflow={{"name":"cancelBeginOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"type":"step","name":"cancelBeginOrderEditValidationStep","description":"This step validates that a requested order edit can be canceled.\nIf the order is canceled or the order change is not active, the step will throw an error.\n\n:::note\n\nYou can retrieve an order and order change details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../core_flows.Order.Workflows_Order.cancelBeginOrderEditValidationStep/page.mdx","depth":3},{"type":"step","name":"deleteOrderChangesStep","description":"This step deletes order changes.","link":"../../../Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangesStep/page.mdx","depth":4},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":4}]}} />
## Input
<TypeList types={[{"name":"CancelBeginOrderEditWorkflowInput","type":"[CancelBeginOrderEditWorkflowInput](../../../../types/core_flows.CancelBeginOrderEditWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to cancel a requested order edit.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the order to cancel the edit for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cancelBeginOrderEditWorkflow"/>
## Emitted Events
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Event
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
<Table.HeaderCell>
Payload
</Table.HeaderCell>
<Table.HeaderCell>
Action
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`order-edit.canceled`
</Table.Cell>
<Table.Cell>
Emitted when an order edit request is canceled.
</Table.Cell>
<Table.Cell>
```ts blockStyle="inline"
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
</Table.Cell>
<Table.Cell>
<CopyGeneratedSnippetButton tooltipText="Copy subscriber for event" type="subscriber" options={{
event: "order-edit.canceled",
payload: `\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``
}}/>
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
@@ -37,14 +37,6 @@ Emitted when a cart is created.
</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>
@@ -110,30 +102,6 @@ The following workflows emit this event when they're executed. These workflows a
---
<EventHeader headerLvl="2" headerProps={{ id: "cartcustomer_updated", children: (<>cart.customer_updated</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="cart.customer_updated" payload={`\`\`\`ts
{
id, // The ID of the cart
}
\`\`\``} />
Emitted when the customer in the cart is updated.
### Payload
```ts
{
id, // The ID of the cart
}
```
### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [updateCartWorkflow](/references/medusa-workflows/updateCartWorkflow)
---
<EventHeader headerLvl="2" headerProps={{ id: "cartregion_updated", children: (<>cart.region_updated</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="cart.region_updated" payload={`\`\`\`ts
{
id, // The ID of the cart
@@ -438,124 +438,3 @@ another customer.
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [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>
<EventHeader headerLvl="3" headerProps={{ id: "order-editrequested", children: (<>order-edit.requested</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.requested" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``} />
Emitted when an order edit is requested.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [requestOrderEditRequestWorkflow](/references/medusa-workflows/requestOrderEditRequestWorkflow)
---
<EventHeader headerLvl="3" headerProps={{ id: "order-editconfirmed", children: (<>order-edit.confirmed</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.confirmed" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``} />
Emitted when an order edit request is confirmed.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [confirmOrderEditRequestWorkflow](/references/medusa-workflows/confirmOrderEditRequestWorkflow)
---
<EventHeader headerLvl="3" headerProps={{ id: "order-editcanceled", children: (<>order-edit.canceled</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.canceled" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``} />
Emitted when an order edit request is canceled.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [cancelBeginOrderEditWorkflow](/references/medusa-workflows/cancelBeginOrderEditWorkflow)
@@ -39,14 +39,6 @@ Emitted when a cart is created.
</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>
@@ -112,30 +104,6 @@ The following workflows emit this event when they're executed. These workflows a
---
<EventHeader headerLvl="3" headerProps={{ id: "cartcustomer_updated", children: (<>cart.customer_updated</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="cart.customer_updated" payload={`\`\`\`ts
{
id, // The ID of the cart
}
\`\`\``} />
Emitted when the customer in the cart is updated.
#### Payload
```ts
{
id, // The ID of the cart
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [updateCartWorkflow](/references/medusa-workflows/updateCartWorkflow)
---
<EventHeader headerLvl="3" headerProps={{ id: "cartregion_updated", children: (<>cart.region_updated</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="cart.region_updated" payload={`\`\`\`ts
{
id, // The ID of the cart
@@ -710,125 +678,6 @@ The following workflows emit this event when they're executed. These workflows a
---
## 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>
<EventHeader headerLvl="3" headerProps={{ id: "order-editrequested", children: (<>order-edit.requested</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.requested" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``} />
Emitted when an order edit is requested.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [requestOrderEditRequestWorkflow](/references/medusa-workflows/requestOrderEditRequestWorkflow)
---
<EventHeader headerLvl="3" headerProps={{ id: "order-editconfirmed", children: (<>order-edit.confirmed</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.confirmed" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
\`\`\``} />
Emitted when an order edit request is confirmed.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [confirmOrderEditRequestWorkflow](/references/medusa-workflows/confirmOrderEditRequestWorkflow)
---
<EventHeader headerLvl="3" headerProps={{ id: "order-editcanceled", children: (<>order-edit.canceled</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="order-edit.canceled" payload={`\`\`\`ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
\`\`\``} />
Emitted when an order edit request is canceled.
#### Payload
```ts
{
order_id, // The ID of the order
actions, // (array) The [actions](https://docs.medusajs.com/resources/references/fulfillment/interfaces/fulfillment.OrderChangeActionDTO) to edit the order
}
```
#### Workflows Emitting this Event
The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the [Store](https://docs.medusajs.com/api/store) and [Admin](https://docs.medusajs.com/api/admin) API references.
- [cancelBeginOrderEditWorkflow](/references/medusa-workflows/cancelBeginOrderEditWorkflow)
---
## User Events
### Summary