chore(core-flows): added workflow events (#8915)

* chore(core-flows): added workflow events

* remove from parallelize

* check array
This commit is contained in:
Carlos R. L. Rodrigues
2024-08-30 16:32:08 -03:00
committed by GitHub
parent c8f951dd89
commit 89c6ef8fc9
29 changed files with 407 additions and 100 deletions
+1
View File
@@ -1,4 +1,5 @@
export * as ApiKeyUtils from "./api-key"
export * as CoreFlowsUitls from "./core-flows"
export * as DALUtils from "./dal"
export * as DecoratorUtils from "./decorators"
export * as DefaultsUtils from "./defaults"
@@ -0,0 +1,53 @@
export const CustomerWorkflowEvents = {
CREATED: "customer.created",
UPDATED: "customer.updated",
DELETED: "customer.deleted",
}
export const OrderWorkflowEvents = {
PLACED: "order.placed",
CANCELED: "order.canceled",
COMPLETED: "order.completed",
}
export const SalesChannelWorkflowEvents = {
CREATED: "sales-channel.created",
UPDATED: "sales-channel.updated",
DELETED: "sales-channel.deleted",
}
export const ProductCategoryWorkflowEvents = {
CREATED: "product-category.created",
UPDATED: "product-category.updated",
DELETED: "product-category.deleted",
}
export const ProductCollectionWorkflowEvents = {
CREATED: "product-collection.created",
UPDATED: "product-collection.updated",
DELETED: "product-collection.deleted",
}
export const ProductVariantWorkflowEvents = {
UPDATED: "product-variant.updated",
CREATED: "product-variant.created",
DELETED: "product-variant.deleted",
}
export const ProductWorkflowEvents = {
UPDATED: "product.updated",
CREATED: "product.created",
DELETED: "product.deleted",
}
export const InviteWorkflowEvents = {
ACCEPTED: "invite.accepted",
CREATED: "invite.created",
DELETED: "invite.deleted",
}
export const RegionWorkflowEvents = {
UPDATED: "region.updated",
CREATED: "region.created",
DELETED: "region.deleted",
}
@@ -0,0 +1 @@
export * from "./events"
+2 -1
View File
@@ -2,6 +2,7 @@ export * from "./api-key"
export * from "./auth"
export * from "./bundles"
export * from "./common"
export * from "./core-flows"
export * from "./dal"
export * from "./decorators"
export * from "./defaults"
@@ -18,6 +19,7 @@ export * from "./notification"
export * from "./orchestration"
export * from "./order"
export * from "./payment"
export * from "./pg"
export * from "./pricing"
export * from "./product"
export * from "./promotion"
@@ -26,6 +28,5 @@ export * from "./shipping"
export * from "./totals"
export * from "./totals/big-number"
export * from "./user"
export * from "./pg"
export const MedusaModuleType = Symbol.for("MedusaModule")
-5
View File
@@ -1,5 +0,0 @@
export const OrderWorkflowEvents = {
PLACED: "order.placed",
CANCELED: "order.canceled",
COMPLETED: "order.completed",
}
-1
View File
@@ -1,4 +1,3 @@
export * from "./events"
export * from "./order-change"
export * from "./order-change-action"
export * from "./status"
-24
View File
@@ -21,27 +21,3 @@ export const ProductEvents = buildEventNamesFromEntityName(
eventBaseNames,
Modules.PRODUCT
)
export const ProductCategoryWorkflowEvents = {
CREATED: "product-category.created",
UPDATED: "product-category.updated",
DELETED: "product-category.deleted",
}
export const ProductCollectionWorkflowEvents = {
CREATED: "product-collection.created",
UPDATED: "product-collection.updated",
DELETED: "product-collection.deleted",
}
export const ProductVariantWorkflowEvents = {
UPDATED: "product-variant.updated",
CREATED: "product-variant.created",
DELETED: "product-variant.deleted",
}
export const ProductWorkflowEvents = {
UPDATED: "product.updated",
CREATED: "product.created",
DELETED: "product.deleted",
}
+6
View File
@@ -7,3 +7,9 @@ export const UserEvents = {
...buildEventNamesFromEntityName(eventBaseNames, Modules.USER),
INVITE_TOKEN_GENERATED: `${Modules.USER}.user.invite.token_generated`,
}
export const UserWorkflowEvents = {
CREATED: "user.created",
UPDATED: "user.updated",
DELETED: "user.deleted",
}