mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: rename crates
This commit is contained in:
parent
b1d87d95cf
commit
6a3820253f
@ -1,21 +1,22 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/document_info.pb.dart';
|
||||
|
||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-sync/text_block_info.pb.dart';
|
||||
|
||||
class DocumentService {
|
||||
Future<Either<BlockDelta, FlowyError>> openDocument({
|
||||
Future<Either<TextBlockDelta, FlowyError>> openDocument({
|
||||
required String docId,
|
||||
}) async {
|
||||
await FolderEventSetLatestView(ViewId(value: docId)).send();
|
||||
|
||||
final payload = BlockId(value: docId);
|
||||
final payload = TextBlockId(value: docId);
|
||||
return BlockEventGetBlockData(payload).send();
|
||||
}
|
||||
|
||||
Future<Either<BlockDelta, FlowyError>> composeDelta({required String docId, required String data}) {
|
||||
final payload = BlockDelta.create()
|
||||
Future<Either<TextBlockDelta, FlowyError>> composeDelta({required String docId, required String data}) {
|
||||
final payload = TextBlockDelta.create()
|
||||
..blockId = docId
|
||||
..deltaStr = data;
|
||||
return BlockEventApplyDelta(payload).send();
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:app_flowy/workspace/application/doc/share_service.dart';
|
||||
import 'package:app_flowy/workspace/application/markdown/delta_markdown.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-block/entities.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
@ -2,7 +2,7 @@ import 'dart:async';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-block/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart';
|
||||
|
||||
class ShareService {
|
||||
Future<Either<ExportData, FlowyError>> export(String docId, ExportType type) {
|
||||
|
@ -21,7 +21,7 @@ import 'package:flowy_infra/theme.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/widget/rounded_button.dart';
|
||||
import 'package:flowy_sdk/log.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-block/entities.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -2,34 +2,34 @@
|
||||
/// Auto generate. Do not edit
|
||||
part of '../../dispatch.dart';
|
||||
class BlockEventGetBlockData {
|
||||
BlockId request;
|
||||
TextBlockId request;
|
||||
BlockEventGetBlockData(this.request);
|
||||
|
||||
Future<Either<BlockDelta, FlowyError>> send() {
|
||||
Future<Either<TextBlockDelta, FlowyError>> send() {
|
||||
final request = FFIRequest.create()
|
||||
..event = BlockEvent.GetBlockData.toString()
|
||||
..payload = requestToBytes(this.request);
|
||||
|
||||
return Dispatch.asyncRequest(request)
|
||||
.then((bytesResult) => bytesResult.fold(
|
||||
(okBytes) => left(BlockDelta.fromBuffer(okBytes)),
|
||||
(okBytes) => left(TextBlockDelta.fromBuffer(okBytes)),
|
||||
(errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class BlockEventApplyDelta {
|
||||
BlockDelta request;
|
||||
TextBlockDelta request;
|
||||
BlockEventApplyDelta(this.request);
|
||||
|
||||
Future<Either<BlockDelta, FlowyError>> send() {
|
||||
Future<Either<TextBlockDelta, FlowyError>> send() {
|
||||
final request = FFIRequest.create()
|
||||
..event = BlockEvent.ApplyDelta.toString()
|
||||
..payload = requestToBytes(this.request);
|
||||
|
||||
return Dispatch.asyncRequest(request)
|
||||
.then((bytesResult) => bytesResult.fold(
|
||||
(okBytes) => left(BlockDelta.fromBuffer(okBytes)),
|
||||
(okBytes) => left(TextBlockDelta.fromBuffer(okBytes)),
|
||||
(errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
||||
));
|
||||
}
|
@ -3,7 +3,6 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/log.dart';
|
||||
// ignore: unnecessary_import
|
||||
import 'package:flowy_sdk/protobuf/dart-ffi/ffi_response.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/document_info.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-net/event.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-net/network_state.pb.dart';
|
||||
@ -21,8 +20,9 @@ import 'package:flowy_sdk/ffi.dart' as ffi;
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/dart-ffi/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-block/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-sync/protobuf.dart';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
@ -33,7 +33,7 @@ part 'dart_event/flowy-folder/dart_event.dart';
|
||||
part 'dart_event/flowy-net/dart_event.dart';
|
||||
part 'dart_event/flowy-user/dart_event.dart';
|
||||
part 'dart_event/flowy-grid/dart_event.dart';
|
||||
part 'dart_event/flowy-block/dart_event.dart';
|
||||
part 'dart_event/flowy-text-block/dart_event.dart';
|
||||
|
||||
enum FFIException {
|
||||
RequestIsEmpty,
|
||||
|
@ -1,412 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: document_info.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'revision.pb.dart' as $0;
|
||||
|
||||
class CreateBlockParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateBlockParams', 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
|
||||
;
|
||||
|
||||
CreateBlockParams._() : super();
|
||||
factory CreateBlockParams({
|
||||
$core.String? id,
|
||||
$0.RepeatedRevision? revisions,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (id != null) {
|
||||
_result.id = id;
|
||||
}
|
||||
if (revisions != null) {
|
||||
_result.revisions = revisions;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory CreateBlockParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory CreateBlockParams.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')
|
||||
CreateBlockParams clone() => CreateBlockParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateBlockParams copyWith(void Function(CreateBlockParams) updates) => super.copyWith((message) => updates(message as CreateBlockParams)) as CreateBlockParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateBlockParams create() => CreateBlockParams._();
|
||||
CreateBlockParams createEmptyInstance() => create();
|
||||
static $pb.PbList<CreateBlockParams> createRepeated() => $pb.PbList<CreateBlockParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateBlockParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateBlockParams>(create);
|
||||
static CreateBlockParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision get revisions => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revisions($0.RepeatedRevision v) { setField(2, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevisions() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearRevisions() => clearField(2);
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision ensureRevisions() => $_ensure(1);
|
||||
}
|
||||
|
||||
class BlockInfo extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockInfo', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId')
|
||||
..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
|
||||
;
|
||||
|
||||
BlockInfo._() : super();
|
||||
factory BlockInfo({
|
||||
$core.String? blockId,
|
||||
$core.String? text,
|
||||
$fixnum.Int64? revId,
|
||||
$fixnum.Int64? baseRevId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (blockId != null) {
|
||||
_result.blockId = blockId;
|
||||
}
|
||||
if (text != null) {
|
||||
_result.text = text;
|
||||
}
|
||||
if (revId != null) {
|
||||
_result.revId = revId;
|
||||
}
|
||||
if (baseRevId != null) {
|
||||
_result.baseRevId = baseRevId;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory BlockInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory BlockInfo.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')
|
||||
BlockInfo clone() => BlockInfo()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
BlockInfo copyWith(void Function(BlockInfo) updates) => super.copyWith((message) => updates(message as BlockInfo)) as BlockInfo; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockInfo create() => BlockInfo._();
|
||||
BlockInfo createEmptyInstance() => create();
|
||||
static $pb.PbList<BlockInfo> createRepeated() => $pb.PbList<BlockInfo>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockInfo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<BlockInfo>(create);
|
||||
static BlockInfo? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get blockId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set blockId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasBlockId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearBlockId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get text => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set text($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasText() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearText() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$fixnum.Int64 get revId => $_getI64(2);
|
||||
@$pb.TagNumber(3)
|
||||
set revId($fixnum.Int64 v) { $_setInt64(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasRevId() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearRevId() => clearField(3);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$fixnum.Int64 get baseRevId => $_getI64(3);
|
||||
@$pb.TagNumber(4)
|
||||
set baseRevId($fixnum.Int64 v) { $_setInt64(3, v); }
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBaseRevId() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearBaseRevId() => clearField(4);
|
||||
}
|
||||
|
||||
class ResetBlockParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ResetBlockParams', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId')
|
||||
..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions', subBuilder: $0.RepeatedRevision.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
ResetBlockParams._() : super();
|
||||
factory ResetBlockParams({
|
||||
$core.String? blockId,
|
||||
$0.RepeatedRevision? revisions,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (blockId != null) {
|
||||
_result.blockId = blockId;
|
||||
}
|
||||
if (revisions != null) {
|
||||
_result.revisions = revisions;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory ResetBlockParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ResetBlockParams.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')
|
||||
ResetBlockParams clone() => ResetBlockParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ResetBlockParams copyWith(void Function(ResetBlockParams) updates) => super.copyWith((message) => updates(message as ResetBlockParams)) as ResetBlockParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ResetBlockParams create() => ResetBlockParams._();
|
||||
ResetBlockParams createEmptyInstance() => create();
|
||||
static $pb.PbList<ResetBlockParams> createRepeated() => $pb.PbList<ResetBlockParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ResetBlockParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ResetBlockParams>(create);
|
||||
static ResetBlockParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get blockId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set blockId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasBlockId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearBlockId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision get revisions => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revisions($0.RepeatedRevision v) { setField(2, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevisions() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearRevisions() => clearField(2);
|
||||
@$pb.TagNumber(2)
|
||||
$0.RepeatedRevision ensureRevisions() => $_ensure(1);
|
||||
}
|
||||
|
||||
class BlockDelta extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockDelta', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deltaStr')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
BlockDelta._() : super();
|
||||
factory BlockDelta({
|
||||
$core.String? blockId,
|
||||
$core.String? deltaStr,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (blockId != null) {
|
||||
_result.blockId = blockId;
|
||||
}
|
||||
if (deltaStr != null) {
|
||||
_result.deltaStr = deltaStr;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory BlockDelta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory BlockDelta.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')
|
||||
BlockDelta clone() => BlockDelta()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
BlockDelta copyWith(void Function(BlockDelta) updates) => super.copyWith((message) => updates(message as BlockDelta)) as BlockDelta; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockDelta create() => BlockDelta._();
|
||||
BlockDelta createEmptyInstance() => create();
|
||||
static $pb.PbList<BlockDelta> createRepeated() => $pb.PbList<BlockDelta>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockDelta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<BlockDelta>(create);
|
||||
static BlockDelta? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get blockId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set blockId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasBlockId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearBlockId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get deltaStr => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set deltaStr($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasDeltaStr() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearDeltaStr() => 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)
|
||||
..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
|
||||
;
|
||||
|
||||
NewDocUser._() : super();
|
||||
factory NewDocUser({
|
||||
$core.String? userId,
|
||||
$fixnum.Int64? revId,
|
||||
$core.String? docId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (userId != null) {
|
||||
_result.userId = userId;
|
||||
}
|
||||
if (revId != null) {
|
||||
_result.revId = revId;
|
||||
}
|
||||
if (docId != null) {
|
||||
_result.docId = docId;
|
||||
}
|
||||
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')
|
||||
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
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewDocUser create() => NewDocUser._();
|
||||
NewDocUser createEmptyInstance() => create();
|
||||
static $pb.PbList<NewDocUser> createRepeated() => $pb.PbList<NewDocUser>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewDocUser getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<NewDocUser>(create);
|
||||
static NewDocUser? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get userId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set userId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasUserId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearUserId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$fixnum.Int64 get revId => $_getI64(1);
|
||||
@$pb.TagNumber(2)
|
||||
set revId($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRevId() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearRevId() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get docId => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set docId($core.String v) { $_setString(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasDocId() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearDocId() => clearField(3);
|
||||
}
|
||||
|
||||
class BlockId extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockId', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
BlockId._() : super();
|
||||
factory BlockId({
|
||||
$core.String? value,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (value != null) {
|
||||
_result.value = value;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory BlockId.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory BlockId.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')
|
||||
BlockId clone() => BlockId()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
BlockId copyWith(void Function(BlockId) updates) => super.copyWith((message) => updates(message as BlockId)) as BlockId; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockId create() => BlockId._();
|
||||
BlockId createEmptyInstance() => create();
|
||||
static $pb.PbList<BlockId> createRepeated() => $pb.PbList<BlockId>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static BlockId getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<BlockId>(create);
|
||||
static BlockId? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get value => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set value($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearValue() => clearField(1);
|
||||
}
|
||||
|
@ -1,78 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: document_info.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use createBlockParamsDescriptor instead')
|
||||
const CreateBlockParams$json = const {
|
||||
'1': 'CreateBlockParams',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'revisions', '3': 2, '4': 1, '5': 11, '6': '.RepeatedRevision', '10': 'revisions'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `CreateBlockParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List createBlockParamsDescriptor = $convert.base64Decode('ChFDcmVhdGVCbG9ja1BhcmFtcxIOCgJpZBgBIAEoCVICaWQSLwoJcmV2aXNpb25zGAIgASgLMhEuUmVwZWF0ZWRSZXZpc2lvblIJcmV2aXNpb25z');
|
||||
@$core.Deprecated('Use blockInfoDescriptor instead')
|
||||
const BlockInfo$json = const {
|
||||
'1': 'BlockInfo',
|
||||
'2': const [
|
||||
const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'},
|
||||
const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'},
|
||||
const {'1': 'rev_id', '3': 3, '4': 1, '5': 3, '10': 'revId'},
|
||||
const {'1': 'base_rev_id', '3': 4, '4': 1, '5': 3, '10': 'baseRevId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `BlockInfo`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List blockInfoDescriptor = $convert.base64Decode('CglCbG9ja0luZm8SGQoIYmxvY2tfaWQYASABKAlSB2Jsb2NrSWQSEgoEdGV4dBgCIAEoCVIEdGV4dBIVCgZyZXZfaWQYAyABKANSBXJldklkEh4KC2Jhc2VfcmV2X2lkGAQgASgDUgliYXNlUmV2SWQ=');
|
||||
@$core.Deprecated('Use resetBlockParamsDescriptor instead')
|
||||
const ResetBlockParams$json = const {
|
||||
'1': 'ResetBlockParams',
|
||||
'2': const [
|
||||
const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'},
|
||||
const {'1': 'revisions', '3': 2, '4': 1, '5': 11, '6': '.RepeatedRevision', '10': 'revisions'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ResetBlockParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List resetBlockParamsDescriptor = $convert.base64Decode('ChBSZXNldEJsb2NrUGFyYW1zEhkKCGJsb2NrX2lkGAEgASgJUgdibG9ja0lkEi8KCXJldmlzaW9ucxgCIAEoCzIRLlJlcGVhdGVkUmV2aXNpb25SCXJldmlzaW9ucw==');
|
||||
@$core.Deprecated('Use blockDeltaDescriptor instead')
|
||||
const BlockDelta$json = const {
|
||||
'1': 'BlockDelta',
|
||||
'2': const [
|
||||
const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'},
|
||||
const {'1': 'delta_str', '3': 2, '4': 1, '5': 9, '10': 'deltaStr'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `BlockDelta`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List blockDeltaDescriptor = $convert.base64Decode('CgpCbG9ja0RlbHRhEhkKCGJsb2NrX2lkGAEgASgJUgdibG9ja0lkEhsKCWRlbHRhX3N0chgCIAEoCVIIZGVsdGFTdHI=');
|
||||
@$core.Deprecated('Use newDocUserDescriptor instead')
|
||||
const NewDocUser$json = const {
|
||||
'1': 'NewDocUser',
|
||||
'2': const [
|
||||
const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '10': 'userId'},
|
||||
const {'1': 'rev_id', '3': 2, '4': 1, '5': 3, '10': 'revId'},
|
||||
const {'1': 'doc_id', '3': 3, '4': 1, '5': 9, '10': 'docId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NewDocUser`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List newDocUserDescriptor = $convert.base64Decode('CgpOZXdEb2NVc2VyEhcKB3VzZXJfaWQYASABKAlSBnVzZXJJZBIVCgZyZXZfaWQYAiABKANSBXJldklkEhUKBmRvY19pZBgDIAEoCVIFZG9jSWQ=');
|
||||
@$core.Deprecated('Use blockIdDescriptor instead')
|
||||
const BlockId$json = const {
|
||||
'1': 'BlockId',
|
||||
'2': const [
|
||||
const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `BlockId`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List blockIdDescriptor = $convert.base64Decode('CgdCbG9ja0lkEhQKBXZhbHVlGAEgASgJUgV2YWx1ZQ==');
|
@ -0,0 +1,137 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: entities.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'entities.pbenum.dart';
|
||||
|
||||
export 'entities.pbenum.dart';
|
||||
|
||||
class ExportPayload extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportPayload', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
||||
..e<ExportType>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'exportType', $pb.PbFieldType.OE, defaultOrMaker: ExportType.Text, valueOf: ExportType.valueOf, enumValues: ExportType.values)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
ExportPayload._() : super();
|
||||
factory ExportPayload({
|
||||
$core.String? viewId,
|
||||
ExportType? exportType,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (viewId != null) {
|
||||
_result.viewId = viewId;
|
||||
}
|
||||
if (exportType != null) {
|
||||
_result.exportType = exportType;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory ExportPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ExportPayload.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')
|
||||
ExportPayload clone() => ExportPayload()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ExportPayload copyWith(void Function(ExportPayload) updates) => super.copyWith((message) => updates(message as ExportPayload)) as ExportPayload; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ExportPayload create() => ExportPayload._();
|
||||
ExportPayload createEmptyInstance() => create();
|
||||
static $pb.PbList<ExportPayload> createRepeated() => $pb.PbList<ExportPayload>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ExportPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportPayload>(create);
|
||||
static ExportPayload? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get viewId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set viewId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasViewId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearViewId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
ExportType get exportType => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set exportType(ExportType v) { setField(2, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasExportType() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearExportType() => clearField(2);
|
||||
}
|
||||
|
||||
class ExportData extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportData', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..e<ExportType>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'exportType', $pb.PbFieldType.OE, defaultOrMaker: ExportType.Text, valueOf: ExportType.valueOf, enumValues: ExportType.values)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
ExportData._() : super();
|
||||
factory ExportData({
|
||||
$core.String? data,
|
||||
ExportType? exportType,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
if (exportType != null) {
|
||||
_result.exportType = exportType;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory ExportData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ExportData.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')
|
||||
ExportData clone() => ExportData()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ExportData copyWith(void Function(ExportData) updates) => super.copyWith((message) => updates(message as ExportData)) as ExportData; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ExportData create() => ExportData._();
|
||||
ExportData createEmptyInstance() => create();
|
||||
static $pb.PbList<ExportData> createRepeated() => $pb.PbList<ExportData>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ExportData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportData>(create);
|
||||
static ExportData? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get data => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set data($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasData() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearData() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
ExportType get exportType => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set exportType(ExportType v) { setField(2, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasExportType() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearExportType() => clearField(2);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: entities.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
// ignore_for_file: UNDEFINED_SHOWN_NAME
|
||||
import 'dart:core' as $core;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class ExportType extends $pb.ProtobufEnum {
|
||||
static const ExportType Text = ExportType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Text');
|
||||
static const ExportType Markdown = ExportType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Markdown');
|
||||
static const ExportType Link = ExportType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Link');
|
||||
|
||||
static const $core.List<ExportType> values = <ExportType> [
|
||||
Text,
|
||||
Markdown,
|
||||
Link,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, ExportType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static ExportType? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const ExportType._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: entities.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use exportTypeDescriptor instead')
|
||||
const ExportType$json = const {
|
||||
'1': 'ExportType',
|
||||
'2': const [
|
||||
const {'1': 'Text', '2': 0},
|
||||
const {'1': 'Markdown', '2': 1},
|
||||
const {'1': 'Link', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ExportType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List exportTypeDescriptor = $convert.base64Decode('CgpFeHBvcnRUeXBlEggKBFRleHQQABIMCghNYXJrZG93bhABEggKBExpbmsQAg==');
|
||||
@$core.Deprecated('Use exportPayloadDescriptor instead')
|
||||
const ExportPayload$json = const {
|
||||
'1': 'ExportPayload',
|
||||
'2': const [
|
||||
const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'},
|
||||
const {'1': 'export_type', '3': 2, '4': 1, '5': 14, '6': '.ExportType', '10': 'exportType'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ExportPayload`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List exportPayloadDescriptor = $convert.base64Decode('Cg1FeHBvcnRQYXlsb2FkEhcKB3ZpZXdfaWQYASABKAlSBnZpZXdJZBIsCgtleHBvcnRfdHlwZRgCIAEoDjILLkV4cG9ydFR5cGVSCmV4cG9ydFR5cGU=');
|
||||
@$core.Deprecated('Use exportDataDescriptor instead')
|
||||
const ExportData$json = const {
|
||||
'1': 'ExportData',
|
||||
'2': const [
|
||||
const {'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'},
|
||||
const {'1': 'export_type', '3': 2, '4': 1, '5': 14, '6': '.ExportType', '10': 'exportType'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ExportData`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List exportDataDescriptor = $convert.base64Decode('CgpFeHBvcnREYXRhEhIKBGRhdGEYASABKAlSBGRhdGESLAoLZXhwb3J0X3R5cGUYAiABKA4yCy5FeHBvcnRUeXBlUgpleHBvcnRUeXBl');
|
@ -1,9 +1,9 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: document_info.proto
|
||||
// source: entities.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
export 'document_info.pb.dart';
|
||||
export 'entities.pb.dart';
|
||||
|
@ -1,7 +1,11 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: document_info.proto
|
||||
// source: event_map.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
export 'event_map.pbenum.dart';
|
||||
|
@ -0,0 +1,28 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: event_map.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
// ignore_for_file: UNDEFINED_SHOWN_NAME
|
||||
import 'dart:core' as $core;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class BlockEvent extends $pb.ProtobufEnum {
|
||||
static const BlockEvent GetBlockData = BlockEvent._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'GetBlockData');
|
||||
static const BlockEvent ApplyDelta = BlockEvent._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ApplyDelta');
|
||||
static const BlockEvent ExportDocument = BlockEvent._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ExportDocument');
|
||||
|
||||
static const $core.List<BlockEvent> values = <BlockEvent> [
|
||||
GetBlockData,
|
||||
ApplyDelta,
|
||||
ExportDocument,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, BlockEvent> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static BlockEvent? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const BlockEvent._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: event_map.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use blockEventDescriptor instead')
|
||||
const BlockEvent$json = const {
|
||||
'1': 'BlockEvent',
|
||||
'2': const [
|
||||
const {'1': 'GetBlockData', '2': 0},
|
||||
const {'1': 'ApplyDelta', '2': 1},
|
||||
const {'1': 'ExportDocument', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `BlockEvent`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List blockEventDescriptor = $convert.base64Decode('CgpCbG9ja0V2ZW50EhAKDEdldEJsb2NrRGF0YRAAEg4KCkFwcGx5RGVsdGEQARISCg5FeHBvcnREb2N1bWVudBAC');
|
@ -0,0 +1,9 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: event_map.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
export 'event_map.pb.dart';
|
||||
|
@ -0,0 +1,3 @@
|
||||
// Auto-generated, do not edit
|
||||
export './entities.pb.dart';
|
||||
export './event_map.pb.dart';
|
168
frontend/rust-lib/Cargo.lock
generated
168
frontend/rust-lib/Cargo.lock
generated
@ -818,74 +818,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-block"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"color-eyre",
|
||||
"criterion",
|
||||
"dart-notify",
|
||||
"dashmap",
|
||||
"derive_more",
|
||||
"diesel",
|
||||
"diesel_derives",
|
||||
"flowy-block",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-sync",
|
||||
"flowy-test",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"lib-dispatch",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"lib-ws",
|
||||
"log",
|
||||
"protobuf",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"unicode-segmentation",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-collaboration"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"dashmap",
|
||||
"dissimilar",
|
||||
"flowy-derive",
|
||||
"flowy-folder-data-model",
|
||||
"flowy-grid-data-model",
|
||||
"futures",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-database"
|
||||
version = "0.1.0"
|
||||
@ -918,10 +850,10 @@ name = "flowy-error"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-error-code",
|
||||
"flowy-sync",
|
||||
"http-flowy",
|
||||
"lib-dispatch",
|
||||
"lib-infra",
|
||||
@ -950,15 +882,15 @@ dependencies = [
|
||||
"dart-notify",
|
||||
"diesel",
|
||||
"diesel_derives",
|
||||
"flowy-block",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-folder",
|
||||
"flowy-folder-data-model",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-test",
|
||||
"flowy-text-block",
|
||||
"futures",
|
||||
"lazy_static",
|
||||
"lib-dispatch",
|
||||
@ -1006,12 +938,12 @@ dependencies = [
|
||||
"dart-notify",
|
||||
"dashmap",
|
||||
"diesel",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-grid",
|
||||
"flowy-grid-data-model",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-test",
|
||||
"lazy_static",
|
||||
@ -1056,12 +988,12 @@ dependencies = [
|
||||
"bytes",
|
||||
"config",
|
||||
"dashmap",
|
||||
"flowy-block",
|
||||
"flowy-collaboration",
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-folder",
|
||||
"flowy-folder-data-model",
|
||||
"flowy-sync",
|
||||
"flowy-text-block",
|
||||
"flowy-user",
|
||||
"flowy-user-data-model",
|
||||
"futures-util",
|
||||
@ -1084,6 +1016,29 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-revision"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytes",
|
||||
"dashmap",
|
||||
"diesel",
|
||||
"diesel_derives",
|
||||
"flowy-database",
|
||||
"flowy-error",
|
||||
"flowy-sync",
|
||||
"futures-util",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"lib-ws",
|
||||
"serde",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-sdk"
|
||||
version = "0.1.0"
|
||||
@ -1092,14 +1047,14 @@ dependencies = [
|
||||
"bytes",
|
||||
"claim 0.5.0",
|
||||
"color-eyre",
|
||||
"flowy-block",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-folder",
|
||||
"flowy-grid",
|
||||
"flowy-grid-data-model",
|
||||
"flowy-net",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-text-block",
|
||||
"flowy-user",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
@ -1121,21 +1076,26 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"dashmap",
|
||||
"diesel",
|
||||
"diesel_derives",
|
||||
"flowy-collaboration",
|
||||
"flowy-database",
|
||||
"flowy-error",
|
||||
"futures-util",
|
||||
"dissimilar",
|
||||
"flowy-derive",
|
||||
"flowy-folder-data-model",
|
||||
"flowy-grid-data-model",
|
||||
"futures",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"lib-ws",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1147,10 +1107,10 @@ dependencies = [
|
||||
"claim 0.4.0",
|
||||
"claim 0.5.0",
|
||||
"fake",
|
||||
"flowy-collaboration",
|
||||
"flowy-folder",
|
||||
"flowy-net",
|
||||
"flowy-sdk",
|
||||
"flowy-sync",
|
||||
"flowy-user",
|
||||
"futures",
|
||||
"futures-util",
|
||||
@ -1168,6 +1128,46 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-text-block"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"color-eyre",
|
||||
"criterion",
|
||||
"dart-notify",
|
||||
"dashmap",
|
||||
"derive_more",
|
||||
"diesel",
|
||||
"diesel_derives",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-test",
|
||||
"flowy-text-block",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"lib-dispatch",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"lib-ws",
|
||||
"log",
|
||||
"protobuf",
|
||||
"rand 0.7.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"unicode-segmentation",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-user"
|
||||
version = "0.1.0"
|
||||
|
@ -11,9 +11,9 @@ members = [
|
||||
"flowy-database",
|
||||
"flowy-folder",
|
||||
"dart-notify",
|
||||
"flowy-block",
|
||||
"flowy-text-block",
|
||||
"flowy-error",
|
||||
"flowy-sync",
|
||||
"flowy-revision",
|
||||
"flowy-grid",
|
||||
]
|
||||
|
||||
|
@ -13,7 +13,7 @@ protobuf = {version = "2.20.0"}
|
||||
bytes = "1.0"
|
||||
|
||||
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration", optional = true}
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync", optional = true}
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot", optional = true}
|
||||
serde_json = {version = "1.0", optional = true}
|
||||
http-flowy = { git = "https://github.com/AppFlowy-IO/AppFlowy-Server", optional = true}
|
||||
@ -22,7 +22,7 @@ r2d2 = { version = "0.8", optional = true}
|
||||
lib-sqlite = { path = "../lib-sqlite", optional = true }
|
||||
|
||||
[features]
|
||||
collaboration = ["flowy-collaboration"]
|
||||
collaboration = ["flowy-sync"]
|
||||
ot = ["lib-ot"]
|
||||
serde = ["serde_json"]
|
||||
http_server = ["http-flowy"]
|
||||
|
@ -1,9 +1,9 @@
|
||||
use crate::FlowyError;
|
||||
|
||||
use flowy_collaboration::errors::ErrorCode;
|
||||
use flowy_sync::errors::ErrorCode;
|
||||
|
||||
impl std::convert::From<flowy_collaboration::errors::CollaborateError> for FlowyError {
|
||||
fn from(error: flowy_collaboration::errors::CollaborateError) -> Self {
|
||||
impl std::convert::From<flowy_sync::errors::CollaborateError> for FlowyError {
|
||||
fn from(error: flowy_sync::errors::CollaborateError) -> Self {
|
||||
match error.code {
|
||||
ErrorCode::RecordNotFound => FlowyError::record_not_found().context(error.msg),
|
||||
_ => FlowyError::internal().context(error.msg),
|
||||
|
@ -7,17 +7,17 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
flowy-folder-data-model = { path = "../../../shared-lib/flowy-folder-data-model" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
|
||||
flowy-block = { path = "../flowy-block" }
|
||||
flowy-text-block = { path = "../flowy-text-block" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-error = { path = "../flowy-error", features = ["db", "http_server"]}
|
||||
dart-notify = { path = "../dart-notify" }
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-sync = { path = "../flowy-sync" }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
|
||||
parking_lot = "0.11"
|
||||
protobuf = {version = "2.18.0"}
|
||||
@ -45,5 +45,5 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file
|
||||
[features]
|
||||
default = []
|
||||
http_server = []
|
||||
flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"]
|
||||
flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-revision/flowy_unit_test"]
|
||||
dart = ["lib-infra/dart", "flowy-folder/dart"]
|
@ -9,14 +9,14 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::client_document::default::{initial_quill_delta_string, initial_read_me};
|
||||
use flowy_sync::client_document::default::{initial_quill_delta_string, initial_read_me};
|
||||
|
||||
use flowy_collaboration::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData};
|
||||
use flowy_error::FlowyError;
|
||||
use flowy_folder_data_model::entities::view::ViewDataType;
|
||||
use flowy_folder_data_model::user_default;
|
||||
use flowy_sync::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_sync::{RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use flowy_revision::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_revision::{RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use flowy_sync::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData};
|
||||
use lazy_static::lazy_static;
|
||||
use lib_infra::future::FutureResult;
|
||||
use std::{collections::HashMap, convert::TryInto, fmt::Formatter, sync::Arc};
|
||||
|
@ -1,15 +1,15 @@
|
||||
use crate::services::web_socket::make_folder_ws_manager;
|
||||
use flowy_collaboration::{
|
||||
use flowy_sync::{
|
||||
client_folder::{FolderChange, FolderPad},
|
||||
entities::{revision::Revision, ws_data::ServerRevisionWSData},
|
||||
};
|
||||
|
||||
use crate::manager::FolderId;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::util::make_delta_from_revisions;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::util::make_delta_from_revisions;
|
||||
|
||||
use flowy_sync::{
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder, RevisionWebSocket,
|
||||
RevisionWebSocketManager,
|
||||
};
|
||||
|
@ -3,7 +3,6 @@ use crate::{
|
||||
event_map::WorkspaceDatabase,
|
||||
services::persistence::{AppTableSql, TrashTableSql, ViewTableSql, WorkspaceTableSql},
|
||||
};
|
||||
use flowy_collaboration::{client_folder::FolderPad, entities::revision::md5};
|
||||
use flowy_database::kv::KV;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_folder_data_model::entities::{
|
||||
@ -11,8 +10,9 @@ use flowy_folder_data_model::entities::{
|
||||
view::{RepeatedView, View},
|
||||
workspace::Workspace,
|
||||
};
|
||||
use flowy_sync::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_sync::{RevisionLoader, RevisionPersistence};
|
||||
use flowy_revision::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_revision::{RevisionLoader, RevisionPersistence};
|
||||
use flowy_sync::{client_folder::FolderPad, entities::revision::md5};
|
||||
use std::sync::Arc;
|
||||
|
||||
const V1_MIGRATION: &str = "FOLDER_V1_MIGRATION";
|
||||
|
@ -7,8 +7,6 @@ use crate::{
|
||||
manager::FolderId,
|
||||
services::{folder_editor::ClientFolderEditor, persistence::migration::FolderMigration},
|
||||
};
|
||||
use flowy_collaboration::client_folder::initial_folder_delta;
|
||||
use flowy_collaboration::{client_folder::FolderPad, entities::revision::Revision};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_folder_data_model::entities::{
|
||||
@ -17,8 +15,10 @@ use flowy_folder_data_model::entities::{
|
||||
view::View,
|
||||
workspace::Workspace,
|
||||
};
|
||||
use flowy_sync::disk::{RevisionRecord, RevisionState};
|
||||
use flowy_sync::mk_revision_disk_cache;
|
||||
use flowy_revision::disk::{RevisionRecord, RevisionState};
|
||||
use flowy_revision::mk_revision_disk_cache;
|
||||
use flowy_sync::client_folder::initial_folder_delta;
|
||||
use flowy_sync::{client_folder::FolderPad, entities::revision::Revision};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
pub use version_1::{app_sql::*, trash_sql::*, v1_impl::V1Transaction, view_sql::*, workspace_sql::*};
|
||||
|
@ -13,9 +13,9 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::text_block_info::TextBlockId;
|
||||
use flowy_database::kv::KV;
|
||||
use flowy_folder_data_model::entities::view::ViewDataType;
|
||||
use flowy_sync::entities::text_block_info::TextBlockId;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use lib_infra::uuid;
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
|
@ -1,14 +1,14 @@
|
||||
use crate::services::FOLDER_SYNC_INTERVAL_IN_MILLIS;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::FlowyError;
|
||||
use flowy_revision::*;
|
||||
use flowy_sync::{
|
||||
client_folder::FolderPad,
|
||||
entities::{
|
||||
revision::RevisionRange,
|
||||
ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSDataType},
|
||||
},
|
||||
};
|
||||
use flowy_error::FlowyError;
|
||||
use flowy_sync::*;
|
||||
use lib_infra::future::{BoxResultFuture, FutureResult};
|
||||
use lib_ot::core::{OperationTransformable, PlainTextAttributes, PlainTextDelta};
|
||||
use parking_lot::RwLock;
|
||||
|
@ -2,7 +2,7 @@ use crate::script::{invalid_workspace_name_test_case, FolderScript::*, FolderTes
|
||||
|
||||
use flowy_folder::entities::workspace::CreateWorkspacePayload;
|
||||
use flowy_folder_data_model::entities::view::ViewDataType;
|
||||
use flowy_sync::disk::RevisionState;
|
||||
use flowy_revision::disk::RevisionState;
|
||||
use flowy_test::{event_builder::*, FlowySDKTest};
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -1,4 +1,3 @@
|
||||
use flowy_collaboration::entities::text_block_info::TextBlockInfo;
|
||||
use flowy_folder::event_map::FolderEvent::*;
|
||||
use flowy_folder::{errors::ErrorCode, services::folder_editor::ClientFolderEditor};
|
||||
use flowy_folder_data_model::entities::view::{RepeatedViewId, ViewId};
|
||||
@ -15,8 +14,9 @@ use flowy_folder_data_model::entities::{
|
||||
view::{CreateViewPayload, UpdateViewPayload},
|
||||
workspace::{CreateWorkspacePayload, RepeatedWorkspace},
|
||||
};
|
||||
use flowy_sync::disk::RevisionState;
|
||||
use flowy_sync::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_revision::disk::RevisionState;
|
||||
use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_sync::entities::text_block_info::TextBlockInfo;
|
||||
use flowy_test::{event_builder::*, FlowySDKTest};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use tokio::time::sleep;
|
||||
|
@ -8,13 +8,13 @@ edition = "2021"
|
||||
[dependencies]
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
dart-notify = { path = "../dart-notify" }
|
||||
flowy-sync = { path = "../flowy-sync" }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
flowy-error = { path = "../flowy-error", features = ["db"]}
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
|
||||
strum = "0.21"
|
||||
@ -45,4 +45,4 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file
|
||||
[features]
|
||||
default = []
|
||||
dart = ["lib-infra/dart"]
|
||||
flowy_unit_test = ["flowy-sync/flowy_unit_test"]
|
||||
flowy_unit_test = ["flowy-revision/flowy_unit_test"]
|
@ -2,13 +2,13 @@ use crate::services::grid_editor::ClientGridEditor;
|
||||
use crate::services::kv_persistence::GridKVPersistence;
|
||||
use bytes::Bytes;
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::client_grid::{make_block_meta_delta, make_grid_delta};
|
||||
use flowy_collaboration::entities::revision::{RepeatedRevision, Revision};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::entities::{BuildGridContext, GridMeta};
|
||||
use flowy_sync::disk::{SQLiteGridBlockMetaRevisionPersistence, SQLiteGridRevisionPersistence};
|
||||
use flowy_sync::{RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use flowy_revision::disk::{SQLiteGridBlockMetaRevisionPersistence, SQLiteGridRevisionPersistence};
|
||||
use flowy_revision::{RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use flowy_sync::client_grid::{make_block_meta_delta, make_grid_delta};
|
||||
use flowy_sync::entities::revision::{RepeatedRevision, Revision};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
|
@ -4,17 +4,17 @@ use bytes::Bytes;
|
||||
|
||||
use crate::dart_notification::{send_dart_notification, GridNotification};
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::client_grid::{GridBlockMetaChange, GridBlockMetaPad};
|
||||
use flowy_collaboration::entities::revision::Revision;
|
||||
use flowy_collaboration::util::make_delta_from_revisions;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::entities::{
|
||||
FieldMeta, GridBlockId, GridBlockMeta, GridBlockMetaChangeset, RepeatedCell, RowMeta, RowMetaChangeset, RowOrder,
|
||||
};
|
||||
use flowy_sync::disk::SQLiteGridBlockMetaRevisionPersistence;
|
||||
use flowy_sync::{
|
||||
use flowy_revision::disk::SQLiteGridBlockMetaRevisionPersistence;
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder, RevisionPersistence,
|
||||
};
|
||||
use flowy_sync::client_grid::{GridBlockMetaChange, GridBlockMetaPad};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::util::make_delta_from_revisions;
|
||||
use lib_infra::future::FutureResult;
|
||||
use lib_ot::core::PlainTextAttributes;
|
||||
use std::collections::HashMap;
|
||||
|
@ -1,14 +1,14 @@
|
||||
use crate::manager::GridUser;
|
||||
use crate::services::block_meta_editor::GridBlockMetaEditorManager;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::client_grid::{GridChangeset, GridMetaPad};
|
||||
use flowy_collaboration::entities::revision::Revision;
|
||||
use flowy_collaboration::util::make_delta_from_revisions;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::entities::{
|
||||
CellMetaChangeset, Field, FieldChangeset, FieldMeta, Grid, GridBlockMeta, GridBlockMetaChangeset, GridBlockOrder,
|
||||
RepeatedField, RepeatedFieldOrder, RepeatedGridBlock, RepeatedRow, Row, RowMeta, RowMetaChangeset, RowOrder,
|
||||
};
|
||||
use flowy_sync::client_grid::{GridChangeset, GridMetaPad};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::util::make_delta_from_revisions;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::dart_notification::{send_dart_notification, GridNotification};
|
||||
@ -16,7 +16,7 @@ use crate::services::row::{
|
||||
make_grid_block_from_block_metas, make_grid_blocks, make_row_meta_from_context, make_rows_from_row_metas,
|
||||
serialize_cell_data, CreateRowMetaBuilder, CreateRowMetaPayload, GridBlockMetaData,
|
||||
};
|
||||
use flowy_sync::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder};
|
||||
use flowy_revision::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder};
|
||||
use lib_infra::future::FutureResult;
|
||||
use lib_ot::core::PlainTextAttributes;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::services::cell::*;
|
||||
use crate::services::field::*;
|
||||
use flowy_collaboration::client_grid::GridBuilder;
|
||||
use flowy_grid_data_model::entities::{BuildGridContext, FieldType};
|
||||
use flowy_sync::client_grid::GridBuilder;
|
||||
|
||||
pub fn make_default_grid() -> BuildGridContext {
|
||||
let text_field = FieldBuilder::new(RichTextTypeOptionsBuilder::default())
|
||||
|
@ -1,5 +1,5 @@
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::client_grid::GridBuilder;
|
||||
use flowy_sync::client_grid::GridBuilder;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use flowy_grid::services::cell::*;
|
||||
@ -10,7 +10,7 @@ use flowy_grid_data_model::entities::{
|
||||
BuildGridContext, CellMetaChangeset, FieldChangeset, FieldMeta, FieldType, GridBlockMeta, GridBlockMetaChangeset,
|
||||
RowMeta, RowMetaChangeset, RowOrder,
|
||||
};
|
||||
use flowy_sync::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_test::helper::ViewTest;
|
||||
use flowy_test::FlowySDKTest;
|
||||
use std::sync::Arc;
|
||||
|
@ -9,12 +9,12 @@ edition = "2018"
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-error = { path = "../flowy-error", features = ["collaboration", "http_server"] }
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration"}
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync"}
|
||||
flowy-folder-data-model = { path = "../../../shared-lib/flowy-folder-data-model"}
|
||||
flowy-user-data-model = { path = "../../../shared-lib/flowy-user-data-model"}
|
||||
flowy-folder = { path = "../flowy-folder" }
|
||||
flowy-user = { path = "../flowy-user" }
|
||||
flowy-block = { path = "../flowy-block" }
|
||||
flowy-text-block = { path = "../flowy-text-block" }
|
||||
lazy_static = "1.4.0"
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
protobuf = {version = "2.18.0"}
|
||||
@ -43,7 +43,7 @@ http_server = []
|
||||
dart = [
|
||||
"lib-infra/dart",
|
||||
"flowy-user/dart",
|
||||
"flowy-collaboration/dart",
|
||||
"flowy-sync/dart",
|
||||
"flowy-error/dart",
|
||||
"flowy-user-data-model/dart",
|
||||
"flowy-folder-data-model/dart"
|
||||
|
@ -2,11 +2,9 @@ use crate::{
|
||||
configuration::*,
|
||||
request::{HttpRequestBuilder, ResponseMiddleware},
|
||||
};
|
||||
use flowy_block::BlockCloudService;
|
||||
use flowy_collaboration::entities::text_block_info::{
|
||||
CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo,
|
||||
};
|
||||
use flowy_error::FlowyError;
|
||||
use flowy_sync::entities::text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo};
|
||||
use flowy_text_block::BlockCloudService;
|
||||
use http_flowy::response::FlowyResponse;
|
||||
use lazy_static::lazy_static;
|
||||
use lib_infra::future::FutureResult;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use flowy_collaboration::{
|
||||
use flowy_sync::{
|
||||
entities::{folder_info::FolderInfo, text_block_info::TextBlockInfo},
|
||||
errors::CollaborateError,
|
||||
protobuf::{RepeatedRevision as RepeatedRevisionPB, Revision as RevisionPB},
|
||||
|
@ -1,7 +1,9 @@
|
||||
use crate::local_server::persistence::LocalTextBlockCloudPersistence;
|
||||
use async_stream::stream;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{internal_error, FlowyError};
|
||||
use flowy_folder::event_map::FolderCouldServiceV1;
|
||||
use flowy_sync::{
|
||||
client_document::default::initial_quill_delta_string,
|
||||
entities::{
|
||||
text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo},
|
||||
@ -13,8 +15,6 @@ use flowy_collaboration::{
|
||||
server_folder::ServerFolderManager,
|
||||
synchronizer::{RevisionSyncResponse, RevisionUser},
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyError};
|
||||
use flowy_folder::event_map::FolderCouldServiceV1;
|
||||
use futures_util::stream::StreamExt;
|
||||
use lib_ws::{WSChannel, WebSocketRawMessage};
|
||||
use parking_lot::RwLock;
|
||||
@ -251,13 +251,13 @@ impl RevisionUser for LocalRevisionUser {
|
||||
}
|
||||
}
|
||||
|
||||
use flowy_block::BlockCloudService;
|
||||
use flowy_folder_data_model::entities::{
|
||||
app::{App, AppId, CreateAppParams, RepeatedApp, UpdateAppParams},
|
||||
trash::{RepeatedTrash, RepeatedTrashId},
|
||||
view::{CreateViewParams, RepeatedView, RepeatedViewId, UpdateViewParams, View, ViewId},
|
||||
workspace::{CreateWorkspaceParams, RepeatedWorkspace, UpdateWorkspaceParams, Workspace, WorkspaceId},
|
||||
};
|
||||
use flowy_text_block::BlockCloudService;
|
||||
use flowy_user::event_map::UserCloudService;
|
||||
use flowy_user_data_model::entities::{
|
||||
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserParams, UserProfile,
|
||||
|
@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "flowy-sync"
|
||||
name = "flowy-revision"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState};
|
||||
|
||||
use bytes::Bytes;
|
||||
use diesel::{sql_types::Integer, update, SqliteConnection};
|
||||
use flowy_collaboration::{
|
||||
entities::revision::{Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use flowy_database::{
|
||||
impl_sql_integer_expression, insert_or_ignore_into,
|
||||
prelude::*,
|
||||
@ -14,6 +10,10 @@ use flowy_database::{
|
||||
ConnectionPool,
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyError, FlowyResult};
|
||||
use flowy_sync::{
|
||||
entities::revision::{Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct SQLiteGridBlockMetaRevisionPersistence {
|
@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState};
|
||||
|
||||
use bytes::Bytes;
|
||||
use diesel::{sql_types::Integer, update, SqliteConnection};
|
||||
use flowy_collaboration::{
|
||||
entities::revision::{Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use flowy_database::{
|
||||
impl_sql_integer_expression, insert_or_ignore_into,
|
||||
prelude::*,
|
||||
@ -14,6 +10,10 @@ use flowy_database::{
|
||||
ConnectionPool,
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyError, FlowyResult};
|
||||
use flowy_sync::{
|
||||
entities::revision::{Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct SQLiteGridRevisionPersistence {
|
@ -8,8 +8,8 @@ pub use grid_meta_rev_impl::*;
|
||||
pub use grid_rev_impl::*;
|
||||
pub use text_rev_impl::*;
|
||||
|
||||
use flowy_collaboration::entities::revision::{RevId, Revision, RevisionRange};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_sync::entities::revision::{RevId, Revision, RevisionRange};
|
||||
use std::fmt::Debug;
|
||||
|
||||
pub trait RevisionDiskCache: Sync + Send {
|
@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState};
|
||||
|
||||
use bytes::Bytes;
|
||||
use diesel::{sql_types::Integer, update, SqliteConnection};
|
||||
use flowy_collaboration::{
|
||||
entities::revision::{RevType, Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use flowy_database::{
|
||||
impl_sql_integer_expression, insert_or_ignore_into,
|
||||
prelude::*,
|
||||
@ -14,6 +10,10 @@ use flowy_database::{
|
||||
ConnectionPool,
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyError, FlowyResult};
|
||||
use flowy_sync::{
|
||||
entities::revision::{RevType, Revision, RevisionRange},
|
||||
util::md5,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct SQLiteTextBlockRevisionPersistence {
|
@ -1,8 +1,8 @@
|
||||
use crate::disk::RevisionRecord;
|
||||
use crate::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::entities::revision::RevisionRange;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::entities::revision::RevisionRange;
|
||||
use std::{borrow::Cow, sync::Arc, time::Duration};
|
||||
use tokio::{sync::RwLock, task::JoinHandle};
|
||||
|
@ -1,13 +1,13 @@
|
||||
use crate::RevisionManager;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::{
|
||||
entities::{
|
||||
revision::{RepeatedRevision, Revision, RevisionRange},
|
||||
ws_data::ServerRevisionWSDataType,
|
||||
},
|
||||
util::make_delta_from_revisions,
|
||||
};
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use lib_infra::future::BoxResultFuture;
|
||||
use lib_ot::core::{Attributes, Delta, PlainTextAttributes};
|
||||
use lib_ot::rich_text::RichTextAttributes;
|
@ -1,11 +1,11 @@
|
||||
use crate::disk::RevisionState;
|
||||
use crate::{RevisionPersistence, WSDataProviderDataSource};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::{
|
||||
entities::revision::{RepeatedRevision, Revision, RevisionRange},
|
||||
util::{pair_rev_id_from_revisions, RevIdCounter},
|
||||
};
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use lib_infra::future::FutureResult;
|
||||
use std::sync::Arc;
|
||||
|
@ -5,9 +5,9 @@ use crate::cache::{
|
||||
use crate::disk::{RevisionRecord, RevisionState};
|
||||
use crate::memory::RevisionMemoryCache;
|
||||
use crate::RevisionCompactor;
|
||||
use flowy_collaboration::entities::revision::{Revision, RevisionRange};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::{internal_error, FlowyError, FlowyResult};
|
||||
use flowy_sync::entities::revision::{Revision, RevisionRange};
|
||||
use std::collections::VecDeque;
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
@ -2,11 +2,11 @@ use crate::ConflictRevisionSink;
|
||||
use async_stream::stream;
|
||||
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::{
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::entities::{
|
||||
revision::{RevId, Revision, RevisionRange},
|
||||
ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSData, ServerRevisionWSDataType},
|
||||
};
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use futures_util::{future::BoxFuture, stream::StreamExt};
|
||||
use lib_infra::future::{BoxResultFuture, FutureResult};
|
||||
use lib_ws::WSConnectState;
|
@ -14,8 +14,8 @@ flowy-folder = { path = "../flowy-folder", default-features = false }
|
||||
flowy-grid = { path = "../flowy-grid", default-features = false }
|
||||
flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-block = { path = "../flowy-block", default-features = false }
|
||||
flowy-sync = { path = "../flowy-sync" }
|
||||
flowy-text-block = { path = "../flowy-text-block", default-features = false }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
|
||||
tracing = { version = "0.1" }
|
||||
log = "0.4.14"
|
||||
@ -25,7 +25,7 @@ bytes = "1.0"
|
||||
tokio = { version = "1", features = ["rt"] }
|
||||
parking_lot = "0.11"
|
||||
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
|
||||
@ -38,6 +38,6 @@ tokio = { version = "1", features = ["full"]}
|
||||
futures-util = "0.3.15"
|
||||
|
||||
[features]
|
||||
http_server = ["flowy-user/http_server", "flowy-folder/http_server", "flowy-block/http_server"]
|
||||
http_server = ["flowy-user/http_server", "flowy-folder/http_server", "flowy-text-block/http_server"]
|
||||
use_bunyan = ["lib-log/use_bunyan"]
|
||||
dart = ["flowy-user/dart", "flowy-net/dart", "flowy-folder/dart", "flowy-collaboration/dart", "flowy-grid/dart", "flowy-block/dart"]
|
||||
dart = ["flowy-user/dart", "flowy-net/dart", "flowy-folder/dart", "flowy-sync/dart", "flowy-grid/dart", "flowy-text-block/dart"]
|
||||
|
@ -1,9 +1,9 @@
|
||||
use bytes::Bytes;
|
||||
use flowy_block::TextBlockManager;
|
||||
use flowy_collaboration::client_document::default::initial_quill_delta_string;
|
||||
use flowy_collaboration::entities::revision::{RepeatedRevision, Revision};
|
||||
use flowy_collaboration::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_sync::client_document::default::initial_quill_delta_string;
|
||||
use flowy_sync::entities::revision::{RepeatedRevision, Revision};
|
||||
use flowy_sync::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_text_block::TextBlockManager;
|
||||
|
||||
use flowy_folder::manager::{ViewDataProcessor, ViewDataProcessorMap};
|
||||
use flowy_folder::prelude::ViewDataType;
|
||||
@ -19,7 +19,7 @@ use flowy_net::ClientServerConfiguration;
|
||||
use flowy_net::{
|
||||
http_server::folder::FolderHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect,
|
||||
};
|
||||
use flowy_sync::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_revision::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_user::services::UserSession;
|
||||
use futures_core::future::BoxFuture;
|
||||
use lib_infra::future::{BoxResultFuture, FutureResult};
|
||||
|
@ -1,10 +1,10 @@
|
||||
use crate::FlowyError;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_grid::manager::{GridManager, GridUser};
|
||||
use flowy_net::ws::connection::FlowyWebSocketConnect;
|
||||
use flowy_sync::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_revision::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_sync::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_user::services::UserSession;
|
||||
use futures_core::future::BoxFuture;
|
||||
use lib_infra::future::BoxResultFuture;
|
||||
|
@ -1,15 +1,15 @@
|
||||
use bytes::Bytes;
|
||||
use flowy_block::{
|
||||
errors::{internal_error, FlowyError},
|
||||
BlockCloudService, TextBlockManager, TextBlockUser,
|
||||
};
|
||||
use flowy_collaboration::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_net::ClientServerConfiguration;
|
||||
use flowy_net::{
|
||||
http_server::document::BlockHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect,
|
||||
};
|
||||
use flowy_sync::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_revision::{RevisionWebSocket, WSStateReceiver};
|
||||
use flowy_sync::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_text_block::{
|
||||
errors::{internal_error, FlowyError},
|
||||
BlockCloudService, TextBlockManager, TextBlockUser,
|
||||
};
|
||||
use flowy_user::services::UserSession;
|
||||
use futures_core::future::BoxFuture;
|
||||
use lib_infra::future::BoxResultFuture;
|
||||
|
@ -3,7 +3,6 @@ pub mod module;
|
||||
pub use flowy_net::get_client_server_configuration;
|
||||
|
||||
use crate::deps_resolve::*;
|
||||
use flowy_block::TextBlockManager;
|
||||
use flowy_folder::{errors::FlowyError, manager::FolderManager};
|
||||
use flowy_grid::manager::GridManager;
|
||||
use flowy_net::ClientServerConfiguration;
|
||||
@ -12,6 +11,7 @@ use flowy_net::{
|
||||
local_server::LocalServer,
|
||||
ws::connection::{listen_on_websocket, FlowyWebSocketConnect},
|
||||
};
|
||||
use flowy_text_block::TextBlockManager;
|
||||
use flowy_user::services::{notifier::UserStatus, UserSession, UserSessionConfig};
|
||||
use lib_dispatch::prelude::*;
|
||||
use lib_dispatch::util::tokio_default_runtime;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use flowy_block::TextBlockManager;
|
||||
use flowy_folder::manager::FolderManager;
|
||||
use flowy_grid::manager::GridManager;
|
||||
use flowy_net::ws::connection::FlowyWebSocketConnect;
|
||||
use flowy_text_block::TextBlockManager;
|
||||
use flowy_user::services::UserSession;
|
||||
use lib_dispatch::prelude::Module;
|
||||
use std::sync::Arc;
|
||||
@ -44,5 +44,5 @@ fn mk_grid_module(grid_manager: Arc<GridManager>) -> Module {
|
||||
}
|
||||
|
||||
fn mk_text_block_module(text_block_manager: Arc<TextBlockManager>) -> Module {
|
||||
flowy_block::event_map::create(text_block_manager)
|
||||
flowy_text_block::event_map::create(text_block_manager)
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ flowy-net = { path = "../flowy-net"}
|
||||
flowy-folder = { path = "../flowy-folder", default-features = false}
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
|
||||
[package]
|
||||
name = "flowy-block"
|
||||
name = "flowy-text-block"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration"}
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync"}
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
@ -15,7 +15,7 @@ lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-sync = { path = "../flowy-sync" }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
flowy-error = { path = "../flowy-error", features = ["collaboration", "ot", "http_server", "serde", "db"] }
|
||||
dart-notify = { path = "../dart-notify" }
|
||||
|
||||
@ -40,7 +40,7 @@ futures = "0.3.15"
|
||||
|
||||
[dev-dependencies]
|
||||
flowy-test = { path = "../flowy-test" }
|
||||
flowy-block = { path = "../flowy-block", features = ["flowy_unit_test"]}
|
||||
flowy-text-block = { path = "../flowy-text-block", features = ["flowy_unit_test"]}
|
||||
derive_more = {version = "0.99", features = ["display"]}
|
||||
|
||||
color-eyre = { version = "0.5", default-features = false }
|
||||
@ -52,5 +52,5 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file
|
||||
|
||||
[features]
|
||||
http_server = []
|
||||
flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"]
|
||||
flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-revision/flowy_unit_test"]
|
||||
dart = ["lib-infra/dart"]
|
@ -5,16 +5,16 @@ use crate::{
|
||||
TextBlockUser,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::ws_data::ServerRevisionWSData;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{internal_error, FlowyResult};
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionManager, RevisionObjectBuilder, RevisionWebSocket, RevisionWebSocketManager,
|
||||
};
|
||||
use flowy_sync::entities::ws_data::ServerRevisionWSData;
|
||||
use flowy_sync::{
|
||||
entities::{revision::Revision, text_block_info::TextBlockInfo},
|
||||
errors::CollaborateResult,
|
||||
util::make_delta_from_revisions,
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyResult};
|
||||
use flowy_sync::{
|
||||
RevisionCloudService, RevisionManager, RevisionObjectBuilder, RevisionWebSocket, RevisionWebSocketManager,
|
||||
};
|
||||
use lib_ot::{
|
||||
core::{Interval, Operation},
|
||||
rich_text::{RichTextAttribute, RichTextDelta},
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::{ExportData, ExportParams, ExportPayload};
|
||||
use crate::TextBlockManager;
|
||||
use flowy_collaboration::entities::text_block_info::{TextBlockDelta, TextBlockId};
|
||||
use flowy_error::FlowyError;
|
||||
use flowy_sync::entities::text_block_info::{TextBlockDelta, TextBlockId};
|
||||
use lib_dispatch::prelude::{data_result, AppData, Data, DataResult};
|
||||
use std::convert::TryInto;
|
||||
use std::sync::Arc;
|
@ -19,10 +19,10 @@ pub fn create(block_manager: Arc<TextBlockManager>) -> Module {
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
|
||||
#[event_err = "FlowyError"]
|
||||
pub enum BlockEvent {
|
||||
#[event(input = "BlockId", output = "BlockDelta")]
|
||||
#[event(input = "TextBlockId", output = "TextBlockDelta")]
|
||||
GetBlockData = 0,
|
||||
|
||||
#[event(input = "BlockDelta", output = "BlockDelta")]
|
||||
#[event(input = "TextBlockDelta", output = "TextBlockDelta")]
|
||||
ApplyDelta = 1,
|
||||
|
||||
#[event(input = "ExportPayload", output = "ExportData")]
|
@ -15,9 +15,7 @@ pub mod errors {
|
||||
pub const TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
|
||||
|
||||
use crate::errors::FlowyError;
|
||||
use flowy_collaboration::entities::text_block_info::{
|
||||
CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo,
|
||||
};
|
||||
use flowy_sync::entities::text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo};
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
pub trait BlockCloudService: Send + Sync {
|
@ -1,15 +1,15 @@
|
||||
use crate::{editor::ClientTextBlockEditor, errors::FlowyError, BlockCloudService};
|
||||
use bytes::Bytes;
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::entities::{
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_revision::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_revision::{RevisionCloudService, RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use flowy_sync::entities::{
|
||||
revision::{md5, RepeatedRevision, Revision},
|
||||
text_block_info::{TextBlockDelta, TextBlockId},
|
||||
ws_data::ServerRevisionWSData,
|
||||
};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_sync::disk::SQLiteTextBlockRevisionPersistence;
|
||||
use flowy_sync::{RevisionCloudService, RevisionManager, RevisionPersistence, RevisionWebSocket};
|
||||
use lib_infra::future::FutureResult;
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
|
@ -2,14 +2,14 @@ use crate::web_socket::EditorCommandReceiver;
|
||||
use crate::TextBlockUser;
|
||||
use async_stream::stream;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::util::make_delta_from_revisions;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_revision::{DeltaMD5, RevisionCompactor, RevisionManager, RichTextTransformDeltas, TransformDeltas};
|
||||
use flowy_sync::util::make_delta_from_revisions;
|
||||
use flowy_sync::{
|
||||
client_document::{history::UndoResult, ClientDocument},
|
||||
entities::revision::{RevId, Revision},
|
||||
errors::CollaborateError,
|
||||
};
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_sync::{DeltaMD5, RevisionCompactor, RevisionManager, RichTextTransformDeltas, TransformDeltas};
|
||||
use futures::stream::StreamExt;
|
||||
use lib_ot::{
|
||||
core::{Interval, OperationTransformable},
|
@ -1,14 +1,14 @@
|
||||
use crate::{queue::EditorCommand, TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS};
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::{
|
||||
use flowy_error::{internal_error, FlowyError};
|
||||
use flowy_revision::*;
|
||||
use flowy_sync::{
|
||||
entities::{
|
||||
revision::RevisionRange,
|
||||
ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSDataType},
|
||||
},
|
||||
errors::CollaborateResult,
|
||||
};
|
||||
use flowy_error::{internal_error, FlowyError};
|
||||
use flowy_sync::*;
|
||||
use lib_infra::future::{BoxResultFuture, FutureResult};
|
||||
use lib_ot::rich_text::RichTextAttributes;
|
||||
use lib_ot::rich_text::RichTextDelta;
|
||||
@ -129,7 +129,7 @@ impl ConflictResolver<RichTextAttributes> for TextBlockConflictResolver {
|
||||
fn transform_delta(
|
||||
&self,
|
||||
delta: RichTextDelta,
|
||||
) -> BoxResultFuture<flowy_sync::RichTextTransformDeltas, FlowyError> {
|
||||
) -> BoxResultFuture<flowy_revision::RichTextTransformDeltas, FlowyError> {
|
||||
let tx = self.edit_cmd_tx.clone();
|
||||
Box::pin(async move {
|
||||
let (ret, rx) = oneshot::channel::<CollaborateResult<RichTextTransformDeltas>>();
|
@ -1,7 +1,7 @@
|
||||
use flowy_block::editor::ClientTextBlockEditor;
|
||||
use flowy_block::TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS;
|
||||
use flowy_sync::disk::RevisionState;
|
||||
use flowy_revision::disk::RevisionState;
|
||||
use flowy_test::{helper::ViewTest, FlowySDKTest};
|
||||
use flowy_text_block::editor::ClientTextBlockEditor;
|
||||
use flowy_text_block::TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS;
|
||||
use lib_ot::{core::Interval, rich_text::RichTextDelta};
|
||||
use std::sync::Arc;
|
||||
use tokio::time::{sleep, Duration};
|
@ -1,5 +1,5 @@
|
||||
use crate::document::script::{EditorScript::*, *};
|
||||
use flowy_sync::disk::RevisionState;
|
||||
use flowy_revision::disk::RevisionState;
|
||||
use lib_ot::core::{count_utf16_code_units, Interval};
|
||||
|
||||
#[tokio::test]
|
@ -1,6 +1,6 @@
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
use crate::editor::{TestBuilder, TestOp::*};
|
||||
use flowy_collaboration::client_document::{NewlineDoc, PlainDoc};
|
||||
use flowy_sync::client_document::{NewlineDoc, PlainDoc};
|
||||
use lib_ot::core::{Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use lib_ot::rich_text::RichTextDelta;
|
@ -4,7 +4,7 @@ mod op_test;
|
||||
mod serde_test;
|
||||
mod undo_redo_test;
|
||||
|
||||
use flowy_collaboration::client_document::{ClientDocument, InitialDocumentText};
|
||||
use flowy_sync::client_document::{ClientDocument, InitialDocumentText};
|
||||
use lib_ot::{
|
||||
core::*,
|
||||
rich_text::{RichTextAttribute, RichTextAttributes, RichTextDelta},
|
@ -1,6 +1,6 @@
|
||||
#![allow(clippy::all)]
|
||||
use crate::editor::{Rng, TestBuilder, TestOp::*};
|
||||
use flowy_collaboration::client_document::{NewlineDoc, PlainDoc};
|
||||
use flowy_sync::client_document::{NewlineDoc, PlainDoc};
|
||||
use lib_ot::{
|
||||
core::*,
|
||||
rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributes, RichTextDelta},
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user