diff --git a/client b/client index 3bce44d..25c132a 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 3bce44d1459072af1c3bdda0b727bd3ae0756c96 +Subproject commit 25c132a2b1914f782904db021cbb011fff7aae99 diff --git a/common/proto/document_data.proto b/common/proto/document_data.proto index 463941e..6416010 100644 --- a/common/proto/document_data.proto +++ b/common/proto/document_data.proto @@ -3,6 +3,7 @@ package komp_ac.document_data; service DocumentDataService { rpc SaveGeneratedPrintJson(SaveGeneratedPrintJsonRequest) returns (SaveGeneratedPrintJsonResponse); + rpc SaveUserAdjustedPrintJson(SaveUserAdjustedPrintJsonRequest) returns (SaveUserAdjustedPrintJsonResponse); } message SourceRecord { @@ -26,3 +27,19 @@ message SaveGeneratedPrintJsonResponse { int64 snapshot_id = 2; int32 version_number = 3; } + +message SaveUserAdjustedPrintJsonRequest { + int64 document_run_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 SaveUserAdjustedPrintJsonResponse { + int64 document_run_id = 1; + int64 snapshot_id = 2; + int32 version_number = 3; +} diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index f6e89ba..5a54d42 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.document_data.rs b/common/src/proto/komp_ac.document_data.rs index e443d79..39fad72 100644 --- a/common/src/proto/komp_ac.document_data.rs +++ b/common/src/proto/komp_ac.document_data.rs @@ -34,6 +34,32 @@ pub struct SaveGeneratedPrintJsonResponse { #[prost(int32, tag = "3")] pub version_number: i32, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SaveUserAdjustedPrintJsonRequest { + #[prost(int64, tag = "1")] + pub document_run_id: i64, + #[prost(int64, optional, tag = "2")] + pub schema_id: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub source_records: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag = "4")] + pub template_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "5")] + pub template_kind: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "6")] + pub template_path: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "7")] + pub data_json: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SaveUserAdjustedPrintJsonResponse { + #[prost(int64, tag = "1")] + pub document_run_id: i64, + #[prost(int64, tag = "2")] + pub snapshot_id: i64, + #[prost(int32, tag = "3")] + pub version_number: i32, +} /// Generated client implementations. pub mod document_data_service_client { #![allow( @@ -154,6 +180,35 @@ pub mod document_data_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn save_user_adjusted_print_json( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.document_data.DocumentDataService/SaveUserAdjustedPrintJson", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.document_data.DocumentDataService", + "SaveUserAdjustedPrintJson", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -176,6 +231,13 @@ pub mod document_data_service_server { tonic::Response, tonic::Status, >; + async fn save_user_adjusted_print_json( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct DocumentDataServiceServer { @@ -302,6 +364,60 @@ pub mod document_data_service_server { }; Box::pin(fut) } + "/komp_ac.document_data.DocumentDataService/SaveUserAdjustedPrintJson" => { + #[allow(non_camel_case_types)] + struct SaveUserAdjustedPrintJsonSvc( + pub Arc, + ); + impl< + T: DocumentDataService, + > tonic::server::UnaryService< + super::SaveUserAdjustedPrintJsonRequest, + > for SaveUserAdjustedPrintJsonSvc { + type Response = super::SaveUserAdjustedPrintJsonResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::SaveUserAdjustedPrintJsonRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::save_user_adjusted_print_json( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = SaveUserAdjustedPrintJsonSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { let mut response = http::Response::new(