1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use wakflo_common::prelude::StepType;
use wakflo_common::EntityConnector;

/// # Task
///
/// Task contract represent an ant schema that takes in
/// operators and actions to be performed on a dataset
#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
pub struct TaskStepMetadata {
    /// Name of the the schema
    pub name: String,

    /// Description of the the schema
    pub is_trigger: bool,
}

/// # Task
///
/// Task contract represent an ant schema that takes in
/// operators and actions to be performed on a dataset
#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
pub struct TaskStepProperties {
    pub input: HashMap<String, serde_json::Value>,

    pub output: HashMap<String, serde_json::Value>,
}

/// # Task
///
/// Task contract represent an ant schema that takes in
/// operators and actions to be performed on a dataset
#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
#[cfg_attr(feature = "sql", derive(sea_orm::FromJsonQueryResult))]
pub struct TaskStepData {
    pub properties: serde_json::Value,
}

/// # Task
///
/// Task contract represent an ant schema that takes in
/// operators and actions to be performed on a dataset
#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
pub struct TaskStep {
    /// Name of the the schema
    pub id: String,

    /// Name of the the schema
    pub label: String,

    #[serde(alias = "type", rename(serialize = "type"))]
    pub _type: StepType,

    /// Name of the the schema
    pub name: String,

    /// Name of the the schema
    pub path: Vec<String>,

    /// Icon of the the schema
    pub icon: String,

    /// if task is a trigger
    pub is_trigger: bool,

    pub reference: Option<EntityConnector>,

    pub children: Option<Vec<TaskStep>>,

    /// Description of the the schema
    pub data: TaskStepData,
}

/// # StepFlow
///
/// Task contract represent an ant schema that takes in
/// operators and actions to be performed on a dataset
#[derive(PartialEq, Eq, Serialize, Deserialize, Clone, Debug, Default)]
pub struct StepEdge {
    /// Name of the the schema
    pub id: String,

    /// Name of the the schema
    pub target: String,

    /// Name of the the schema
    pub source: String,

    /// Name of the the schema
    pub style: Option<HashMap<String, String>>,

    #[serde(alias = "type")]
    pub _type: serde_json::Value,
}