Skip to main content

stormchaser_model/
lib.rs

1//! Core data models and domain types for the Stormchaser workflow engine.
2//!
3//! This crate provides the foundational types representing workflows, steps,
4//! executions, and other entities that make up the domain model.
5
6/// Standard MIME type for JSON data.
7pub const APPLICATION_JSON: &str = "application/json";
8
9pub mod id;
10pub use id::*;
11
12/// Authentication and authorization models.
13pub mod auth;
14/// Cron scheduling definitions.
15pub mod cron;
16/// Domain-Specific Language (DSL) abstract syntax tree and types.
17pub mod dsl;
18/// System event and correlation models.
19pub mod event;
20/// Rule-based trigger definitions for events.
21pub mod event_rules;
22/// Event schemas for CloudEvents.
23pub mod events;
24/// HCL expression evaluation models.
25pub mod hcl_eval;
26/// Logging configuration and log streaming types.
27pub mod logging;
28/// NATS helpers.
29pub mod nats;
30/// Outbox pattern models for reliable message publishing.
31pub mod outbox;
32/// Execution runner definitions and status models.
33pub mod runner;
34/// Schema cache for OCI schemas.
35pub mod schema_cache;
36/// Schema generation functions.
37pub mod schema_gen;
38/// Workflow step execution models and state.
39pub mod step;
40/// Storage backend and artifact registry models.
41pub mod storage;
42/// Test reporting and summary models.
43pub mod test_report;
44/// Core workflow run and state management types.
45pub mod workflow;
46
47pub use auth::{ApiOpaContext, Claims, EngineOpaContext, OpaClient};
48pub use dsl::{ApprovalSpec, WaitEventSpec};
49pub use event::{ApprovalRegistry, EventCorrelation};
50pub use event_rules::{EventRule, WebhookConfig};
51pub use logging::LogBackend;
52pub use outbox::OutboxMessage;
53pub use runner::{Runner, RunnerStatus, StepDefinition};
54pub use step::{StepInstance, StepOutput, StepStatus};
55pub use storage::{BackendType, StorageBackend};
56pub use test_report::{TestCase, TestCaseStatus, TestReport, TestSummary};
57pub use workflow::{AuditLog, RunContext, RunQuotas, RunStatus, WorkflowRun};
58
59/// Engine trait for scheduling and managing workflow runs.
60pub trait WorkflowEngine {
61    /// Schedules a new workflow run by name.
62    fn schedule_run(&self, name: &str) -> anyhow::Result<WorkflowRun>;
63}