Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: init flowy document 2 (#2248)

Lucas.Xuec89e9517be2
diff --git a/frontend/appflowy_flutter/lib/core/document_notification.dart b/frontend/appflowy_flutter/lib/core/document_notification.dart
new file mode 100644
index 0000000000..8bc8d39b02
--- /dev/null
+++ b/frontend/appflowy_flutter/lib/core/document_notification.dart
@@ -0,0 +1,24 @@
+import 'dart:typed_data';
+
+import 'package:appflowy/core/notification_helper.dart';
+import 'package:appflowy_backend/protobuf/flowy-document2/notification.pb.dart';
+import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
+import 'package:dartz/dartz.dart';
+
+typedef DocumentNotificationCallback = void Function(
+ DocumentNotification,
+ Either<Uint8List, FlowyError>,
+);
+
+class DocumentNotificationParser
+ extends NotificationParser<DocumentNotification, FlowyError> {
+ DocumentNotificationParser({
+ String? id,
+ required DocumentNotificationCallback callback,
+ }) : super(
+ id: id,
+ callback: callback,
+ tyParser: (ty) => DocumentNotification.valueOf(ty),
+ errorParser: (bytes) => FlowyError.fromBuffer(bytes),
+ );
+}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart b/frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart
index b1eae868d7..05526f5b62 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/application/doc_bloc.dart
@@ -3,6 +3,7 @@ import 'package:appflowy/plugins/document/presentation/plugins/cover/cover_node_
import 'package:appflowy/plugins/trash/application/trash_service.dart';
import 'package:appflowy/user/application/user_service.dart';
import 'package:appflowy/workspace/application/view/view_listener.dart';
+import 'package:appflowy/workspace/application/doc/doc_listener.dart';
import 'package:appflowy/plugins/document/application/doc_service.dart';
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pbserver.dart';
@@ -17,12 +18,13 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:dartz/dartz.dart';
import 'dart:async';
import 'package:appflowy/util/either_extension.dart';
-
+import 'package:appflowy_backend/protobuf/flowy-document2/entities.pb.dart';
part 'doc_bloc.freezed.dart';
class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
final ViewPB view;
final DocumentService _documentService;
+ final DocumentListener _docListener;
final ViewListener _listener;
final TrashService _trashService;
@@ -32,12 +34,14 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
DocumentBloc({
required this.view,
}) : _documentService = DocumentService(),
+ _docListener = DocumentListener(id: view.id),
_listener = ViewListener(view: view),
_trashService = TrashService(),
super(DocumentState.initial()) {
on<DocumentEvent>((event, emit) async {
await event.map(
initial: (Initial value) async {
+ _listenOnDocChange();
await _initial(value, emit);
_listenOnViewChange();
},
@@ -73,6 +77,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
}
await _documentService.closeDocument(docId: view.id);
+ await _documentService.closeDocumentV2(view: view);
return super.close();
}
@@ -88,6 +93,39 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
);
}
final result = await _documentService.openDocument(view: view);
+ // test code
+ final document = await _documentService.openDocumentV2(view: view);
+ BlockPB? root;
+ document.fold((l) {
+ print('---------<open document v2>-----------');
+ print('page id = ${l.pageId}');
+ l.blocks.blocks.forEach((key, value) {
+ print('-----<block begin>-----');
+ print('block = $value');
+ if (value.ty == 'page') {
+ root = value;
+ }
+ print('-----<block end>-----');
+ });
+ print('---------<open document v2>-----------');
+ }, (r) {});
+ if (root != null) {
+ await _documentService.applyAction(
+ view: view,
+ actions: [
+ BlockActionPB(
+ action: BlockActionTypePB.Insert,
+ payload: BlockActionPayloadPB(
+ block: BlockPB()
+ ..id = 'id_0'
+ ..ty = 'text'
+ ..parentId = root!.id,
+ ),
+ ),
+ ],
+ );
+ }
+
return result.fold(
(documentData) async {
await _initEditorState(documentData).whenComplete(() {
@@ -126,6 +164,14 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
);
}
+ void _listenOnDocChange() {
+ _docListener.start(
+ didReceiveUpdate: () {
+ print('---------<receive document update>-----------');
+ },
+ );
+ }
+
Future<void> _initEditorState(DocumentDataPB documentData) async {
final document = Document.fromJson(jsonDecode(documentData.content));
final editorState = EditorState(document: document);
diff --git a/frontend/appflowy_flutter/lib/plugins/document/application/doc_service.dart b/frontend/appflowy_flutter/lib/plugins/document/application/doc_service.dart
index 88f4ead686..d484f8acff 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/application/doc_service.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/application/doc_service.dart
@@ -4,6 +4,7 @@ import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
+import 'package:appflowy_backend/protobuf/flowy-document2/entities.pb.dart';
class DocumentService {
Future<Either<DocumentDataPB, FlowyError>> openDocument({
@@ -39,4 +40,32 @@ class DocumentService {
final payload = ViewIdPB(value: docId);
return FolderEventCloseView(payload).send();
}
+
+ Future<Either<DocumentDataPB2, FlowyError>> openDocumentV2({
+ required ViewPB view,
+ }) async {
+ await FolderEventSetLatestView(ViewIdPB(value: view.id)).send();
+
+ final payload = OpenDocumentPayloadPBV2()..documentId = view.id;
+
+ return DocumentEvent2OpenDocument(payload).send();
+ }
+
+ Future<Either<Unit, FlowyError>> closeDocumentV2({
+ required ViewPB view,
+ }) async {
+ final payload = CloseDocumentPayloadPBV2()..documentId = view.id;
+ return DocumentEvent2CloseDocument(payload).send();
+ }
+
+ Future<Either<Unit, FlowyError>> applyAction({
+ required ViewPB view,
+ required List<BlockActionPB> actions,
+ }) async {
+ final payload = ApplyActionPayloadPBV2(
+ documentId: view.id,
+ actions: actions,
+ );
+ return DocumentEvent2ApplyAction(payload).send();
+ }
}
diff --git a/frontend/appflowy_flutter/lib/workspace/application/doc/doc_listener.dart b/frontend/appflowy_flutter/lib/workspace/application/doc/doc_listener.dart
new file mode 100644
index 0000000000..9dbed39c6f
--- /dev/null
+++ b/frontend/appflowy_flutter/lib/workspace/application/doc/doc_listener.dart
@@ -0,0 +1,54 @@
+import 'dart:async';
+import 'dart:typed_data';
+import 'package:appflowy/core/document_notification.dart';
+import 'package:dartz/dartz.dart';
+import 'package:appflowy_backend/protobuf/flowy-notification/subject.pb.dart';
+import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
+import 'package:appflowy_backend/protobuf/flowy-document2/notification.pb.dart';
+import 'package:appflowy_backend/rust_stream.dart';
+import 'package:flowy_infra/notifier.dart';
+
+class DocumentListener {
+ DocumentListener({
+ required this.id,
+ });
+
+ final String id;
+
+ final _didReceiveUpdate = PublishNotifier();
+ StreamSubscription<SubscribeObject>? _subscription;
+ DocumentNotificationParser? _parser;
+
+ Function()? didReceiveUpdate;
+
+ void start({
+ void Function()? didReceiveUpdate,
+ }) {
+ this.didReceiveUpdate = didReceiveUpdate;
+
+ _parser = DocumentNotificationParser(
+ id: id,
+ callback: _callback,
+ );
+ _subscription = RustStreamReceiver.listen(
+ (observable) => _parser?.parse(observable),
+ );
+ }
+
+ void _callback(
+ DocumentNotification ty,
+ Either<Uint8List, FlowyError> result,
+ ) {
+ switch (ty) {
+ case DocumentNotification.DidReceiveUpdate:
+ didReceiveUpdate?.call();
+ break;
+ default:
+ break;
+ }
+ }
+
+ Future<void> stop() async {
+ await _subscription?.cancel();
+ }
+}
diff --git a/frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart b/frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart
index a32fce93a9..a71861f075 100644
--- a/frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart
+++ b/frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart
@@ -17,6 +17,7 @@ import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:appflowy_backend/protobuf/dart-ffi/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-document/protobuf.dart';
+import 'package:appflowy_backend/protobuf/flowy-document2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart';
// ignore: unused_import
@@ -30,6 +31,7 @@ part 'dart_event/flowy-net/dart_event.dart';
part 'dart_event/flowy-user/dart_event.dart';
part 'dart_event/flowy-database/dart_event.dart';
part 'dart_event/flowy-document/dart_event.dart';
+part 'dart_event/flowy-document2/dart_event.dart';
enum FFIException {
RequestIsEmpty,
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock
index 93a06be85a..98208cea08 100644
--- a/frontend/appflowy_tauri/src-tauri/Cargo.lock
+++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock
@@ -564,7 +564,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#9b3f895bb6f8e92830acd90cfb68b69aece83095"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#4ccf3e5cf88ee71f1ce257e587cca54a8173abae"
dependencies = [
"anyhow",
"bytes",
@@ -582,7 +582,7 @@ dependencies = [
[[package]]
name = "collab-derive"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#9b3f895bb6f8e92830acd90cfb68b69aece83095"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#4ccf3e5cf88ee71f1ce257e587cca54a8173abae"
dependencies = [
"proc-macro2",
"quote",
@@ -591,10 +591,26 @@ dependencies = [
"yrs",
]
+[[package]]
+name = "collab-document"
+version = "0.1.0"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#4ccf3e5cf88ee71f1ce257e587cca54a8173abae"
+dependencies = [
+ "anyhow",
+ "collab",
+ "collab-derive",
+ "collab-persistence",
+ "nanoid",
+ "parking_lot 0.12.1",
+ "serde",
+ "serde_json",
+ "thiserror",
+]
+
[[package]]
name = "collab-folder"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#9b3f895bb6f8e92830acd90cfb68b69aece83095"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#4ccf3e5cf88ee71f1ce257e587cca54a8173abae"
dependencies = [
"anyhow",
"collab",
@@ -612,7 +628,7 @@ dependencies = [
[[package]]
name = "collab-persistence"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#9b3f895bb6f8e92830acd90cfb68b69aece83095"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#4ccf3e5cf88ee71f1ce257e587cca54a8173abae"
dependencies = [
"bincode",
"chrono",
@@ -1284,6 +1300,7 @@ dependencies = [
"flowy-client-ws",
"flowy-database",
"flowy-document",
+ "flowy-document2",
"flowy-error",
"flowy-folder",
"flowy-folder2",
@@ -1407,6 +1424,28 @@ dependencies = [
"ws-model",
]
+[[package]]
+name = "flowy-document2"
+version = "0.1.0"
+dependencies = [
+ "bytes",
+ "collab",
+ "collab-document",
+ "collab-persistence",
+ "flowy-codegen",
+ "flowy-derive",
+ "flowy-error",
+ "flowy-notification",
+ "lib-dispatch",
+ "nanoid",
+ "parking_lot 0.12.1",
+ "protobuf",
+ "serde",
+ "serde_json",
+ "strum",
+ "strum_macros",
+]
+
[[package]]
name = "flowy-error"
version = "0.1.0"
@@ -1511,6 +1550,7 @@ dependencies = [
"flowy-codegen",
"flowy-derive",
"flowy-document",
+ "flowy-document2",
"flowy-error",
"flowy-folder2",
"flowy-server-sync",
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml
index 085164b8fc..4834810178 100644
--- a/frontend/appflowy_tauri/src-tauri/Cargo.toml
+++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml
@@ -36,9 +36,13 @@ custom-protocol = ["tauri/custom-protocol"]
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
+collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
+
#collab = { path = "../../AppFlowy-Collab/collab" }
#collab-folder = { path = "../../AppFlowy-Collab/collab-folder" }
#collab-persistence = { path = "../../AppFlowy-Collab/collab-persistence" }
+#collab-document = { path = "../../AppFlowy-Collab/collab-document" }
+
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_bd_svc.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_bd_svc.ts
index c582b1f7d2..43c79e09f4 100644
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_bd_svc.ts
+++ b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_bd_svc.ts
@@ -4,11 +4,22 @@ import {
EditPayloadPB,
FlowyError,
OpenDocumentPayloadPB,
+ DocumentDataPB2,
ViewIdPB,
+ OpenDocumentPayloadPBV2,
+ ApplyActionPayloadPBV2,
+ BlockActionTypePB,
+ BlockActionPB,
+ CloseDocumentPayloadPBV2,
} from '@/services/backend';
import { DocumentEventApplyEdit, DocumentEventGetDocument } from '@/services/backend/events/flowy-document';
import { Result } from 'ts-results';
import { FolderEventCloseView } from '@/services/backend/events/flowy-folder2';
+import {
+ DocumentEvent2ApplyAction,
+ DocumentEvent2CloseDocument,
+ DocumentEvent2OpenDocument,
+} from '@/services/backend/events/flowy-document2';
export class DocumentBackendService {
constructor(public readonly viewId: string) {}
@@ -27,4 +38,26 @@ export class DocumentBackendService {
const payload = ViewIdPB.fromObject({ value: this.viewId });
return FolderEventCloseView(payload);
};
+
+ openV2 = (): Promise<Result<DocumentDataPB2, FlowyError>> => {
+ const payload = OpenDocumentPayloadPBV2.fromObject({
+ document_id: this.viewId,
+ });
+ return DocumentEvent2OpenDocument(payload);
+ };
+
+ applyActions = (actions: [BlockActionPB]): Promise<Result<void, FlowyError>> => {
+ const payload = ApplyActionPayloadPBV2.fromObject({
+ document_id: this.viewId,
+ actions: actions,
+ });
+ return DocumentEvent2ApplyAction(payload);
+ };
+
+ closeV2 = (): Promise<Result<void, FlowyError>> => {
+ const payload = CloseDocumentPayloadPBV2.fromObject({
+ document_id: this.viewId,
+ });
+ return DocumentEvent2CloseDocument(payload);
+ };
}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts
index e6ee3ec250..51f4a73154 100644
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts
+++ b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts
@@ -2,37 +2,70 @@ import { DocumentData, BlockType, TextDelta } from '@/appflowy_app/interfaces/do
import { createContext } from 'react';
import { DocumentBackendService } from './document_bd_svc';
import { Err } from 'ts-results';
-import { FlowyError } from '@/services/backend';
+import { BlockActionPB, BlockActionPayloadPB, BlockActionTypePB, BlockPB, FlowyError } from '@/services/backend';
+import { DocumentObserver } from './document_observer';
+import { nanoid } from 'nanoid';
export const DocumentControllerContext = createContext<DocumentController | null>(null);
export class DocumentController {
private readonly backendService: DocumentBackendService;
+ private readonly observer: DocumentObserver;
constructor(public readonly viewId: string) {
this.backendService = new DocumentBackendService(viewId);
+ this.observer = new DocumentObserver(viewId);
}
open = async (): Promise<DocumentData | null> => {
+ // example:
+ await this.observer.subscribe({
+ didReceiveUpdate: () => {
+ console.log('didReceiveUpdate');
+ },
+ });
+
+ const document = await this.backendService.openV2();
+ let root_id = '';
+ if (document.ok) {
+ root_id = document.val.page_id;
+ console.log(document.val.blocks);
+ }
+ await this.backendService.applyActions([
+ BlockActionPB.fromObject({
+ action: BlockActionTypePB.Insert,
+ payload: BlockActionPayloadPB.fromObject({
+ block: BlockPB.fromObject({
+ id: nanoid(10),
+ ty: 'text',
+ parent_id: root_id,
+ }),
+ }),
+ }),
+ ]);
+
const openDocumentResult = await this.backendService.open();
if (openDocumentResult.ok) {
return {
rootId: '',
blocks: {},
ytexts: {},
- yarrays: {}
+ yarrays: {},
};
} else {
return null;
}
};
-
- insert(node: {
- id: string,
- type: BlockType,
- delta?: TextDelta[]
- }, parentId: string, prevId: string) {
+ insert(
+ node: {
+ id: string;
+ type: BlockType;
+ delta?: TextDelta[];
+ },
+ parentId: string,
+ prevId: string
+ ) {
//
}
@@ -42,7 +75,7 @@ export class DocumentController {
yTextApply = (yTextId: string, delta: TextDelta[]) => {
//
- }
+ };
dispose = async () => {
await this.backendService.close();
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_observer.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_observer.ts
new file mode 100644
index 0000000000..908f02ce1b
--- /dev/null
+++ b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_observer.ts
@@ -0,0 +1,36 @@
+import { Ok, Result } from 'ts-results';
+import { ChangeNotifier } from '$app/utils/change_notifier';
+import { FolderNotificationObserver } from '../folder/notifications/observer';
+import { DocumentNotification } from '@/services/backend';
+import { DocumentNotificationObserver } from './notifications/observer';
+
+export type DidReceiveUpdateCallback = () => void; // todo: add params
+
+export class DocumentObserver {
+ private listener?: DocumentNotificationObserver;
+
+ constructor(public readonly workspaceId: string) {}
+
+ subscribe = async (callbacks: { didReceiveUpdate: DidReceiveUpdateCallback }) => {
+ this.listener = new DocumentNotificationObserver({
+ viewId: this.workspaceId,
+ parserHandler: (notification, result) => {
+ switch (notification) {
+ case DocumentNotification.DidReceiveUpdate:
+ callbacks.didReceiveUpdate();
+ // Fixme: ...
+ break;
+ default:
+ break;
+ }
+ },
+ });
+ await this.listener.start();
+ };
+
+ unsubscribe = async () => {
+ this.appListNotifier.unsubscribe();
+ this.workspaceNotifier.unsubscribe();
+ await this.listener?.stop();
+ };
+}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/observer.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/observer.ts
new file mode 100644
index 0000000000..ee149e5718
--- /dev/null
+++ b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/observer.ts
@@ -0,0 +1,16 @@
+import { OnNotificationError, AFNotificationObserver } from '@/services/backend/notifications';
+import { DocumentNotificationParser } from './parser';
+import { FlowyError, DocumentNotification } from '@/services/backend';
+import { Result } from 'ts-results';
+
+export type ParserHandler = (notification: DocumentNotification, payload: Result<Uint8Array, FlowyError>) => void;
+
+export class DocumentNotificationObserver extends AFNotificationObserver<DocumentNotification> {
+ constructor(params: { viewId?: string; parserHandler: ParserHandler; onError?: OnNotificationError }) {
+ const parser = new DocumentNotificationParser({
+ callback: params.parserHandler,
+ id: params.viewId,
+ });
+ super(parser);
+ }
+}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/parser.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/parser.ts
new file mode 100644
index 0000000000..e29956803b
--- /dev/null
+++ b/frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/notifications/parser.ts
@@ -0,0 +1,26 @@
+import { NotificationParser, OnNotificationError } from '@/services/backend/notifications';
+import { FlowyError, DocumentNotification } from '@/services/backend';
+import { Result } from 'ts-results';
+
+declare type DocumentNotificationCallback = (ty: DocumentNotification, payload: Result<Uint8Array, FlowyError>) => void;
+
+export class DocumentNotificationParser extends NotificationParser<DocumentNotification> {
+ constructor(params: { id?: string; callback: DocumentNotificationCallback; onError?: OnNotificationError }) {
+ super(
+ params.callback,
+ (ty) => {
+ const notification = DocumentNotification[ty];
+ if (isDocumentNotification(notification)) {
+ return DocumentNotification[notification];
+ } else {
+ return DocumentNotification.Unknown;
+ }
+ },
+ params.id
+ );
+ }
+}
+
+const isDocumentNotification = (notification: string): notification is keyof typeof DocumentNotification => {
+ return Object.values(DocumentNotification).indexOf(notification) !== -1;
+};
diff --git a/frontend/appflowy_tauri/src/services/backend/index.ts b/frontend/appflowy_tauri/src/services/backend/index.ts
index af708e6c22..4c9332026c 100644
--- a/frontend/appflowy_tauri/src/services/backend/index.ts
+++ b/frontend/appflowy_tauri/src/services/backend/index.ts
@@ -2,5 +2,6 @@ export * from "./models/flowy-user";
export * from "./models/flowy-document";
export * from "./models/flowy-database";
export * from "./models/flowy-folder2";
+export * from "./models/flowy-document2";
export * from "./models/flowy-net";
export * from "./models/flowy-error";
diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock
index a61256f6b9..f8438e7031 100644
--- a/frontend/rust-lib/Cargo.lock
+++ b/frontend/rust-lib/Cargo.lock
@@ -23,7 +23,18 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
- "getrandom 0.2.8",
+ "getrandom 0.2.9",
+ "once_cell",
+ "version_check",
+]
+
+[[package]]
+name = "ahash"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
+dependencies = [
+ "cfg-if",
"once_cell",
"version_check",
]
@@ -85,9 +96,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]]
name = "async-stream"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e"
+checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
dependencies = [
"async-stream-impl",
"futures-core",
@@ -96,24 +107,24 @@ dependencies = [
[[package]]
name = "async-stream-impl"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965"
+checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
name = "async-trait"
-version = "0.1.64"
+version = "0.1.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2"
+checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
@@ -150,9 +161,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "axum"
-version = "0.6.7"
+version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fb79c228270dcf2426e74864cabc94babb5dbab01a4314e702d2f16540e1591"
+checksum = "3b32c5ea3aabaf4deb5f5ced2d688ec0844c881c9e6c696a8b769a05fc691e62"
dependencies = [
"async-trait",
"axum-core",
@@ -162,7 +173,7 @@ dependencies = [
"http",
"http-body",
"hyper",
- "itoa 1.0.5",
+ "itoa",
"matchit",
"memchr",
"mime",
@@ -172,16 +183,15 @@ dependencies = [
"serde",
"sync_wrapper",
"tower",
- "tower-http",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
-version = "0.3.2"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cae3e661676ffbacb30f1a824089a8c9150e71017f7e1e38f2aa32009188d34"
+checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c"
dependencies = [
"async-trait",
"bytes",
@@ -223,9 +233,9 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
[[package]]
name = "basic-toml"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e819b667739967cd44d308b8c7b71305d8bb0729ac44a248aa08f33d01950b4"
+checksum = "5c0de75129aa8d0cceaf750b89013f0e08804d6ec61416da787b35ad0d7cddf1"
dependencies = [
"serde",
]
@@ -271,28 +281,28 @@ dependencies = [
[[package]]
name = "block-buffer"
-version = "0.10.3"
+version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
[[package]]
name = "borsh"
-version = "0.10.2"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40f9ca3698b2e4cb7c15571db0abc5551dca417a21ae8140460b50309bb2cc62"
+checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b"
dependencies = [
"borsh-derive",
- "hashbrown",
+ "hashbrown 0.13.2",
]
[[package]]
name = "borsh-derive"
-version = "0.10.2"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "598b3eacc6db9c3ee57b22707ad8f6a8d2f6d442bfe24ffeb8cbb70ca59e6a35"
+checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7"
dependencies = [
"borsh-derive-internal",
"borsh-schema-derive-internal",
@@ -303,9 +313,9 @@ dependencies = [
[[package]]
name = "borsh-derive-internal"
-version = "0.10.2"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "186b734fa1c9f6743e90c95d7233c9faab6360d1a96d4ffa19d9cfd1e9350f8a"
+checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb"
dependencies = [
"proc-macro2",
"quote",
@@ -314,9 +324,9 @@ dependencies = [
[[package]]
name = "borsh-schema-derive-internal"
-version = "0.10.2"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99b7ff1008316626f485991b960ade129253d4034014616b94f309a15366cc49"
+checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd"
dependencies = [
"proc-macro2",
"quote",
@@ -325,21 +335,9 @@ dependencies = [
[[package]]
name = "bstr"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
-dependencies = [
- "lazy_static",
- "memchr",
- "regex-automata",
- "serde",
-]
-
-[[package]]
-name = "bstr"
-version = "1.1.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b"
+checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09"
dependencies = [
"memchr",
"serde",
@@ -347,25 +345,26 @@ dependencies = [
[[package]]
name = "bumpalo"
-version = "3.11.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
+checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
[[package]]
name = "bytecheck"
-version = "0.6.9"
+version = "0.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f"
+checksum = "13fe11640a23eb24562225322cd3e452b93a3d4091d62fab69c70542fcd17d1f"
dependencies = [
"bytecheck_derive",
"ptr_meta",
+ "simdutf8",
]
[[package]]
name = "bytecheck_derive"
-version = "0.6.9"
+version = "0.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf"
+checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5"
dependencies = [
"proc-macro2",
"quote",
@@ -395,9 +394,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.0.78"
+version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]]
name = "cfg-if"
@@ -422,23 +421,23 @@ dependencies = [
[[package]]
name = "chrono-tz"
-version = "0.6.3"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c39203181991a7dd4343b8005bd804e7a9a37afb8ac070e43771e8c820bbde"
+checksum = "58549f1842da3080ce63002102d5bc954c7bc843d4f47818e642abdc36253552"
dependencies = [
"chrono",
"chrono-tz-build",
- "phf 0.11.1",
+ "phf 0.10.1",
]
[[package]]
name = "chrono-tz-build"
-version = "0.0.3"
+version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f509c3a87b33437b05e2458750a0700e5bdd6956176773e6c7d6dd15a283a0c"
+checksum = "db058d493fb2f65f41861bfed7e3fe6335264a9f0f92710cab5bdf01fef09069"
dependencies = [
"parse-zoneinfo",
- "phf 0.11.1",
+ "phf 0.10.1",
"phf_codegen",
]
@@ -491,7 +490,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#306f27e56481eb2a998da4cb9f13763699dade76"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#dd49b08fae2ad008844409c7ce6b8c754446955c"
dependencies = [
"anyhow",
"bytes",
@@ -509,7 +508,7 @@ dependencies = [
[[package]]
name = "collab-derive"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#306f27e56481eb2a998da4cb9f13763699dade76"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#dd49b08fae2ad008844409c7ce6b8c754446955c"
dependencies = [
"proc-macro2",
"quote",
@@ -518,10 +517,26 @@ dependencies = [
"yrs",
]
+[[package]]
+name = "collab-document"
+version = "0.1.0"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#dd49b08fae2ad008844409c7ce6b8c754446955c"
+dependencies = [
+ "anyhow",
+ "collab",
+ "collab-derive",
+ "collab-persistence",
+ "nanoid",
+ "parking_lot 0.12.1",
+ "serde",
+ "serde_json",
+ "thiserror",
+]
+
[[package]]
name = "collab-folder"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#306f27e56481eb2a998da4cb9f13763699dade76"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#dd49b08fae2ad008844409c7ce6b8c754446955c"
dependencies = [
"anyhow",
"collab",
@@ -539,7 +554,7 @@ dependencies = [
[[package]]
name = "collab-persistence"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#306f27e56481eb2a998da4cb9f13763699dade76"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#dd49b08fae2ad008844409c7ce6b8c754446955c"
dependencies = [
"bincode",
"chrono",
@@ -646,15 +661,15 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.8.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
+checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]]
name = "cpufeatures"
-version = "0.2.5"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
+checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
dependencies = [
"libc",
]
@@ -706,9 +721,9 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
-version = "0.5.6"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
+checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
dependencies = [
"cfg-if",
"crossbeam-utils",
@@ -716,9 +731,9 @@ dependencies = [
[[package]]
name = "crossbeam-deque"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
+checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if",
"crossbeam-epoch",
@@ -727,9 +742,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
-version = "0.9.13"
+version = "0.9.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a"
+checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
dependencies = [
"autocfg",
"cfg-if",
@@ -759,13 +774,12 @@ dependencies = [
[[package]]
name = "csv"
-version = "1.1.6"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"
+checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad"
dependencies = [
- "bstr 0.2.17",
"csv-core",
- "itoa 0.4.8",
+ "itoa",
"ryu",
"serde",
]
@@ -781,9 +795,9 @@ dependencies = [
[[package]]
name = "cxx"
-version = "1.0.86"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579"
+checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
dependencies = [
"cc",
"cxxbridge-flags",
@@ -793,9 +807,9 @@ dependencies = [
[[package]]
name = "cxx-build"
-version = "1.0.86"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70"
+checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
dependencies = [
"cc",
"codespan-reporting",
@@ -803,24 +817,24 @@ dependencies = [
"proc-macro2",
"quote",
"scratch",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
name = "cxxbridge-flags"
-version = "1.0.86"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c"
+checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
[[package]]
name = "cxxbridge-macro"
-version = "1.0.86"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5"
+checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
@@ -848,13 +862,15 @@ dependencies = [
[[package]]
name = "dashmap"
-version = "5.2.0"
+version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8858831f7781322e539ea39e72449c46b059638250c14344fec8d0aa6e539c"
+checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
dependencies = [
"cfg-if",
- "num_cpus",
- "parking_lot 0.12.1",
+ "hashbrown 0.12.3",
+ "lock_api",
+ "once_cell",
+ "parking_lot_core 0.9.7",
]
[[package]]
@@ -946,15 +962,15 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
dependencies = [
- "block-buffer 0.10.3",
+ "block-buffer 0.10.4",
"crypto-common",
]
[[package]]
name = "dissimilar"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd5f0c7e4bd266b8ab2550e6238d2e74977c23c15536ac7be45e9c95e2e3fbbb"
+checksum = "210ec60ae7d710bed8683e333e9d2855a8a56a3e9892b38bad3bb0d4d29b0d5e"
[[package]]
name = "document-model"
@@ -967,15 +983,15 @@ dependencies = [
[[package]]
name = "dyn-clone"
-version = "1.0.10"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60"
+checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]]
name = "either"
-version = "1.8.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "encode_unicode"
@@ -985,9 +1001,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "encoding_rs"
-version = "0.8.31"
+version = "0.8.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
+checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
dependencies = [
"cfg-if",
]
@@ -1002,6 +1018,27 @@ dependencies = [
"regex",
]
+[[package]]
+name = "errno"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
+dependencies = [
+ "errno-dragonfly",
+ "libc",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "errno-dragonfly"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
+dependencies = [
+ "cc",
+ "libc",
+]
+
[[package]]
name = "error-chain"
version = "0.12.0"
@@ -1063,9 +1100,9 @@ dependencies = [
[[package]]
name = "fastrand"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
+checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
@@ -1174,6 +1211,7 @@ dependencies = [
"flowy-client-ws",
"flowy-database",
"flowy-document",
+ "flowy-document2",
"flowy-error",
"flowy-folder",
"flowy-folder2",
@@ -1310,6 +1348,28 @@ dependencies = [
"ws-model",
]
+[[package]]
+name = "flowy-document2"
+version = "0.1.0"
+dependencies = [
+ "bytes",
+ "collab",
+ "collab-document",
+ "collab-persistence",
+ "flowy-codegen",
+ "flowy-derive",
+ "flowy-error",
+ "flowy-notification",
+ "lib-dispatch",
+ "nanoid",
+ "parking_lot 0.12.1",
+ "protobuf",
+ "serde",
+ "serde_json",
+ "strum",
+ "strum_macros",
+]
+
[[package]]
name = "flowy-error"
version = "0.1.0"
@@ -1418,6 +1478,7 @@ dependencies = [
"flowy-codegen",
"flowy-derive",
"flowy-document",
+ "flowy-document2",
"flowy-error",
"flowy-folder2",
"flowy-server-sync",
@@ -1676,9 +1737,9 @@ dependencies = [
[[package]]
name = "futures"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84"
+checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40"
dependencies = [
"futures-channel",
"futures-core",
@@ -1691,9 +1752,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5"
+checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
dependencies = [
"futures-core",
"futures-sink",
@@ -1701,15 +1762,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608"
+checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
[[package]]
name = "futures-executor"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e"
+checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0"
dependencies = [
"futures-core",
"futures-task",
@@ -1718,38 +1779,38 @@ dependencies = [
[[package]]
name = "futures-io"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531"
+checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
[[package]]
name = "futures-macro"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70"
+checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
name = "futures-sink"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364"
+checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
[[package]]
name = "futures-task"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366"
+checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
[[package]]
name = "futures-util"
-version = "0.3.26"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1"
+checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
dependencies = [
"futures-channel",
"futures-core",
@@ -1774,9 +1835,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.6"
+version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
@@ -1807,9 +1868,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.8"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
+checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
dependencies = [
"cfg-if",
"libc",
@@ -1818,9 +1879,9 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.27.0"
+version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793"
+checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
[[package]]
name = "glob"
@@ -1835,7 +1896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
dependencies = [
"aho-corasick",
- "bstr 1.1.0",
+ "bstr",
"fnv",
"log",
"regex",
@@ -1854,9 +1915,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.3.15"
+version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4"
+checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d"
dependencies = [
"bytes",
"fnv",
@@ -1883,7 +1944,16 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
- "ahash",
+ "ahash 0.7.6",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
+dependencies = [
+ "ahash 0.8.3",
]
[[package]]
@@ -1926,15 +1996,21 @@ dependencies = [
"libc",
]
+[[package]]
+name = "hermit-abi"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
+
[[package]]
name = "http"
-version = "0.2.8"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
+checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
"bytes",
"fnv",
- "itoa 1.0.5",
+ "itoa",
]
[[package]]
@@ -1958,12 +2034,6 @@ dependencies = [
"thiserror",
]
-[[package]]
-name = "http-range-header"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29"
-
[[package]]
name = "httparse"
version = "1.8.0"
@@ -1978,9 +2048,12 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "humansize"
-version = "1.1.1"
+version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026"
+checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
+dependencies = [
+ "libm",
+]
[[package]]
name = "humantime"
@@ -1990,9 +2063,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.23"
+version = "0.14.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c"
+checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899"
dependencies = [
"bytes",
"futures-channel",
@@ -2003,7 +2076,7 @@ dependencies = [
"http-body",
"httparse",
"httpdate",
- "itoa 1.0.5",
+ "itoa",
"pin-project-lite",
"socket2",
"tokio",
@@ -2039,16 +2112,16 @@ dependencies = [
[[package]]
name = "iana-time-zone"
-version = "0.1.53"
+version = "0.1.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765"
+checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
- "winapi",
+ "windows",
]
[[package]]
@@ -2084,9 +2157,9 @@ dependencies = [
[[package]]
name = "ignore"
-version = "0.4.19"
+version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a05705bc64e0b66a806c3740bd6578ea66051b157ec42dc219c785cbf185aef3"
+checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492"
dependencies = [
"globset",
"lazy_static",
@@ -2107,20 +2180,20 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
[[package]]
name = "indexmap"
-version = "1.9.2"
+version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
- "hashbrown",
+ "hashbrown 0.12.3",
"serde",
]
[[package]]
name = "indextree"
-version = "4.5.0"
+version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497f036ac2fae75c34224648a77802e5dd4e9cfb56f4713ab6b12b7160a0523b"
+checksum = "c40411d0e5c63ef1323c3d09ce5ec6d84d71531e18daed0743fccea279d7deb6"
[[package]]
name = "instant"
@@ -2131,11 +2204,22 @@ dependencies = [
"cfg-if",
]
+[[package]]
+name = "io-lifetimes"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
+dependencies = [
+ "hermit-abi 0.3.1",
+ "libc",
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "ipnet"
-version = "2.7.1"
+version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
+checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"
[[package]]
name = "itertools"
@@ -2148,21 +2232,15 @@ dependencies = [
[[package]]
name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
-[[package]]
-name = "itoa"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
+checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "js-sys"
-version = "0.3.60"
+version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
+checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
dependencies = [
"wasm-bindgen",
]
@@ -2285,9 +2363,9 @@ dependencies = [
[[package]]
name = "lib0"
-version = "0.16.4"
+version = "0.16.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3994538ae0215990b1c3df6dc45bb5afad77abce3a6ba3335512c5f5d9bfb1d4"
+checksum = "daf23122cb1c970b77ea6030eac5e328669415b65d2ab245c99bfb110f9d62dc"
dependencies = [
"serde",
"serde_json",
@@ -2296,9 +2374,15 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.139"
+version = "0.2.141"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
+
+[[package]]
+name = "libm"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
+checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "libsqlite3-sys"
@@ -2326,12 +2410,19 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
+[[package]]
+name = "linux-raw-sys"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f"
+
[[package]]
name = "lock_api"
-version = "0.4.6"
+version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
+checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
+ "autocfg",
"scopeguard",
]
@@ -2364,9 +2455,9 @@ dependencies = [
[[package]]
name = "matches"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
+checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]]
name = "matchit"
@@ -2388,9 +2479,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memoffset"
-version = "0.7.1"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
+checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
dependencies = [
"autocfg",
]
@@ -2418,9 +2509,9 @@ dependencies = [
[[package]]
name = "mime"
-version = "0.3.16"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "minimal-lexical"
@@ -2439,14 +2530,14 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.8.5"
+version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
+checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys 0.42.0",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -2528,9 +2619,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.30.2"
+version = "0.30.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83"
+checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439"
dependencies = [
"memchr",
]
@@ -2555,9 +2646,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
-version = "0.10.45"
+version = "0.10.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1"
+checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1"
dependencies = [
"bitflags",
"cfg-if",
@@ -2570,13 +2661,13 @@ dependencies = [
[[package]]
name = "openssl-macros"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
@@ -2587,20 +2678,19 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
-version = "111.25.0+1.1.1t"
+version = "111.25.2+1.1.1t"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6"
+checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.80"
+version = "0.9.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7"
+checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0"
dependencies = [
- "autocfg",
"cc",
"libc",
"openssl-src",
@@ -2642,7 +2732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
- "parking_lot_core 0.9.6",
+ "parking_lot_core 0.9.7",
]
[[package]]
@@ -2661,15 +2751,15 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.6"
+version = "0.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf"
+checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
dependencies = [
"cfg-if",
"libc",
"redox_syscall 0.2.16",
"smallvec",
- "windows-sys 0.42.0",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -2689,9 +2779,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "pest"
-version = "2.5.3"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a"
+checksum = "7b1403e8401ad5dedea73c626b99758535b342502f8d1e361f4a2dd952749122"
dependencies = [
"thiserror",
"ucd-trie",
@@ -2699,9 +2789,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.5.3"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "241cda393b0cdd65e62e07e12454f1f25d57017dcc514b1514cd3c4645e3a0a6"
+checksum = "be99c4c1d2fc2769b1d00239431d711d08f6efedcecb8b6e30707160aee99c15"
dependencies = [
"pest",
"pest_generator",
@@ -2709,22 +2799,22 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.5.3"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46b53634d8c8196302953c74d5352f33d0c512a9499bd2ce468fc9f4128fa27c"
+checksum = "e56094789873daa36164de2e822b3888c6ae4b4f9da555a1103587658c805b1e"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
name = "pest_meta"
-version = "2.5.3"
+version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ef4f1332a8d4678b41966bb4cc1d0676880e84183a1ecc3f4b69f03e99c7a51"
+checksum = "6733073c7cff3d8459fda0e42f13a047870242aed8b509fe98000928975f359e"
dependencies = [
"once_cell",
"pest",
@@ -2744,21 +2834,21 @@ dependencies = [
[[package]]
name = "phf"
-version = "0.11.1"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
- "phf_shared 0.11.1",
+ "phf_shared 0.10.0",
]
[[package]]
name = "phf_codegen"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770"
+checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
dependencies = [
- "phf_generator 0.11.1",
- "phf_shared 0.11.1",
+ "phf_generator 0.10.0",
+ "phf_shared 0.10.0",
]
[[package]]
@@ -2773,11 +2863,11 @@ dependencies = [
[[package]]
name = "phf_generator"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf"
+checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
dependencies = [
- "phf_shared 0.11.1",
+ "phf_shared 0.10.0",
"rand 0.8.5",
]
@@ -2806,9 +2896,9 @@ dependencies = [
[[package]]
name = "phf_shared"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
"uncased",
@@ -2927,9 +3017,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]]
name = "proc-macro2"
-version = "1.0.53"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73"
+checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
dependencies = [
"unicode-ident",
]
@@ -3175,7 +3265,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.8",
+ "getrandom 0.2.9",
]
[[package]]
@@ -3198,9 +3288,9 @@ dependencies = [
[[package]]
name = "rayon"
-version = "1.6.1"
+version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7"
+checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b"
dependencies = [
"either",
"rayon-core",
@@ -3208,9 +3298,9 @@ dependencies = [
[[package]]
name = "rayon-core"
-version = "1.10.1"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3"
+checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
@@ -3233,11 +3323,20 @@ dependencies = [
"bitflags",
]
+[[package]]
+name = "redox_syscall"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
+dependencies = [
+ "bitflags",
+]
+
[[package]]
name = "regex"
-version = "1.7.1"
+version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
+checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [
"aho-corasick",
"memchr",
@@ -3255,33 +3354,24 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.6.28"
+version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
-
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
+checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "rend"
-version = "0.3.6"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95"
+checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab"
dependencies = [
"bytecheck",
]
[[package]]
name = "reqwest"
-version = "0.11.14"
+version = "0.11.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9"
+checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254"
dependencies = [
"base64 0.21.0",
"bytes",
@@ -3326,12 +3416,12 @@ dependencies = [
[[package]]
name = "rkyv"
-version = "0.7.39"
+version = "0.7.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15"
+checksum = "21499ed91807f07ae081880aabb2ccc0235e9d88011867d984525e9a4c3cfa3e"
dependencies = [
"bytecheck",
- "hashbrown",
+ "hashbrown 0.12.3",
"ptr_meta",
"rend",
"rkyv_derive",
@@ -3340,9 +3430,9 @@ dependencies = [
[[package]]
name = "rkyv_derive"
-version = "0.7.39"
+version = "0.7.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4"
+checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666"
dependencies = [
"proc-macro2",
"quote",
@@ -3351,9 +3441,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
-version = "1.28.1"
+version = "1.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13cf35f7140155d02ba4ec3294373d513a3c7baa8364c162b030e33c61520a8"
+checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc"
dependencies = [
"arrayvec 0.7.2",
"borsh",
@@ -3369,9 +3459,9 @@ dependencies = [
[[package]]
name = "rust_decimal_macros"
-version = "1.27.0"
+version = "1.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a7e2dba1342e9f1166786a4329ba0d6d6b8d9db7e81d702ec9ba3b39591ddff"
+checksum = "0e773fd3da1ed42472fdf3cfdb4972948a555bc3d73f5e0bdb99d17e7b54c687"
dependencies = [
"quote",
"rust_decimal",
@@ -3379,9 +3469,9 @@ dependencies = [
[[package]]
name = "rustc-demangle"
-version = "0.1.21"
+version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
+checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b"
[[package]]
name = "rustc_version"
@@ -3392,11 +3482,25 @@ dependencies = [
"semver",
]
+[[package]]
+name = "rustix"
+version = "0.37.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77"
+dependencies = [
+ "bitflags",
+ "errno",
+ "io-lifetimes",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "rustversion"
-version = "1.0.11"
+version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70"
+checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
[[package]]
name = "rusty-money"
@@ -3410,9 +3514,9 @@ dependencies = [
[[package]]
name = "ryu"
-version = "1.0.12"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
+checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
[[package]]
name = "same-file"
@@ -3434,9 +3538,9 @@ dependencies = [
[[package]]
name = "scheduled-thread-pool"
-version = "0.2.6"
+version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf"
+checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
dependencies = [
"parking_lot 0.12.1",
]
@@ -3449,9 +3553,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "scratch"
-version = "1.0.3"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
+checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
[[package]]
name = "seahash"
@@ -3461,9 +3565,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]]
name = "security-framework"
-version = "2.7.0"
+version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
+checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
dependencies = [
"bitflags",
"core-foundation",
@@ -3474,9 +3578,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
-version = "2.6.1"
+version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
+checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
dependencies = [
"core-foundation-sys",
"libc",
@@ -3484,15 +3588,15 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.16"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
+checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
[[package]]
name = "serde"
-version = "1.0.158"
+version = "1.0.160"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9"
+checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
dependencies = [
"serde_derive",
]
@@ -3520,35 +3624,35 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.158"
+version = "1.0.160"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad"
+checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.8",
+ "syn 2.0.14",
]
[[package]]
name = "serde_json"
-version = "1.0.94"
+version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
+checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744"
dependencies = [
- "itoa 1.0.5",
+ "itoa",
"ryu",
"serde",
]
[[package]]
name = "serde_repr"
-version = "0.1.10"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e"
+checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
@@ -3558,7 +3662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
- "itoa 1.0.5",
+ "itoa",
"ryu",
"serde",
]
@@ -3620,13 +3724,19 @@ dependencies = [
[[package]]
name = "signal-hook-registry"
-version = "1.4.0"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
+checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
dependencies = [
"libc",
]
+[[package]]
+name = "simdutf8"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
+
[[package]]
name = "similar"
version = "1.3.0"
@@ -3641,9 +3751,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "slab"
-version = "0.4.7"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
+checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
dependencies = [
"autocfg",
]
@@ -3690,9 +3800,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "socket2"
-version = "0.4.7"
+version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
+checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
dependencies = [
"libc",
"winapi",
@@ -3735,9 +3845,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.8"
+version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"
+checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5"
dependencies = [
"proc-macro2",
"quote",
@@ -3752,23 +3862,22 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "tempfile"
-version = "3.3.0"
+version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
+checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998"
dependencies = [
"cfg-if",
"fastrand",
- "libc",
- "redox_syscall 0.2.16",
- "remove_dir_all",
- "winapi",
+ "redox_syscall 0.3.5",
+ "rustix",
+ "windows-sys 0.45.0",
]
[[package]]
name = "tera"
-version = "1.17.1"
+version = "1.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c"
+checksum = "95a665751302f22a03c56721e23094e4dc22b04a80f381e6737a07bf7a7c70c0"
dependencies = [
"chrono",
"chrono-tz",
@@ -3783,14 +3892,15 @@ dependencies = [
"serde",
"serde_json",
"slug",
+ "thread_local",
"unic-segment",
]
[[package]]
name = "termcolor"
-version = "1.1.3"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
@@ -3831,7 +3941,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.8",
+ "syn 2.0.14",
]
[[package]]
@@ -3886,20 +3996,19 @@ dependencies = [
[[package]]
name = "tinyvec_macros"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.26.0"
+version = "1.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64"
+checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001"
dependencies = [
"autocfg",
"bytes",
"libc",
- "memchr",
"mio",
"num_cpus",
"parking_lot 0.12.1",
@@ -3923,20 +4032,20 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "1.8.2"
+version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8"
+checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.14",
]
[[package]]
name = "tokio-native-tls"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
+checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
@@ -3968,9 +4077,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.7.3"
+version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45"
+checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2"
dependencies = [
"bytes",
"futures-core",
@@ -4041,25 +4150,6 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "tower-http"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "http-range-header",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
[[package]]
name = "tower-layer"
version = "0.3.2"
@@ -4210,9 +4300,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "trybuild"
-version = "1.0.77"
+version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44da5a6f2164c8e14d3bbc0657d69c5966af9f5f6930d4f600b1f5c4a673413"
+checksum = "501dbdbb99861e4ab6b60eb6a7493956a9defb644fd034bc4a5ef27c693c8a3a"
dependencies = [
"basic-toml",
"glob",
@@ -4315,15 +4405,15 @@ dependencies = [
[[package]]
name = "unicode-bidi"
-version = "0.3.8"
+version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
+checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
[[package]]
name = "unicode-ident"
-version = "1.0.6"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
+checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unicode-normalization"
@@ -4336,9 +4426,9 @@ dependencies = [
[[package]]
name = "unicode-segmentation"
-version = "1.10.0"
+version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a"
+checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
[[package]]
name = "unicode-width"
@@ -4412,12 +4502,11 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "walkdir"
-version = "2.3.2"
+version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
+checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698"
dependencies = [
"same-file",
- "winapi",
"winapi-util",
]
@@ -4451,9 +4540,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.83"
+version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
+checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -4461,9 +4550,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.83"
+version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
+checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
dependencies = [
"bumpalo",
"log",
@@ -4476,9 +4565,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.33"
+version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
+checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454"
dependencies = [
"cfg-if",
"js-sys",
@@ -4488,9 +4577,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.83"
+version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
+checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -4498,9 +4587,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.83"
+version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
+checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
dependencies = [
"proc-macro2",
"quote",
@@ -4511,15 +4600,15 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.83"
+version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
+checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
[[package]]
name = "web-sys"
-version = "0.3.60"
+version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
+checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -4527,9 +4616,9 @@ dependencies = [
[[package]]
name = "which"
-version = "4.3.0"
+version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b"
+checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
dependencies = [
"either",
"libc",
@@ -4567,19 +4656,28 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+[[package]]
+name = "windows"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
+dependencies = [
+ "windows-targets 0.48.0",
+]
+
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
- "windows_aarch64_gnullvm",
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_gnullvm",
- "windows_x86_64_msvc",
+ "windows_aarch64_gnullvm 0.42.2",
+ "windows_aarch64_msvc 0.42.2",
+ "windows_i686_gnu 0.42.2",
+ "windows_i686_msvc 0.42.2",
+ "windows_x86_64_gnu 0.42.2",
+ "windows_x86_64_gnullvm 0.42.2",
+ "windows_x86_64_msvc 0.42.2",
]
[[package]]
@@ -4588,65 +4686,131 @@ version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
- "windows-targets",
+ "windows-targets 0.42.2",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.0",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
+dependencies = [
+ "windows_aarch64_gnullvm 0.42.2",
+ "windows_aarch64_msvc 0.42.2",
+ "windows_i686_gnu 0.42.2",
+ "windows_i686_msvc 0.42.2",
+ "windows_x86_64_gnu 0.42.2",
+ "windows_x86_64_gnullvm 0.42.2",
+ "windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-targets"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
+checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
dependencies = [
- "windows_aarch64_gnullvm",
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_gnullvm",
- "windows_x86_64_msvc",
+ "windows_aarch64_gnullvm 0.48.0",
+ "windows_aarch64_msvc 0.48.0",
+ "windows_i686_gnu 0.48.0",
+ "windows_i686_msvc 0.48.0",
+ "windows_x86_64_gnu 0.48.0",
+ "windows_x86_64_gnullvm 0.48.0",
+ "windows_x86_64_msvc 0.48.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.42.1"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
+checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
+checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_i686_gnu"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
+checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_i686_msvc"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
+checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
+checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.1"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
+checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
+checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winreg"
@@ -4690,9 +4854,9 @@ dependencies = [
[[package]]
name = "yrs"
-version = "0.16.4"
+version = "0.16.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b2b23ac465bed6c0ffbb9fbd80ec808bd89b37b823a420b16917d1806d76d75"
+checksum = "4c2aef2bf89b4f7c003f9c73f1c8097427ca32e1d006443f3f607f11e79a797b"
dependencies = [
"atomic_refcell",
"lib0",
diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml
index a7e271a950..497a5ab230 100644
--- a/frontend/rust-lib/Cargo.toml
+++ b/frontend/rust-lib/Cargo.toml
@@ -11,6 +11,7 @@ members = [
# "flowy-folder",r
"flowy-folder2",
"flowy-notification",
+ "flowy-document2",
"flowy-document",
"flowy-error",
"flowy-revision",
@@ -38,9 +39,12 @@ opt-level = 3
incremental = false
[patch.crates-io]
-collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
-collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
-collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
-#collab = { path = "../AppFlowy-Collab/collab" }
-#collab-folder = { path = "../AppFlowy-Collab/collab-folder" }
-#collab-persistence = { path = "../AppFlowy-Collab/collab-persistence" }
+collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
+collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
+collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
+collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
+
+# collab = { path = "../AppFlowy-Collab/collab" }
+# collab-folder = { path = "../AppFlowy-Collab/collab-folder" }
+# collab-persistence = { path = "../AppFlowy-Collab/collab-persistence" }
+# collab-document = { path = "../AppFlowy-Collab/collab-document" }
\ No newline at end of file
diff --git a/frontend/rust-lib/flowy-core/Cargo.toml b/frontend/rust-lib/flowy-core/Cargo.toml
index 98903e60f6..ee11f4d4f0 100644
--- a/frontend/rust-lib/flowy-core/Cargo.toml
+++ b/frontend/rust-lib/flowy-core/Cargo.toml
@@ -18,6 +18,7 @@ user-model = { path = "../../../shared-lib/user-model" }
flowy-client-ws = { path = "../../../shared-lib/flowy-client-ws" }
flowy-sqlite = { path = "../flowy-sqlite", optional = true }
flowy-document = { path = "../flowy-document" }
+flowy-document2 = { path = "../flowy-document2" }
flowy-revision = { path = "../flowy-revision" }
flowy-error = { path = "../flowy-error", features = ["adaptor_ws"] }
flowy-task = { path = "../flowy-task" }
@@ -50,6 +51,7 @@ dart = [
"flowy-folder2/dart",
"flowy-database/dart",
"flowy-document/dart",
+ "flowy-document2/dart",
]
ts = [
"flowy-user/ts",
@@ -58,6 +60,7 @@ ts = [
"flowy-folder2/ts",
"flowy-database/ts",
"flowy-document/ts",
+ "flowy-document2/ts",
]
rev-sqlite = [
"flowy-sqlite",
diff --git a/frontend/rust-lib/flowy-core/src/deps_resolve/document2_deps.rs b/frontend/rust-lib/flowy-core/src/deps_resolve/document2_deps.rs
new file mode 100644
index 0000000000..4c044662f1
--- /dev/null
+++ b/frontend/rust-lib/flowy-core/src/deps_resolve/document2_deps.rs
@@ -0,0 +1,40 @@
+use std::sync::Arc;
+
+use collab_persistence::CollabKV;
+use flowy_database::manager::DatabaseManager;
+use flowy_document2::manager::{DocumentManager as DocumentManager2, DocumentUser};
+use flowy_error::FlowyError;
+use flowy_user::services::UserSession;
+
+pub struct Document2DepsResolver();
+impl Document2DepsResolver {
+ pub fn resolve(
+ user_session: Arc<UserSession>,
+ database_manager: &Arc<DatabaseManager>,
+ ) -> Arc<DocumentManager2> {
+ let user: Arc<dyn DocumentUser> = Arc::new(DocumentUserImpl(user_session.clone()));
+
+ Arc::new(DocumentManager2::new(user.clone()))
+ }
+}
+
+struct DocumentUserImpl(Arc<UserSession>);
+impl DocumentUser for DocumentUserImpl {
+ fn user_id(&self) -> Result<i64, FlowyError> {
+ self
+ .0
+ .user_id()
+ .map_err(|e| FlowyError::internal().context(e))
+ }
+
+ fn token(&self) -> Result<String, FlowyError> {
+ self
+ .0
+ .token()
+ .map_err(|e| FlowyError::internal().context(e))
+ }
+
+ fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError> {
+ self.0.get_kv_db()
+ }
+}
diff --git a/frontend/rust-lib/flowy-core/src/deps_resolve/mod.rs b/frontend/rust-lib/flowy-core/src/deps_resolve/mod.rs
index 9620e97ff3..6603edb598 100644
--- a/frontend/rust-lib/flowy-core/src/deps_resolve/mod.rs
+++ b/frontend/rust-lib/flowy-core/src/deps_resolve/mod.rs
@@ -1,9 +1,11 @@
+mod document2_deps;
mod document_deps;
mod folder2_deps;
mod grid_deps;
mod user_deps;
mod util;
+pub use document2_deps::*;
pub use document_deps::*;
pub use folder2_deps::*;
pub use grid_deps::*;
diff --git a/frontend/rust-lib/flowy-core/src/lib.rs b/frontend/rust-lib/flowy-core/src/lib.rs
index 7539f87826..09bbecc1bd 100644
--- a/frontend/rust-lib/flowy-core/src/lib.rs
+++ b/frontend/rust-lib/flowy-core/src/lib.rs
@@ -7,6 +7,7 @@ use flowy_database::entities::DatabaseLayoutPB;
use flowy_database::manager::DatabaseManager;
use flowy_document::entities::DocumentVersionPB;
use flowy_document::{DocumentConfig, DocumentManager};
+use flowy_document2::manager::DocumentManager as DocumentManager2;
use flowy_error::FlowyResult;
use flowy_folder::errors::FlowyError;
use flowy_folder2::manager::Folder2Manager;
@@ -124,6 +125,7 @@ pub struct AppFlowyCore {
pub config: AppFlowyCoreConfig,
pub user_session: Arc<UserSession>,
pub document_manager: Arc<DocumentManager>,
+ pub document_manager2: Arc<DocumentManager2>,
pub folder_manager: Arc<Folder2Manager>,
pub database_manager: Arc<DatabaseManager>,
pub event_dispatcher: Arc<AFPluginDispatcher>,
@@ -146,40 +148,50 @@ impl AppFlowyCore {
runtime.spawn(TaskRunner::run(task_dispatcher.clone()));
let (local_server, ws_conn) = mk_local_server(&config.server_config);
- let (user_session, document_manager, folder_manager, local_server, database_manager) = runtime
- .block_on(async {
- let user_session = mk_user_session(&config, &local_server, &config.server_config);
- let document_manager = DocumentDepsResolver::resolve(
- local_server.clone(),
- ws_conn.clone(),
- user_session.clone(),
- &config.server_config,
- &config.document,
- );
-
- let database_manager = DatabaseDepsResolver::resolve(
- ws_conn.clone(),
- user_session.clone(),
- task_dispatcher.clone(),
- )
- .await;
-
- let folder_manager =
- Folder2DepsResolver::resolve(user_session.clone(), &document_manager, &database_manager)
- .await;
-
- if let Some(local_server) = local_server.as_ref() {
- local_server.run();
- }
- ws_conn.init().await;
- (
- user_session,
- document_manager,
- folder_manager,
- local_server,
- database_manager,
- )
- });
+ let (
+ user_session,
+ document_manager,
+ folder_manager,
+ local_server,
+ database_manager,
+ document_manager2,
+ ) = runtime.block_on(async {
+ let user_session = mk_user_session(&config, &local_server, &config.server_config);
+ let document_manager = DocumentDepsResolver::resolve(
+ local_server.clone(),
+ ws_conn.clone(),
+ user_session.clone(),
+ &config.server_config,
+ &config.document,
+ );
+
+ let database_manager = DatabaseDepsResolver::resolve(
+ ws_conn.clone(),
+ user_session.clone(),
+ task_dispatcher.clone(),
+ )
+ .await;
+
+ let folder_manager =
+ Folder2DepsResolver::resolve(user_session.clone(), &document_manager, &database_manager)
+ .await;
+
+ let document_manager2 =
+ Document2DepsResolver::resolve(user_session.clone(), &database_manager);
+
+ if let Some(local_server) = local_server.as_ref() {
+ local_server.run();
+ }
+ ws_conn.init().await;
+ (
+ user_session,
+ document_manager,
+ folder_manager,
+ local_server,
+ database_manager,
+ document_manager2,
+ )
+ });
let user_status_listener = UserStatusListener {
document_manager: document_manager.clone(),
@@ -203,6 +215,7 @@ impl AppFlowyCore {
&database_manager,
&user_session,
&document_manager,
+ &document_manager2,
)
}));
_start_listening(&event_dispatcher, &ws_conn, &folder_manager);
@@ -211,6 +224,7 @@ impl AppFlowyCore {
config,
user_session,
document_manager,
+ document_manager2,
folder_manager,
database_manager,
event_dispatcher,
diff --git a/frontend/rust-lib/flowy-core/src/module.rs b/frontend/rust-lib/flowy-core/src/module.rs
index 41cad63a3c..2b55edb7f5 100644
--- a/frontend/rust-lib/flowy-core/src/module.rs
+++ b/frontend/rust-lib/flowy-core/src/module.rs
@@ -1,6 +1,7 @@
use flowy_client_ws::FlowyWebSocketConnect;
use flowy_database::manager::DatabaseManager;
use flowy_document::DocumentManager;
+use flowy_document2::manager::DocumentManager as DocumentManager2;
use flowy_folder2::manager::Folder2Manager;
use flowy_user::services::UserSession;
@@ -13,17 +14,20 @@ pub fn make_plugins(
grid_manager: &Arc<DatabaseManager>,
user_session: &Arc<UserSession>,
document_manager: &Arc<DocumentManager>,
+ document_manager2: &Arc<DocumentManager2>,
) -> Vec<AFPlugin> {
let user_plugin = flowy_user::event_map::init(user_session.clone());
let folder_plugin = flowy_folder2::event_map::init(folder_manager.clone());
let network_plugin = flowy_net::event_map::init(ws_conn.clone());
let grid_plugin = flowy_database::event_map::init(grid_manager.clone());
let document_plugin = flowy_document::event_map::init(document_manager.clone());
+ let document_plugin2 = flowy_document2::event_map::init(document_manager2.clone());
vec![
user_plugin,
folder_plugin,
network_plugin,
grid_plugin,
document_plugin,
+ document_plugin2,
]
}
diff --git a/frontend/rust-lib/flowy-document2/Cargo.toml b/frontend/rust-lib/flowy-document2/Cargo.toml
new file mode 100644
index 0000000000..3d76696705
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/Cargo.toml
@@ -0,0 +1,33 @@
+[package]
+name = "flowy-document2"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+collab = { version = "0.1.0" }
+collab-persistence = { version = "0.1.0" }
+collab-document = { version = "0.1.0" }
+
+flowy-derive = { path = "../flowy-derive" }
+flowy-notification = { path = "../flowy-notification" }
+flowy-error = { path = "../flowy-error", features = ["adaptor_sync", "adaptor_ot", "adaptor_serde", "adaptor_database", "adaptor_dispatch"] }
+
+lib-dispatch = { path = "../lib-dispatch" }
+
+protobuf = {version = "2.28.0"}
+bytes = { version = "1.4" }
+nanoid = "0.4.0"
+parking_lot = "0.12.1"
+strum = "0.21"
+strum_macros = "0.21"
+serde = { version = "1.0", features = ["derive"] }
+serde_json = {version = "1.0"}
+
+[build-dependencies]
+flowy-codegen = { path = "../flowy-codegen"}
+
+[features]
+dart = ["flowy-codegen/dart", "flowy-notification/dart"]
+ts = ["flowy-codegen/ts", "flowy-notification/ts"]
\ No newline at end of file
diff --git a/frontend/rust-lib/flowy-document2/Flowy.toml b/frontend/rust-lib/flowy-document2/Flowy.toml
new file mode 100644
index 0000000000..a48035cb14
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/Flowy.toml
@@ -0,0 +1,3 @@
+# Check out the FlowyConfig (located in flowy_toml.rs) for more details.
+proto_input = ["src/event_map.rs", "src/entities.rs", "src/notification.rs"]
+event_files = ["src/event_map.rs"]
\ No newline at end of file
diff --git a/frontend/rust-lib/flowy-document2/build.rs b/frontend/rust-lib/flowy-document2/build.rs
new file mode 100644
index 0000000000..06388d2a02
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/build.rs
@@ -0,0 +1,10 @@
+fn main() {
+ let crate_name = env!("CARGO_PKG_NAME");
+ flowy_codegen::protobuf_file::gen(crate_name);
+
+ #[cfg(feature = "dart")]
+ flowy_codegen::dart_event::gen(crate_name);
+
+ #[cfg(feature = "ts")]
+ flowy_codegen::ts_event::gen(crate_name);
+}
diff --git a/frontend/rust-lib/flowy-document2/src/document.rs b/frontend/rust-lib/flowy-document2/src/document.rs
new file mode 100644
index 0000000000..49b139d7f3
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/document.rs
@@ -0,0 +1,148 @@
+use std::{
+ collections::HashMap,
+ ops::{Deref, DerefMut},
+ sync::Arc,
+ vec,
+};
+
+use collab::preclude::Collab;
+use collab_document::{
+ blocks::{Block, DocumentData, DocumentMeta},
+ document::Document as InnerDocument,
+};
+use flowy_error::{ErrorCode, FlowyError, FlowyResult};
+use nanoid::nanoid;
+use parking_lot::Mutex;
+
+use crate::entities::{BlockMapPB, BlockPB, ChildrenPB, DocumentDataPB2, MetaPB};
+
+#[derive(Clone)]
+pub struct Document(Arc<Mutex<InnerDocument>>);
+
+impl Document {
+ pub fn new(collab: Collab, data: DocumentDataWrapper) -> FlowyResult<Self> {
+ let inner = InnerDocument::create(collab, data.0)
+ .map_err(|_| FlowyError::from(ErrorCode::DocumentDataInvalid))?;
+ Ok(Self(Arc::new(Mutex::new(inner))))
+ }
+}
+
+unsafe impl Sync for Document {}
+unsafe impl Send for Document {}
+
+impl Deref for Document {
+ type Target = Arc<Mutex<InnerDocument>>;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
+impl DerefMut for Document {
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.0
+ }
+}
+
+#[derive(Clone)]
+pub struct DocumentDataWrapper(pub DocumentData);
+
+impl Deref for DocumentDataWrapper {
+ type Target = DocumentData;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
+impl DerefMut for DocumentDataWrapper {
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.0
+ }
+}
+
+impl From<DocumentDataWrapper> for DocumentDataPB2 {
+ fn from(data: DocumentDataWrapper) -> Self {
+ let blocks = data
+ .0
+ .blocks
+ .into_iter()
+ .map(|(id, block)| {
+ (
+ id,
+ BlockPB {
+ id: block.id,
+ ty: block.ty,
+ parent_id: block.parent,
+ children_id: block.children,
+ data: serde_json::to_string(&block.data).unwrap(),
+ },
+ )
+ })
+ .collect::<HashMap<String, BlockPB>>();
+ let children_map = data
+ .0
+ .meta
+ .children_map
+ .into_iter()
+ .map(|(id, children)| {
+ (
+ id,
+ ChildrenPB {
+ children: children.into_iter().collect(),
+ },
+ )
+ })
+ .collect::<HashMap<String, ChildrenPB>>();
+ Self {
+ page_id: data.0.page_id,
+ blocks: BlockMapPB { blocks },
+ meta: MetaPB { children_map },
+ }
+ }
+}
+
+impl Default for DocumentDataWrapper {
+ fn default() -> Self {
+ let mut blocks: HashMap<String, Block> = HashMap::new();
+ let mut meta: HashMap<String, Vec<String>> = HashMap::new();
+
+ // page block
+ let page_id = nanoid!(10);
+ let children_id = nanoid!(10);
+ let root = Block {
+ id: page_id.clone(),
+ ty: "page".to_string(),
+ parent: "".to_string(),
+ children: children_id.clone(),
+ external_id: None,
+ external_type: None,
+ data: HashMap::new(),
+ };
+ blocks.insert(page_id.clone(), root);
+
+ // text block
+ let text_block_id = nanoid!(10);
+ let text_0_children_id = nanoid!(10);
+ let text_block = Block {
+ id: text_block_id.clone(),
+ ty: "text".to_string(),
+ parent: page_id.clone(),
+ children: text_0_children_id.clone(),
+ external_id: None,
+ external_type: None,
+ data: HashMap::new(),
+ };
+ blocks.insert(text_block_id.clone(), text_block);
+
+ // meta
+ meta.insert(children_id, vec![text_block_id]);
+ meta.insert(text_0_children_id, vec![]);
+
+ Self(DocumentData {
+ page_id,
+ blocks,
+ meta: DocumentMeta { children_map: meta },
+ })
+ }
+}
diff --git a/frontend/rust-lib/flowy-document2/src/entities.rs b/frontend/rust-lib/flowy-document2/src/entities.rs
new file mode 100644
index 0000000000..8507189ae7
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/entities.rs
@@ -0,0 +1,110 @@
+use std::collections::HashMap;
+
+use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
+
+#[derive(Default, ProtoBuf)]
+pub struct OpenDocumentPayloadPBV2 {
+ #[pb(index = 1)]
+ pub document_id: String,
+ // Support customize initial data
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct CloseDocumentPayloadPBV2 {
+ #[pb(index = 1)]
+ pub document_id: String,
+ // Support customize initial data
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct ApplyActionPayloadPBV2 {
+ #[pb(index = 1)]
+ pub document_id: String,
+
+ #[pb(index = 2)]
+ pub actions: Vec<BlockActionPB>,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct DocumentDataPB2 {
+ #[pb(index = 1)]
+ pub page_id: String,
+
+ #[pb(index = 2)]
+ pub blocks: BlockMapPB,
+
+ #[pb(index = 3)]
+ pub meta: MetaPB,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct BlockMapPB {
+ #[pb(index = 1)]
+ pub blocks: HashMap<String, BlockPB>,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct BlockPB {
+ #[pb(index = 1)]
+ pub id: String,
+
+ #[pb(index = 2)]
+ pub ty: String,
+
+ #[pb(index = 3)]
+ pub data: String,
+
+ #[pb(index = 4)]
+ pub parent_id: String,
+
+ #[pb(index = 5)]
+ pub children_id: String,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct MetaPB {
+ #[pb(index = 1)]
+ pub children_map: HashMap<String, ChildrenPB>,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct ChildrenPB {
+ #[pb(index = 1)]
+ pub children: Vec<String>,
+}
+
+// Actions
+#[derive(Default, ProtoBuf)]
+pub struct BlockActionPB {
+ #[pb(index = 1)]
+ pub action: BlockActionTypePB,
+
+ #[pb(index = 2)]
+ pub payload: BlockActionPayloadPB,
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct BlockActionPayloadPB {
+ #[pb(index = 1)]
+ pub block: BlockPB,
+
+ #[pb(index = 2, one_of)]
+ pub prev_id: Option<String>,
+
+ #[pb(index = 3, one_of)]
+ pub parent_id: Option<String>,
+}
+
+#[derive(ProtoBuf_Enum)]
+pub enum BlockActionTypePB {
+ Insert = 0,
+ Update = 1,
+ Delete = 2,
+ Move = 3,
+}
+
+impl Default for BlockActionTypePB {
+ fn default() -> Self {
+ Self::Insert
+ }
+}
diff --git a/frontend/rust-lib/flowy-document2/src/event_handler.rs b/frontend/rust-lib/flowy-document2/src/event_handler.rs
new file mode 100644
index 0000000000..9405992533
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/event_handler.rs
@@ -0,0 +1,98 @@
+use std::{sync::Arc};
+
+use crate::{
+ document::DocumentDataWrapper,
+ entities::{
+ ApplyActionPayloadPBV2, BlockActionPB, BlockActionPayloadPB, BlockActionTypePB,
+ BlockPB, CloseDocumentPayloadPBV2, DocumentDataPB2, OpenDocumentPayloadPBV2,
+ },
+ manager::DocumentManager,
+};
+
+use collab_document::blocks::{
+ json_str_to_hashmap, Block, BlockAction, BlockActionPayload, BlockActionType,
+};
+use flowy_error::{FlowyError, FlowyResult};
+use lib_dispatch::prelude::{data_result_ok, AFPluginData, AFPluginState, DataResult};
+pub(crate) async fn open_document_handler(
+ data: AFPluginData<OpenDocumentPayloadPBV2>,
+ manager: AFPluginState<Arc<DocumentManager>>,
+) -> DataResult<DocumentDataPB2, FlowyError> {
+ let context = data.into_inner();
+ let document = manager.open_document(context.document_id)?;
+ let document_data = document
+ .lock()
+ .get_document()
+ .map_err(|err| FlowyError::internal().context(err))?;
+ data_result_ok(DocumentDataPB2::from(DocumentDataWrapper(document_data)))
+}
+
+pub(crate) async fn close_document_handler(
+ data: AFPluginData<CloseDocumentPayloadPBV2>,
+ manager: AFPluginState<Arc<DocumentManager>>,
+) -> FlowyResult<()> {
+ let context = data.into_inner();
+ manager.close_document(context.document_id)?;
+ Ok(())
+}
+
+pub(crate) async fn apply_action_handler(
+ data: AFPluginData<ApplyActionPayloadPBV2>,
+ manager: AFPluginState<Arc<DocumentManager>>,
+) -> FlowyResult<()> {
+ let context = data.into_inner();
+ let doc_id = context.document_id;
+ let actions = context
+ .actions
+ .into_iter()
+ .map(|action| action.into())
+ .collect();
+ let document = manager.open_document(doc_id)?;
+ document.lock().apply_action(actions);
+ Ok(())
+}
+
+impl From<BlockActionPB> for BlockAction {
+ fn from(pb: BlockActionPB) -> Self {
+ Self {
+ action: pb.action.into(),
+ payload: pb.payload.into(),
+ }
+ }
+}
+
+impl From<BlockActionTypePB> for BlockActionType {
+ fn from(pb: BlockActionTypePB) -> Self {
+ match pb {
+ BlockActionTypePB::Insert => Self::Insert,
+ BlockActionTypePB::Update => Self::Update,
+ BlockActionTypePB::Delete => Self::Delete,
+ BlockActionTypePB::Move => Self::Move,
+ }
+ }
+}
+
+impl From<BlockActionPayloadPB> for BlockActionPayload {
+ fn from(pb: BlockActionPayloadPB) -> Self {
+ Self {
+ block: pb.block.into(),
+ parent_id: pb.parent_id,
+ prev_id: pb.prev_id,
+ }
+ }
+}
+
+impl From<BlockPB> for Block {
+ fn from(pb: BlockPB) -> Self {
+ let data = json_str_to_hashmap(&pb.data).unwrap_or_default();
+ Self {
+ id: pb.id,
+ ty: pb.ty,
+ children: pb.children_id,
+ parent: pb.parent_id,
+ data,
+ external_id: None,
+ external_type: None,
+ }
+ }
+}
diff --git a/frontend/rust-lib/flowy-document2/src/event_map.rs b/frontend/rust-lib/flowy-document2/src/event_map.rs
new file mode 100644
index 0000000000..d44586d4ab
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/event_map.rs
@@ -0,0 +1,35 @@
+use std::sync::Arc;
+use strum_macros::Display;
+
+use flowy_derive::{Flowy_Event, ProtoBuf_Enum};
+use lib_dispatch::prelude::AFPlugin;
+
+use crate::{
+ event_handler::{apply_action_handler, close_document_handler, open_document_handler},
+ manager::DocumentManager,
+};
+
+pub fn init(document_manager: Arc<DocumentManager>) -> AFPlugin {
+ let mut plugin = AFPlugin::new()
+ .name(env!("CARGO_PKG_NAME"))
+ .state(document_manager);
+
+ plugin = plugin.event(DocumentEvent2::OpenDocument, open_document_handler);
+ plugin = plugin.event(DocumentEvent2::CloseDocument, close_document_handler);
+ plugin = plugin.event(DocumentEvent2::ApplyAction, apply_action_handler);
+
+ plugin
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Display, ProtoBuf_Enum, Flowy_Event)]
+#[event_err = "FlowyError"]
+pub enum DocumentEvent2 {
+ #[event(input = "OpenDocumentPayloadPBV2", output = "DocumentDataPB2")]
+ OpenDocument = 0,
+
+ #[event(input = "CloseDocumentPayloadPBV2")]
+ CloseDocument = 1,
+
+ #[event(input = "ApplyActionPayloadPBV2")]
+ ApplyAction = 2,
+}
diff --git a/frontend/rust-lib/flowy-document2/src/lib.rs b/frontend/rust-lib/flowy-document2/src/lib.rs
new file mode 100644
index 0000000000..540db70f70
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/lib.rs
@@ -0,0 +1,8 @@
+pub mod entities;
+pub mod event_map;
+pub mod manager;
+pub mod protobuf;
+
+mod document;
+mod event_handler;
+mod notification;
diff --git a/frontend/rust-lib/flowy-document2/src/manager.rs b/frontend/rust-lib/flowy-document2/src/manager.rs
new file mode 100644
index 0000000000..a4b87f2143
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/manager.rs
@@ -0,0 +1,71 @@
+use std::{collections::HashMap, sync::Arc};
+
+use collab::{plugin_impl::disk::CollabDiskPlugin, preclude::CollabBuilder};
+use collab_persistence::CollabKV;
+use flowy_error::{FlowyError, FlowyResult};
+use parking_lot::RwLock;
+
+use crate::{
+ document::{Document, DocumentDataWrapper},
+ notification::{send_notification, DocumentNotification},
+};
+
+pub trait DocumentUser: Send + Sync {
+ fn user_id(&self) -> Result<i64, FlowyError>;
+ fn token(&self) -> Result<String, FlowyError>; // unused now.
+ fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError>;
+}
+
+pub struct DocumentManager {
+ documents: Arc<RwLock<HashMap<String, Arc<Document>>>>,
+ user: Arc<dyn DocumentUser>,
+}
+
+// unsafe impl Send for DocumentManager {}
+// unsafe impl Sync for DocumentManager {}
+
+impl DocumentManager {
+ pub fn new(user: Arc<dyn DocumentUser>) -> Self {
+ Self {
+ documents: Default::default(),
+ user,
+ }
+ }
+
+ pub fn open_document(&self, doc_id: String) -> FlowyResult<Arc<Document>> {
+ if let Some(doc) = self.documents.read().get(&doc_id) {
+ return Ok(doc.clone());
+ }
+ let collab = self.get_collab_for_doc_id(&doc_id)?;
+ let data = DocumentDataWrapper::default();
+ let document = Arc::new(Document::new(collab, data)?);
+
+ let clone_doc_id = doc_id.clone();
+ let _document_data = document
+ .lock()
+ .open(move |_, _| {
+ // TODO: add payload data.
+ send_notification(&clone_doc_id, DocumentNotification::DidReceiveUpdate).send();
+ })
+ .map_err(|err| FlowyError::internal().context(err))?;
+ self.documents.write().insert(doc_id, document.clone());
+ Ok(document)
+ }
+
+ pub fn close_document(&self, doc_id: String) -> FlowyResult<()> {
+ self.documents.write().remove(&doc_id);
+ Ok(())
+ }
+
+ fn get_collab_for_doc_id(&self, doc_id: &str) -> Result<collab::preclude::Collab, FlowyError> {
+ let uid = self.user.user_id()?;
+ let kv_db = self.user.kv_db()?;
+ let mut collab = CollabBuilder::new(uid, doc_id).build();
+ let disk_plugin = Arc::new(
+ CollabDiskPlugin::new(uid, kv_db).map_err(|err| FlowyError::internal().context(err))?,
+ );
+ collab.add_plugin(disk_plugin);
+ collab.initial();
+ Ok(collab)
+ }
+}
diff --git a/frontend/rust-lib/flowy-document2/src/notification.rs b/frontend/rust-lib/flowy-document2/src/notification.rs
new file mode 100644
index 0000000000..65ab6d62dc
--- /dev/null
+++ b/frontend/rust-lib/flowy-document2/src/notification.rs
@@ -0,0 +1,28 @@
+use flowy_derive::ProtoBuf_Enum;
+use flowy_notification::NotificationBuilder;
+
+
+const OBSERVABLE_CATEGORY: &str = "Document";
+
+#[derive(ProtoBuf_Enum, Debug)]
+pub(crate) enum DocumentNotification {
+ Unknown = 0,
+
+ DidReceiveUpdate = 1,
+}
+
+impl std::default::Default for DocumentNotification {
+ fn default() -> Self {
+ DocumentNotification::Unknown
+ }
+}
+
+impl std::convert::From<DocumentNotification> for i32 {
+ fn from(notification: DocumentNotification) -> Self {
+ notification as i32
+ }
+}
+
+pub(crate) fn send_notification(id: &str, ty: DocumentNotification) -> NotificationBuilder {
+ NotificationBuilder::new(id, ty, OBSERVABLE_CATEGORY)
+}
diff --git a/frontend/rust-lib/flowy-document2/tests/document_test.rs b/frontend/rust-lib/flowy-document2/tests/document_test.rs
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frontend/rust-lib/flowy-error/src/code.rs b/frontend/rust-lib/flowy-error/src/code.rs
index 12e25b7dec..0827b690c5 100644
--- a/frontend/rust-lib/flowy-error/src/code.rs
+++ b/frontend/rust-lib/flowy-error/src/code.rs
@@ -189,6 +189,9 @@ pub enum ErrorCode {
#[error("Only the date type can be used in calendar")]
UnexpectedCalendarFieldType = 61,
+
+ #[error("Document Data Invalid")]
+ DocumentDataInvalid = 62,
}
impl ErrorCode {
diff --git a/frontend/rust-lib/flowy-net/Cargo.toml b/frontend/rust-lib/flowy-net/Cargo.toml
index a7bc4f23af..8dda2f5151 100644
--- a/frontend/rust-lib/flowy-net/Cargo.toml
+++ b/frontend/rust-lib/flowy-net/Cargo.toml
@@ -20,6 +20,7 @@ flowy-client-network-config= { path = "../../../shared-lib/flowy-client-network-
flowy-sync = { path = "../../../shared-lib/flowy-sync"}
user-model = { path = "../../../shared-lib/user-model"}
flowy-folder2 = { path = "../flowy-folder2" }
+flowy-document2 = { path = "../flowy-document2" }
flowy-user = { path = "../flowy-user" }
flowy-document = { path = "../flowy-document" }
lazy_static = "1.4.0"