Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions crates/taurus-core/src/runtime/functions/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub(crate) const FUNCTIONS: &[FunctionRegistration] = &[
FunctionRegistration::eager("std::number::exponential", exponential, 2),
FunctionRegistration::eager("std::number::pi", pi, 0),
FunctionRegistration::eager("std::number::euler", euler, 0),
FunctionRegistration::eager("std::number::infinity", infinity, 0),
FunctionRegistration::eager("std::number::round_up", round_up, 2),
FunctionRegistration::eager("std::number::round_down", round_down, 2),
FunctionRegistration::eager("std::number::round", round, 2),
Expand Down Expand Up @@ -396,15 +395,6 @@ fn euler(
Signal::Success(value_from_f64(f64::consts::E))
}

fn infinity(
args: &[Argument],
_ctx: &mut ValueStore,
_run: &mut crate::handler::registry::ThunkRunner<'_>,
) -> Signal {
no_args!(args);
Signal::Success(value_from_f64(f64::INFINITY))
}

fn round_up(
args: &[Argument],
_ctx: &mut ValueStore,
Expand Down Expand Up @@ -1056,10 +1046,6 @@ mod tests {
assert!(
(expect_num(euler(&[], &mut ctx, &mut run)) - std::f64::consts::E).abs() < f64::EPSILON
);

let mut run = dummy_run;
let inf = expect_num(infinity(&[], &mut ctx, &mut run));
assert!(inf.is_infinite() && inf.is_sign_positive());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion flows/02_return_flow_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{
"definition_source": "taurus",
"databaseId": "3",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
Comment thread
raphael-goetz marked this conversation as resolved.
{
"databaseId": "5",
Expand Down
40 changes: 4 additions & 36 deletions flows/05_if_control.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,9 @@
],
"startingNodeId": "11",
"nodeFunctions": [
{
"databaseId": "13",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "57",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "14"
}
}
}
]
},
{
"databaseId": "14",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "54",
Expand Down Expand Up @@ -120,8 +105,7 @@
}
}
}
],
"nextNodeId": "13"
]
},
{
"databaseId": "11",
Expand Down Expand Up @@ -158,24 +142,9 @@
],
"nextNodeId": "14"
},
{
"databaseId": "15",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "58",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "12"
}
}
}
]
},
{
"databaseId": "12",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "51",
Expand Down Expand Up @@ -214,8 +183,7 @@
}
}
}
],
"nextNodeId": "15"
]
}
],
"projectSlug": "codezero-project",
Expand Down
36 changes: 2 additions & 34 deletions flows/06_if_else_control.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"nodeFunctions": [
{
"databaseId": "19",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "51",
Expand Down Expand Up @@ -105,22 +105,6 @@
}
}
}
],
"nextNodeId": "20"
},
{
"databaseId": "20",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "76",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "19"
}
}
}
]
},
{
Expand Down Expand Up @@ -170,7 +154,7 @@
},
{
"databaseId": "17",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "72",
Expand Down Expand Up @@ -201,22 +185,6 @@
}
}
}
],
"nextNodeId": "18"
},
{
"databaseId": "18",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "64",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "17"
}
}
}
]
}
],
Expand Down
20 changes: 2 additions & 18 deletions flows/07_simple_return.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,9 @@
}
]
},
{
"databaseId": "13",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "25",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "8"
}
}
}
]
},
{
"databaseId": "8",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "16",
Expand Down Expand Up @@ -236,8 +221,7 @@
}
}
}
],
"nextNodeId": "13"
]
}
],
"projectSlug": "codezero-project",
Expand Down
18 changes: 1 addition & 17 deletions flows/09_filter_return.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
},
{
"databaseId": "11",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "27",
Expand Down Expand Up @@ -354,22 +354,6 @@
}
}
}
],
"nextNodeId": "4"
},
{
"databaseId": "4",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "8",
"runtimeParameterId": "http_response",
"value": {
"referenceValue": {
"nodeId": "11"
}
}
}
]
}
],
Expand Down
80 changes: 58 additions & 22 deletions flows/10_multiple_respond.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
},
{
"databaseId": "11",
"runtimeFunctionId": "http::response::create",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "27",
Expand Down Expand Up @@ -342,35 +342,45 @@
}
}
],
"nextNodeId": "4"
"nextNodeId": "20"
},
{
"databaseId": "4",
"nextNodeId": "20",
"nextNodeId": "21",
"databaseId": "20",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "8",
"runtimeParameterId": "http_response",
"databaseId": "27",
"runtimeParameterId": "http_status_code",
"value": {
"referenceValue": {
"nodeId": "11"
"literalValue": {
"numberValue": {
"integer": "200"
}
}
}
}
]
},
{
"nextNodeId": "21",
"databaseId": "20",
"runtimeFunctionId": "rest::control::respond",
"parameters": [
},
{
"databaseId": "8",
"runtimeParameterId": "http_response",
"databaseId": "30",
"runtimeParameterId": "headers",
"value": {
"literalValue": {
"structValue": {
"fields": {
"x": {
"stringValue": "y"
}
}
}
}
}
},
{
"databaseId": "31",
"runtimeParameterId": "payload",
"value": {
"referenceValue": {
"nodeId": "11"
"nodeId": "10"
}
}
}
Expand All @@ -382,11 +392,37 @@
"runtimeFunctionId": "rest::control::respond",
"parameters": [
{
"databaseId": "8",
"runtimeParameterId": "http_response",
"databaseId": "27",
"runtimeParameterId": "http_status_code",
"value": {
"literalValue": {
"numberValue": {
"integer": "200"
}
}
}
},
{
"databaseId": "30",
"runtimeParameterId": "headers",
"value": {
"literalValue": {
"structValue": {
"fields": {
"x": {
"stringValue": "y"
}
}
}
}
}
},
{
"databaseId": "31",
"runtimeParameterId": "payload",
"value": {
"referenceValue": {
"nodeId": "11"
"nodeId": "10"
}
}
}
Expand Down