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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2024"
[workspace.dependencies]
serde = "1.0.219"
serde_json = "1.0.140"
tucana = "0.0.56"
tucana = "0.0.58"
clap = "4.5.41"
colored = "3.0"
tabled = "0.20"
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/analyser/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ impl Analyser {
));
}

if dt.signature == "" {
if dt.r#type == "" {
self.reporter.add(Diagnose::new(
dt.identifier.clone(),
adt.original_definition.clone(),
DiagnosticKind::NullField {
field_name: "signature".into(),
field_name: "type".into(),
},
));
}
Expand Down
36 changes: 30 additions & 6 deletions crates/cli/src/analyser/flow_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ impl Analyser {
let name = flow.identifier.clone();
let original = aft.original_definition.clone();

for linked in flow.linked_data_type_identifiers.clone() {
if !self.data_type_identifier_exists(linked.as_str(), None) {
self.reporter.add(Diagnose::new(
name.clone(),
original.clone(),
DiagnosticKind::UndefinedDataTypeIdentifier {
identifier: linked.clone(),
},
));
}
}

if flow.display_icon.is_empty() {
self.reporter.add(Diagnose::new(
name.clone(),
Expand Down Expand Up @@ -65,31 +77,43 @@ impl Analyser {
));
}

if let Some(identifier) = &flow.input_type_identifier
if let Some(identifier) = &flow.input_type
&& identifier == ""
{
self.reporter.add(Diagnose::new(
name.clone(),
original.clone(),
DiagnosticKind::NullField {
field_name: "input_type_identifier".into(),
field_name: "input_type".into(),
},
));
}

if let Some(identifier) = &flow.return_type_identifier
if let Some(identifier) = &flow.return_type
&& identifier == ""
{
self.reporter.add(Diagnose::new(
name.clone(),
original.clone(),
DiagnosticKind::NullField {
field_name: "return_type_identifier".into(),
field_name: "return_type".into(),
},
));
}

for setting in &flow.settings {
for linked in setting.linked_data_type_identifiers.clone() {
if !self.data_type_identifier_exists(linked.as_str(), None) {
self.reporter.add(Diagnose::new(
name.clone(),
original.clone(),
DiagnosticKind::UndefinedDataTypeIdentifier {
identifier: linked.clone(),
},
));
}
}

if setting.name.is_empty() {
self.reporter.add(Diagnose::new(
setting.identifier.clone(),
Expand All @@ -108,12 +132,12 @@ impl Analyser {
},
));
}
if !self.data_type_identifier_exists(&setting.data_type_identifier, None) {
if !self.data_type_identifier_exists(&setting.r#type, None) {
self.reporter.add(Diagnose::new(
name.clone(),
original.clone(),
DiagnosticKind::UndefinedDataTypeIdentifier {
identifier: setting.data_type_identifier.clone(),
identifier: setting.r#type.clone(),
},
));
}
Expand Down
4 changes: 2 additions & 2 deletions definitions/cron/data_type/type/cron_day_of_month.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"content": "Cron Day of Month"
}
],
"linked_data_type_identifiers": [],
"signature": "string"
"linkedDataTypeIdentifiers": [],
"type": "string"
}
4 changes: 2 additions & 2 deletions definitions/cron/data_type/type/cron_day_of_week.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"content": "Cron Day of Week"
}
],
"linked_data_type_identifiers": [],
"signature": "string | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN'"
"linkedDataTypeIdentifiers": [],
"type": "string | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN'"
}
4 changes: 2 additions & 2 deletions definitions/cron/data_type/type/cron_hour.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"content": "Cron Hour"
}
],
"linked_data_type_identifiers": [],
"signature": "string"
"linkedDataTypeIdentifiers": [],
"type": "string"
}
4 changes: 2 additions & 2 deletions definitions/cron/data_type/type/cron_minute.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"content": "Cron Minute"
}
],
"linked_data_type_identifiers": [],
"signature": "string"
"linkedDataTypeIdentifiers": [],
"type": "string"
}
4 changes: 2 additions & 2 deletions definitions/cron/data_type/type/cron_month.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"content": "Cron Month"
}
],
"linked_data_type_identifiers": [],
"signature": "string | 'JAN' | 'FEB' | 'MAR' | 'APR' | 'MAY' | 'JUN' | 'JUL' | 'AUG' | 'SEP' | 'OCT' | 'NOV' | 'DEC' "
"linkedDataTypeIdentifiers": [],
"type": "string | 'JAN' | 'FEB' | 'MAR' | 'APR' | 'MAY' | 'JUN' | 'JUL' | 'AUG' | 'SEP' | 'OCT' | 'NOV' | 'DEC' "
}
25 changes: 20 additions & 5 deletions definitions/cron/flow_type/cron.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
{
"identifier": "CRON_MINUTE",
"unique": "NONE",
"dataTypeIdentifier": "CRON_MINUTE",
"type": "CRON_MINUTE",
"linkedDataTypeIdentifiers": [
"CRON_MINUTE"
],
"defaultValue": null,
"name": [
{
Expand All @@ -22,7 +25,10 @@
{
"identifier": "CRON_HOUR",
"unique": "NONE",
"dataTypeIdentifier": "CRON_HOUR",
"type": "CRON_HOUR",
"linkedDataTypeIdentifiers": [
"CRON_HOUR"
],
"defaultValue": null,
"name": [
{
Expand All @@ -40,7 +46,10 @@
{
"identifier": "CRON_DAY_OF_MONTH",
"unique": "NONE",
"dataTypeIdentifier": "CRON_DAY_OF_MONTH",
"type": "CRON_DAY_OF_MONTH",
"linkedDataTypeIdentifiers": [
"CRON_DAY_OF_MONTH"
],
"defaultValue": null,
"name": [
{
Expand All @@ -58,7 +67,10 @@
{
"identifier": "CRON_MONTH",
"unique": "NONE",
"dataTypeIdentifier": "CRON_MONTH",
"type": "CRON_MONTH",
"linkedDataTypeIdentifiers": [
"CRON_MONTH"
],
"defaultValue": null,
"name": [
{
Expand All @@ -76,7 +88,10 @@
{
"identifier": "CRON_DAY_OF_WEEK",
"unique": "NONE",
"dataTypeIdentifier": "CRON_DAY_OF_WEEK",
"type": "CRON_DAY_OF_WEEK",
"linkedDataTypeIdentifiers": [
"CRON_DAY_OF_WEEK"
],
"defaultValue": null,
"name": [
{
Expand Down
4 changes: 2 additions & 2 deletions definitions/rest/data_type/rest_adapter_input.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"genericKeys": [
"T"
],
"linked_data_type_identifiers": [
"linkedDataTypeIdentifiers": [
"OBJECT"
],
"signature": "{ body: T, headers: OBJECT<{}> }"
"type": "{ body: T, headers: OBJECT<{}> }"
}
18 changes: 14 additions & 4 deletions definitions/rest/flow_type/rest.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
{
"identifier": "HTTP_URL",
"unique": "PROJECT",
"dataTypeIdentifier": "HTTP_URL",
"type": "HTTP_URL",
"linkedDataTypeIdentifiers": [
"HTTP_URL"
],
"name": [
{
"code": "en-US",
Expand All @@ -21,7 +24,10 @@
{
"identifier": "HTTP_METHOD",
"unique": "NONE",
"dataTypeIdentifier": "HTTP_METHOD",
"type": "HTTP_METHOD",
"linkedDataTypeIdentifiers": [
"HTTP_METHOD"
],
"name": [
{
"code": "en-US",
Expand All @@ -36,8 +42,12 @@
]
}
],
"inputTypeIdentifier": "REST_ADAPTER_INPUT",
"returnTypeIdentifier": "HTTP_RESPONSE",
"inputType": "REST_ADAPTER_INPUT",
"returnType": "HTTP_RESPONSE",
"linkedDataTypeIdentifiers": [
"REST_ADAPTER_INPUT",
"HTTP_RESPONSE"
],
"editable": false,
"name": [
{
Expand Down
2 changes: 1 addition & 1 deletion definitions/standard/data_type/array/list.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
],
"genericKeys": ["T"],
"rules": [],
"signature": "T[]"
"type": "T[]"
}
2 changes: 1 addition & 1 deletion definitions/standard/data_type/node/comparator.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"rules": [],
"genericKeys": ["I"],
"signature": "(left: I, right: I): NUMBER",
"type": "(left: I, right: I): NUMBER",
"linkedDataTypeIdentifiers": [
"NUMBER"
]
Expand Down
2 changes: 1 addition & 1 deletion definitions/standard/data_type/node/consumer.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
],
"rules": [],
"genericKeys": ["T"],
"signature": "(item: T): void"
"type": "(item: T): void"
}
4 changes: 2 additions & 2 deletions definitions/standard/data_type/node/predicate.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
],
"rules": [],
"genericKeys": ["T"],
"signature": "(item: T): BOOLEAN",
"linked_data_type_identifiers": [
"type": "(item: T): BOOLEAN",
"linkedDataTypeIdentifiers": [
"BOOLEAN"
]
}
2 changes: 1 addition & 1 deletion definitions/standard/data_type/node/runnable.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
}
],
"rules": [],
"signature": "(): void"
"type": "(): void"
}
2 changes: 1 addition & 1 deletion definitions/standard/data_type/node/transform.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
],
"rules": [],
"genericKeys": ["I", "R"],
"signature": "(item: I): R"
"type": "(item: I): R"
}
4 changes: 2 additions & 2 deletions definitions/standard/data_type/object/http_request.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"content": "HTTP Request"
}
],
"signature": "{ method: HTTP_METHOD, url: HTTP_URL, body: T, headers: OBJECT<{}> }",
"type": "{ method: HTTP_METHOD, url: HTTP_URL, body: T, headers: OBJECT<{}> }",
"genericKeys": ["T"],
"rules": [],
"linked_data_type_identifiers": [
"linkedDataTypeIdentifiers": [
"HTTP_METHOD",
"HTTP_URL",
"OBJECT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
}
],
"genericKeys": ["T"],
"signature": "{ body: T, headers: OBJECT<{}>, status_code: HTTP_STATUS_CODE }",
"linked_data_type_identifiers": [
"type": "{ body: T, headers: OBJECT<{}>, status_code: HTTP_STATUS_CODE }",
"linkedDataTypeIdentifiers": [
"HTTP_STATUS_CODE",
"OBJECT"
],
Expand Down
Loading