typst files stored in the db from now on2
This commit is contained in:
Binary file not shown.
@@ -12,17 +12,15 @@ pub struct SourceRecord {
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SaveDocumentRequest {
|
||||
#[prost(int64, optional, tag = "1")]
|
||||
pub schema_id: ::core::option::Option<i64>,
|
||||
#[prost(message, repeated, tag = "2")]
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub source_records: ::prost::alloc::vec::Vec<SourceRecord>,
|
||||
#[prost(string, optional, tag = "3")]
|
||||
pub template_name: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "4")]
|
||||
pub template_kind: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "5")]
|
||||
pub template_path: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, tag = "6")]
|
||||
#[prost(string, tag = "2")]
|
||||
pub template_name: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "3")]
|
||||
pub typst_source: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "4")]
|
||||
pub typst_compiler_version: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "5")]
|
||||
pub data_json: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
@@ -33,22 +31,16 @@ pub struct SaveDocumentResponse {
|
||||
pub snapshot_id: i64,
|
||||
#[prost(int32, tag = "3")]
|
||||
pub version_number: i32,
|
||||
#[prost(int64, tag = "4")]
|
||||
pub template_version_id: i64,
|
||||
#[prost(int32, tag = "5")]
|
||||
pub template_version: i32,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct UpdateDocumentRequest {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub document_id: i64,
|
||||
#[prost(int64, optional, tag = "2")]
|
||||
pub schema_id: ::core::option::Option<i64>,
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub source_records: ::prost::alloc::vec::Vec<SourceRecord>,
|
||||
#[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")]
|
||||
#[prost(string, tag = "2")]
|
||||
pub data_json: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
@@ -75,26 +67,24 @@ pub struct Document {
|
||||
pub snapshot_id: i64,
|
||||
#[prost(int64, tag = "2")]
|
||||
pub document_id: i64,
|
||||
#[prost(int64, optional, tag = "3")]
|
||||
pub schema_id: ::core::option::Option<i64>,
|
||||
#[prost(int64, tag = "3")]
|
||||
pub schema_id: i64,
|
||||
#[prost(message, repeated, tag = "4")]
|
||||
pub source_records: ::prost::alloc::vec::Vec<SourceRecord>,
|
||||
#[prost(string, optional, tag = "5")]
|
||||
pub template_name: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "6")]
|
||||
pub template_kind: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "7")]
|
||||
pub template_path: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, tag = "8")]
|
||||
#[prost(string, tag = "5")]
|
||||
pub data_json: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "9")]
|
||||
#[prost(string, tag = "6")]
|
||||
pub change_kind: ::prost::alloc::string::String,
|
||||
#[prost(int32, tag = "10")]
|
||||
#[prost(int32, tag = "7")]
|
||||
pub version_number: i32,
|
||||
#[prost(string, tag = "11")]
|
||||
#[prost(string, tag = "8")]
|
||||
pub created_at: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "12")]
|
||||
#[prost(string, tag = "9")]
|
||||
pub updated_at: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "10")]
|
||||
pub template_version_id: i64,
|
||||
#[prost(string, tag = "11")]
|
||||
pub data_sha256: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct GetDocumentsResponse {
|
||||
@@ -123,6 +113,37 @@ pub struct GetDocumentVersionResponse {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub document: ::core::option::Option<Document>,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetTypstTemplateVersionRequest {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub template_version_id: i64,
|
||||
#[prost(int64, tag = "2")]
|
||||
pub document_id: i64,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct TypstTemplateVersion {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub id: i64,
|
||||
#[prost(int64, tag = "2")]
|
||||
pub schema_id: i64,
|
||||
#[prost(string, tag = "3")]
|
||||
pub template_name: ::prost::alloc::string::String,
|
||||
#[prost(int32, tag = "4")]
|
||||
pub version: i32,
|
||||
#[prost(string, tag = "5")]
|
||||
pub source_code: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "6")]
|
||||
pub source_sha256: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "7")]
|
||||
pub typst_compiler_version: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "8")]
|
||||
pub created_at: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetTypstTemplateVersionResponse {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub template_version: ::core::option::Option<TypstTemplateVersion>,
|
||||
}
|
||||
/// Generated client implementations.
|
||||
pub mod document_data_service_client {
|
||||
#![allow(
|
||||
@@ -359,6 +380,35 @@ pub mod document_data_service_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
pub async fn get_typst_template_version(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::GetTypstTemplateVersionRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::GetTypstTemplateVersionResponse>,
|
||||
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/GetTypstTemplateVersion",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new(
|
||||
"komp_ac.document_data.DocumentDataService",
|
||||
"GetTypstTemplateVersion",
|
||||
),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Generated server implementations.
|
||||
@@ -409,6 +459,13 @@ pub mod document_data_service_server {
|
||||
tonic::Response<super::GetDocumentVersionResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
async fn get_typst_template_version(
|
||||
&self,
|
||||
request: tonic::Request<super::GetTypstTemplateVersionRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::GetTypstTemplateVersionResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
}
|
||||
#[derive(Debug)]
|
||||
pub struct DocumentDataServiceServer<T> {
|
||||
@@ -719,6 +776,59 @@ pub mod document_data_service_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.document_data.DocumentDataService/GetTypstTemplateVersion" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetTypstTemplateVersionSvc<T: DocumentDataService>(
|
||||
pub Arc<T>,
|
||||
);
|
||||
impl<
|
||||
T: DocumentDataService,
|
||||
> tonic::server::UnaryService<super::GetTypstTemplateVersionRequest>
|
||||
for GetTypstTemplateVersionSvc<T> {
|
||||
type Response = super::GetTypstTemplateVersionResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<
|
||||
super::GetTypstTemplateVersionRequest,
|
||||
>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as DocumentDataService>::get_typst_template_version(
|
||||
&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 = GetTypstTemplateVersionSvc(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(
|
||||
|
||||
@@ -255,8 +255,8 @@ pub struct ColumnDefinition {
|
||||
/// MONEY rounding applied before a value is stored.
|
||||
#[prost(enumeration = "MoneyRounding", tag = "3")]
|
||||
pub rounding: i32,
|
||||
/// When true, this numeric or Boolean column is server-owned and projected
|
||||
/// from ledger contributions.
|
||||
/// When true, this numeric column is server-owned and projected
|
||||
/// from quantity-ledger contributions.
|
||||
#[prost(bool, tag = "4")]
|
||||
pub quantity_ledger: bool,
|
||||
/// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
|
||||
@@ -266,11 +266,11 @@ pub struct ColumnDefinition {
|
||||
/// When true, the server rejects omitted or explicitly null values.
|
||||
#[prost(bool, tag = "6")]
|
||||
pub required: bool,
|
||||
/// Required for Boolean ledger columns and forbidden otherwise. ANY means
|
||||
/// Enables a Boolean ledger on Boolean columns. ANY means
|
||||
/// one true contribution wins; ALL means one false contribution wins.
|
||||
#[prost(enumeration = "BooleanLedgerOperator", tag = "7")]
|
||||
#[serde(default)]
|
||||
pub boolean_ledger_operator: i32,
|
||||
#[serde(default, alias = "boolean_ledger_operator")]
|
||||
pub boolean_ledger: i32,
|
||||
}
|
||||
/// Response after table creation (success + DDL preview).
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
@@ -620,6 +620,9 @@ pub mod list_column_types_response {
|
||||
/// Whether ColumnDefinition.quantity_ledger may be set on this type.
|
||||
#[prost(bool, tag = "8")]
|
||||
pub allows_quantity_ledger: bool,
|
||||
/// Whether ColumnDefinition.boolean_ledger may be set on this type.
|
||||
#[prost(bool, tag = "11")]
|
||||
pub allows_boolean_ledger: bool,
|
||||
/// Optional name grouping several types a client offers behind one choice —
|
||||
/// "temporal" for the date and time types, "gtin" for the GTIN lengths.
|
||||
/// Empty when the type stands on its own.
|
||||
|
||||
Reference in New Issue
Block a user