typst files stored in the db from now on2

This commit is contained in:
Filipriec
2026-08-29 23:19:53 +02:00
parent 36d401f3a4
commit eb2d6bea5d
9 changed files with 203 additions and 69 deletions

View File

@@ -7,6 +7,7 @@ service DocumentDataService {
rpc GetDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
rpc GetDocument(GetDocumentRequest) returns (GetDocumentResponse);
rpc GetDocumentVersion(GetDocumentVersionRequest) returns (GetDocumentVersionResponse);
rpc GetTypstTemplateVersion(GetTypstTemplateVersionRequest) returns (GetTypstTemplateVersionResponse);
}
message SourceRecord {
@@ -17,28 +18,24 @@ message SourceRecord {
}
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;
repeated SourceRecord source_records = 1;
string template_name = 2;
string typst_source = 3;
string typst_compiler_version = 4;
string data_json = 5;
}
message SaveDocumentResponse {
int64 document_id = 1;
int64 snapshot_id = 2;
int32 version_number = 3;
int64 template_version_id = 4;
int32 template_version = 5;
}
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;
string data_json = 2;
}
message UpdateDocumentResponse {
@@ -56,16 +53,15 @@ message GetDocumentsRequest {
message Document {
int64 snapshot_id = 1;
int64 document_id = 2;
optional int64 schema_id = 3;
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;
string data_json = 5;
string change_kind = 6;
int32 version_number = 7;
string created_at = 8;
string updated_at = 9;
int64 template_version_id = 10;
string data_sha256 = 11;
}
message GetDocumentsResponse {
@@ -88,3 +84,23 @@ message GetDocumentVersionRequest {
message GetDocumentVersionResponse {
optional Document document = 1;
}
message GetTypstTemplateVersionRequest {
int64 template_version_id = 1;
int64 document_id = 2;
}
message TypstTemplateVersion {
int64 id = 1;
int64 schema_id = 2;
string template_name = 3;
int32 version = 4;
string source_code = 5;
string source_sha256 = 6;
string typst_compiler_version = 7;
string created_at = 8;
}
message GetTypstTemplateVersionResponse {
optional TypstTemplateVersion template_version = 1;
}