chore(utils): fixes to events TSDocs (#12342)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-05-01 19:23:50 +03:00
1 parent 91f5ac91a9
commit 332e46d1db
1 file changed
+144 -9
+144 -9
View File
@@ -1,32 +1,39 @@
/** /**
* @category Cart * @category Cart
* @customNamespace Cart
*/ */
export const CartWorkflowEvents = { export const CartWorkflowEvents = {
/** /**
* Emitted when a cart is created. * Emitted when a cart is created.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the cart * id, // The ID of the cart
* } * }
* ```
*/ */
CREATED: "cart.created", CREATED: "cart.created",
/** /**
* Emitted when a cart's details are updated. * Emitted when a cart's details are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the cart * id, // The ID of the cart
* } * }
* ```
*/ */
UPDATED: "cart.updated", UPDATED: "cart.updated",
/** /**
* Emitted when the customer in the cart is updated. * Emitted when the customer in the cart is updated.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the cart * id, // The ID of the cart
* } * }
* ```
*/ */
CUSTOMER_UPDATED: "cart.customer_updated", CUSTOMER_UPDATED: "cart.customer_updated",
/** /**
@@ -34,48 +41,58 @@ export const CartWorkflowEvents = {
* event is emitted alongside the {@link CartWorkflowEvents.UPDATED} event. * event is emitted alongside the {@link CartWorkflowEvents.UPDATED} event.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the cart * id, // The ID of the cart
* } * }
* ```
*/ */
REGION_UPDATED: "cart.region_updated", REGION_UPDATED: "cart.region_updated",
} }
/** /**
* @category Cart * @category Customer
* @customNamespace Customer
*/ */
export const CustomerWorkflowEvents = { export const CustomerWorkflowEvents = {
/** /**
* Emitted when a customer is created. * Emitted when a customer is created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the customer * id, // The ID of the customer
* }] * }]
* ```
*/ */
CREATED: "customer.created", CREATED: "customer.created",
/** /**
* Emitted when a customer is updated. * Emitted when a customer is updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the customer * id, // The ID of the customer
* }] * }]
* ```
*/ */
UPDATED: "customer.updated", UPDATED: "customer.updated",
/** /**
* Emitted when a customer is deleted. * Emitted when a customer is deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the customer * id, // The ID of the customer
* }] * }]
* ```
*/ */
DELETED: "customer.deleted", DELETED: "customer.deleted",
} }
/** /**
* @category Order * @category Order
* @customNamespace Order
*/ */
export const OrderWorkflowEvents = { export const OrderWorkflowEvents = {
/** /**
@@ -83,9 +100,11 @@ export const OrderWorkflowEvents = {
* doesn't include updates made by an edit. * doesn't include updates made by an edit.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the order * id, // The ID of the order
* } * }
* ```
*/ */
UPDATED: "order.updated", UPDATED: "order.updated",
@@ -94,36 +113,44 @@ export const OrderWorkflowEvents = {
* order. * order.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the order * id, // The ID of the order
* } * }
* ```
*/ */
PLACED: "order.placed", PLACED: "order.placed",
/** /**
* Emitted when an order is canceld. * Emitted when an order is canceld.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the order * id, // The ID of the order
* } * }
* ```
*/ */
CANCELED: "order.canceled", CANCELED: "order.canceled",
/** /**
* Emitted when orders are completed. * Emitted when orders are completed.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the order * id, // The ID of the order
* }] * }]
* ```
*/ */
COMPLETED: "order.completed", COMPLETED: "order.completed",
/** /**
* Emitted when an order is archived. * Emitted when an order is archived.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the order * id, // The ID of the order
* }] * }]
* ```
*/ */
ARCHIVED: "order.archived", ARCHIVED: "order.archived",
@@ -131,22 +158,26 @@ export const OrderWorkflowEvents = {
* Emitted when a fulfillment is created for an order. * Emitted when a fulfillment is created for an order.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* fulfillment_id, // The ID of the fulfillment * fulfillment_id, // The ID of the fulfillment
* no_notification, // Whether to notify the customer * no_notification, // Whether to notify the customer
* } * }
* ```
*/ */
FULFILLMENT_CREATED: "order.fulfillment_created", FULFILLMENT_CREATED: "order.fulfillment_created",
/** /**
* Emitted when an order's fulfillment is canceled. * Emitted when an order's fulfillment is canceled.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* fulfillment_id, // The ID of the fulfillment * fulfillment_id, // The ID of the fulfillment
* no_notification, // Whether to notify the customer * no_notification, // Whether to notify the customer
* } * }
* ```
*/ */
FULFILLMENT_CANCELED: "order.fulfillment_canceled", FULFILLMENT_CANCELED: "order.fulfillment_canceled",
@@ -154,20 +185,24 @@ export const OrderWorkflowEvents = {
* Emitted when a return request is confirmed. * Emitted when a return request is confirmed.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* return_id, // The ID of the return * return_id, // The ID of the return
* } * }
* ```
*/ */
RETURN_REQUESTED: "order.return_requested", RETURN_REQUESTED: "order.return_requested",
/** /**
* Emitted when a return is marked as received. * Emitted when a return is marked as received.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* return_id, // The ID of the return * return_id, // The ID of the return
* } * }
* ```
*/ */
RETURN_RECEIVED: "order.return_received", RETURN_RECEIVED: "order.return_received",
@@ -175,20 +210,24 @@ export const OrderWorkflowEvents = {
* Emitted when a claim is created for an order. * Emitted when a claim is created for an order.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* claim_id, // The ID of the claim * claim_id, // The ID of the claim
* } * }
* ```
*/ */
CLAIM_CREATED: "order.claim_created", CLAIM_CREATED: "order.claim_created",
/** /**
* Emitted when an exchange is created for an order. * Emitted when an exchange is created for an order.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* exchange_id, // The ID of the exchange * exchange_id, // The ID of the exchange
* } * }
* ```
*/ */
EXCHANGE_CREATED: "order.exchange_created", EXCHANGE_CREATED: "order.exchange_created",
@@ -197,85 +236,102 @@ export const OrderWorkflowEvents = {
* another customer. * another customer.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the order * id, // The ID of the order
* order_change_id, // The ID of the order change created for the transfer * order_change_id, // The ID of the order change created for the transfer
* } * }
* ```
*/ */
TRANSFER_REQUESTED: "order.transfer_requested", TRANSFER_REQUESTED: "order.transfer_requested",
} }
/** /**
* @category Order * @category Order Edit
* @customNamespace Order
*/ */
export const OrderEditWorkflowEvents = { export const OrderEditWorkflowEvents = {
/** /**
* Emitted when an order edit is requested. * Emitted when an order edit is requested.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* actions, // The actions to edit the order * actions, // The actions to edit the order
* } * }
* ```
*/ */
REQUESTED: "order-edit.requested", REQUESTED: "order-edit.requested",
/** /**
* Emitted when an order edit request is confirmed. * Emitted when an order edit request is confirmed.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* actions, // The actions to edit the order * actions, // The actions to edit the order
* } * }
* ```
*/ */
CONFIRMED: "order-edit.confirmed", CONFIRMED: "order-edit.confirmed",
/** /**
* Emitted when an order edit request is canceled. * Emitted when an order edit request is canceled.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* order_id, // The ID of the order * order_id, // The ID of the order
* actions, // The actions to edit the order * actions, // The actions to edit the order
* } * }
* ```
*/ */
CANCELED: "order-edit.canceled", CANCELED: "order-edit.canceled",
} }
/** /**
* @category User * @category User
* @customNamespace User
*/ */
export const UserWorkflowEvents = { export const UserWorkflowEvents = {
/** /**
* Emitted when users are created. * Emitted when users are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the user * id, // The ID of the user
* }] * }]
* ```
*/ */
CREATED: "user.created", CREATED: "user.created",
/** /**
* Emitted when users are updated. * Emitted when users are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the user * id, // The ID of the user
* }] * }]
* ```
*/ */
UPDATED: "user.updated", UPDATED: "user.updated",
/** /**
* Emitted when users are deleted. * Emitted when users are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the user * id, // The ID of the user
* }] * }]
* ```
*/ */
DELETED: "user.deleted", DELETED: "user.deleted",
} }
/** /**
* @category Auth * @category Auth
* @customNamespace Auth
*/ */
export const AuthWorkflowEvents = { export const AuthWorkflowEvents = {
/** /**
@@ -283,290 +339,351 @@ export const AuthWorkflowEvents = {
* to send a reset password email to the user or customer, for example. * to send a reset password email to the user or customer, for example.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* entity_id, // The identifier of the user or customer. For example, an email address. * 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. * actor_type, // The type of actor. For example, "customer", "user", or custom.
* token, // The generated token. * token, // The generated token.
* } * }
* ```
*/ */
PASSWORD_RESET: "auth.password_reset", PASSWORD_RESET: "auth.password_reset",
} }
/** /**
* @category Sales Channel * @category Sales Channel
* @customNamespace Sales Channel
*/ */
export const SalesChannelWorkflowEvents = { export const SalesChannelWorkflowEvents = {
/** /**
* Emitted when sales channels are created. * Emitted when sales channels are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the sales channel * id, // The ID of the sales channel
* }] * }]
* ```
*/ */
CREATED: "sales-channel.created", CREATED: "sales-channel.created",
/** /**
* Emitted when sales channels are updated. * Emitted when sales channels are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the sales channel * id, // The ID of the sales channel
* }] * }]
* ```
*/ */
UPDATED: "sales-channel.updated", UPDATED: "sales-channel.updated",
/** /**
* Emitted when sales channels are deleted. * Emitted when sales channels are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the sales channel * id, // The ID of the sales channel
* }] * }]
* ```
*/ */
DELETED: "sales-channel.deleted", DELETED: "sales-channel.deleted",
} }
/** /**
* @category Product * @category Product Category
* @customNamespace Product
*/ */
export const ProductCategoryWorkflowEvents = { export const ProductCategoryWorkflowEvents = {
/** /**
* Emitted when product categories are created. * Emitted when product categories are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product category * id, // The ID of the product category
* }] * }]
* ```
*/ */
CREATED: "product-category.created", CREATED: "product-category.created",
/** /**
* Emitted when product categories are updated. * Emitted when product categories are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product category * id, // The ID of the product category
* }] * }]
* ```
*/ */
UPDATED: "product-category.updated", UPDATED: "product-category.updated",
/** /**
* Emitted when product categories are deleted. * Emitted when product categories are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product category * id, // The ID of the product category
* }] * }]
* ```
*/ */
DELETED: "product-category.deleted", DELETED: "product-category.deleted",
} }
/** /**
* @category Product * @category Product Collection
* @customNamespace Product
*/ */
export const ProductCollectionWorkflowEvents = { export const ProductCollectionWorkflowEvents = {
/** /**
* Emitted when product collections are created. * Emitted when product collections are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product collection * id, // The ID of the product collection
* }] * }]
* ```
*/ */
CREATED: "product-collection.created", CREATED: "product-collection.created",
/** /**
* Emitted when product collections are updated. * Emitted when product collections are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product collection * id, // The ID of the product collection
* }] * }]
* ```
*/ */
UPDATED: "product-collection.updated", UPDATED: "product-collection.updated",
/** /**
* Emitted when product collections are deleted. * Emitted when product collections are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product collection * id, // The ID of the product collection
* }] * }]
* ```
*/ */
DELETED: "product-collection.deleted", DELETED: "product-collection.deleted",
} }
/** /**
* @category Product * @category Product Variant
* @customNamespace Product
*/ */
export const ProductVariantWorkflowEvents = { export const ProductVariantWorkflowEvents = {
/** /**
* Emitted when product variants are updated. * Emitted when product variants are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product variant * id, // The ID of the product variant
* }] * }]
* ```
*/ */
UPDATED: "product-variant.updated", UPDATED: "product-variant.updated",
/** /**
* Emitted when product variants are created. * Emitted when product variants are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product variant * id, // The ID of the product variant
* }] * }]
* ```
*/ */
CREATED: "product-variant.created", CREATED: "product-variant.created",
/** /**
* Emitted when product variants are deleted. * Emitted when product variants are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product variant * id, // The ID of the product variant
* }] * }]
* ```
*/ */
DELETED: "product-variant.deleted", DELETED: "product-variant.deleted",
} }
/** /**
* @category Product * @category Product
* @customNamespace Product
*/ */
export const ProductWorkflowEvents = { export const ProductWorkflowEvents = {
/** /**
* Emitted when products are updated. * Emitted when products are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product * id, // The ID of the product
* }] * }]
* ```
*/ */
UPDATED: "product.updated", UPDATED: "product.updated",
/** /**
* Emitted when products are created. * Emitted when products are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product * id, // The ID of the product
* }] * }]
* ```
*/ */
CREATED: "product.created", CREATED: "product.created",
/** /**
* Emitted when products are deleted. * Emitted when products are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product * id, // The ID of the product
* }] * }]
* ```
*/ */
DELETED: "product.deleted", DELETED: "product.deleted",
} }
/** /**
* @category Product * @category Product Type
* @customNamespace Product
*/ */
export const ProductTypeWorkflowEvents = { export const ProductTypeWorkflowEvents = {
/** /**
* Emitted when product types are updated. * Emitted when product types are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product type * id, // The ID of the product type
* }] * }]
* ```
*/ */
UPDATED: "product-type.updated", UPDATED: "product-type.updated",
/** /**
* Emitted when product types are created. * Emitted when product types are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product type * id, // The ID of the product type
* }] * }]
* ```
*/ */
CREATED: "product-type.created", CREATED: "product-type.created",
/** /**
* Emitted when product types are deleted. * Emitted when product types are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product type * id, // The ID of the product type
* }] * }]
* ```
*/ */
DELETED: "product-type.deleted", DELETED: "product-type.deleted",
} }
/** /**
* @category Product * @category Product Tag
* @customNamespace Product
*/ */
export const ProductTagWorkflowEvents = { export const ProductTagWorkflowEvents = {
/** /**
* Emitted when product tags are updated. * Emitted when product tags are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product tag * id, // The ID of the product tag
* }] * }]
* ```
*/ */
UPDATED: "product-tag.updated", UPDATED: "product-tag.updated",
/** /**
* Emitted when product tags are created. * Emitted when product tags are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product tag * id, // The ID of the product tag
* }] * }]
* ```
*/ */
CREATED: "product-tag.created", CREATED: "product-tag.created",
/** /**
* Emitted when product tags are deleted. * Emitted when product tags are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product tag * id, // The ID of the product tag
* }] * }]
* ```
*/ */
DELETED: "product-tag.deleted", DELETED: "product-tag.deleted",
} }
/** /**
* @category Product * @category Product Option
* @customNamespace Product
*/ */
export const ProductOptionWorkflowEvents = { export const ProductOptionWorkflowEvents = {
/** /**
* Emitted when product options are updated. * Emitted when product options are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product option * id, // The ID of the product option
* }] * }]
* ```
*/ */
UPDATED: "product-option.updated", UPDATED: "product-option.updated",
/** /**
* Emitted when product options are created. * Emitted when product options are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product option * id, // The ID of the product option
* }] * }]
* ```
*/ */
CREATED: "product-option.created", CREATED: "product-option.created",
/** /**
* Emitted when product options are deleted. * Emitted when product options are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the product option * id, // The ID of the product option
* }] * }]
* ```
*/ */
DELETED: "product-option.deleted", DELETED: "product-option.deleted",
} }
/** /**
* @category User * @category Invite
* @customNamespace User
*/ */
export const InviteWorkflowEvents = { export const InviteWorkflowEvents = {
/** /**
* Emitted when an invite is accepted. * Emitted when an invite is accepted.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // The ID of the invite * id, // The ID of the invite
* } * }
* ```
*/ */
ACCEPTED: "invite.accepted", ACCEPTED: "invite.accepted",
/** /**
@@ -574,18 +691,22 @@ export const InviteWorkflowEvents = {
* to send an email to the invited users, for example. * to send an email to the invited users, for example.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the invite * id, // The ID of the invite
* }] * }]
* ```
*/ */
CREATED: "invite.created", CREATED: "invite.created",
/** /**
* Emitted when invites are deleted. * Emitted when invites are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the invite * id, // The ID of the invite
* }] * }]
* ```
*/ */
DELETED: "invite.deleted", DELETED: "invite.deleted",
/** /**
@@ -594,67 +715,81 @@ export const InviteWorkflowEvents = {
* for example. * for example.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the invite * id, // The ID of the invite
* }] * }]
* ```
*/ */
RESENT: "invite.resent", RESENT: "invite.resent",
} }
/** /**
* @category Region * @category Region
* @customNamespace Region
*/ */
export const RegionWorkflowEvents = { export const RegionWorkflowEvents = {
/** /**
* Emitted when regions are updated. * Emitted when regions are updated.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the region * id, // The ID of the region
* }] * }]
* ```
*/ */
UPDATED: "region.updated", UPDATED: "region.updated",
/** /**
* Emitted when regions are created. * Emitted when regions are created.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the region * id, // The ID of the region
* }] * }]
* ```
*/ */
CREATED: "region.created", CREATED: "region.created",
/** /**
* Emitted when regions are deleted. * Emitted when regions are deleted.
* *
* @eventPayload * @eventPayload
* ```ts
* [{ * [{
* id, // The ID of the region * id, // The ID of the region
* }] * }]
* ```
*/ */
DELETED: "region.deleted", DELETED: "region.deleted",
} }
/** /**
* @category Fulfillment * @category Fulfillment
* @customNamespace Fulfillment
*/ */
export const FulfillmentWorkflowEvents = { export const FulfillmentWorkflowEvents = {
/** /**
* Emitted when a shipment is created for an order. * Emitted when a shipment is created for an order.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // the ID of the shipment * id, // the ID of the shipment
* no_notification, // whether to notify the customer * no_notification, // whether to notify the customer
* } * }
* ```
*/ */
SHIPMENT_CREATED: "shipment.created", SHIPMENT_CREATED: "shipment.created",
/** /**
* Emitted when a fulfillment is marked as delivered. * Emitted when a fulfillment is marked as delivered.
* *
* @eventPayload * @eventPayload
* ```ts
* { * {
* id, // the ID of the fulfillment * id, // the ID of the fulfillment
* } * }
* ```
*/ */
DELIVERY_CREATED: "delivery.created", DELIVERY_CREATED: "delivery.created",
} }