docs-util: add events to workflows reference (#12376)
This commit is contained in:
1 parent
aba4cba373
commit
ecf3556589
10 files changed
+263
-74
No files matched your search
@@ -8,6 +8,8 @@ import {
|
|||||||
CodeTabs,
|
CodeTabs,
|
||||||
CodeTab,
|
CodeTab,
|
||||||
Table,
|
Table,
|
||||||
|
Badge,
|
||||||
|
Tooltip,
|
||||||
} from "docs-ui"
|
} from "docs-ui"
|
||||||
import { CommerceModuleSections } from "../CommerceModuleSections"
|
import { CommerceModuleSections } from "../CommerceModuleSections"
|
||||||
|
|
||||||
@@ -21,6 +23,8 @@ const MDXComponents: MDXComponentsType = {
|
|||||||
CodeTabs,
|
CodeTabs,
|
||||||
CodeTab,
|
CodeTab,
|
||||||
Table,
|
Table,
|
||||||
|
Badge,
|
||||||
|
Tooltip,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MDXComponents
|
export default MDXComponents
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
"name": "cart.created",
|
"name": "cart.created",
|
||||||
"parentName": "CartWorkflowEvents",
|
"parentName": "CartWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "{\n id, // The ID of the cart\n}",
|
"payload": "```ts\n{\n id, // The ID of the cart\n}\n```",
|
||||||
"description": "Emitted when a cart is created.",
|
"description": "Emitted when a cart is created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createCartWorkflow"
|
"createCartWorkflow"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"name": "cart.updated",
|
"name": "cart.updated",
|
||||||
"parentName": "CartWorkflowEvents",
|
"parentName": "CartWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "{\n id, // The ID of the cart\n}",
|
"payload": "```ts\n{\n id, // The ID of the cart\n}\n```",
|
||||||
"description": "Emitted when a cart's details are updated.",
|
"description": "Emitted when a cart's details are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateLineItemInCartWorkflow",
|
"updateLineItemInCartWorkflow",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"name": "cart.customer_updated",
|
"name": "cart.customer_updated",
|
||||||
"parentName": "CartWorkflowEvents",
|
"parentName": "CartWorkflowEvents",
|
||||||
"propertyName": "CUSTOMER_UPDATED",
|
"propertyName": "CUSTOMER_UPDATED",
|
||||||
"payload": "{\n id, // The ID of the cart\n}",
|
"payload": "```ts\n{\n id, // The ID of the cart\n}\n```",
|
||||||
"description": "Emitted when the customer in the cart is updated.",
|
"description": "Emitted when the customer in the cart is updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateCartWorkflow"
|
"updateCartWorkflow"
|
||||||
@@ -39,7 +39,8 @@
|
|||||||
"name": "cart.region_updated",
|
"name": "cart.region_updated",
|
||||||
"parentName": "CartWorkflowEvents",
|
"parentName": "CartWorkflowEvents",
|
||||||
"propertyName": "REGION_UPDATED",
|
"propertyName": "REGION_UPDATED",
|
||||||
"payload": "{\n id, // The ID of the cart\n}",
|
"payload": "```ts\n{\n id, // The ID of the cart\n}\n```",
|
||||||
|
"description": "Emitted when the cart's region is updated. This\nevent is emitted alongside the `cart.updated` event.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateCartWorkflow"
|
"updateCartWorkflow"
|
||||||
],
|
],
|
||||||
@@ -49,7 +50,7 @@
|
|||||||
"name": "customer.created",
|
"name": "customer.created",
|
||||||
"parentName": "CustomerWorkflowEvents",
|
"parentName": "CustomerWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the customer\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the customer\n}]\n```",
|
||||||
"description": "Emitted when a customer is created.",
|
"description": "Emitted when a customer is created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createCustomersWorkflow",
|
"createCustomersWorkflow",
|
||||||
@@ -61,7 +62,7 @@
|
|||||||
"name": "customer.updated",
|
"name": "customer.updated",
|
||||||
"parentName": "CustomerWorkflowEvents",
|
"parentName": "CustomerWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the customer\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the customer\n}]\n```",
|
||||||
"description": "Emitted when a customer is updated.",
|
"description": "Emitted when a customer is updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateCustomersWorkflow"
|
"updateCustomersWorkflow"
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
"name": "customer.deleted",
|
"name": "customer.deleted",
|
||||||
"parentName": "CustomerWorkflowEvents",
|
"parentName": "CustomerWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the customer\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the customer\n}]\n```",
|
||||||
"description": "Emitted when a customer is deleted.",
|
"description": "Emitted when a customer is deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteCustomersWorkflow",
|
"deleteCustomersWorkflow",
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
"name": "order.updated",
|
"name": "order.updated",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "{\n id, // The ID of the order\n}",
|
"payload": "```ts\n{\n id, // The ID of the order\n}\n```",
|
||||||
"description": "Emitted when the details of an order or draft order is updated. This\ndoesn't include updates made by an edit.",
|
"description": "Emitted when the details of an order or draft order is updated. This\ndoesn't include updates made by an edit.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateOrderWorkflow",
|
"updateOrderWorkflow",
|
||||||
@@ -96,7 +97,7 @@
|
|||||||
"name": "order.placed",
|
"name": "order.placed",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "PLACED",
|
"propertyName": "PLACED",
|
||||||
"payload": "{\n id, // The ID of the order\n}",
|
"payload": "```ts\n{\n id, // The ID of the order\n}\n```",
|
||||||
"description": "Emitted when an order is placed, or when a draft order is converted to an\norder.",
|
"description": "Emitted when an order is placed, or when a draft order is converted to an\norder.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"completeCartWorkflow",
|
"completeCartWorkflow",
|
||||||
@@ -109,7 +110,7 @@
|
|||||||
"name": "order.canceled",
|
"name": "order.canceled",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "CANCELED",
|
"propertyName": "CANCELED",
|
||||||
"payload": "{\n id, // The ID of the order\n}",
|
"payload": "```ts\n{\n id, // The ID of the order\n}\n```",
|
||||||
"description": "Emitted when an order is canceld.",
|
"description": "Emitted when an order is canceld.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"cancelOrderWorkflow"
|
"cancelOrderWorkflow"
|
||||||
@@ -120,7 +121,7 @@
|
|||||||
"name": "order.completed",
|
"name": "order.completed",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "COMPLETED",
|
"propertyName": "COMPLETED",
|
||||||
"payload": "[{\n id, // The ID of the order\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the order\n}]\n```",
|
||||||
"description": "Emitted when orders are completed.",
|
"description": "Emitted when orders are completed.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"completeOrderWorkflow"
|
"completeOrderWorkflow"
|
||||||
@@ -131,7 +132,7 @@
|
|||||||
"name": "order.archived",
|
"name": "order.archived",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "ARCHIVED",
|
"propertyName": "ARCHIVED",
|
||||||
"payload": "[{\n id, // The ID of the order\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the order\n}]\n```",
|
||||||
"description": "Emitted when an order is archived.",
|
"description": "Emitted when an order is archived.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"archiveOrderWorkflow"
|
"archiveOrderWorkflow"
|
||||||
@@ -142,7 +143,7 @@
|
|||||||
"name": "order.fulfillment_created",
|
"name": "order.fulfillment_created",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "FULFILLMENT_CREATED",
|
"propertyName": "FULFILLMENT_CREATED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n fulfillment_id, // The ID of the fulfillment\n no_notification, // Whether to notify the customer\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n fulfillment_id, // The ID of the fulfillment\n no_notification, // Whether to notify the customer\n}\n```",
|
||||||
"description": "Emitted when a fulfillment is created for an order.",
|
"description": "Emitted when a fulfillment is created for an order.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createOrderFulfillmentWorkflow"
|
"createOrderFulfillmentWorkflow"
|
||||||
@@ -153,7 +154,7 @@
|
|||||||
"name": "order.fulfillment_canceled",
|
"name": "order.fulfillment_canceled",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "FULFILLMENT_CANCELED",
|
"propertyName": "FULFILLMENT_CANCELED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n fulfillment_id, // The ID of the fulfillment\n no_notification, // Whether to notify the customer\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n fulfillment_id, // The ID of the fulfillment\n no_notification, // Whether to notify the customer\n}\n```",
|
||||||
"description": "Emitted when an order's fulfillment is canceled.",
|
"description": "Emitted when an order's fulfillment is canceled.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"cancelOrderFulfillmentWorkflow"
|
"cancelOrderFulfillmentWorkflow"
|
||||||
@@ -164,7 +165,7 @@
|
|||||||
"name": "order.return_requested",
|
"name": "order.return_requested",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "RETURN_REQUESTED",
|
"propertyName": "RETURN_REQUESTED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n return_id, // The ID of the return\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n return_id, // The ID of the return\n}\n```",
|
||||||
"description": "Emitted when a return request is confirmed.",
|
"description": "Emitted when a return request is confirmed.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createAndCompleteReturnOrderWorkflow",
|
"createAndCompleteReturnOrderWorkflow",
|
||||||
@@ -176,7 +177,7 @@
|
|||||||
"name": "order.return_received",
|
"name": "order.return_received",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "RETURN_RECEIVED",
|
"propertyName": "RETURN_RECEIVED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n return_id, // The ID of the return\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n return_id, // The ID of the return\n}\n```",
|
||||||
"description": "Emitted when a return is marked as received.",
|
"description": "Emitted when a return is marked as received.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createAndCompleteReturnOrderWorkflow",
|
"createAndCompleteReturnOrderWorkflow",
|
||||||
@@ -188,7 +189,7 @@
|
|||||||
"name": "order.claim_created",
|
"name": "order.claim_created",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "CLAIM_CREATED",
|
"propertyName": "CLAIM_CREATED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n claim_id, // The ID of the claim\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n claim_id, // The ID of the claim\n}\n```",
|
||||||
"description": "Emitted when a claim is created for an order.",
|
"description": "Emitted when a claim is created for an order.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"confirmClaimRequestWorkflow"
|
"confirmClaimRequestWorkflow"
|
||||||
@@ -199,7 +200,7 @@
|
|||||||
"name": "order.exchange_created",
|
"name": "order.exchange_created",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "EXCHANGE_CREATED",
|
"propertyName": "EXCHANGE_CREATED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n exchange_id, // The ID of the exchange\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n exchange_id, // The ID of the exchange\n}\n```",
|
||||||
"description": "Emitted when an exchange is created for an order.",
|
"description": "Emitted when an exchange is created for an order.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"confirmExchangeRequestWorkflow"
|
"confirmExchangeRequestWorkflow"
|
||||||
@@ -210,7 +211,7 @@
|
|||||||
"name": "order.transfer_requested",
|
"name": "order.transfer_requested",
|
||||||
"parentName": "OrderWorkflowEvents",
|
"parentName": "OrderWorkflowEvents",
|
||||||
"propertyName": "TRANSFER_REQUESTED",
|
"propertyName": "TRANSFER_REQUESTED",
|
||||||
"payload": "{\n id, // The ID of the order\n order_change_id, // The ID of the order change created for the transfer\n}",
|
"payload": "```ts\n{\n id, // The ID of the order\n order_change_id, // The ID of the order change created for the transfer\n}\n```",
|
||||||
"description": "Emitted when an order is requested to be transferred to\nanother customer.",
|
"description": "Emitted when an order is requested to be transferred to\nanother customer.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"requestOrderTransferWorkflow"
|
"requestOrderTransferWorkflow"
|
||||||
@@ -221,7 +222,7 @@
|
|||||||
"name": "order-edit.requested",
|
"name": "order-edit.requested",
|
||||||
"parentName": "OrderEditWorkflowEvents",
|
"parentName": "OrderEditWorkflowEvents",
|
||||||
"propertyName": "REQUESTED",
|
"propertyName": "REQUESTED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}\n```",
|
||||||
"description": "Emitted when an order edit is requested.",
|
"description": "Emitted when an order edit is requested.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"requestOrderEditRequestWorkflow"
|
"requestOrderEditRequestWorkflow"
|
||||||
@@ -232,7 +233,7 @@
|
|||||||
"name": "order-edit.confirmed",
|
"name": "order-edit.confirmed",
|
||||||
"parentName": "OrderEditWorkflowEvents",
|
"parentName": "OrderEditWorkflowEvents",
|
||||||
"propertyName": "CONFIRMED",
|
"propertyName": "CONFIRMED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}\n```",
|
||||||
"description": "Emitted when an order edit request is confirmed.",
|
"description": "Emitted when an order edit request is confirmed.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"confirmOrderEditRequestWorkflow"
|
"confirmOrderEditRequestWorkflow"
|
||||||
@@ -243,7 +244,7 @@
|
|||||||
"name": "order-edit.canceled",
|
"name": "order-edit.canceled",
|
||||||
"parentName": "OrderEditWorkflowEvents",
|
"parentName": "OrderEditWorkflowEvents",
|
||||||
"propertyName": "CANCELED",
|
"propertyName": "CANCELED",
|
||||||
"payload": "{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}",
|
"payload": "```ts\n{\n order_id, // The ID of the order\n actions, // The actions to edit the order\n}\n```",
|
||||||
"description": "Emitted when an order edit request is canceled.",
|
"description": "Emitted when an order edit request is canceled.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"cancelBeginOrderEditWorkflow"
|
"cancelBeginOrderEditWorkflow"
|
||||||
@@ -254,7 +255,7 @@
|
|||||||
"name": "user.created",
|
"name": "user.created",
|
||||||
"parentName": "UserWorkflowEvents",
|
"parentName": "UserWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the user\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the user\n}]\n```",
|
||||||
"description": "Emitted when users are created.",
|
"description": "Emitted when users are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createUsersWorkflow",
|
"createUsersWorkflow",
|
||||||
@@ -267,7 +268,7 @@
|
|||||||
"name": "user.updated",
|
"name": "user.updated",
|
||||||
"parentName": "UserWorkflowEvents",
|
"parentName": "UserWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the user\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the user\n}]\n```",
|
||||||
"description": "Emitted when users are updated.",
|
"description": "Emitted when users are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateUsersWorkflow"
|
"updateUsersWorkflow"
|
||||||
@@ -278,7 +279,7 @@
|
|||||||
"name": "user.deleted",
|
"name": "user.deleted",
|
||||||
"parentName": "UserWorkflowEvents",
|
"parentName": "UserWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the user\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the user\n}]\n```",
|
||||||
"description": "Emitted when users are deleted.",
|
"description": "Emitted when users are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteUsersWorkflow",
|
"deleteUsersWorkflow",
|
||||||
@@ -290,7 +291,7 @@
|
|||||||
"name": "auth.password_reset",
|
"name": "auth.password_reset",
|
||||||
"parentName": "AuthWorkflowEvents",
|
"parentName": "AuthWorkflowEvents",
|
||||||
"propertyName": "PASSWORD_RESET",
|
"propertyName": "PASSWORD_RESET",
|
||||||
"payload": "{\n entity_id, // The identifier of the user or customer. For example, an email address.\n actor_type, // The type of actor. For example, \"customer\", \"user\", or custom.\n token, // The generated token.\n}",
|
"payload": "```ts\n{\n entity_id, // The identifier of the user or customer. For example, an email address.\n actor_type, // The type of actor. For example, \"customer\", \"user\", or custom.\n token, // The generated token.\n}\n```",
|
||||||
"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.",
|
"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.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"generateResetPasswordTokenWorkflow"
|
"generateResetPasswordTokenWorkflow"
|
||||||
@@ -301,7 +302,7 @@
|
|||||||
"name": "sales-channel.created",
|
"name": "sales-channel.created",
|
||||||
"parentName": "SalesChannelWorkflowEvents",
|
"parentName": "SalesChannelWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the sales channel\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the sales channel\n}]\n```",
|
||||||
"description": "Emitted when sales channels are created.",
|
"description": "Emitted when sales channels are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createSalesChannelsWorkflow"
|
"createSalesChannelsWorkflow"
|
||||||
@@ -312,7 +313,7 @@
|
|||||||
"name": "sales-channel.updated",
|
"name": "sales-channel.updated",
|
||||||
"parentName": "SalesChannelWorkflowEvents",
|
"parentName": "SalesChannelWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the sales channel\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the sales channel\n}]\n```",
|
||||||
"description": "Emitted when sales channels are updated.",
|
"description": "Emitted when sales channels are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateSalesChannelsWorkflow"
|
"updateSalesChannelsWorkflow"
|
||||||
@@ -323,7 +324,7 @@
|
|||||||
"name": "sales-channel.deleted",
|
"name": "sales-channel.deleted",
|
||||||
"parentName": "SalesChannelWorkflowEvents",
|
"parentName": "SalesChannelWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the sales channel\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the sales channel\n}]\n```",
|
||||||
"description": "Emitted when sales channels are deleted.",
|
"description": "Emitted when sales channels are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteSalesChannelsWorkflow"
|
"deleteSalesChannelsWorkflow"
|
||||||
@@ -334,7 +335,7 @@
|
|||||||
"name": "product-category.created",
|
"name": "product-category.created",
|
||||||
"parentName": "ProductCategoryWorkflowEvents",
|
"parentName": "ProductCategoryWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product category\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product category\n}]\n```",
|
||||||
"description": "Emitted when product categories are created.",
|
"description": "Emitted when product categories are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductCategoriesWorkflow"
|
"createProductCategoriesWorkflow"
|
||||||
@@ -345,7 +346,7 @@
|
|||||||
"name": "product-category.updated",
|
"name": "product-category.updated",
|
||||||
"parentName": "ProductCategoryWorkflowEvents",
|
"parentName": "ProductCategoryWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product category\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product category\n}]\n```",
|
||||||
"description": "Emitted when product categories are updated.",
|
"description": "Emitted when product categories are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductCategoriesWorkflow"
|
"updateProductCategoriesWorkflow"
|
||||||
@@ -356,7 +357,7 @@
|
|||||||
"name": "product-category.deleted",
|
"name": "product-category.deleted",
|
||||||
"parentName": "ProductCategoryWorkflowEvents",
|
"parentName": "ProductCategoryWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product category\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product category\n}]\n```",
|
||||||
"description": "Emitted when product categories are deleted.",
|
"description": "Emitted when product categories are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductCategoriesWorkflow"
|
"deleteProductCategoriesWorkflow"
|
||||||
@@ -367,7 +368,7 @@
|
|||||||
"name": "product-collection.created",
|
"name": "product-collection.created",
|
||||||
"parentName": "ProductCollectionWorkflowEvents",
|
"parentName": "ProductCollectionWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product collection\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product collection\n}]\n```",
|
||||||
"description": "Emitted when product collections are created.",
|
"description": "Emitted when product collections are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createCollectionsWorkflow"
|
"createCollectionsWorkflow"
|
||||||
@@ -378,7 +379,7 @@
|
|||||||
"name": "product-collection.updated",
|
"name": "product-collection.updated",
|
||||||
"parentName": "ProductCollectionWorkflowEvents",
|
"parentName": "ProductCollectionWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product collection\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product collection\n}]\n```",
|
||||||
"description": "Emitted when product collections are updated.",
|
"description": "Emitted when product collections are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateCollectionsWorkflow"
|
"updateCollectionsWorkflow"
|
||||||
@@ -389,7 +390,7 @@
|
|||||||
"name": "product-collection.deleted",
|
"name": "product-collection.deleted",
|
||||||
"parentName": "ProductCollectionWorkflowEvents",
|
"parentName": "ProductCollectionWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product collection\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product collection\n}]\n```",
|
||||||
"description": "Emitted when product collections are deleted.",
|
"description": "Emitted when product collections are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteCollectionsWorkflow"
|
"deleteCollectionsWorkflow"
|
||||||
@@ -400,7 +401,7 @@
|
|||||||
"name": "product-variant.updated",
|
"name": "product-variant.updated",
|
||||||
"parentName": "ProductVariantWorkflowEvents",
|
"parentName": "ProductVariantWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product variant\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product variant\n}]\n```",
|
||||||
"description": "Emitted when product variants are updated.",
|
"description": "Emitted when product variants are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductVariantsWorkflow",
|
"updateProductVariantsWorkflow",
|
||||||
@@ -412,7 +413,7 @@
|
|||||||
"name": "product-variant.created",
|
"name": "product-variant.created",
|
||||||
"parentName": "ProductVariantWorkflowEvents",
|
"parentName": "ProductVariantWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product variant\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product variant\n}]\n```",
|
||||||
"description": "Emitted when product variants are created.",
|
"description": "Emitted when product variants are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductVariantsWorkflow",
|
"createProductVariantsWorkflow",
|
||||||
@@ -427,7 +428,7 @@
|
|||||||
"name": "product-variant.deleted",
|
"name": "product-variant.deleted",
|
||||||
"parentName": "ProductVariantWorkflowEvents",
|
"parentName": "ProductVariantWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product variant\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product variant\n}]\n```",
|
||||||
"description": "Emitted when product variants are deleted.",
|
"description": "Emitted when product variants are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductVariantsWorkflow",
|
"deleteProductVariantsWorkflow",
|
||||||
@@ -439,7 +440,7 @@
|
|||||||
"name": "product.updated",
|
"name": "product.updated",
|
||||||
"parentName": "ProductWorkflowEvents",
|
"parentName": "ProductWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product\n}]\n```",
|
||||||
"description": "Emitted when products are updated.",
|
"description": "Emitted when products are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductsWorkflow",
|
"updateProductsWorkflow",
|
||||||
@@ -452,7 +453,7 @@
|
|||||||
"name": "product.created",
|
"name": "product.created",
|
||||||
"parentName": "ProductWorkflowEvents",
|
"parentName": "ProductWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product\n}]\n```",
|
||||||
"description": "Emitted when products are created.",
|
"description": "Emitted when products are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductsWorkflow",
|
"createProductsWorkflow",
|
||||||
@@ -465,7 +466,7 @@
|
|||||||
"name": "product.deleted",
|
"name": "product.deleted",
|
||||||
"parentName": "ProductWorkflowEvents",
|
"parentName": "ProductWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product\n}]\n```",
|
||||||
"description": "Emitted when products are deleted.",
|
"description": "Emitted when products are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductsWorkflow",
|
"deleteProductsWorkflow",
|
||||||
@@ -478,7 +479,7 @@
|
|||||||
"name": "product-type.updated",
|
"name": "product-type.updated",
|
||||||
"parentName": "ProductTypeWorkflowEvents",
|
"parentName": "ProductTypeWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product type\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product type\n}]\n```",
|
||||||
"description": "Emitted when product types are updated.",
|
"description": "Emitted when product types are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductTypesWorkflow"
|
"updateProductTypesWorkflow"
|
||||||
@@ -489,7 +490,7 @@
|
|||||||
"name": "product-type.created",
|
"name": "product-type.created",
|
||||||
"parentName": "ProductTypeWorkflowEvents",
|
"parentName": "ProductTypeWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product type\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product type\n}]\n```",
|
||||||
"description": "Emitted when product types are created.",
|
"description": "Emitted when product types are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductTypesWorkflow"
|
"createProductTypesWorkflow"
|
||||||
@@ -500,7 +501,7 @@
|
|||||||
"name": "product-type.deleted",
|
"name": "product-type.deleted",
|
||||||
"parentName": "ProductTypeWorkflowEvents",
|
"parentName": "ProductTypeWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product type\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product type\n}]\n```",
|
||||||
"description": "Emitted when product types are deleted.",
|
"description": "Emitted when product types are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductTypesWorkflow"
|
"deleteProductTypesWorkflow"
|
||||||
@@ -511,7 +512,7 @@
|
|||||||
"name": "product-tag.updated",
|
"name": "product-tag.updated",
|
||||||
"parentName": "ProductTagWorkflowEvents",
|
"parentName": "ProductTagWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product tag\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product tag\n}]\n```",
|
||||||
"description": "Emitted when product tags are updated.",
|
"description": "Emitted when product tags are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductTagsWorkflow"
|
"updateProductTagsWorkflow"
|
||||||
@@ -522,7 +523,7 @@
|
|||||||
"name": "product-tag.created",
|
"name": "product-tag.created",
|
||||||
"parentName": "ProductTagWorkflowEvents",
|
"parentName": "ProductTagWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product tag\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product tag\n}]\n```",
|
||||||
"description": "Emitted when product tags are created.",
|
"description": "Emitted when product tags are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductTagsWorkflow"
|
"createProductTagsWorkflow"
|
||||||
@@ -533,7 +534,7 @@
|
|||||||
"name": "product-tag.deleted",
|
"name": "product-tag.deleted",
|
||||||
"parentName": "ProductTagWorkflowEvents",
|
"parentName": "ProductTagWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product tag\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product tag\n}]\n```",
|
||||||
"description": "Emitted when product tags are deleted.",
|
"description": "Emitted when product tags are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductTagsWorkflow"
|
"deleteProductTagsWorkflow"
|
||||||
@@ -544,7 +545,7 @@
|
|||||||
"name": "product-option.updated",
|
"name": "product-option.updated",
|
||||||
"parentName": "ProductOptionWorkflowEvents",
|
"parentName": "ProductOptionWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the product option\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product option\n}]\n```",
|
||||||
"description": "Emitted when product options are updated.",
|
"description": "Emitted when product options are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateProductOptionsWorkflow"
|
"updateProductOptionsWorkflow"
|
||||||
@@ -555,7 +556,7 @@
|
|||||||
"name": "product-option.created",
|
"name": "product-option.created",
|
||||||
"parentName": "ProductOptionWorkflowEvents",
|
"parentName": "ProductOptionWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the product option\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product option\n}]\n```",
|
||||||
"description": "Emitted when product options are created.",
|
"description": "Emitted when product options are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createProductOptionsWorkflow"
|
"createProductOptionsWorkflow"
|
||||||
@@ -566,7 +567,7 @@
|
|||||||
"name": "product-option.deleted",
|
"name": "product-option.deleted",
|
||||||
"parentName": "ProductOptionWorkflowEvents",
|
"parentName": "ProductOptionWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the product option\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the product option\n}]\n```",
|
||||||
"description": "Emitted when product options are deleted.",
|
"description": "Emitted when product options are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteProductOptionsWorkflow"
|
"deleteProductOptionsWorkflow"
|
||||||
@@ -577,7 +578,7 @@
|
|||||||
"name": "invite.accepted",
|
"name": "invite.accepted",
|
||||||
"parentName": "InviteWorkflowEvents",
|
"parentName": "InviteWorkflowEvents",
|
||||||
"propertyName": "ACCEPTED",
|
"propertyName": "ACCEPTED",
|
||||||
"payload": "{\n id, // The ID of the invite\n}",
|
"payload": "```ts\n{\n id, // The ID of the invite\n}\n```",
|
||||||
"description": "Emitted when an invite is accepted.",
|
"description": "Emitted when an invite is accepted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"acceptInviteWorkflow"
|
"acceptInviteWorkflow"
|
||||||
@@ -588,7 +589,7 @@
|
|||||||
"name": "invite.created",
|
"name": "invite.created",
|
||||||
"parentName": "InviteWorkflowEvents",
|
"parentName": "InviteWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the invite\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the invite\n}]\n```",
|
||||||
"description": "Emitted when invites are created. You can listen to this event\nto send an email to the invited users, for example.",
|
"description": "Emitted when invites are created. You can listen to this event\nto send an email to the invited users, for example.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createInvitesWorkflow"
|
"createInvitesWorkflow"
|
||||||
@@ -599,7 +600,7 @@
|
|||||||
"name": "invite.deleted",
|
"name": "invite.deleted",
|
||||||
"parentName": "InviteWorkflowEvents",
|
"parentName": "InviteWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the invite\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the invite\n}]\n```",
|
||||||
"description": "Emitted when invites are deleted.",
|
"description": "Emitted when invites are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteInvitesWorkflow"
|
"deleteInvitesWorkflow"
|
||||||
@@ -610,7 +611,7 @@
|
|||||||
"name": "invite.resent",
|
"name": "invite.resent",
|
||||||
"parentName": "InviteWorkflowEvents",
|
"parentName": "InviteWorkflowEvents",
|
||||||
"propertyName": "RESENT",
|
"propertyName": "RESENT",
|
||||||
"payload": "[{\n id, // The ID of the invite\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the invite\n}]\n```",
|
||||||
"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.",
|
"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.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"refreshInviteTokensWorkflow"
|
"refreshInviteTokensWorkflow"
|
||||||
@@ -621,7 +622,7 @@
|
|||||||
"name": "region.updated",
|
"name": "region.updated",
|
||||||
"parentName": "RegionWorkflowEvents",
|
"parentName": "RegionWorkflowEvents",
|
||||||
"propertyName": "UPDATED",
|
"propertyName": "UPDATED",
|
||||||
"payload": "[{\n id, // The ID of the region\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the region\n}]\n```",
|
||||||
"description": "Emitted when regions are updated.",
|
"description": "Emitted when regions are updated.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"updateRegionsWorkflow"
|
"updateRegionsWorkflow"
|
||||||
@@ -632,7 +633,7 @@
|
|||||||
"name": "region.created",
|
"name": "region.created",
|
||||||
"parentName": "RegionWorkflowEvents",
|
"parentName": "RegionWorkflowEvents",
|
||||||
"propertyName": "CREATED",
|
"propertyName": "CREATED",
|
||||||
"payload": "[{\n id, // The ID of the region\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the region\n}]\n```",
|
||||||
"description": "Emitted when regions are created.",
|
"description": "Emitted when regions are created.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createRegionsWorkflow"
|
"createRegionsWorkflow"
|
||||||
@@ -643,7 +644,7 @@
|
|||||||
"name": "region.deleted",
|
"name": "region.deleted",
|
||||||
"parentName": "RegionWorkflowEvents",
|
"parentName": "RegionWorkflowEvents",
|
||||||
"propertyName": "DELETED",
|
"propertyName": "DELETED",
|
||||||
"payload": "[{\n id, // The ID of the region\n}]",
|
"payload": "```ts\n[{\n id, // The ID of the region\n}]\n```",
|
||||||
"description": "Emitted when regions are deleted.",
|
"description": "Emitted when regions are deleted.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"deleteRegionsWorkflow"
|
"deleteRegionsWorkflow"
|
||||||
@@ -654,7 +655,7 @@
|
|||||||
"name": "shipment.created",
|
"name": "shipment.created",
|
||||||
"parentName": "FulfillmentWorkflowEvents",
|
"parentName": "FulfillmentWorkflowEvents",
|
||||||
"propertyName": "SHIPMENT_CREATED",
|
"propertyName": "SHIPMENT_CREATED",
|
||||||
"payload": "{\n id, // the ID of the shipment\n no_notification, // whether to notify the customer\n}",
|
"payload": "```ts\n{\n id, // the ID of the shipment\n no_notification, // whether to notify the customer\n}\n```",
|
||||||
"description": "Emitted when a shipment is created for an order.",
|
"description": "Emitted when a shipment is created for an order.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"createOrderShipmentWorkflow"
|
"createOrderShipmentWorkflow"
|
||||||
@@ -665,7 +666,7 @@
|
|||||||
"name": "delivery.created",
|
"name": "delivery.created",
|
||||||
"parentName": "FulfillmentWorkflowEvents",
|
"parentName": "FulfillmentWorkflowEvents",
|
||||||
"propertyName": "DELIVERY_CREATED",
|
"propertyName": "DELIVERY_CREATED",
|
||||||
"payload": "{\n id, // the ID of the fulfillment\n}",
|
"payload": "```ts\n{\n id, // the ID of the fulfillment\n}\n```",
|
||||||
"description": "Emitted when a fulfillment is marked as delivered.",
|
"description": "Emitted when a fulfillment is marked as delivered.",
|
||||||
"workflows": [
|
"workflows": [
|
||||||
"markOrderFulfillmentAsDeliveredWorkflow"
|
"markOrderFulfillmentAsDeliveredWorkflow"
|
||||||
|
|||||||
@@ -69,6 +69,10 @@
|
|||||||
{
|
{
|
||||||
"tagName": "@eventPayload",
|
"tagName": "@eventPayload",
|
||||||
"syntaxKind": "block"
|
"syntaxKind": "block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tagName": "@workflowEvent",
|
||||||
|
"syntaxKind": "block"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -82,6 +82,7 @@ import workflowExamplesHelper from "./resources/helpers/workflow-examples.js"
|
|||||||
import stepExamplesHelper from "./resources/helpers/step-examples.js"
|
import stepExamplesHelper from "./resources/helpers/step-examples.js"
|
||||||
import ifEventsReferenceHelper from "./resources/helpers/if-events-reference.js"
|
import ifEventsReferenceHelper from "./resources/helpers/if-events-reference.js"
|
||||||
import eventsListingHelper from "./resources/helpers/events-listing.js"
|
import eventsListingHelper from "./resources/helpers/events-listing.js"
|
||||||
|
import workflowEventsHelper from "./resources/helpers/workflow-events.js"
|
||||||
import { MarkdownTheme } from "./theme.js"
|
import { MarkdownTheme } from "./theme.js"
|
||||||
import { getDirname } from "utils"
|
import { getDirname } from "utils"
|
||||||
|
|
||||||
@@ -195,4 +196,5 @@ export function registerHelpers(theme: MarkdownTheme) {
|
|||||||
stepExamplesHelper()
|
stepExamplesHelper()
|
||||||
ifEventsReferenceHelper(theme)
|
ifEventsReferenceHelper(theme)
|
||||||
eventsListingHelper()
|
eventsListingHelper()
|
||||||
|
workflowEventsHelper()
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ const EXCLUDED_TAGS = [
|
|||||||
"@version",
|
"@version",
|
||||||
"@tags",
|
"@tags",
|
||||||
"@summary",
|
"@summary",
|
||||||
|
"@workflowEvent",
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
|
|||||||
+59
-11
@@ -1,6 +1,6 @@
|
|||||||
import Handlebars from "handlebars"
|
import Handlebars from "handlebars"
|
||||||
import pkg from "slugify"
|
import pkg from "slugify"
|
||||||
import { DeclarationReflection } from "typedoc"
|
import { DeclarationReflection, ReflectionKind } from "typedoc"
|
||||||
import { pascalToWords } from "utils"
|
import { pascalToWords } from "utils"
|
||||||
|
|
||||||
const slugify = pkg.default
|
const slugify = pkg.default
|
||||||
@@ -14,19 +14,34 @@ export default function () {
|
|||||||
const subtitleLevel = (this.children?.length ?? 0) > 1 ? 3 : 2
|
const subtitleLevel = (this.children?.length ?? 0) > 1 ? 3 : 2
|
||||||
const showHeader = (this.children?.length ?? 0) > 1
|
const showHeader = (this.children?.length ?? 0) > 1
|
||||||
|
|
||||||
this.children?.forEach((child, index) => {
|
function parseChildren(children: DeclarationReflection[]) {
|
||||||
|
children?.forEach((child, index) => {
|
||||||
content.push(
|
content.push(
|
||||||
formatEventsType(child as DeclarationReflection, {
|
formatEventsType(child as DeclarationReflection, {
|
||||||
subtitleLevel,
|
subtitleLevel,
|
||||||
showHeader,
|
showHeader,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
if (index < children!.length - 1) {
|
||||||
|
content.push("")
|
||||||
|
content.push("---")
|
||||||
|
content.push("")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.kind === ReflectionKind.Module) {
|
||||||
|
this.children?.forEach((child, index) => {
|
||||||
|
parseChildren(child.children || [])
|
||||||
if (index < this.children!.length - 1) {
|
if (index < this.children!.length - 1) {
|
||||||
content.push("")
|
content.push("")
|
||||||
content.push("---")
|
content.push("---")
|
||||||
content.push("")
|
content.push("")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
parseChildren(this.children || [])
|
||||||
|
}
|
||||||
|
|
||||||
return content.join("\n")
|
return content.join("\n")
|
||||||
}
|
}
|
||||||
@@ -73,24 +88,38 @@ function formatEventsType(
|
|||||||
// table body start
|
// table body start
|
||||||
content.push(` <Table.Body>`)
|
content.push(` <Table.Body>`)
|
||||||
eventProperties.forEach((event) => {
|
eventProperties.forEach((event) => {
|
||||||
const eventName =
|
let eventName =
|
||||||
event.comment?.blockTags
|
event.comment?.blockTags
|
||||||
.find((tag) => tag.tag === "@eventName")
|
.find((tag) => tag.tag === "@eventName")
|
||||||
?.content.map((content) => content.text)
|
?.content.map((content) => content.text)
|
||||||
.join("") || ""
|
.join("") || ""
|
||||||
|
eventName = `[${eventName}](#${slugify(eventName.replace(".", ""), {
|
||||||
|
lower: true,
|
||||||
|
})})`
|
||||||
const eventDescription = event.comment?.summary
|
const eventDescription = event.comment?.summary
|
||||||
.map((content) => content.text)
|
.map((content) => content.text)
|
||||||
.join("")
|
.join("")
|
||||||
|
const deprecationTag = event.comment?.blockTags.find(
|
||||||
|
(tag) => tag.tag === "@deprecated"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (deprecationTag) {
|
||||||
|
eventName += `\n`
|
||||||
|
const deprecationText = deprecationTag.content
|
||||||
|
.map((content) => content.text)
|
||||||
|
.join("")
|
||||||
|
.trim()
|
||||||
|
if (deprecationText.length) {
|
||||||
|
eventName += `<Tooltip text="${deprecationText}">`
|
||||||
|
}
|
||||||
|
eventName += `<Badge variant="orange">Deprecated</Badge>`
|
||||||
|
if (deprecationText.length) {
|
||||||
|
eventName += `</Tooltip>`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
content.push(` <Table.Row>`)
|
content.push(` <Table.Row>`)
|
||||||
content.push(
|
content.push(` <Table.Cell>\n${eventName}\n</Table.Cell>`)
|
||||||
` <Table.Cell>\n[${eventName}](#${slugify(
|
|
||||||
eventName.replace(".", ""),
|
|
||||||
{
|
|
||||||
lower: true,
|
|
||||||
}
|
|
||||||
)})\n</Table.Cell>`
|
|
||||||
)
|
|
||||||
content.push(` <Table.Cell>\n${eventDescription}\n</Table.Cell>`)
|
content.push(` <Table.Cell>\n${eventDescription}\n</Table.Cell>`)
|
||||||
content.push(` </Table.Row>`)
|
content.push(` </Table.Row>`)
|
||||||
})
|
})
|
||||||
@@ -117,9 +146,28 @@ function formatEventsType(
|
|||||||
?.content.map((content) => content.text)
|
?.content.map((content) => content.text)
|
||||||
.join("")
|
.join("")
|
||||||
.split(", ")
|
.split(", ")
|
||||||
|
const deprecatedTag = event.comment?.blockTags.find(
|
||||||
|
(tag) => tag.tag === "@deprecated"
|
||||||
|
)
|
||||||
|
|
||||||
content.push(`${subHeaderPrefix} \`${eventName}\``)
|
content.push(`${subHeaderPrefix} \`${eventName}\``)
|
||||||
content.push("")
|
content.push("")
|
||||||
|
if (deprecatedTag) {
|
||||||
|
const deprecationText = deprecatedTag.content
|
||||||
|
.map((content) => content.text)
|
||||||
|
.join("")
|
||||||
|
.trim()
|
||||||
|
if (deprecationText.length) {
|
||||||
|
content.push(`<Tooltip text="${deprecationText}">`)
|
||||||
|
}
|
||||||
|
|
||||||
|
content.push(`<Badge variant="orange">Deprecated</Badge>`)
|
||||||
|
|
||||||
|
if (deprecationText.length) {
|
||||||
|
content.push(`</Tooltip>`)
|
||||||
|
}
|
||||||
|
content.push("")
|
||||||
|
}
|
||||||
content.push(eventDescription || "")
|
content.push(eventDescription || "")
|
||||||
content.push("")
|
content.push("")
|
||||||
content.push(`${subHeaderPrefix}# Payload`)
|
content.push(`${subHeaderPrefix}# Payload`)
|
||||||
|
|||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
import Handlebars from "handlebars"
|
||||||
|
import { SignatureReflection } from "typedoc"
|
||||||
|
|
||||||
|
export default function () {
|
||||||
|
Handlebars.registerHelper(
|
||||||
|
"workflowEvents",
|
||||||
|
function (this: SignatureReflection): string {
|
||||||
|
if (!this.parent) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
const workflowEventComments = this.parent.comment?.blockTags.filter(
|
||||||
|
(tag) => tag.tag === "@workflowEvent"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!workflowEventComments?.length) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
let str = `${Handlebars.helpers.titleLevel()} Emitted Events\n\nThis section lists the events that are either triggered by the \`emitEventStep\` in the workflow, or by another workflow executed within this workflow.\n\nYou can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.\n\n`
|
||||||
|
|
||||||
|
str += `<Table>\n`
|
||||||
|
str += ` <Table.Header>\n`
|
||||||
|
str += ` <Table.Row>\n`
|
||||||
|
str += ` <Table.HeaderCell>\nEvent\n</Table.HeaderCell>\n`
|
||||||
|
str += ` <Table.HeaderCell>\nDescription\n</Table.HeaderCell>\n`
|
||||||
|
str += ` <Table.HeaderCell>\nPayload\n</Table.HeaderCell>\n`
|
||||||
|
str += ` </Table.Row>\n`
|
||||||
|
str += ` </Table.Header>\n`
|
||||||
|
str += ` <Table.Body>\n`
|
||||||
|
workflowEventComments.forEach((comment) => {
|
||||||
|
const commentContent = comment.content
|
||||||
|
.map((c) => c.text)
|
||||||
|
.join(" ")
|
||||||
|
.split("--")
|
||||||
|
let eventName = `\`${commentContent[0].trim()}\``
|
||||||
|
const eventDescription = commentContent[1]?.trim() || ""
|
||||||
|
const eventPayload = (commentContent[2]?.trim() || "")
|
||||||
|
.replace("```ts\n", "")
|
||||||
|
.replace("\n```", "")
|
||||||
|
const isDeprecated = commentContent.length >= 4
|
||||||
|
|
||||||
|
if (isDeprecated) {
|
||||||
|
const deprecatedText = commentContent[4]?.trim()
|
||||||
|
eventName += `\n`
|
||||||
|
if (deprecatedText) {
|
||||||
|
eventName += `<Tooltip text="${deprecatedText}">`
|
||||||
|
}
|
||||||
|
eventName += `<Badge variant="orange">Deprecated</Badge>`
|
||||||
|
if (deprecatedText) {
|
||||||
|
eventName += `</Tooltip>`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
str += ` <Table.Row>\n`
|
||||||
|
str += ` <Table.Cell>\n${eventName}\n</Table.Cell>\n`
|
||||||
|
str += ` <Table.Cell>\n${eventDescription}\n</Table.Cell>\n`
|
||||||
|
str += ` <Table.Cell>\n\`\`\`ts blockStyle="inline"\n${eventPayload}\n\`\`\`\n</Table.Cell>\n`
|
||||||
|
str += ` </Table.Row>\n`
|
||||||
|
})
|
||||||
|
str += ` </Table.Body>\n`
|
||||||
|
str += `</Table>\n\n`
|
||||||
|
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
+2
@@ -23,3 +23,5 @@
|
|||||||
{{{workflowOutput sectionTitle=name}}}
|
{{{workflowOutput sectionTitle=name}}}
|
||||||
|
|
||||||
{{{workflowHooks}}}
|
{{{workflowHooks}}}
|
||||||
|
|
||||||
|
{{{workflowEvents}}}
|
||||||
@@ -25,6 +25,9 @@ import {
|
|||||||
} from "utils"
|
} from "utils"
|
||||||
import { StepType } from "./types.js"
|
import { StepType } from "./types.js"
|
||||||
import Examples from "./utils/examples.js"
|
import Examples from "./utils/examples.js"
|
||||||
|
import { MedusaEvent } from "types"
|
||||||
|
import path from "path"
|
||||||
|
import { readFileSync } from "fs"
|
||||||
|
|
||||||
type ParsedStep = {
|
type ParsedStep = {
|
||||||
stepReflection: DeclarationReflection
|
stepReflection: DeclarationReflection
|
||||||
@@ -47,6 +50,7 @@ class WorkflowsPlugin {
|
|||||||
workflowIds: string[]
|
workflowIds: string[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
protected events: MedusaEvent[] = []
|
||||||
|
|
||||||
constructor(app: Application) {
|
constructor(app: Application) {
|
||||||
this.app = app
|
this.app = app
|
||||||
@@ -92,6 +96,7 @@ class WorkflowsPlugin {
|
|||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.readEventsJson()
|
||||||
for (const reflection of context.project.getReflectionsByKind(
|
for (const reflection of context.project.getReflectionsByKind(
|
||||||
ReflectionKind.All
|
ReflectionKind.All
|
||||||
)) {
|
)) {
|
||||||
@@ -235,6 +240,7 @@ class WorkflowsPlugin {
|
|||||||
])
|
])
|
||||||
|
|
||||||
this.updateWorkflowsTagsMap(workflowId, uniqueResources)
|
this.updateWorkflowsTagsMap(workflowId, uniqueResources)
|
||||||
|
this.attachEvents(parentReflection)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -855,6 +861,61 @@ class WorkflowsPlugin {
|
|||||||
argument.getText()
|
argument.getText()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readEventsJson() {
|
||||||
|
if (this.events.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const eventsPath = path.resolve(
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"generated",
|
||||||
|
"events-output.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
this.events = JSON.parse(readFileSync(eventsPath, "utf-8"))
|
||||||
|
}
|
||||||
|
|
||||||
|
attachEvents(workflowReflection: DeclarationReflection) {
|
||||||
|
if (!workflowReflection.comment) {
|
||||||
|
workflowReflection.comment = new Comment()
|
||||||
|
}
|
||||||
|
|
||||||
|
const eventsTag = workflowReflection.comment.blockTags.find(
|
||||||
|
(tag) => tag.tag === "@workflowEvent"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (eventsTag) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const workflowEvents = this.events.filter((event) =>
|
||||||
|
event.workflows.includes(workflowReflection.name)
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!workflowEvents) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
workflowReflection.comment.blockTags.push(
|
||||||
|
...workflowEvents.map((event) => {
|
||||||
|
let commentText = `${event.name} -- ${event.description} -- ${event.payload}`
|
||||||
|
if (event.deprecated) {
|
||||||
|
commentText += " -- deprecated"
|
||||||
|
if (event.deprecated_message) {
|
||||||
|
commentText += ` -- ${event.deprecated_message}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new CommentTag(`@workflowEvent`, [
|
||||||
|
{
|
||||||
|
kind: "text",
|
||||||
|
text: commentText,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WorkflowsPlugin
|
export default WorkflowsPlugin
|
||||||
@@ -33,10 +33,9 @@ export default class Helper {
|
|||||||
? dotPos
|
? dotPos
|
||||||
: Math.min(dotPos, parenPos)
|
: Math.min(dotPos, parenPos)
|
||||||
|
|
||||||
return nameWithoutQuotes.substring(
|
return nameWithoutQuotes
|
||||||
0,
|
.substring(0, endIndex === -1 ? nameWithoutQuotes.length : endIndex)
|
||||||
endIndex === -1 ? nameWithoutQuotes.length : endIndex
|
.trim()
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user