@loop-engine/events
v0.1.5
Published
Typed Loop Engine lifecycle event contracts and in-memory event bus
Downloads
667
Maintainers
Readme
@loop-engine/events
Typed event definitions and factory functions for Loop Engine runtime events.
Install
npm install @loop-engine/eventsQuick Start
import { createLoopStartedEvent, createLoopTransitionExecutedEvent, type LoopEvent } from "@loop-engine/events";
const started = createLoopStartedEvent({
loopId: "expense.approval" as never,
aggregateId: "EXP-1" as never,
initialState: "submitted" as never,
actor: { type: "human", id: "[email protected]" as never },
definition: { loopId: "expense.approval" as never, version: "1.0.0", name: "Expense Approval" }
});
const transitioned: LoopEvent = createLoopTransitionExecutedEvent({
loopId: started.loopId,
aggregateId: started.aggregateId,
transitionId: "approve" as never,
fromState: "submitted" as never,
toState: "approved" as never,
signal: "approve" as never,
actor: started.actor
});Documentation link
https://loopengine.io/docs/packages/events
License
Apache-2.0 © Better Data, Inc.
