mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix warnings
This commit is contained in:
parent
64ea2d4f31
commit
463cab6eee
@ -11,7 +11,7 @@ use backend_service::errors::ServerError;
|
||||
use flowy_collaboration::{
|
||||
core::sync::{DocumentPersistence, ServerDocumentManager},
|
||||
entities::{
|
||||
doc::{CreateDocParams, Doc},
|
||||
doc::{CreateDocParams, DocumentInfo},
|
||||
revision::{RepeatedRevision, Revision},
|
||||
},
|
||||
errors::CollaborateError,
|
||||
@ -86,7 +86,7 @@ impl DocumentPersistence for DocumentPersistenceImpl {
|
||||
// })
|
||||
// }
|
||||
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<Doc, CollaborateError> {
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<DocumentInfo, CollaborateError> {
|
||||
let params = DocIdentifier {
|
||||
doc_id: doc_id.to_string(),
|
||||
..Default::default()
|
||||
@ -103,10 +103,10 @@ impl DocumentPersistence for DocumentPersistenceImpl {
|
||||
})
|
||||
}
|
||||
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<Doc, CollaborateError> {
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<DocumentInfo, CollaborateError> {
|
||||
let kv_store = self.0.kv_store();
|
||||
FutureResultSend::new(async move {
|
||||
let doc: Doc = revision.clone().try_into()?;
|
||||
let doc: DocumentInfo = revision.clone().try_into()?;
|
||||
let doc_id = revision.doc_id.clone();
|
||||
let revisions = RepeatedRevision { items: vec![revision] };
|
||||
|
||||
|
@ -1,15 +1,17 @@
|
||||
use crate::{context::FlowyPersistence, services::document::persistence::DocumentKVPersistence};
|
||||
|
||||
use backend_service::errors::{internal_error, ServerError};
|
||||
use flowy_collaboration::protobuf::{CreateDocParams, Doc, DocIdentifier, RepeatedRevision, ResetDocumentParams};
|
||||
use flowy_collaboration::protobuf::{
|
||||
CreateDocParams,
|
||||
DocIdentifier,
|
||||
DocumentInfo,
|
||||
RepeatedRevision,
|
||||
ResetDocumentParams,
|
||||
};
|
||||
use lib_ot::{core::OperationTransformable, rich_text::RichTextDelta};
|
||||
use protobuf::Message;
|
||||
use sqlx::PgPool;
|
||||
use std::sync::Arc;
|
||||
use uuid::Uuid;
|
||||
|
||||
const DOC_TABLE: &str = "doc_table";
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(kv_store), err)]
|
||||
pub(crate) async fn create_doc(
|
||||
kv_store: &Arc<DocumentKVPersistence>,
|
||||
@ -21,7 +23,10 @@ pub(crate) async fn create_doc(
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(persistence), err)]
|
||||
pub(crate) async fn read_doc(persistence: &Arc<FlowyPersistence>, params: DocIdentifier) -> Result<Doc, ServerError> {
|
||||
pub(crate) async fn read_doc(
|
||||
persistence: &Arc<FlowyPersistence>,
|
||||
params: DocIdentifier,
|
||||
) -> Result<DocumentInfo, ServerError> {
|
||||
let _ = Uuid::parse_str(¶ms.doc_id)?;
|
||||
|
||||
let kv_store = persistence.kv_store();
|
||||
@ -37,7 +42,6 @@ pub async fn reset_document(_pool: &PgPool, _params: ResetDocumentParams) -> Res
|
||||
#[tracing::instrument(level = "debug", skip(kv_store), err)]
|
||||
pub(crate) async fn delete_doc(kv_store: &Arc<DocumentKVPersistence>, doc_id: Uuid) -> Result<(), ServerError> {
|
||||
let _ = kv_store.batch_delete_revisions(&doc_id.to_string(), None).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -47,7 +51,7 @@ struct DocTable {
|
||||
rev_id: i64,
|
||||
}
|
||||
|
||||
fn make_doc_from_revisions(doc_id: &str, mut revisions: RepeatedRevision) -> Result<Doc, ServerError> {
|
||||
fn make_doc_from_revisions(doc_id: &str, mut revisions: RepeatedRevision) -> Result<DocumentInfo, ServerError> {
|
||||
let revisions = revisions.take_items();
|
||||
let mut document_delta = RichTextDelta::new();
|
||||
let mut base_rev_id = 0;
|
||||
@ -60,10 +64,10 @@ fn make_doc_from_revisions(doc_id: &str, mut revisions: RepeatedRevision) -> Res
|
||||
document_delta = document_delta.compose(&delta).map_err(internal_error)?;
|
||||
}
|
||||
let text = document_delta.to_json();
|
||||
let mut doc = Doc::new();
|
||||
doc.set_id(doc_id.to_owned());
|
||||
doc.set_text(text);
|
||||
doc.set_base_rev_id(base_rev_id);
|
||||
doc.set_rev_id(rev_id);
|
||||
Ok(doc)
|
||||
let mut document_info = DocumentInfo::new();
|
||||
document_info.set_id(doc_id.to_owned());
|
||||
document_info.set_text(text);
|
||||
document_info.set_base_rev_id(base_rev_id);
|
||||
document_info.set_rev_id(rev_id);
|
||||
Ok(document_info)
|
||||
}
|
||||
|
@ -5,11 +5,9 @@ use flowy_core_data_model::entities::view::ViewIdentifiers;
|
||||
#[actix_rt::test]
|
||||
async fn doc_read() {
|
||||
let test = ViewTest::new().await;
|
||||
|
||||
let params = DocIdentifier {
|
||||
doc_id: test.view.id.clone(),
|
||||
};
|
||||
|
||||
let doc = test.server.read_doc(params).await;
|
||||
assert_eq!(doc.is_some(), true);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ async fn delta_sync_while_editing_with_attribute() {
|
||||
// │ops: ["123", "456"] rev: 2│ │ │
|
||||
// └──────────────────────────┘ │ │
|
||||
// │ │
|
||||
// ◀── http request ─┤ Open document_test
|
||||
// ◀── http request ─┤ Open doc
|
||||
// │ │
|
||||
// │ │ ┌──────────────────────────┐
|
||||
// ├──http response──┼─▶│ops: ["123", "456"] rev: 2│
|
||||
@ -115,7 +115,7 @@ async fn delta_sync_with_server_push_delta() {
|
||||
// └─────────┘ └─────────┘
|
||||
// │ │
|
||||
// │ │
|
||||
// ◀── http request ─┤ Open document_test
|
||||
// ◀── http request ─┤ Open doc
|
||||
// │ │
|
||||
// │ │ ┌───────────────┐
|
||||
// ├──http response──┼─▶│ops: [] rev: 0 │
|
||||
@ -165,7 +165,7 @@ async fn delta_sync_while_local_rev_less_than_server_rev() {
|
||||
// ┌───────────────────┐ │ │
|
||||
// │ops: ["123"] rev: 1│ │ │
|
||||
// └───────────────────┘ │ │
|
||||
// ◀── http request ─┤ Open document_test
|
||||
// ◀── http request ─┤ Open doc
|
||||
// │ │
|
||||
// │ │ ┌───────────────┐
|
||||
// ├──http response──┼──▶│ops: [123] rev:│
|
||||
|
@ -9,7 +9,7 @@ use backend_service::{
|
||||
user_request::*,
|
||||
workspace_request::*,
|
||||
};
|
||||
use flowy_collaboration::entities::doc::{Doc, DocIdentifier};
|
||||
use flowy_collaboration::entities::doc::{DocIdentifier, DocumentInfo};
|
||||
use flowy_core_data_model::entities::prelude::*;
|
||||
use flowy_document::services::server::read_doc_request;
|
||||
use flowy_user_data_model::entities::*;
|
||||
@ -149,8 +149,8 @@ impl TestUserServer {
|
||||
read_trash_request(self.user_token(), &url).await.unwrap()
|
||||
}
|
||||
|
||||
pub async fn read_doc(&self, params: DocIdentifier) -> Option<Doc> {
|
||||
let url = format!("{}/api/document_test", self.http_addr());
|
||||
pub async fn read_doc(&self, params: DocIdentifier) -> Option<DocumentInfo> {
|
||||
let url = format!("{}/api/doc", self.http_addr());
|
||||
let doc = read_doc_request(self.user_token(), params, &url).await.unwrap();
|
||||
doc
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class DocBloc extends Bloc<DocEvent, DocState> {
|
||||
final result = await docManager.readDoc();
|
||||
yield result.fold(
|
||||
(doc) {
|
||||
document = _decodeJsonToDocument(doc.data);
|
||||
document = _decodeJsonToDocument(doc.text);
|
||||
_subscription = document.changes.listen((event) {
|
||||
final delta = event.item2;
|
||||
final documentDelta = document.toDelta();
|
||||
@ -113,7 +113,7 @@ class DocBloc extends Bloc<DocEvent, DocState> {
|
||||
|
||||
result.fold((rustDoc) {
|
||||
// final json = utf8.decode(doc.data);
|
||||
final rustDelta = Delta.fromJson(jsonDecode(rustDoc.data));
|
||||
final rustDelta = Delta.fromJson(jsonDecode(rustDoc.text));
|
||||
if (documentDelta != rustDelta) {
|
||||
Log.error("Receive : $rustDelta");
|
||||
Log.error("Expected : $documentDelta");
|
||||
|
@ -4,7 +4,7 @@ import 'package:flowy_sdk/protobuf/flowy-collaboration/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
|
||||
abstract class IDoc {
|
||||
Future<Either<DocDelta, FlowyError>> readDoc();
|
||||
Future<Either<DocDelta, FlowyError>> composeDelta({required String json});
|
||||
Future<Either<DocumentDelta, FlowyError>> readDoc();
|
||||
Future<Either<DocumentDelta, FlowyError>> composeDelta({required String json});
|
||||
Future<Either<Unit, FlowyError>> closeDoc();
|
||||
}
|
||||
|
@ -18,13 +18,13 @@ class IDocImpl extends IDoc {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<DocDelta, FlowyError>> readDoc() async {
|
||||
Future<Either<DocumentDelta, FlowyError>> readDoc() async {
|
||||
final docOrFail = await repo.readDoc();
|
||||
return docOrFail;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<DocDelta, FlowyError>> composeDelta({required String json}) {
|
||||
Future<Either<DocumentDelta, FlowyError>> composeDelta({required String json}) {
|
||||
return repo.composeDelta(data: json);
|
||||
}
|
||||
}
|
||||
|
@ -10,15 +10,15 @@ class DocRepository {
|
||||
required this.docId,
|
||||
});
|
||||
|
||||
Future<Either<DocDelta, FlowyError>> readDoc() {
|
||||
Future<Either<DocumentDelta, FlowyError>> readDoc() {
|
||||
final request = QueryViewRequest(viewIds: [docId]);
|
||||
return WorkspaceEventOpenView(request).send();
|
||||
}
|
||||
|
||||
Future<Either<DocDelta, FlowyError>> composeDelta({required String data}) {
|
||||
final request = DocDelta.create()
|
||||
Future<Either<DocumentDelta, FlowyError>> composeDelta({required String data}) {
|
||||
final request = DocumentDelta.create()
|
||||
..docId = docId
|
||||
..data = data;
|
||||
..text = data;
|
||||
return WorkspaceEventApplyDocDelta(request).send();
|
||||
}
|
||||
|
||||
|
@ -272,14 +272,14 @@ class WorkspaceEventOpenView {
|
||||
QueryViewRequest request;
|
||||
WorkspaceEventOpenView(this.request);
|
||||
|
||||
Future<Either<DocDelta, FlowyError>> send() {
|
||||
Future<Either<DocumentDelta, FlowyError>> send() {
|
||||
final request = FFIRequest.create()
|
||||
..event = WorkspaceEvent.OpenView.toString()
|
||||
..payload = requestToBytes(this.request);
|
||||
|
||||
return Dispatch.asyncRequest(request)
|
||||
.then((bytesResult) => bytesResult.fold(
|
||||
(okBytes) => left(DocDelta.fromBuffer(okBytes)),
|
||||
(okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
||||
(errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
||||
));
|
||||
}
|
||||
@ -379,17 +379,17 @@ class WorkspaceEventDeleteAll {
|
||||
}
|
||||
|
||||
class WorkspaceEventApplyDocDelta {
|
||||
DocDelta request;
|
||||
DocumentDelta request;
|
||||
WorkspaceEventApplyDocDelta(this.request);
|
||||
|
||||
Future<Either<DocDelta, FlowyError>> send() {
|
||||
Future<Either<DocumentDelta, FlowyError>> send() {
|
||||
final request = FFIRequest.create()
|
||||
..event = WorkspaceEvent.ApplyDocDelta.toString()
|
||||
..payload = requestToBytes(this.request);
|
||||
|
||||
return Dispatch.asyncRequest(request)
|
||||
.then((bytesResult) => bytesResult.fold(
|
||||
(okBytes) => left(DocDelta.fromBuffer(okBytes)),
|
||||
(okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
||||
(errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
||||
));
|
||||
}
|
||||
|
@ -13,11 +13,13 @@ import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'revision.pb.dart' as $0;
|
||||
|
||||
class CreateDocParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateDocParams', createEmptyInstance: create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateDocParams',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions', subBuilder: $0.RepeatedRevision.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions',
|
||||
subBuilder: $0.RepeatedRevision.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
CreateDocParams._() : super();
|
||||
factory CreateDocParams({
|
||||
@ -33,31 +35,38 @@ class CreateDocParams extends $pb.GeneratedMessage {
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory CreateDocParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory CreateDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
factory CreateDocParams.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory CreateDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateDocParams clone() => CreateDocParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateDocParams copyWith(void Function(CreateDocParams) updates) => super.copyWith((message) => updates(message as CreateDocParams)) as CreateDocParams; // ignore: deprecated_member_use
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateDocParams copyWith(void Function(CreateDocParams) updates) =>
|
||||
super.copyWith((message) => updates(message as CreateDocParams))
|
||||
as CreateDocParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateDocParams create() => CreateDocParams._();
|
||||
CreateDocParams createEmptyInstance() => create();
|
||||
static $pb.PbList<CreateDocParams> createRepeated() => $pb.PbList<CreateDocParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateDocParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateDocParams>(create);
|
||||
static CreateDocParams getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateDocParams>(create);
|
||||
static CreateDocParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
set id($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
@ -66,7 +75,10 @@ class CreateDocParams extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision get revisions => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revisions($0.RepeatedRevision v) { setField(2, v); }
|
||||
set revisions($0.RepeatedRevision v) {
|
||||
setField(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevisions() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
@ -75,17 +87,18 @@ class CreateDocParams extends $pb.GeneratedMessage {
|
||||
$0.RepeatedRevision ensureRevisions() => $_ensure(1);
|
||||
}
|
||||
|
||||
class Doc extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Doc', createEmptyInstance: create)
|
||||
class DocumentInfo extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocumentInfo',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'text')
|
||||
..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revId')
|
||||
..aInt64(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'baseRevId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Doc._() : super();
|
||||
factory Doc({
|
||||
DocumentInfo._() : super();
|
||||
factory DocumentInfo({
|
||||
$core.String? id,
|
||||
$core.String? text,
|
||||
$fixnum.Int64? revId,
|
||||
@ -106,31 +119,35 @@ class Doc extends $pb.GeneratedMessage {
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory Doc.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Doc.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Doc clone() => Doc()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Doc copyWith(void Function(Doc) updates) => super.copyWith((message) => updates(message as Doc)) as Doc; // ignore: deprecated_member_use
|
||||
factory DocumentInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory DocumentInfo.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocumentInfo clone() => DocumentInfo()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocumentInfo copyWith(void Function(DocumentInfo) updates) =>
|
||||
super.copyWith((message) => updates(message as DocumentInfo)) as DocumentInfo; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Doc create() => Doc._();
|
||||
Doc createEmptyInstance() => create();
|
||||
static $pb.PbList<Doc> createRepeated() => $pb.PbList<Doc>();
|
||||
static DocumentInfo create() => DocumentInfo._();
|
||||
DocumentInfo createEmptyInstance() => create();
|
||||
static $pb.PbList<DocumentInfo> createRepeated() => $pb.PbList<DocumentInfo>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Doc getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Doc>(create);
|
||||
static Doc? _defaultInstance;
|
||||
static DocumentInfo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DocumentInfo>(create);
|
||||
static DocumentInfo? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
set id($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
@ -139,7 +156,10 @@ class Doc extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get text => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set text($core.String v) { $_setString(1, v); }
|
||||
set text($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasText() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
@ -148,7 +168,10 @@ class Doc extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(3)
|
||||
$fixnum.Int64 get revId => $_getI64(2);
|
||||
@$pb.TagNumber(3)
|
||||
set revId($fixnum.Int64 v) { $_setInt64(2, v); }
|
||||
set revId($fixnum.Int64 v) {
|
||||
$_setInt64(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasRevId() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
@ -157,7 +180,10 @@ class Doc extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(4)
|
||||
$fixnum.Int64 get baseRevId => $_getI64(3);
|
||||
@$pb.TagNumber(4)
|
||||
set baseRevId($fixnum.Int64 v) { $_setInt64(3, v); }
|
||||
set baseRevId($fixnum.Int64 v) {
|
||||
$_setInt64(3, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBaseRevId() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
@ -165,11 +191,13 @@ class Doc extends $pb.GeneratedMessage {
|
||||
}
|
||||
|
||||
class ResetDocumentParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ResetDocumentParams', createEmptyInstance: create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ResetDocumentParams',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions', subBuilder: $0.RepeatedRevision.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions',
|
||||
subBuilder: $0.RepeatedRevision.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
ResetDocumentParams._() : super();
|
||||
factory ResetDocumentParams({
|
||||
@ -185,31 +213,38 @@ class ResetDocumentParams extends $pb.GeneratedMessage {
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory ResetDocumentParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ResetDocumentParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
factory ResetDocumentParams.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory ResetDocumentParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ResetDocumentParams clone() => ResetDocumentParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ResetDocumentParams copyWith(void Function(ResetDocumentParams) updates) => super.copyWith((message) => updates(message as ResetDocumentParams)) as ResetDocumentParams; // ignore: deprecated_member_use
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ResetDocumentParams copyWith(void Function(ResetDocumentParams) updates) =>
|
||||
super.copyWith((message) => updates(message as ResetDocumentParams))
|
||||
as ResetDocumentParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ResetDocumentParams create() => ResetDocumentParams._();
|
||||
ResetDocumentParams createEmptyInstance() => create();
|
||||
static $pb.PbList<ResetDocumentParams> createRepeated() => $pb.PbList<ResetDocumentParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ResetDocumentParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ResetDocumentParams>(create);
|
||||
static ResetDocumentParams getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ResetDocumentParams>(create);
|
||||
static ResetDocumentParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
set docId($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
@ -218,7 +253,10 @@ class ResetDocumentParams extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision get revisions => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revisions($0.RepeatedRevision v) { setField(2, v); }
|
||||
set revisions($0.RepeatedRevision v) {
|
||||
setField(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevisions() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
@ -227,74 +265,83 @@ class ResetDocumentParams extends $pb.GeneratedMessage {
|
||||
$0.RepeatedRevision ensureRevisions() => $_ensure(1);
|
||||
}
|
||||
|
||||
class DocDelta extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocDelta', createEmptyInstance: create)
|
||||
class DocumentDelta extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocumentDelta',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'text')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
DocDelta._() : super();
|
||||
factory DocDelta({
|
||||
DocumentDelta._() : super();
|
||||
factory DocumentDelta({
|
||||
$core.String? docId,
|
||||
$core.String? data,
|
||||
$core.String? text,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (docId != null) {
|
||||
_result.docId = docId;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
if (text != null) {
|
||||
_result.text = text;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory DocDelta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory DocDelta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocDelta clone() => DocDelta()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocDelta copyWith(void Function(DocDelta) updates) => super.copyWith((message) => updates(message as DocDelta)) as DocDelta; // ignore: deprecated_member_use
|
||||
factory DocumentDelta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory DocumentDelta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocumentDelta clone() => DocumentDelta()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocumentDelta copyWith(void Function(DocumentDelta) updates) =>
|
||||
super.copyWith((message) => updates(message as DocumentDelta)) as DocumentDelta; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static DocDelta create() => DocDelta._();
|
||||
DocDelta createEmptyInstance() => create();
|
||||
static $pb.PbList<DocDelta> createRepeated() => $pb.PbList<DocDelta>();
|
||||
static DocumentDelta create() => DocumentDelta._();
|
||||
DocumentDelta createEmptyInstance() => create();
|
||||
static $pb.PbList<DocumentDelta> createRepeated() => $pb.PbList<DocumentDelta>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static DocDelta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DocDelta>(create);
|
||||
static DocDelta? _defaultInstance;
|
||||
static DocumentDelta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DocumentDelta>(create);
|
||||
static DocumentDelta? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
set docId($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearDocId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
$core.String get text => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
set text($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
$core.bool hasText() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
void clearText() => clearField(2);
|
||||
}
|
||||
|
||||
class NewDocUser extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NewDocUser', createEmptyInstance: create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NewDocUser',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId')
|
||||
..aInt64(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revId')
|
||||
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..hasRequiredFields = false;
|
||||
|
||||
NewDocUser._() : super();
|
||||
factory NewDocUser({
|
||||
@ -314,18 +361,19 @@ class NewDocUser extends $pb.GeneratedMessage {
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory NewDocUser.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory NewDocUser.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
factory NewDocUser.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory NewDocUser.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewDocUser clone() => NewDocUser()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewDocUser copyWith(void Function(NewDocUser) updates) => super.copyWith((message) => updates(message as NewDocUser)) as NewDocUser; // ignore: deprecated_member_use
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewDocUser copyWith(void Function(NewDocUser) updates) =>
|
||||
super.copyWith((message) => updates(message as NewDocUser)) as NewDocUser; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewDocUser create() => NewDocUser._();
|
||||
@ -338,7 +386,10 @@ class NewDocUser extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get userId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set userId($core.String v) { $_setString(0, v); }
|
||||
set userId($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasUserId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
@ -347,7 +398,10 @@ class NewDocUser extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(2)
|
||||
$fixnum.Int64 get revId => $_getI64(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revId($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||
set revId($fixnum.Int64 v) {
|
||||
$_setInt64(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevId() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
@ -356,7 +410,10 @@ class NewDocUser extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get docId => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set docId($core.String v) { $_setString(2, v); }
|
||||
set docId($core.String v) {
|
||||
$_setString(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasDocId() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
@ -364,10 +421,11 @@ class NewDocUser extends $pb.GeneratedMessage {
|
||||
}
|
||||
|
||||
class DocIdentifier extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocIdentifier', createEmptyInstance: create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocIdentifier',
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
..hasRequiredFields = false;
|
||||
|
||||
DocIdentifier._() : super();
|
||||
factory DocIdentifier({
|
||||
@ -379,18 +437,19 @@ class DocIdentifier extends $pb.GeneratedMessage {
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory DocIdentifier.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory DocIdentifier.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
factory DocIdentifier.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory DocIdentifier.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocIdentifier clone() => DocIdentifier()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocIdentifier copyWith(void Function(DocIdentifier) updates) => super.copyWith((message) => updates(message as DocIdentifier)) as DocIdentifier; // ignore: deprecated_member_use
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
DocIdentifier copyWith(void Function(DocIdentifier) updates) =>
|
||||
super.copyWith((message) => updates(message as DocIdentifier)) as DocIdentifier; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static DocIdentifier create() => DocIdentifier._();
|
||||
@ -403,10 +462,12 @@ class DocIdentifier extends $pb.GeneratedMessage {
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
set docId($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearDocId() => clearField(1);
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@ const CreateDocParams$json = const {
|
||||
|
||||
/// Descriptor for `CreateDocParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List createDocParamsDescriptor = $convert.base64Decode('Cg9DcmVhdGVEb2NQYXJhbXMSDgoCaWQYASABKAlSAmlkEi8KCXJldmlzaW9ucxgCIAEoCzIRLlJlcGVhdGVkUmV2aXNpb25SCXJldmlzaW9ucw==');
|
||||
@$core.Deprecated('Use docDescriptor instead')
|
||||
const Doc$json = const {
|
||||
'1': 'Doc',
|
||||
@$core.Deprecated('Use documentInfoDescriptor instead')
|
||||
const DocumentInfo$json = const {
|
||||
'1': 'DocumentInfo',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'},
|
||||
@ -30,8 +30,8 @@ const Doc$json = const {
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Doc`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List docDescriptor = $convert.base64Decode('CgNEb2MSDgoCaWQYASABKAlSAmlkEhIKBHRleHQYAiABKAlSBHRleHQSFQoGcmV2X2lkGAMgASgDUgVyZXZJZBIeCgtiYXNlX3Jldl9pZBgEIAEoA1IJYmFzZVJldklk');
|
||||
/// Descriptor for `DocumentInfo`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List documentInfoDescriptor = $convert.base64Decode('CgxEb2N1bWVudEluZm8SDgoCaWQYASABKAlSAmlkEhIKBHRleHQYAiABKAlSBHRleHQSFQoGcmV2X2lkGAMgASgDUgVyZXZJZBIeCgtiYXNlX3Jldl9pZBgEIAEoA1IJYmFzZVJldklk');
|
||||
@$core.Deprecated('Use resetDocumentParamsDescriptor instead')
|
||||
const ResetDocumentParams$json = const {
|
||||
'1': 'ResetDocumentParams',
|
||||
@ -43,17 +43,17 @@ const ResetDocumentParams$json = const {
|
||||
|
||||
/// Descriptor for `ResetDocumentParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List resetDocumentParamsDescriptor = $convert.base64Decode('ChNSZXNldERvY3VtZW50UGFyYW1zEhUKBmRvY19pZBgBIAEoCVIFZG9jSWQSLwoJcmV2aXNpb25zGAIgASgLMhEuUmVwZWF0ZWRSZXZpc2lvblIJcmV2aXNpb25z');
|
||||
@$core.Deprecated('Use docDeltaDescriptor instead')
|
||||
const DocDelta$json = const {
|
||||
'1': 'DocDelta',
|
||||
@$core.Deprecated('Use documentDeltaDescriptor instead')
|
||||
const DocumentDelta$json = const {
|
||||
'1': 'DocumentDelta',
|
||||
'2': const [
|
||||
const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '10': 'data'},
|
||||
const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `DocDelta`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List docDeltaDescriptor = $convert.base64Decode('CghEb2NEZWx0YRIVCgZkb2NfaWQYASABKAlSBWRvY0lkEhIKBGRhdGEYAiABKAlSBGRhdGE=');
|
||||
/// Descriptor for `DocumentDelta`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List documentDeltaDescriptor = $convert.base64Decode('Cg1Eb2N1bWVudERlbHRhEhUKBmRvY19pZBgBIAEoCVIFZG9jSWQSEgoEdGV4dBgCIAEoCVIEdGV4dA==');
|
||||
@$core.Deprecated('Use newDocUserDescriptor instead')
|
||||
const NewDocUser$json = const {
|
||||
'1': 'NewDocUser',
|
||||
|
@ -4,7 +4,7 @@ use chrono::Utc;
|
||||
use lazy_static::lazy_static;
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use flowy_collaboration::{core::document::default::initial_read_me, entities::doc::DocDelta};
|
||||
use flowy_collaboration::{core::document::default::initial_read_me, entities::doc::DocumentDelta};
|
||||
use flowy_core_data_model::user_default;
|
||||
use flowy_net::entities::NetworkType;
|
||||
|
||||
@ -92,9 +92,9 @@ impl CoreContext {
|
||||
for (index, view) in views.into_iter().enumerate() {
|
||||
if index == 0 {
|
||||
let delta = initial_read_me();
|
||||
let doc_delta = DocDelta {
|
||||
let doc_delta = DocumentDelta {
|
||||
doc_id: view.id.clone(),
|
||||
data: delta.to_json(),
|
||||
text: delta.to_json(),
|
||||
};
|
||||
let _ = self.view_controller.apply_doc_delta(doc_delta).await?;
|
||||
self.view_controller.set_latest_view(&view);
|
||||
|
@ -52,7 +52,7 @@ pub enum WorkspaceEvent {
|
||||
#[event()]
|
||||
CopyLink = 206,
|
||||
|
||||
#[event(input = "QueryViewRequest", output = "DocDelta")]
|
||||
#[event(input = "QueryViewRequest", output = "DocumentDelta")]
|
||||
OpenView = 207,
|
||||
|
||||
#[event(input = "QueryViewRequest")]
|
||||
@ -73,7 +73,7 @@ pub enum WorkspaceEvent {
|
||||
#[event()]
|
||||
DeleteAll = 304,
|
||||
|
||||
#[event(input = "DocDelta", output = "DocDelta")]
|
||||
#[event(input = "DocumentDelta", output = "DocumentDelta")]
|
||||
ApplyDocDelta = 400,
|
||||
|
||||
#[event(input = "ExportRequest", output = "ExportData")]
|
||||
|
@ -1,4 +1,4 @@
|
||||
use flowy_collaboration::entities::doc::{DocDelta, DocIdentifier};
|
||||
use flowy_collaboration::entities::doc::{DocIdentifier, DocumentDelta};
|
||||
use flowy_database::SqliteConnection;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
@ -110,7 +110,7 @@ impl ViewController {
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, params), fields(doc_id = %params.doc_id), err)]
|
||||
pub(crate) async fn open_view(&self, params: DocIdentifier) -> Result<DocDelta, FlowyError> {
|
||||
pub(crate) async fn open_view(&self, params: DocIdentifier) -> Result<DocumentDelta, FlowyError> {
|
||||
let doc_id = params.doc_id.clone();
|
||||
let edit_context = self.document.open(params).await?;
|
||||
|
||||
@ -164,7 +164,7 @@ impl ViewController {
|
||||
.await?;
|
||||
|
||||
Ok(ExportData {
|
||||
data: doc.data,
|
||||
data: doc.text,
|
||||
export_type: params.export_type,
|
||||
})
|
||||
}
|
||||
@ -200,7 +200,7 @@ impl ViewController {
|
||||
Ok(updated_view)
|
||||
}
|
||||
|
||||
pub(crate) async fn apply_doc_delta(&self, params: DocDelta) -> Result<DocDelta, FlowyError> {
|
||||
pub(crate) async fn apply_doc_delta(&self, params: DocumentDelta) -> Result<DocumentDelta, FlowyError> {
|
||||
let doc = self.document.apply_doc_delta(params).await?;
|
||||
Ok(doc)
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
||||
errors::FlowyError,
|
||||
services::{TrashController, ViewController},
|
||||
};
|
||||
use flowy_collaboration::entities::doc::DocDelta;
|
||||
use flowy_collaboration::entities::doc::DocumentDelta;
|
||||
use flowy_core_data_model::entities::share::{ExportData, ExportParams, ExportRequest};
|
||||
use lib_dispatch::prelude::{data_result, Data, DataResult, Unit};
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
@ -52,10 +52,10 @@ pub(crate) async fn update_view_handler(
|
||||
}
|
||||
|
||||
pub(crate) async fn apply_doc_delta_handler(
|
||||
data: Data<DocDelta>,
|
||||
data: Data<DocumentDelta>,
|
||||
controller: Unit<Arc<ViewController>>,
|
||||
) -> DataResult<DocDelta, FlowyError> {
|
||||
// let params: DocDelta = data.into_inner().try_into()?;
|
||||
) -> DataResult<DocumentDelta, FlowyError> {
|
||||
// let params: DocumentDelta = data.into_inner().try_into()?;
|
||||
let doc = controller.apply_doc_delta(data.into_inner()).await?;
|
||||
data_result(doc)
|
||||
}
|
||||
@ -83,7 +83,7 @@ pub(crate) async fn delete_view_handler(
|
||||
pub(crate) async fn open_view_handler(
|
||||
data: Data<QueryViewRequest>,
|
||||
controller: Unit<Arc<ViewController>>,
|
||||
) -> DataResult<DocDelta, FlowyError> {
|
||||
) -> DataResult<DocumentDelta, FlowyError> {
|
||||
let params: ViewIdentifier = data.into_inner().try_into()?;
|
||||
let doc = controller.open_view(params.into()).await?;
|
||||
data_result(doc)
|
||||
|
@ -7,7 +7,7 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use backend_service::configuration::ClientServerConfiguration;
|
||||
use flowy_collaboration::entities::doc::{DocDelta, DocIdentifier};
|
||||
use flowy_collaboration::entities::doc::{DocIdentifier, DocumentDelta};
|
||||
use flowy_database::ConnectionPool;
|
||||
use std::sync::Arc;
|
||||
|
||||
@ -58,13 +58,13 @@ impl FlowyDocument {
|
||||
&self,
|
||||
params: DocIdentifier,
|
||||
pool: Arc<ConnectionPool>,
|
||||
) -> Result<DocDelta, FlowyError> {
|
||||
) -> Result<DocumentDelta, FlowyError> {
|
||||
let edit_context = self.doc_ctrl.open(params, pool).await?;
|
||||
let delta = edit_context.delta().await?;
|
||||
Ok(delta)
|
||||
}
|
||||
|
||||
pub async fn apply_doc_delta(&self, params: DocDelta) -> Result<DocDelta, FlowyError> {
|
||||
pub async fn apply_doc_delta(&self, params: DocumentDelta) -> Result<DocumentDelta, FlowyError> {
|
||||
// workaround: compare the rust's delta with flutter's delta. Will be removed
|
||||
// very soon
|
||||
let doc = self
|
||||
|
@ -12,7 +12,7 @@ use crate::{
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::entities::doc::{Doc, DocDelta, DocIdentifier};
|
||||
use flowy_collaboration::entities::doc::{DocIdentifier, DocumentDelta, DocumentInfo};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::FlowyResult;
|
||||
use lib_infra::future::FutureResult;
|
||||
@ -77,16 +77,16 @@ impl DocController {
|
||||
#[tracing::instrument(level = "debug", skip(self, delta, db_pool), fields(doc_id = %delta.doc_id), err)]
|
||||
pub(crate) async fn apply_local_delta(
|
||||
&self,
|
||||
delta: DocDelta,
|
||||
delta: DocumentDelta,
|
||||
db_pool: Arc<ConnectionPool>,
|
||||
) -> Result<DocDelta, FlowyError> {
|
||||
) -> Result<DocumentDelta, FlowyError> {
|
||||
if !self.open_cache.contains(&delta.doc_id) {
|
||||
let doc_identifier: DocIdentifier = delta.doc_id.clone().into();
|
||||
let _ = self.open(doc_identifier, db_pool).await?;
|
||||
}
|
||||
|
||||
let edit_doc_ctx = self.open_cache.get(&delta.doc_id)?;
|
||||
let _ = edit_doc_ctx.composing_local_delta(Bytes::from(delta.data)).await?;
|
||||
let _ = edit_doc_ctx.composing_local_delta(Bytes::from(delta.text)).await?;
|
||||
Ok(edit_doc_ctx.delta().await?)
|
||||
}
|
||||
}
|
||||
@ -128,7 +128,7 @@ struct RevisionServerImpl {
|
||||
|
||||
impl RevisionServer for RevisionServerImpl {
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
fn fetch_document(&self, doc_id: &str) -> FutureResult<Doc, FlowyError> {
|
||||
fn fetch_document(&self, doc_id: &str) -> FutureResult<DocumentInfo, FlowyError> {
|
||||
let params = DocIdentifier {
|
||||
doc_id: doc_id.to_string(),
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
core::document::history::UndoResult,
|
||||
entities::{
|
||||
doc::DocDelta,
|
||||
doc::DocumentDelta,
|
||||
revision::{RevId, RevType, Revision},
|
||||
},
|
||||
errors::CollaborateResult,
|
||||
@ -144,15 +144,15 @@ impl ClientDocEditor {
|
||||
Ok(r)
|
||||
}
|
||||
|
||||
pub async fn delta(&self) -> FlowyResult<DocDelta> {
|
||||
pub async fn delta(&self) -> FlowyResult<DocumentDelta> {
|
||||
let (ret, rx) = oneshot::channel::<CollaborateResult<DocumentMD5>>();
|
||||
let msg = EditorCommand::ReadDoc { ret };
|
||||
let _ = self.editor_cmd_sender.send(msg);
|
||||
let data = rx.await.map_err(internal_error)??;
|
||||
|
||||
Ok(DocDelta {
|
||||
Ok(DocumentDelta {
|
||||
doc_id: self.doc_id.clone(),
|
||||
data,
|
||||
text: data,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ use crate::{errors::FlowyError, services::doc::revision::RevisionCache};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
entities::{
|
||||
doc::Doc,
|
||||
doc::DocumentInfo,
|
||||
revision::{RevState, RevType, Revision, RevisionRange},
|
||||
},
|
||||
util::{md5, RevIdCounter},
|
||||
@ -16,7 +16,7 @@ use lib_ot::{
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait RevisionServer: Send + Sync {
|
||||
fn fetch_document(&self, doc_id: &str) -> FutureResult<Doc, FlowyError>;
|
||||
fn fetch_document(&self, doc_id: &str) -> FutureResult<DocumentInfo, FlowyError>;
|
||||
}
|
||||
|
||||
pub struct RevisionManager {
|
||||
@ -158,7 +158,7 @@ impl RevisionLoader {
|
||||
}
|
||||
}
|
||||
|
||||
fn mk_doc_from_revisions(doc_id: &str, revisions: Vec<Revision>) -> FlowyResult<Doc> {
|
||||
fn mk_doc_from_revisions(doc_id: &str, revisions: Vec<Revision>) -> FlowyResult<DocumentInfo> {
|
||||
let (base_rev_id, rev_id) = revisions.last().unwrap().pair_rev_id();
|
||||
let mut delta = RichTextDelta::new();
|
||||
for (_, revision) in revisions.into_iter().enumerate() {
|
||||
@ -173,7 +173,7 @@ fn mk_doc_from_revisions(doc_id: &str, revisions: Vec<Revision>) -> FlowyResult<
|
||||
}
|
||||
correct_delta_if_need(&mut delta);
|
||||
|
||||
Result::<Doc, FlowyError>::Ok(Doc {
|
||||
Result::<DocumentInfo, FlowyError>::Ok(DocumentInfo {
|
||||
id: doc_id.to_owned(),
|
||||
text: delta.to_json(),
|
||||
rev_id,
|
||||
|
@ -6,7 +6,7 @@ pub use server_api::*;
|
||||
// TODO: ignore mock files in production
|
||||
use crate::errors::FlowyError;
|
||||
use backend_service::configuration::ClientServerConfiguration;
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, Doc, DocIdentifier, ResetDocumentParams};
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, DocIdentifier, DocumentInfo, ResetDocumentParams};
|
||||
use lib_infra::future::FutureResult;
|
||||
pub use server_api_mock::*;
|
||||
use std::sync::Arc;
|
||||
@ -15,7 +15,7 @@ pub(crate) type Server = Arc<dyn DocumentServerAPI + Send + Sync>;
|
||||
pub trait DocumentServerAPI {
|
||||
fn create_doc(&self, token: &str, params: CreateDocParams) -> FutureResult<(), FlowyError>;
|
||||
|
||||
fn read_doc(&self, token: &str, params: DocIdentifier) -> FutureResult<Option<Doc>, FlowyError>;
|
||||
fn read_doc(&self, token: &str, params: DocIdentifier) -> FutureResult<Option<DocumentInfo>, FlowyError>;
|
||||
|
||||
fn update_doc(&self, token: &str, params: ResetDocumentParams) -> FutureResult<(), FlowyError>;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{errors::FlowyError, services::server::DocumentServerAPI};
|
||||
use backend_service::{configuration::*, request::HttpRequestBuilder};
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, Doc, DocIdentifier, ResetDocumentParams};
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, DocIdentifier, DocumentInfo, ResetDocumentParams};
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
pub struct DocServer {
|
||||
@ -18,7 +18,7 @@ impl DocumentServerAPI for DocServer {
|
||||
FutureResult::new(async move { create_doc_request(&token, params, &url).await })
|
||||
}
|
||||
|
||||
fn read_doc(&self, token: &str, params: DocIdentifier) -> FutureResult<Option<Doc>, FlowyError> {
|
||||
fn read_doc(&self, token: &str, params: DocIdentifier) -> FutureResult<Option<DocumentInfo>, FlowyError> {
|
||||
let token = token.to_owned();
|
||||
let url = self.config.doc_url();
|
||||
FutureResult::new(async move { read_doc_request(&token, params, &url).await })
|
||||
@ -45,7 +45,11 @@ pub async fn create_doc_request(token: &str, params: CreateDocParams, url: &str)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn read_doc_request(token: &str, params: DocIdentifier, url: &str) -> Result<Option<Doc>, FlowyError> {
|
||||
pub async fn read_doc_request(
|
||||
token: &str,
|
||||
params: DocIdentifier,
|
||||
url: &str,
|
||||
) -> Result<Option<DocumentInfo>, FlowyError> {
|
||||
let doc = request_builder()
|
||||
.get(&url.to_owned())
|
||||
.header(HEADER_TOKEN, token)
|
||||
|
@ -1,6 +1,6 @@
|
||||
use flowy_collaboration::{
|
||||
core::document::default::initial_delta_string,
|
||||
entities::doc::{CreateDocParams, Doc, DocIdentifier, ResetDocumentParams},
|
||||
entities::doc::{CreateDocParams, DocIdentifier, DocumentInfo, ResetDocumentParams},
|
||||
};
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
@ -13,8 +13,8 @@ impl DocumentServerAPI for DocServerMock {
|
||||
FutureResult::new(async { Ok(()) })
|
||||
}
|
||||
|
||||
fn read_doc(&self, _token: &str, params: DocIdentifier) -> FutureResult<Option<Doc>, FlowyError> {
|
||||
let doc = Doc {
|
||||
fn read_doc(&self, _token: &str, params: DocIdentifier) -> FutureResult<Option<DocumentInfo>, FlowyError> {
|
||||
let doc = DocumentInfo {
|
||||
id: params.doc_id,
|
||||
text: initial_delta_string(),
|
||||
rev_id: 0,
|
||||
|
@ -4,7 +4,7 @@ use dashmap::DashMap;
|
||||
use flowy_collaboration::{
|
||||
core::sync::{DocumentPersistence, RevisionUser, ServerDocumentManager, SyncResponse},
|
||||
entities::{
|
||||
doc::Doc,
|
||||
doc::DocumentInfo,
|
||||
revision::Revision,
|
||||
ws::{DocumentWSData, DocumentWSDataBuilder, DocumentWSDataType, NewDocumentUser},
|
||||
},
|
||||
@ -148,7 +148,7 @@ impl MockDocServer {
|
||||
}
|
||||
|
||||
struct MockDocServerPersistence {
|
||||
inner: Arc<DashMap<String, Doc>>,
|
||||
inner: Arc<DashMap<String, DocumentInfo>>,
|
||||
}
|
||||
|
||||
impl std::default::Default for MockDocServerPersistence {
|
||||
@ -160,11 +160,7 @@ impl std::default::Default for MockDocServerPersistence {
|
||||
}
|
||||
|
||||
impl DocumentPersistence for MockDocServerPersistence {
|
||||
// fn update_doc(&self, _doc_id: &str, _rev_id: i64, _delta: RichTextDelta) ->
|
||||
// FutureResultSend<(), CollaborateError> { unimplemented!()
|
||||
// }
|
||||
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<Doc, CollaborateError> {
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<DocumentInfo, CollaborateError> {
|
||||
let inner = self.inner.clone();
|
||||
let doc_id = doc_id.to_owned();
|
||||
FutureResultSend::new(async move {
|
||||
@ -181,10 +177,10 @@ impl DocumentPersistence for MockDocServerPersistence {
|
||||
})
|
||||
}
|
||||
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<Doc, CollaborateError> {
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<DocumentInfo, CollaborateError> {
|
||||
FutureResultSend::new(async move {
|
||||
let doc: Doc = revision.try_into().unwrap();
|
||||
Ok(doc)
|
||||
let document_info: DocumentInfo = revision.try_into().unwrap();
|
||||
Ok(document_info)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::{fs, path::PathBuf, sync::Arc};
|
||||
|
||||
use flowy_collaboration::entities::doc::Doc;
|
||||
use flowy_collaboration::entities::doc::DocumentInfo;
|
||||
use flowy_core::{
|
||||
entities::{
|
||||
app::*,
|
||||
@ -269,13 +269,13 @@ pub async fn putback_trash(sdk: &FlowySDKTest, id: TrashIdentifier) {
|
||||
.await;
|
||||
}
|
||||
|
||||
pub async fn open_view(sdk: &FlowySDKTest, request: QueryViewRequest) -> Doc {
|
||||
pub async fn open_view(sdk: &FlowySDKTest, request: QueryViewRequest) -> DocumentInfo {
|
||||
CoreModuleEventBuilder::new(sdk.clone())
|
||||
.event(OpenView)
|
||||
.request(request)
|
||||
.async_send()
|
||||
.await
|
||||
.parse::<Doc>()
|
||||
.parse::<DocumentInfo>()
|
||||
}
|
||||
|
||||
pub fn root_dir() -> String {
|
||||
|
@ -3,7 +3,7 @@ use crate::{
|
||||
document::Document,
|
||||
sync::{RevisionSynchronizer, RevisionUser},
|
||||
},
|
||||
entities::{doc::Doc, revision::Revision},
|
||||
entities::{doc::DocumentInfo, revision::Revision},
|
||||
errors::{internal_error, CollaborateError, CollaborateResult},
|
||||
};
|
||||
use async_stream::stream;
|
||||
@ -20,8 +20,8 @@ use tokio::{
|
||||
pub trait DocumentPersistence: Send + Sync {
|
||||
// fn update_doc(&self, doc_id: &str, rev_id: i64, delta: RichTextDelta) ->
|
||||
// FutureResultSend<(), CollaborateError>;
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<Doc, CollaborateError>;
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<Doc, CollaborateError>;
|
||||
fn read_doc(&self, doc_id: &str) -> FutureResultSend<DocumentInfo, CollaborateError>;
|
||||
fn create_doc(&self, revision: Revision) -> FutureResultSend<DocumentInfo, CollaborateError>;
|
||||
}
|
||||
|
||||
pub struct ServerDocumentManager {
|
||||
@ -63,7 +63,7 @@ impl ServerDocumentManager {
|
||||
Ok(handler)
|
||||
}
|
||||
|
||||
async fn cache(&self, doc: Doc) -> Result<Arc<OpenDocHandle>, CollaborateError> {
|
||||
async fn cache(&self, doc: DocumentInfo) -> Result<Arc<OpenDocHandle>, CollaborateError> {
|
||||
let doc_id = doc.id.clone();
|
||||
let handle = spawn_blocking(|| OpenDocHandle::new(doc))
|
||||
.await
|
||||
@ -79,7 +79,7 @@ pub struct OpenDocHandle {
|
||||
}
|
||||
|
||||
impl OpenDocHandle {
|
||||
pub fn new(doc: Doc) -> Result<Self, CollaborateError> {
|
||||
pub fn new(doc: DocumentInfo) -> Result<Self, CollaborateError> {
|
||||
let (sender, receiver) = mpsc::channel(100);
|
||||
let queue = DocCommandQueue::new(receiver, doc)?;
|
||||
tokio::task::spawn(queue.run());
|
||||
@ -137,7 +137,7 @@ struct DocCommandQueue {
|
||||
}
|
||||
|
||||
impl DocCommandQueue {
|
||||
fn new(receiver: mpsc::Receiver<DocCommand>, doc: Doc) -> Result<Self, CollaborateError> {
|
||||
fn new(receiver: mpsc::Receiver<DocCommand>, doc: DocumentInfo) -> Result<Self, CollaborateError> {
|
||||
let edit_doc = Arc::new(ServerDocEditor::new(doc).map_err(internal_error)?);
|
||||
Ok(Self {
|
||||
receiver: Some(receiver),
|
||||
@ -205,7 +205,7 @@ pub struct ServerDocEditor {
|
||||
}
|
||||
|
||||
impl ServerDocEditor {
|
||||
pub fn new(doc: Doc) -> Result<Self, OTError> {
|
||||
pub fn new(doc: DocumentInfo) -> Result<Self, OTError> {
|
||||
let delta = RichTextDelta::from_bytes(&doc.text)?;
|
||||
let users = DashMap::new();
|
||||
let synchronizer = Arc::new(RevisionSynchronizer::new(
|
||||
|
@ -15,7 +15,7 @@ pub struct CreateDocParams {
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Doc {
|
||||
pub struct DocumentInfo {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
|
||||
@ -29,14 +29,14 @@ pub struct Doc {
|
||||
pub base_rev_id: i64,
|
||||
}
|
||||
|
||||
impl Doc {
|
||||
impl DocumentInfo {
|
||||
pub fn delta(&self) -> Result<RichTextDelta, OTError> {
|
||||
let delta = RichTextDelta::from_bytes(&self.text)?;
|
||||
Ok(delta)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom<Revision> for Doc {
|
||||
impl std::convert::TryFrom<Revision> for DocumentInfo {
|
||||
type Error = CollaborateError;
|
||||
|
||||
fn try_from(revision: Revision) -> Result<Self, Self::Error> {
|
||||
@ -48,7 +48,7 @@ impl std::convert::TryFrom<Revision> for Doc {
|
||||
let delta = RichTextDelta::from_bytes(&revision.delta_data)?;
|
||||
let doc_json = delta.to_json();
|
||||
|
||||
Ok(Doc {
|
||||
Ok(DocumentInfo {
|
||||
id: revision.doc_id,
|
||||
text: doc_json,
|
||||
rev_id: revision.rev_id,
|
||||
@ -67,12 +67,12 @@ pub struct ResetDocumentParams {
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct DocDelta {
|
||||
pub struct DocumentDelta {
|
||||
#[pb(index = 1)]
|
||||
pub doc_id: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub data: String, // RichTextDelta
|
||||
pub text: String, // RichTextDelta
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
|
@ -240,7 +240,7 @@ impl ::protobuf::reflect::ProtobufValue for CreateDocParams {
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct Doc {
|
||||
pub struct DocumentInfo {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
pub text: ::std::string::String,
|
||||
@ -251,14 +251,14 @@ pub struct Doc {
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a Doc {
|
||||
fn default() -> &'a Doc {
|
||||
<Doc as ::protobuf::Message>::default_instance()
|
||||
impl<'a> ::std::default::Default for &'a DocumentInfo {
|
||||
fn default() -> &'a DocumentInfo {
|
||||
<DocumentInfo as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl Doc {
|
||||
pub fn new() -> Doc {
|
||||
impl DocumentInfo {
|
||||
pub fn new() -> DocumentInfo {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ impl Doc {
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for Doc {
|
||||
impl ::protobuf::Message for DocumentInfo {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
@ -446,8 +446,8 @@ impl ::protobuf::Message for Doc {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> Doc {
|
||||
Doc::new()
|
||||
fn new() -> DocumentInfo {
|
||||
DocumentInfo::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
@ -456,39 +456,39 @@ impl ::protobuf::Message for Doc {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &Doc| { &m.id },
|
||||
|m: &mut Doc| { &mut m.id },
|
||||
|m: &DocumentInfo| { &m.id },
|
||||
|m: &mut DocumentInfo| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"text",
|
||||
|m: &Doc| { &m.text },
|
||||
|m: &mut Doc| { &mut m.text },
|
||||
|m: &DocumentInfo| { &m.text },
|
||||
|m: &mut DocumentInfo| { &mut m.text },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
|
||||
"rev_id",
|
||||
|m: &Doc| { &m.rev_id },
|
||||
|m: &mut Doc| { &mut m.rev_id },
|
||||
|m: &DocumentInfo| { &m.rev_id },
|
||||
|m: &mut DocumentInfo| { &mut m.rev_id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
|
||||
"base_rev_id",
|
||||
|m: &Doc| { &m.base_rev_id },
|
||||
|m: &mut Doc| { &mut m.base_rev_id },
|
||||
|m: &DocumentInfo| { &m.base_rev_id },
|
||||
|m: &mut DocumentInfo| { &mut m.base_rev_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<Doc>(
|
||||
"Doc",
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<DocumentInfo>(
|
||||
"DocumentInfo",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static Doc {
|
||||
static instance: ::protobuf::rt::LazyV2<Doc> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(Doc::new)
|
||||
fn default_instance() -> &'static DocumentInfo {
|
||||
static instance: ::protobuf::rt::LazyV2<DocumentInfo> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(DocumentInfo::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for Doc {
|
||||
impl ::protobuf::Clear for DocumentInfo {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.text.clear();
|
||||
@ -498,13 +498,13 @@ impl ::protobuf::Clear for Doc {
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for Doc {
|
||||
impl ::std::fmt::Debug for DocumentInfo {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for Doc {
|
||||
impl ::protobuf::reflect::ProtobufValue for DocumentInfo {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
@ -727,23 +727,23 @@ impl ::protobuf::reflect::ProtobufValue for ResetDocumentParams {
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct DocDelta {
|
||||
pub struct DocumentDelta {
|
||||
// message fields
|
||||
pub doc_id: ::std::string::String,
|
||||
pub data: ::std::string::String,
|
||||
pub text: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a DocDelta {
|
||||
fn default() -> &'a DocDelta {
|
||||
<DocDelta as ::protobuf::Message>::default_instance()
|
||||
impl<'a> ::std::default::Default for &'a DocumentDelta {
|
||||
fn default() -> &'a DocumentDelta {
|
||||
<DocumentDelta as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl DocDelta {
|
||||
pub fn new() -> DocDelta {
|
||||
impl DocumentDelta {
|
||||
pub fn new() -> DocumentDelta {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
@ -773,34 +773,34 @@ impl DocDelta {
|
||||
::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
// string text = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
&self.data
|
||||
pub fn get_text(&self) -> &str {
|
||||
&self.text
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.data.clear();
|
||||
pub fn clear_text(&mut self) {
|
||||
self.text.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.data = v;
|
||||
pub fn set_text(&mut self, v: ::std::string::String) {
|
||||
self.text = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.data
|
||||
pub fn mut_text(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.text
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
||||
pub fn take_text(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.text, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for DocDelta {
|
||||
impl ::protobuf::Message for DocumentDelta {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
@ -813,7 +813,7 @@ impl ::protobuf::Message for DocDelta {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
|
||||
},
|
||||
2 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.text)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
@ -830,8 +830,8 @@ impl ::protobuf::Message for DocDelta {
|
||||
if !self.doc_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.doc_id);
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(2, &self.data);
|
||||
if !self.text.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(2, &self.text);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
@ -842,8 +842,8 @@ impl ::protobuf::Message for DocDelta {
|
||||
if !self.doc_id.is_empty() {
|
||||
os.write_string(1, &self.doc_id)?;
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
os.write_string(2, &self.data)?;
|
||||
if !self.text.is_empty() {
|
||||
os.write_string(2, &self.text)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
@ -875,8 +875,8 @@ impl ::protobuf::Message for DocDelta {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> DocDelta {
|
||||
DocDelta::new()
|
||||
fn new() -> DocumentDelta {
|
||||
DocumentDelta::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
@ -885,43 +885,43 @@ impl ::protobuf::Message for DocDelta {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"doc_id",
|
||||
|m: &DocDelta| { &m.doc_id },
|
||||
|m: &mut DocDelta| { &mut m.doc_id },
|
||||
|m: &DocumentDelta| { &m.doc_id },
|
||||
|m: &mut DocumentDelta| { &mut m.doc_id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"data",
|
||||
|m: &DocDelta| { &m.data },
|
||||
|m: &mut DocDelta| { &mut m.data },
|
||||
"text",
|
||||
|m: &DocumentDelta| { &m.text },
|
||||
|m: &mut DocumentDelta| { &mut m.text },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<DocDelta>(
|
||||
"DocDelta",
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<DocumentDelta>(
|
||||
"DocumentDelta",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static DocDelta {
|
||||
static instance: ::protobuf::rt::LazyV2<DocDelta> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(DocDelta::new)
|
||||
fn default_instance() -> &'static DocumentDelta {
|
||||
static instance: ::protobuf::rt::LazyV2<DocumentDelta> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(DocumentDelta::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for DocDelta {
|
||||
impl ::protobuf::Clear for DocumentDelta {
|
||||
fn clear(&mut self) {
|
||||
self.doc_id.clear();
|
||||
self.data.clear();
|
||||
self.text.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for DocDelta {
|
||||
impl ::std::fmt::Debug for DocumentDelta {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for DocDelta {
|
||||
impl ::protobuf::reflect::ProtobufValue for DocumentDelta {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
@ -1325,64 +1325,64 @@ impl ::protobuf::reflect::ProtobufValue for DocIdentifier {
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\tdoc.proto\x1a\x0erevision.proto\"R\n\x0fCreateDocParams\x12\x0e\n\
|
||||
\x02id\x18\x01\x20\x01(\tR\x02id\x12/\n\trevisions\x18\x02\x20\x01(\x0b2\
|
||||
\x11.RepeatedRevisionR\trevisions\"`\n\x03Doc\x12\x0e\n\x02id\x18\x01\
|
||||
\x20\x01(\tR\x02id\x12\x12\n\x04text\x18\x02\x20\x01(\tR\x04text\x12\x15\
|
||||
\n\x06rev_id\x18\x03\x20\x01(\x03R\x05revId\x12\x1e\n\x0bbase_rev_id\x18\
|
||||
\x04\x20\x01(\x03R\tbaseRevId\"]\n\x13ResetDocumentParams\x12\x15\n\x06d\
|
||||
oc_id\x18\x01\x20\x01(\tR\x05docId\x12/\n\trevisions\x18\x02\x20\x01(\
|
||||
\x0b2\x11.RepeatedRevisionR\trevisions\"5\n\x08DocDelta\x12\x15\n\x06doc\
|
||||
_id\x18\x01\x20\x01(\tR\x05docId\x12\x12\n\x04data\x18\x02\x20\x01(\tR\
|
||||
\x04data\"S\n\nNewDocUser\x12\x17\n\x07user_id\x18\x01\x20\x01(\tR\x06us\
|
||||
erId\x12\x15\n\x06rev_id\x18\x02\x20\x01(\x03R\x05revId\x12\x15\n\x06doc\
|
||||
_id\x18\x03\x20\x01(\tR\x05docId\"&\n\rDocIdentifier\x12\x15\n\x06doc_id\
|
||||
\x18\x01\x20\x01(\tR\x05docIdJ\xaf\x07\n\x06\x12\x04\0\0\x1c\x01\n\x08\n\
|
||||
\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x18\n\n\n\x02\x04\
|
||||
\0\x12\x04\x03\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x03\x08\x17\n\x0b\n\
|
||||
\x04\x04\0\x02\0\x12\x03\x04\x04\x12\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\
|
||||
\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\x0b\r\n\x0c\n\x05\x04\
|
||||
\0\x02\0\x03\x12\x03\x04\x10\x11\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x05\
|
||||
\x04#\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x05\x04\x14\n\x0c\n\x05\x04\
|
||||
\0\x02\x01\x01\x12\x03\x05\x15\x1e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
|
||||
\x05!\"\n\n\n\x02\x04\x01\x12\x04\x07\0\x0c\x01\n\n\n\x03\x04\x01\x01\
|
||||
\x12\x03\x07\x08\x0b\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x08\x04\x12\n\x0c\
|
||||
\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\
|
||||
\x12\x03\x08\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x08\x10\x11\n\
|
||||
\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\x14\n\x0c\n\x05\x04\x01\x02\x01\
|
||||
\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\t\x0b\x0f\n\
|
||||
\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x12\x13\n\x0b\n\x04\x04\x01\x02\
|
||||
\x02\x12\x03\n\x04\x15\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\n\x04\t\n\
|
||||
\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\n\x10\n\x0c\n\x05\x04\x01\x02\
|
||||
\x02\x03\x12\x03\n\x13\x14\n\x0b\n\x04\x04\x01\x02\x03\x12\x03\x0b\x04\
|
||||
\x1a\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x0b\x04\t\n\x0c\n\x05\x04\
|
||||
\x01\x02\x03\x01\x12\x03\x0b\n\x15\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\
|
||||
\x03\x0b\x18\x19\n\n\n\x02\x04\x02\x12\x04\r\0\x10\x01\n\n\n\x03\x04\x02\
|
||||
\x01\x12\x03\r\x08\x1b\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0e\x04\x16\n\
|
||||
\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\x04\x02\x02\0\
|
||||
\x01\x12\x03\x0e\x0b\x11\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0e\x14\
|
||||
\x15\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0f\x04#\n\x0c\n\x05\x04\x02\
|
||||
\x02\x01\x06\x12\x03\x0f\x04\x14\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\
|
||||
\x0f\x15\x1e\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x0f!\"\n\n\n\x02\
|
||||
\x04\x03\x12\x04\x11\0\x14\x01\n\n\n\x03\x04\x03\x01\x12\x03\x11\x08\x10\
|
||||
\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x12\x04\x16\n\x0c\n\x05\x04\x03\x02\0\
|
||||
\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x12\x0b\x11\
|
||||
\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\x14\x15\n\x0b\n\x04\x04\x03\
|
||||
\x02\x01\x12\x03\x13\x04\x14\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03\x13\
|
||||
\x04\n\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x03\x13\x0b\x0f\n\x0c\n\x05\
|
||||
\x04\x03\x02\x01\x03\x12\x03\x13\x12\x13\n\n\n\x02\x04\x04\x12\x04\x15\0\
|
||||
\x19\x01\n\n\n\x03\x04\x04\x01\x12\x03\x15\x08\x12\n\x0b\n\x04\x04\x04\
|
||||
\x02\0\x12\x03\x16\x04\x17\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03\x16\x04\
|
||||
\n\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03\x16\x0b\x12\n\x0c\n\x05\x04\x04\
|
||||
\x02\0\x03\x12\x03\x16\x15\x16\n\x0b\n\x04\x04\x04\x02\x01\x12\x03\x17\
|
||||
\x04\x15\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03\x17\x04\t\n\x0c\n\x05\
|
||||
\x04\x04\x02\x01\x01\x12\x03\x17\n\x10\n\x0c\n\x05\x04\x04\x02\x01\x03\
|
||||
\x12\x03\x17\x13\x14\n\x0b\n\x04\x04\x04\x02\x02\x12\x03\x18\x04\x16\n\
|
||||
\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03\x18\x04\n\n\x0c\n\x05\x04\x04\x02\
|
||||
\x02\x01\x12\x03\x18\x0b\x11\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03\x18\
|
||||
\x14\x15\n\n\n\x02\x04\x05\x12\x04\x1a\0\x1c\x01\n\n\n\x03\x04\x05\x01\
|
||||
\x12\x03\x1a\x08\x15\n\x0b\n\x04\x04\x05\x02\0\x12\x03\x1b\x04\x16\n\x0c\
|
||||
\n\x05\x04\x05\x02\0\x05\x12\x03\x1b\x04\n\n\x0c\n\x05\x04\x05\x02\0\x01\
|
||||
\x12\x03\x1b\x0b\x11\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03\x1b\x14\x15b\
|
||||
\x06proto3\
|
||||
\x11.RepeatedRevisionR\trevisions\"i\n\x0cDocumentInfo\x12\x0e\n\x02id\
|
||||
\x18\x01\x20\x01(\tR\x02id\x12\x12\n\x04text\x18\x02\x20\x01(\tR\x04text\
|
||||
\x12\x15\n\x06rev_id\x18\x03\x20\x01(\x03R\x05revId\x12\x1e\n\x0bbase_re\
|
||||
v_id\x18\x04\x20\x01(\x03R\tbaseRevId\"]\n\x13ResetDocumentParams\x12\
|
||||
\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docId\x12/\n\trevisions\x18\x02\
|
||||
\x20\x01(\x0b2\x11.RepeatedRevisionR\trevisions\":\n\rDocumentDelta\x12\
|
||||
\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docId\x12\x12\n\x04text\x18\x02\
|
||||
\x20\x01(\tR\x04text\"S\n\nNewDocUser\x12\x17\n\x07user_id\x18\x01\x20\
|
||||
\x01(\tR\x06userId\x12\x15\n\x06rev_id\x18\x02\x20\x01(\x03R\x05revId\
|
||||
\x12\x15\n\x06doc_id\x18\x03\x20\x01(\tR\x05docId\"&\n\rDocIdentifier\
|
||||
\x12\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docIdJ\xaf\x07\n\x06\x12\x04\
|
||||
\0\0\x1c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\
|
||||
\0\x18\n\n\n\x02\x04\0\x12\x04\x03\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\
|
||||
\x03\x08\x17\n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x12\n\x0c\n\x05\x04\
|
||||
\0\x02\0\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\
|
||||
\x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x04\x10\x11\n\x0b\n\x04\x04\0\
|
||||
\x02\x01\x12\x03\x05\x04#\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x05\x04\
|
||||
\x14\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x05\x15\x1e\n\x0c\n\x05\x04\0\
|
||||
\x02\x01\x03\x12\x03\x05!\"\n\n\n\x02\x04\x01\x12\x04\x07\0\x0c\x01\n\n\
|
||||
\n\x03\x04\x01\x01\x12\x03\x07\x08\x14\n\x0b\n\x04\x04\x01\x02\0\x12\x03\
|
||||
\x08\x04\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\
|
||||
\x04\x01\x02\0\x01\x12\x03\x08\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\
|
||||
\x03\x08\x10\x11\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\x14\n\x0c\n\
|
||||
\x05\x04\x01\x02\x01\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\
|
||||
\x12\x03\t\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x12\x13\n\
|
||||
\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x04\x15\n\x0c\n\x05\x04\x01\x02\x02\
|
||||
\x05\x12\x03\n\x04\t\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\n\x10\n\
|
||||
\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x13\x14\n\x0b\n\x04\x04\x01\x02\
|
||||
\x03\x12\x03\x0b\x04\x1a\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x0b\x04\
|
||||
\t\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x0b\n\x15\n\x0c\n\x05\x04\x01\
|
||||
\x02\x03\x03\x12\x03\x0b\x18\x19\n\n\n\x02\x04\x02\x12\x04\r\0\x10\x01\n\
|
||||
\n\n\x03\x04\x02\x01\x12\x03\r\x08\x1b\n\x0b\n\x04\x04\x02\x02\0\x12\x03\
|
||||
\x0e\x04\x16\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\
|
||||
\x04\x02\x02\0\x01\x12\x03\x0e\x0b\x11\n\x0c\n\x05\x04\x02\x02\0\x03\x12\
|
||||
\x03\x0e\x14\x15\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0f\x04#\n\x0c\n\
|
||||
\x05\x04\x02\x02\x01\x06\x12\x03\x0f\x04\x14\n\x0c\n\x05\x04\x02\x02\x01\
|
||||
\x01\x12\x03\x0f\x15\x1e\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x0f!\"\
|
||||
\n\n\n\x02\x04\x03\x12\x04\x11\0\x14\x01\n\n\n\x03\x04\x03\x01\x12\x03\
|
||||
\x11\x08\x15\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x12\x04\x16\n\x0c\n\x05\
|
||||
\x04\x03\x02\0\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\
|
||||
\x03\x12\x0b\x11\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\x14\x15\n\x0b\
|
||||
\n\x04\x04\x03\x02\x01\x12\x03\x13\x04\x14\n\x0c\n\x05\x04\x03\x02\x01\
|
||||
\x05\x12\x03\x13\x04\n\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x03\x13\x0b\
|
||||
\x0f\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x13\x12\x13\n\n\n\x02\x04\
|
||||
\x04\x12\x04\x15\0\x19\x01\n\n\n\x03\x04\x04\x01\x12\x03\x15\x08\x12\n\
|
||||
\x0b\n\x04\x04\x04\x02\0\x12\x03\x16\x04\x17\n\x0c\n\x05\x04\x04\x02\0\
|
||||
\x05\x12\x03\x16\x04\n\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03\x16\x0b\x12\
|
||||
\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03\x16\x15\x16\n\x0b\n\x04\x04\x04\
|
||||
\x02\x01\x12\x03\x17\x04\x15\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03\x17\
|
||||
\x04\t\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03\x17\n\x10\n\x0c\n\x05\x04\
|
||||
\x04\x02\x01\x03\x12\x03\x17\x13\x14\n\x0b\n\x04\x04\x04\x02\x02\x12\x03\
|
||||
\x18\x04\x16\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03\x18\x04\n\n\x0c\n\
|
||||
\x05\x04\x04\x02\x02\x01\x12\x03\x18\x0b\x11\n\x0c\n\x05\x04\x04\x02\x02\
|
||||
\x03\x12\x03\x18\x14\x15\n\n\n\x02\x04\x05\x12\x04\x1a\0\x1c\x01\n\n\n\
|
||||
\x03\x04\x05\x01\x12\x03\x1a\x08\x15\n\x0b\n\x04\x04\x05\x02\0\x12\x03\
|
||||
\x1b\x04\x16\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03\x1b\x04\n\n\x0c\n\x05\
|
||||
\x04\x05\x02\0\x01\x12\x03\x1b\x0b\x11\n\x0c\n\x05\x04\x05\x02\0\x03\x12\
|
||||
\x03\x1b\x14\x15b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -5,7 +5,7 @@ message CreateDocParams {
|
||||
string id = 1;
|
||||
RepeatedRevision revisions = 2;
|
||||
}
|
||||
message Doc {
|
||||
message DocumentInfo {
|
||||
string id = 1;
|
||||
string text = 2;
|
||||
int64 rev_id = 3;
|
||||
@ -15,9 +15,9 @@ message ResetDocumentParams {
|
||||
string doc_id = 1;
|
||||
RepeatedRevision revisions = 2;
|
||||
}
|
||||
message DocDelta {
|
||||
message DocumentDelta {
|
||||
string doc_id = 1;
|
||||
string data = 2;
|
||||
string text = 2;
|
||||
}
|
||||
message NewDocUser {
|
||||
string user_id = 1;
|
||||
|
@ -92,14 +92,14 @@ impl TryInto<UpdateViewParams> for UpdateViewRequest {
|
||||
// pub data: String,
|
||||
// }
|
||||
//
|
||||
// impl TryInto<DocDelta> for DocDeltaRequest {
|
||||
// impl TryInto<DocumentDelta> for DocDeltaRequest {
|
||||
// type Error = FlowyError;
|
||||
//
|
||||
// fn try_into(self) -> Result<DocDelta, Self::Error> {
|
||||
// fn try_into(self) -> Result<DocumentDelta, Self::Error> {
|
||||
// let view_id = ViewId::parse(self.view_id)
|
||||
// .map_err(|e| FlowyError::view_id().context(e))?
|
||||
// .0;
|
||||
//
|
||||
// Ok(DocDelta { doc_id: view_id, data: self.data })
|
||||
// Ok(DocumentDelta { doc_id: view_id, data: self.data })
|
||||
// }
|
||||
// }
|
||||
|
@ -32,9 +32,9 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
|
||||
| "UpdateUserRequest"
|
||||
| "UpdateUserParams"
|
||||
| "CreateDocParams"
|
||||
| "Doc"
|
||||
| "DocumentInfo"
|
||||
| "ResetDocumentParams"
|
||||
| "DocDelta"
|
||||
| "DocumentDelta"
|
||||
| "NewDocUser"
|
||||
| "DocIdentifier"
|
||||
| "Revision"
|
||||
|
Loading…
Reference in New Issue
Block a user