91 lines
2.2 KiB
Protocol Buffer
91 lines
2.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
package komp_ac.document_data;
|
|
|
|
service DocumentDataService {
|
|
rpc SaveDocument(SaveDocumentRequest) returns (SaveDocumentResponse);
|
|
rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse);
|
|
rpc GetDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
|
|
rpc GetDocument(GetDocumentRequest) returns (GetDocumentResponse);
|
|
rpc GetDocumentVersion(GetDocumentVersionRequest) returns (GetDocumentVersionResponse);
|
|
}
|
|
|
|
message SourceRecord {
|
|
string profile_name = 1;
|
|
string table_name = 2;
|
|
int64 table_def_id = 3;
|
|
int64 record_id = 4;
|
|
}
|
|
|
|
message SaveDocumentRequest {
|
|
optional int64 schema_id = 1;
|
|
repeated SourceRecord source_records = 2;
|
|
optional string template_name = 3;
|
|
optional string template_kind = 4;
|
|
optional string template_path = 5;
|
|
string data_json = 6;
|
|
}
|
|
|
|
message SaveDocumentResponse {
|
|
int64 document_id = 1;
|
|
int64 snapshot_id = 2;
|
|
int32 version_number = 3;
|
|
}
|
|
|
|
message UpdateDocumentRequest {
|
|
int64 document_id = 1;
|
|
optional int64 schema_id = 2;
|
|
repeated SourceRecord source_records = 3;
|
|
optional string template_name = 4;
|
|
optional string template_kind = 5;
|
|
optional string template_path = 6;
|
|
string data_json = 7;
|
|
}
|
|
|
|
message UpdateDocumentResponse {
|
|
int64 document_id = 1;
|
|
int64 snapshot_id = 2;
|
|
int32 version_number = 3;
|
|
}
|
|
|
|
message GetDocumentsRequest {
|
|
optional int64 schema_id = 1;
|
|
uint32 limit = 2;
|
|
optional string template_name = 3;
|
|
}
|
|
|
|
message Document {
|
|
int64 snapshot_id = 1;
|
|
int64 document_id = 2;
|
|
optional int64 schema_id = 3;
|
|
repeated SourceRecord source_records = 4;
|
|
optional string template_name = 5;
|
|
optional string template_kind = 6;
|
|
optional string template_path = 7;
|
|
string data_json = 8;
|
|
string change_kind = 9;
|
|
int32 version_number = 10;
|
|
string created_at = 11;
|
|
string updated_at = 12;
|
|
}
|
|
|
|
message GetDocumentsResponse {
|
|
repeated Document documents = 1;
|
|
}
|
|
|
|
message GetDocumentRequest {
|
|
int64 document_id = 1;
|
|
}
|
|
|
|
message GetDocumentResponse {
|
|
optional Document document = 1;
|
|
}
|
|
|
|
message GetDocumentVersionRequest {
|
|
int64 document_id = 1;
|
|
int32 version_number = 2;
|
|
}
|
|
|
|
message GetDocumentVersionResponse {
|
|
optional Document document = 1;
|
|
}
|