wakflo_core/
step.rs

1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3use wakflo_common::prelude::StepType;
4use wakflo_common::EntityConnector;
5
6/// # Connector
7///
8/// Connector contract represent an ant schema that takes in
9/// operators and actions to be performed on a dataset
10#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
11pub struct ConnectorStepMetadata {
12    /// Name of the the schema
13    pub name: String,
14
15    /// Description of the the schema
16    pub is_trigger: bool,
17}
18
19/// # Connector
20///
21/// Connector contract represent an ant schema that takes in
22/// operators and actions to be performed on a dataset
23#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
24pub struct ConnectorStepProperties {
25    pub input: HashMap<String, serde_json::Value>,
26
27    pub output: HashMap<String, serde_json::Value>,
28}
29
30/// # Connector
31///
32/// Connector contract represent an ant schema that takes in
33/// operators and actions to be performed on a dataset
34#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
35#[cfg_attr(feature = "sql", derive(sea_orm::FromJsonQueryResult))]
36pub struct ConnectorStepData {
37    pub properties: serde_json::Value,
38}
39
40/// # Connector
41///
42/// Connector contract represent an ant schema that takes in
43/// operators and actions to be performed on a dataset
44#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
45pub struct ConnectorStep {
46    /// Name of the the schema
47    pub id: String,
48
49    /// Name of the the schema
50    pub label: String,
51
52    #[serde(alias = "type", rename(serialize = "type"))]
53    pub _type: StepType,
54
55    /// Name of the the schema
56    pub name: String,
57
58    /// Name of the the schema
59    pub path: Vec<String>,
60
61    /// Icon of the the schema
62    pub icon: String,
63
64    /// if connector is a trigger
65    pub is_trigger: bool,
66
67    pub reference: Option<EntityConnector>,
68
69    pub children: Option<Vec<ConnectorStep>>,
70
71    /// Description of the the schema
72    pub data: ConnectorStepData,
73}
74
75/// # StepFlow
76///
77/// Connector contract represent an ant schema that takes in
78/// operators and actions to be performed on a dataset
79#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
80pub struct StepEdge {
81    /// Name of the the schema
82    pub id: String,
83
84    /// Name of the the schema
85    pub target: String,
86
87    /// Name of the the schema
88    pub source: String,
89
90    /// Name of the the schema
91    pub style: Option<HashMap<String, String>>,
92
93    #[serde(alias = "type")]
94    pub _type: serde_json::Value,
95}