diff --git a/common.proto b/common.proto index 2f09d03..630bdb9 100644 --- a/common.proto +++ b/common.proto @@ -1,8 +1,8 @@ syntax = "proto3"; option optimize_for = SPEED; option java_multiple_files = true; -option go_package = "fivetran.com/fivetran_sdk"; -package fivetran_sdk; +option go_package = "fivetran.com/fivetran_sdk_v2"; +package fivetran_sdk.v2; import "google/protobuf/timestamp.proto"; @@ -18,12 +18,29 @@ message ConfigurationFormResponse { message FormField { string name = 1; string label = 2; - bool required = 3; + optional bool required = 3; optional string description = 4; oneof type { TextField text_field = 5; DropdownField dropdown_field = 6; ToggleField toggle_field = 7; + ConditionalFields conditional_fields = 10; + } + optional string default_value = 8; + optional string placeholder = 9; +} + +message ConditionalFields { + VisibilityCondition condition = 1; + repeated FormField fields = 2; +} + +message VisibilityCondition { + string condition_field = 1; + oneof visible_when { + bool bool_value = 2; + string string_value = 3; + bool empty_value = 4; } } @@ -53,7 +70,6 @@ message TestResponse { oneof response { bool success = 1; string failure = 2; - // potential future warning } } @@ -86,6 +102,14 @@ enum DataType { XML = 12; STRING = 13; JSON = 14; + NAIVE_TIME = 15; +} + +message DataTypeParams { + oneof params { + DecimalParams decimal = 1; + int32 string_byte_length = 2; + } } message DecimalParams { @@ -93,7 +117,7 @@ message DecimalParams { uint32 scale = 2; } -enum OpType { +enum RecordType { UPSERT = 0; UPDATE = 1; DELETE = 2; @@ -117,6 +141,7 @@ message ValueType { string string = 13; string json = 14; string xml = 15; + google.protobuf.Timestamp naive_time = 16; } } @@ -129,5 +154,13 @@ message Column { string name = 1; DataType type = 2; bool primary_key = 3; - optional DecimalParams decimal = 4; + optional DataTypeParams params = 4; +} + +message Warning { + string message = 1; +} + +message Task { + string message = 1; } diff --git a/connector_sdk.proto b/connector_sdk.proto index 4d906ee..0117b39 100644 --- a/connector_sdk.proto +++ b/connector_sdk.proto @@ -1,13 +1,13 @@ syntax = "proto3"; option optimize_for = SPEED; option java_multiple_files = true; -option go_package = "fivetran.com/fivetran_sdk"; -package fivetran_sdk; +option go_package = "fivetran.com/fivetran_sdk_v2"; +package fivetran_sdk.v2; import "common.proto"; -// Fivetran (grpc client) <> Connector (grpc server) -service Connector { +// Fivetran (grpc client) <> SourceConnector (grpc server) +service SourceConnector { rpc ConfigurationForm (ConfigurationFormRequest) returns (ConfigurationFormResponse) {} rpc Test (TestRequest) returns (TestResponse) {} rpc Schema (SchemaRequest) returns (SchemaResponse) {} @@ -65,28 +65,12 @@ message TableSelection { } message UpdateResponse { - oneof response { - LogEntry log_entry = 1; - Operation operation = 2; - } -} - -enum LogLevel { - INFO = 0; - WARNING = 1; - SEVERE = 2; -} - -message LogEntry { - LogLevel level = 1; - string message = 2; -} - -message Operation { - oneof op { + oneof operation { Record record = 1; SchemaChange schema_change = 2; Checkpoint checkpoint = 3; + Warning warning = 4; + Task task = 5; } } @@ -100,7 +84,7 @@ message SchemaChange { message Record { optional string schema_name = 1; string table_name = 2; - OpType type = 3; + RecordType type = 3; map data = 4; } diff --git a/destination_sdk.proto b/destination_sdk.proto index 8c5635b..438d641 100644 --- a/destination_sdk.proto +++ b/destination_sdk.proto @@ -1,14 +1,14 @@ syntax = "proto3"; option optimize_for = SPEED; option java_multiple_files = true; -option go_package = "fivetran.com/fivetran_sdk"; -package fivetran_sdk; +option go_package = "fivetran.com/fivetran_sdk_v2"; +package fivetran_sdk.v2; import "google/protobuf/timestamp.proto"; import "common.proto"; -// Fivetran (grpc client) <> Destination (grpc server) -service Destination { +// Fivetran (grpc client) <> DestinationConnector (grpc server) +service DestinationConnector { rpc ConfigurationForm (ConfigurationFormRequest) returns (ConfigurationFormResponse) {} rpc Capabilities (CapabilitiesRequest) returns (CapabilitiesResponse) {} rpc Test (TestRequest) returns (TestResponse) {} @@ -34,8 +34,9 @@ message DescribeTableRequest { message DescribeTableResponse { oneof response { bool not_found = 1; - string failure = 2; - Table table = 3; + Table table = 2; + Warning warning = 3; + Task task = 4; } } @@ -48,7 +49,8 @@ message CreateTableRequest { message CreateTableResponse { oneof response { bool success = 1; - string failure = 2; + Warning warning = 2; + Task task = 3; } } @@ -61,7 +63,8 @@ message AlterTableRequest { message AlterTableResponse { oneof response { bool success = 1; - string failure = 2; + Warning warning = 2; + Task task = 3; } } @@ -75,13 +78,14 @@ message TruncateRequest { } message SoftTruncate { - string deleted_column = 3; + string deleted_column = 1; } message TruncateResponse { oneof response { bool success = 1; - string failure = 2; + Warning warning = 2; + Task task = 3; } } @@ -93,23 +97,16 @@ message WriteBatchRequest { repeated string replace_files = 5; repeated string update_files = 6; repeated string delete_files = 7; - oneof file_params { - CsvFileParams csv = 8; - ParquetFileParams parquet = 9; - } + FileParams file_params = 9; } -message CsvFileParams { +message FileParams { Compression compression = 1; Encryption encryption = 2; string null_string = 3; string unmodified_string = 4; } -message ParquetFileParams { - Encryption encryption = 1; -} - enum Encryption { NONE = 0; AES = 1; @@ -129,6 +126,7 @@ enum Compression { message WriteBatchResponse { oneof response { bool success = 1; - string failure = 2; + Warning warning = 2; + Task task = 3; } -} \ No newline at end of file +}