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.

Import notion zip (#6528)

Nathan.fooo320ffcb43409
diff --git a/.github/workflows/flutter_ci.yaml b/.github/workflows/flutter_ci.yaml
index 0d0baafe21..15ca158632 100644
--- a/.github/workflows/flutter_ci.yaml
+++ b/.github/workflows/flutter_ci.yaml
@@ -28,6 +28,7 @@ env:
FLUTTER_VERSION: "3.22.2"
RUST_TOOLCHAIN: "1.80.1"
CARGO_MAKE_VERSION: "0.37.18"
+ CLOUD_VERSION: 0.6.34-amd64
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -39,7 +40,7 @@ jobs:
strategy:
fail-fast: true
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
@@ -73,7 +74,7 @@ jobs:
strategy:
fail-fast: true
matrix:
- os: [windows-2019]
+ os: [ windows-2019 ]
include:
- os: windows-2019
flutter_profile: development-windows-x86
@@ -100,7 +101,7 @@ jobs:
strategy:
fail-fast: true
matrix:
- os: [macos-latest]
+ os: [ macos-latest ]
include:
- os: macos-latest
flutter_profile: development-mac-x86_64
@@ -122,12 +123,12 @@ jobs:
flutter_profile: ${{ matrix.flutter_profile }}
unit_test:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
@@ -216,11 +217,11 @@ jobs:
shell: bash
cloud_integration_test:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
@@ -247,9 +248,9 @@ jobs:
- name: Run Docker-Compose
working-directory: AppFlowy-Cloud
env:
- APPFLOWY_CLOUD_VERSION: 0.6.29-amd64
- APPFLOWY_HISTORY_VERSION: 0.6.29-amd64
- APPFLOWY_WORKER_VERSION: 0.6.29-amd64
+ APPFLOWY_CLOUD_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_HISTORY_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_WORKER_VERSION: ${{ env.CLOUD_VERSION }}
run: |
container_id=$(docker ps --filter name=appflowy-cloud-appflowy_cloud-1 -q)
if [ -z "$container_id" ]; then
@@ -325,12 +326,12 @@ jobs:
# split the integration tests into different machines to minimize the time
integration_test_1:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
@@ -349,12 +350,12 @@ jobs:
rust_target: ${{ matrix.target }}
integration_test_2:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
@@ -373,12 +374,12 @@ jobs:
rust_target: ${{ matrix.target }}
integration_test_3:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
@@ -397,12 +398,12 @@ jobs:
rust_target: ${{ matrix.target }}
integration_test_4:
- needs: [prepare-linux]
+ needs: [ prepare-linux ]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest]
+ os: [ ubuntu-latest ]
include:
- os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
diff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yaml
index 77f09f08c5..f47fc0d67a 100644
--- a/.github/workflows/rust_ci.yaml
+++ b/.github/workflows/rust_ci.yaml
@@ -20,6 +20,7 @@ on:
env:
CARGO_TERM_COLOR: always
+ CLOUD_VERSION: 0.6.34-amd64
RUST_TOOLCHAIN: "1.77.2"
jobs:
@@ -46,9 +47,9 @@ jobs:
- name: Ensure AppFlowy-Cloud is Running with Correct Version
working-directory: AppFlowy-Cloud
env:
- APPFLOWY_CLOUD_VERSION: 0.6.29-amd64
- APPFLOWY_HISTORY_VERSION: 0.6.29-amd64
- APPFLOWY_WORKER_VERSION: 0.6.29-amd64
+ APPFLOWY_CLOUD_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_HISTORY_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_WORKER_VERSION: ${{ env.CLOUD_VERSION }}
run: |
container_id=$(docker ps --filter name=appflowy-cloud-appflowy_cloud-1 -q)
if [ -z "$container_id" ]; then
@@ -135,9 +136,9 @@ jobs:
- name: Ensure AppFlowy-Cloud is Running with Correct Version
working-directory: AppFlowy-Cloud
env:
- APPFLOWY_CLOUD_VERSION: 0.6.29-amd64
- APPFLOWY_HISTORY_VERSION: 0.6.29-amd64
- APPFLOWY_WORKER_VERSION: 0.6.29-amd64
+ APPFLOWY_CLOUD_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_HISTORY_VERSION: ${{ env.CLOUD_VERSION }}
+ APPFLOWY_WORKER_VERSION: ${{ env.CLOUD_VERSION }}
run: |
container_id=$(docker ps --filter name=appflowy-cloud-appflowy_cloud-1 -q)
if [ -z "$container_id" ]; then
diff --git a/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart b/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart
index 04668a3f99..5f8ea7cac6 100644
--- a/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart
+++ b/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart
@@ -68,7 +68,7 @@ class AppFlowyCloudMockAuthService implements AuthService {
value.fold(
(l) => null,
(err) {
- debugPrint("signUpWithOAuth Error: $err");
+ debugPrint("mock auth service Error: $err");
Log.error(err);
},
);
@@ -76,7 +76,7 @@ class AppFlowyCloudMockAuthService implements AuthService {
});
},
(r) {
- debugPrint("signUpWithOAuth Error: $r");
+ debugPrint("mock auth service error: $r");
return FlowyResult.failure(r);
},
);
diff --git a/frontend/appflowy_flutter/lib/workspace/application/settings/share/import_service.dart b/frontend/appflowy_flutter/lib/workspace/application/settings/share/import_service.dart
index 3a323abce0..021203e9b9 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/settings/share/import_service.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/settings/share/import_service.dart
@@ -27,4 +27,16 @@ class ImportBackendService {
return FolderEventImportData(request).send();
}
+
+ static Future<FlowyResult<void, FlowyError>> importZipFiles(
+ List<ImportZipPB> values,
+ ) async {
+ for (final value in values) {
+ final result = await FolderEventImportZipFile(value).send();
+ if (result.isFailure) {
+ return result;
+ }
+ }
+ return FlowyResult.success(null);
+ }
}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_panel.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_panel.dart
index 9bda8ff288..6cfa675a90 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_panel.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_panel.dart
@@ -152,18 +152,27 @@ class _ImportPanelState extends State<ImportPanel> {
showLoading.value = true;
final importValues = <ImportValuePayloadPB>[];
-
for (final file in result.files) {
final path = file.path;
if (path == null) {
continue;
}
- final data = await File(path).readAsString();
final name = p.basenameWithoutExtension(path);
switch (importType) {
- case ImportType.markdownOrText:
+ case ImportType.historyDatabase:
+ final data = await File(path).readAsString();
+ importValues.add(
+ ImportValuePayloadPB.create()
+ ..name = name
+ ..data = utf8.encode(data)
+ ..viewLayout = ViewLayoutPB.Grid
+ ..importType = ImportTypePB.HistoryDatabase,
+ );
+ break;
case ImportType.historyDocument:
+ case ImportType.markdownOrText:
+ final data = await File(path).readAsString();
final bytes = _documentDataFrom(importType, data);
if (bytes != null) {
importValues.add(
@@ -171,46 +180,41 @@ class _ImportPanelState extends State<ImportPanel> {
..name = name
..data = bytes
..viewLayout = ViewLayoutPB.Document
- ..importType = ImportTypePB.HistoryDocument,
+ ..importType = ImportTypePB.Markdown,
);
}
break;
- case ImportType.historyDatabase:
- importValues.add(
- ImportValuePayloadPB.create()
- ..name = name
- ..data = utf8.encode(data)
- ..viewLayout = ViewLayoutPB.Grid
- ..importType = ImportTypePB.HistoryDatabase,
- );
- break;
- case ImportType.databaseRawData:
+ case ImportType.csv:
+ final data = await File(path).readAsString();
importValues.add(
ImportValuePayloadPB.create()
..name = name
..data = utf8.encode(data)
..viewLayout = ViewLayoutPB.Grid
- ..importType = ImportTypePB.RawDatabase,
+ ..importType = ImportTypePB.CSV,
);
break;
- case ImportType.databaseCSV:
+ case ImportType.afDatabase:
+ final data = await File(path).readAsString();
importValues.add(
ImportValuePayloadPB.create()
..name = name
..data = utf8.encode(data)
..viewLayout = ViewLayoutPB.Grid
- ..importType = ImportTypePB.CSV,
+ ..importType = ImportTypePB.AFDatabase,
);
break;
default:
- assert(false, 'Unsupported Type $importType');
+ break;
}
}
- await ImportBackendService.importPages(
- parentViewId,
- importValues,
- );
+ if (importValues.isNotEmpty) {
+ await ImportBackendService.importPages(
+ parentViewId,
+ importValues,
+ );
+ }
showLoading.value = false;
widget.importCallback(importType, '', null);
@@ -219,12 +223,12 @@ class _ImportPanelState extends State<ImportPanel> {
Uint8List? _documentDataFrom(ImportType importType, String data) {
switch (importType) {
- case ImportType.markdownOrText:
- final document = customMarkdownToDocument(data);
- return DocumentDataPBFromTo.fromDocument(document)?.writeToBuffer();
case ImportType.historyDocument:
final document = EditorMigration.migrateDocument(data);
return DocumentDataPBFromTo.fromDocument(document)?.writeToBuffer();
+ case ImportType.markdownOrText:
+ final document = customMarkdownToDocument(data);
+ return DocumentDataPBFromTo.fromDocument(document)?.writeToBuffer();
default:
assert(false, 'Unsupported Type $importType');
return null;
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_type.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_type.dart
index 5465bb0533..5c7c297327 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_type.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/import/import_type.dart
@@ -8,8 +8,8 @@ enum ImportType {
historyDocument,
historyDatabase,
markdownOrText,
- databaseCSV,
- databaseRawData;
+ csv,
+ afDatabase;
@override
String toString() {
@@ -20,9 +20,9 @@ enum ImportType {
return LocaleKeys.importPanel_databaseFromV010.tr();
case ImportType.markdownOrText:
return LocaleKeys.importPanel_textAndMarkdown.tr();
- case ImportType.databaseCSV:
+ case ImportType.csv:
return LocaleKeys.importPanel_csv.tr();
- case ImportType.databaseRawData:
+ case ImportType.afDatabase:
return LocaleKeys.importPanel_database.tr();
}
}
@@ -33,8 +33,8 @@ enum ImportType {
case ImportType.historyDatabase:
svg = FlowySvgs.document_s;
case ImportType.historyDocument:
- case ImportType.databaseCSV:
- case ImportType.databaseRawData:
+ case ImportType.csv:
+ case ImportType.afDatabase:
svg = FlowySvgs.board_s;
case ImportType.markdownOrText:
svg = FlowySvgs.text_s;
@@ -50,7 +50,7 @@ enum ImportType {
switch (this) {
case ImportType.historyDatabase:
case ImportType.historyDocument:
- case ImportType.databaseRawData:
+ case ImportType.afDatabase:
return kDebugMode;
default:
return true;
@@ -62,11 +62,11 @@ enum ImportType {
case ImportType.historyDocument:
return ['afdoc'];
case ImportType.historyDatabase:
- case ImportType.databaseRawData:
+ case ImportType.afDatabase:
return ['afdb'];
case ImportType.markdownOrText:
return ['md', 'txt'];
- case ImportType.databaseCSV:
+ case ImportType.csv:
return ['csv'];
}
}
@@ -74,9 +74,9 @@ enum ImportType {
bool get allowMultiSelect {
switch (this) {
case ImportType.historyDocument:
- case ImportType.databaseCSV:
- case ImportType.databaseRawData:
case ImportType.historyDatabase:
+ case ImportType.csv:
+ case ImportType.afDatabase:
case ImportType.markdownOrText:
return true;
}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_import_notion.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_import_notion.dart
new file mode 100644
index 0000000000..3ecf607b7d
--- /dev/null
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_import_notion.dart
@@ -0,0 +1,90 @@
+import 'package:appflowy/generated/locale_keys.g.dart';
+import 'package:appflowy/workspace/application/settings/share/import_service.dart';
+import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
+import 'package:appflowy_backend/protobuf/flowy-folder/import.pb.dart';
+import 'package:appflowy_result/appflowy_result.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flowy_infra_ui/flowy_infra_ui.dart';
+import 'package:flutter/material.dart';
+
+class NotionImporter extends StatelessWidget {
+ const NotionImporter({required this.filePath, super.key});
+
+ final String filePath;
+
+ @override
+ Widget build(BuildContext context) {
+ return ConstrainedBox(
+ constraints: const BoxConstraints(minHeight: 40, maxHeight: 200),
+ child: FutureBuilder(
+ future: _uploadFile(),
+ builder: (context, snapshots) {
+ if (!snapshots.hasData) {
+ return const _Uploading();
+ }
+
+ if (snapshots.hasError) {
+ return _UploadError(error: snapshots.error as FlowyError);
+ }
+
+ return const _UploadSuccess();
+ },
+ ),
+ );
+ }
+
+ Future<FlowyResult<void, FlowyError>> _uploadFile() async {
+ final importResult = await ImportBackendService.importZipFiles(
+ [ImportZipPB()..filePath = filePath],
+ );
+
+ return importResult;
+ }
+}
+
+class _UploadSuccess extends StatelessWidget {
+ const _UploadSuccess();
+
+ @override
+ Widget build(BuildContext context) {
+ return FlowyText(
+ fontSize: 16,
+ LocaleKeys.settings_common_uploadNotionSuccess.tr(),
+ maxLines: 10,
+ );
+ }
+}
+
+class _Uploading extends StatelessWidget {
+ const _Uploading();
+
+ @override
+ Widget build(BuildContext context) {
+ return IntrinsicHeight(
+ child: Center(
+ child: Column(
+ children: [
+ const CircularProgressIndicator.adaptive(),
+ const VSpace(12),
+ FlowyText(
+ fontSize: 16,
+ LocaleKeys.settings_common_uploadingFile.tr(),
+ maxLines: null,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class _UploadError extends StatelessWidget {
+ const _UploadError({required this.error});
+
+ final FlowyError error;
+
+ @override
+ Widget build(BuildContext context) {
+ return const Placeholder();
+ }
+}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
index 4f2c36cf88..55ccb4bd53 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
@@ -11,13 +11,19 @@ import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
+import 'package:flowy_infra/file_picker/file_picker_service.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import '_sidebar_import_notion.dart';
+
@visibleForTesting
const createWorkspaceButtonKey = ValueKey('createWorkspaceButton');
+@visibleForTesting
+const importNotionButtonKey = ValueKey('importNotinoButton');
+
class WorkspacesMenu extends StatelessWidget {
const WorkspacesMenu({
super.key,
@@ -82,6 +88,8 @@ class WorkspacesMenu extends StatelessWidget {
// add new workspace
const _CreateWorkspaceButton(),
const VSpace(6.0),
+ const _ImportNotionButton(),
+ const VSpace(6.0),
],
);
}
@@ -360,6 +368,78 @@ class _CreateWorkspaceButton extends StatelessWidget {
}
}
+class _ImportNotionButton extends StatelessWidget {
+ const _ImportNotionButton();
+
+ @override
+ Widget build(BuildContext context) {
+ return SizedBox(
+ height: 40,
+ child: FlowyButton(
+ key: importNotionButtonKey,
+ onTap: () {
+ _showImportNotinoDialog(context);
+ },
+ margin: const EdgeInsets.symmetric(horizontal: 4.0),
+ text: Row(
+ children: [
+ _buildLeftIcon(context),
+ const HSpace(8.0),
+ FlowyText.regular(
+ LocaleKeys.workspace_importFromNotion.tr(),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _buildLeftIcon(BuildContext context) {
+ return Container(
+ width: 36.0,
+ height: 36.0,
+ padding: const EdgeInsets.all(7.0),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(12),
+ border: Border.all(
+ color: const Color(0x01717171).withOpacity(0.12),
+ width: 0.8,
+ ),
+ ),
+ child: const FlowySvg(FlowySvgs.add_workspace_s),
+ );
+ }
+
+ Future<void> _showImportNotinoDialog(BuildContext context) async {
+ final result = await getIt<FilePickerService>().pickFiles(
+ type: FileType.custom,
+ allowedExtensions: ['zip'],
+ );
+
+ if (result == null || result.files.isEmpty) {
+ return;
+ }
+
+ final path = result.files.first.path;
+ if (path == null) {
+ return;
+ }
+
+ if (context.mounted) {
+ PopoverContainer.of(context).closeAll();
+ await NavigatorCustomDialog(
+ hideCancelButton: true,
+ confirm: () {},
+ child: NotionImporter(
+ filePath: path,
+ ),
+ ).show(context);
+ } else {
+ Log.error('context is not mounted when showing import notion dialog');
+ }
+ }
+}
+
class _WorkspaceMoreButton extends StatelessWidget {
const _WorkspaceMoreButton();
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialogs.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialogs.dart
index f9cbaac48c..8e4bee6112 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialogs.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialogs.dart
@@ -16,6 +16,62 @@ import 'package:universal_platform/universal_platform.dart';
export 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
+class NavigatorCustomDialog extends StatefulWidget {
+ const NavigatorCustomDialog({
+ super.key,
+ required this.child,
+ this.cancel,
+ this.confirm,
+ this.hideCancelButton = false,
+ });
+
+ final Widget child;
+ final void Function()? cancel;
+ final void Function()? confirm;
+ final bool hideCancelButton;
+
+ @override
+ State<NavigatorCustomDialog> createState() => _NavigatorCustomDialog();
+}
+
+class _NavigatorCustomDialog extends State<NavigatorCustomDialog> {
+ @override
+ Widget build(BuildContext context) {
+ return StyledDialog(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: <Widget>[
+ ...[
+ ConstrainedBox(
+ constraints: const BoxConstraints(
+ maxWidth: 400,
+ maxHeight: 260,
+ ),
+ child: widget.child,
+ ),
+ ],
+ if (widget.confirm != null) ...[
+ const VSpace(20),
+ OkCancelButton(
+ onOkPressed: () {
+ widget.confirm?.call();
+ Navigator.of(context).pop();
+ },
+ onCancelPressed: widget.hideCancelButton
+ ? null
+ : () {
+ widget.cancel?.call();
+ Navigator.of(context).pop();
+ },
+ ),
+ ],
+ ],
+ ),
+ );
+ }
+}
+
class NavigatorTextFieldDialog extends StatefulWidget {
const NavigatorTextFieldDialog({
super.key,
diff --git a/frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart b/frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart
index 518b9dba54..becc14c883 100644
--- a/frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart
+++ b/frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart
@@ -125,7 +125,7 @@ class AppFlowyGridTest {
..name = fileName
..data = utf8.encode(data)
..viewLayout = ViewLayoutPB.Grid
- ..importType = ImportTypePB.RawDatabase,
+ ..importType = ImportTypePB.AFDatabase,
],
).fold(
(views) async {
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock
index 4996c52b4e..f703c4a50f 100644
--- a/frontend/appflowy_tauri/src-tauri/Cargo.lock
+++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock
@@ -172,7 +172,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "app-error"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -192,7 +192,7 @@ dependencies = [
[[package]]
name = "appflowy-ai-client"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -848,7 +848,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"again",
"anyhow",
@@ -901,7 +901,7 @@ dependencies = [
[[package]]
name = "client-api-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"collab-entity",
"collab-rt-entity",
@@ -914,7 +914,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"futures-channel",
"futures-util",
@@ -988,7 +988,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1013,7 +1013,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-trait",
@@ -1052,7 +1052,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1073,7 +1073,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"bytes",
@@ -1093,7 +1093,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1115,7 +1115,7 @@ dependencies = [
[[package]]
name = "collab-importer"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-recursion",
@@ -1129,6 +1129,7 @@ dependencies = [
"collab-folder",
"fancy-regex 0.13.0",
"futures",
+ "futures-util",
"fxhash",
"hex",
"markdown",
@@ -1170,7 +1171,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-stream",
@@ -1208,7 +1209,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -1233,7 +1234,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"async-trait",
@@ -1250,7 +1251,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"collab",
@@ -1499,7 +1500,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa 1.0.6",
- "phf 0.8.0",
+ "phf 0.11.2",
"smallvec",
]
@@ -1624,7 +1625,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -1640,7 +1641,7 @@ dependencies = [
"thiserror",
"tracing",
"uuid",
- "validator",
+ "validator 0.16.1",
]
[[package]]
@@ -2114,7 +2115,7 @@ dependencies = [
"tokio-util",
"tracing",
"uuid",
- "validator",
+ "validator 0.18.1",
"zip",
"zip-extensions",
]
@@ -2288,7 +2289,7 @@ dependencies = [
"tokio-util",
"tracing",
"url",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2356,7 +2357,7 @@ dependencies = [
"tokio-stream",
"tracing",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2410,7 +2411,7 @@ dependencies = [
"thiserror",
"tokio",
"url",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2449,7 +2450,7 @@ dependencies = [
"tracing",
"unicode-segmentation",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2514,7 +2515,7 @@ dependencies = [
"tempfile",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2705,7 +2706,7 @@ dependencies = [
"tracing",
"unicode-segmentation",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -3194,7 +3195,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"futures-util",
@@ -3211,7 +3212,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -3643,7 +3644,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -3916,7 +3917,7 @@ dependencies = [
"thread-id",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
"wasm-bindgen",
"wasm-bindgen-futures",
]
@@ -3940,7 +3941,7 @@ dependencies = [
"tempfile",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
"walkdir",
"zip",
]
@@ -6281,7 +6282,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -7790,7 +7791,23 @@ dependencies = [
"serde_derive",
"serde_json",
"url",
- "validator_derive",
+ "validator_derive 0.16.0",
+]
+
+[[package]]
+name = "validator"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db79c75af171630a3148bd3e6d7c4f42b6a9a014c2945bc5ed0020cbb8d9478e"
+dependencies = [
+ "idna 0.5.0",
+ "once_cell",
+ "regex",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "url",
+ "validator_derive 0.18.2",
]
[[package]]
@@ -7809,6 +7826,20 @@ dependencies = [
"validator_types",
]
+[[package]]
+name = "validator_derive"
+version = "0.18.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df0bcf92720c40105ac4b2dda2a4ea3aa717d4d6a862cc217da653a4bd5c6b10"
+dependencies = [
+ "darling",
+ "once_cell",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.47",
+]
+
[[package]]
name = "validator_types"
version = "0.16.0"
@@ -8610,9 +8641,9 @@ dependencies = [
[[package]]
name = "yrs"
-version = "0.21.0"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8fc56b25e3aaf4b81a73f2a9a68ceae1e02d9005552e24058cfb9f96db73f33"
+checksum = "7744baf8d4f74beba8f47ca3a611c512766c82023f271167b14d21216559b014"
dependencies = [
"arc-swap",
"async-lock",
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml
index 69b1d92ed2..3a2c007528 100644
--- a/frontend/appflowy_tauri/src-tauri/Cargo.toml
+++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml
@@ -59,7 +59,7 @@ collab-importer = { version = "0.1" }
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9c0dffacef6b58070002d988fffd92d09e5516a8" }
+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "95e8b30f110fca0c914301da852c467a294d86dc" }
[dependencies]
serde_json.workspace = true
@@ -120,14 +120,14 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
-collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
+collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
# Working directory: frontend
# To update the commit ID, run:
diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.lock b/frontend/appflowy_web_app/src-tauri/Cargo.lock
index 775c2c9673..c96b7444e7 100644
--- a/frontend/appflowy_web_app/src-tauri/Cargo.lock
+++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock
@@ -163,7 +163,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "app-error"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -183,7 +183,7 @@ dependencies = [
[[package]]
name = "appflowy-ai-client"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -837,7 +837,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"again",
"anyhow",
@@ -890,7 +890,7 @@ dependencies = [
[[package]]
name = "client-api-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"collab-entity",
"collab-rt-entity",
@@ -903,7 +903,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"futures-channel",
"futures-util",
@@ -986,7 +986,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1011,7 +1011,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-trait",
@@ -1050,7 +1050,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1071,7 +1071,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"bytes",
@@ -1091,7 +1091,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -1113,7 +1113,7 @@ dependencies = [
[[package]]
name = "collab-importer"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-recursion",
@@ -1127,6 +1127,7 @@ dependencies = [
"collab-folder",
"fancy-regex 0.13.0",
"futures",
+ "futures-util",
"fxhash",
"hex",
"markdown",
@@ -1168,7 +1169,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-stream",
@@ -1206,7 +1207,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -1231,7 +1232,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"async-trait",
@@ -1248,7 +1249,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"collab",
@@ -1504,7 +1505,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa 1.0.10",
- "phf 0.8.0",
+ "phf 0.11.2",
"smallvec",
]
@@ -1629,7 +1630,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "database-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -1645,7 +1646,7 @@ dependencies = [
"thiserror",
"tracing",
"uuid",
- "validator",
+ "validator 0.16.1",
]
[[package]]
@@ -2159,7 +2160,7 @@ dependencies = [
"tokio-util",
"tracing",
"uuid",
- "validator",
+ "validator 0.18.1",
"zip",
"zip-extensions",
]
@@ -2333,7 +2334,7 @@ dependencies = [
"tokio-util",
"tracing",
"url",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2401,7 +2402,7 @@ dependencies = [
"tokio-stream",
"tracing",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2455,7 +2456,7 @@ dependencies = [
"thiserror",
"tokio",
"url",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2494,7 +2495,7 @@ dependencies = [
"tracing",
"unicode-segmentation",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2559,7 +2560,7 @@ dependencies = [
"tempfile",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -2750,7 +2751,7 @@ dependencies = [
"tracing",
"unicode-segmentation",
"uuid",
- "validator",
+ "validator 0.18.1",
]
[[package]]
@@ -3276,7 +3277,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"futures-util",
@@ -3293,7 +3294,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -3730,7 +3731,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -4008,7 +4009,7 @@ dependencies = [
"thread-id",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
"wasm-bindgen",
"wasm-bindgen-futures",
]
@@ -4032,7 +4033,7 @@ dependencies = [
"tempfile",
"tokio",
"tracing",
- "validator",
+ "validator 0.18.1",
"walkdir",
"zip",
]
@@ -6361,7 +6362,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -7924,7 +7925,23 @@ dependencies = [
"serde_derive",
"serde_json",
"url",
- "validator_derive",
+ "validator_derive 0.16.0",
+]
+
+[[package]]
+name = "validator"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db79c75af171630a3148bd3e6d7c4f42b6a9a014c2945bc5ed0020cbb8d9478e"
+dependencies = [
+ "idna 0.5.0",
+ "once_cell",
+ "regex",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "url",
+ "validator_derive 0.18.2",
]
[[package]]
@@ -7943,6 +7960,20 @@ dependencies = [
"validator_types",
]
+[[package]]
+name = "validator_derive"
+version = "0.18.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df0bcf92720c40105ac4b2dda2a4ea3aa717d4d6a862cc217da653a4bd5c6b10"
+dependencies = [
+ "darling",
+ "once_cell",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.55",
+]
+
[[package]]
name = "validator_types"
version = "0.16.0"
@@ -8852,9 +8883,9 @@ dependencies = [
[[package]]
name = "yrs"
-version = "0.21.0"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8fc56b25e3aaf4b81a73f2a9a68ceae1e02d9005552e24058cfb9f96db73f33"
+checksum = "7744baf8d4f74beba8f47ca3a611c512766c82023f271167b14d21216559b014"
dependencies = [
"arc-swap",
"async-lock",
diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml
index 25e47a4948..7c6887a64d 100644
--- a/frontend/appflowy_web_app/src-tauri/Cargo.toml
+++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml
@@ -58,7 +58,7 @@ collab-importer = { version = "0.1" }
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9c0dffacef6b58070002d988fffd92d09e5516a8" }
+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "95e8b30f110fca0c914301da852c467a294d86dc" }
[dependencies]
serde_json.workspace = true
@@ -118,14 +118,14 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
-collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
+collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
# Working directory: frontend
diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json
index d6aa564e68..f94524be85 100644
--- a/frontend/resources/translations/en.json
+++ b/frontend/resources/translations/en.json
@@ -74,6 +74,7 @@
"chooseWorkspace": "Choose your workspace",
"defaultName": "My Workspace",
"create": "Create workspace",
+ "importFromNotion": "Import From Notion",
"reset": "Reset workspace",
"renameWorkspace": "Rename workspace",
"workspaceNameCannotBeEmpty": "Workspace name cannot be empty",
@@ -144,6 +145,7 @@
"textAndMarkdown": "Text & Markdown",
"documentFromV010": "Document from v0.1.0",
"databaseFromV010": "Database from v0.1.0",
+ "notionZip": "Notion Exported Zip File",
"csv": "CSV",
"database": "Database"
},
@@ -939,6 +941,8 @@
}
},
"common": {
+ "uploadingFile": "File is uploading. Please do not quit the app",
+ "uploadNotionSuccess": "Your Notion zip file has been uploaded successfully. Once the import is complete, you will receive a confirmation email",
"reset": "Reset"
},
"menu": {
diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock
index db6f7b9185..42848b7a05 100644
--- a/frontend/rust-lib/Cargo.lock
+++ b/frontend/rust-lib/Cargo.lock
@@ -163,7 +163,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "app-error"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -183,7 +183,7 @@ dependencies = [
[[package]]
name = "appflowy-ai-client"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -740,7 +740,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"again",
"anyhow",
@@ -793,7 +793,7 @@ dependencies = [
[[package]]
name = "client-api-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"collab-entity",
"collab-rt-entity",
@@ -806,7 +806,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"futures-channel",
"futures-util",
@@ -849,7 +849,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -874,7 +874,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-trait",
@@ -913,7 +913,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -934,7 +934,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"bytes",
@@ -954,7 +954,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"arc-swap",
@@ -976,7 +976,7 @@ dependencies = [
[[package]]
name = "collab-importer"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-recursion",
@@ -990,6 +990,7 @@ dependencies = [
"collab-folder",
"fancy-regex 0.13.0",
"futures",
+ "futures-util",
"fxhash",
"hex",
"markdown",
@@ -1031,7 +1032,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"async-stream",
@@ -1069,7 +1070,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bincode",
@@ -1094,7 +1095,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"async-trait",
@@ -1111,7 +1112,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=b56d051#b56d0512acf2d3a3857c8e1d425e04ed38763516"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=8987e035accc81bd5ca0acc9812da8e4c6023eba#8987e035accc81bd5ca0acc9812da8e4c6023eba"
dependencies = [
"anyhow",
"collab",
@@ -1334,7 +1335,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa",
- "phf 0.11.2",
+ "phf 0.8.0",
"smallvec",
]
@@ -1483,7 +1484,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -2908,7 +2909,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"futures-util",
@@ -2925,7 +2926,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -3287,7 +3288,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"bytes",
@@ -4259,7 +4260,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
dependencies = [
- "phf_macros 0.8.0",
+ "phf_macros",
"phf_shared 0.8.0",
"proc-macro-hack",
]
@@ -4279,7 +4280,6 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
dependencies = [
- "phf_macros 0.11.2",
"phf_shared 0.11.2",
]
@@ -4347,19 +4347,6 @@ dependencies = [
"syn 1.0.109",
]
-[[package]]
-name = "phf_macros"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
-dependencies = [
- "phf_generator 0.11.2",
- "phf_shared 0.11.2",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
[[package]]
name = "phf_shared"
version = "0.8.0"
@@ -5557,7 +5544,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9c0dffacef6b58070002d988fffd92d09e5516a8#9c0dffacef6b58070002d988fffd92d09e5516a8"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=95e8b30f110fca0c914301da852c467a294d86dc#95e8b30f110fca0c914301da852c467a294d86dc"
dependencies = [
"anyhow",
"app-error",
@@ -7289,9 +7276,9 @@ dependencies = [
[[package]]
name = "yrs"
-version = "0.21.0"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8fc56b25e3aaf4b81a73f2a9a68ceae1e02d9005552e24058cfb9f96db73f33"
+checksum = "7744baf8d4f74beba8f47ca3a611c512766c82023f271167b14d21216559b014"
dependencies = [
"arc-swap",
"async-lock",
diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml
index b2429ccb38..bd408bef0f 100644
--- a/frontend/rust-lib/Cargo.toml
+++ b/frontend/rust-lib/Cargo.toml
@@ -106,8 +106,8 @@ dashmap = "6.0.1"
# Run the script.add_workspace_members:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9c0dffacef6b58070002d988fffd92d09e5516a8" }
-client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9c0dffacef6b58070002d988fffd92d09e5516a8" }
+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "95e8b30f110fca0c914301da852c467a294d86dc" }
+client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "95e8b30f110fca0c914301da852c467a294d86dc" }
[profile.dev]
opt-level = 0
@@ -142,14 +142,14 @@ rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
-collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
-collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "b56d051" }
+collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
+collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "8987e035accc81bd5ca0acc9812da8e4c6023eba" }
# Working directory: frontend
# To update the commit ID, run:
diff --git a/frontend/rust-lib/collab-integrate/src/collab_builder.rs b/frontend/rust-lib/collab-integrate/src/collab_builder.rs
index c9021bd947..afe06b6cc3 100644
--- a/frontend/rust-lib/collab-integrate/src/collab_builder.rs
+++ b/frontend/rust-lib/collab-integrate/src/collab_builder.rs
@@ -10,7 +10,7 @@ use collab::core::collab_plugin::CollabPersistence;
use collab::entity::EncodedCollab;
use collab::error::CollabError;
use collab::preclude::{Collab, CollabBuilder};
-use collab_database::workspace_database::{DatabaseCollabService, WorkspaceDatabase};
+use collab_database::workspace_database::{DatabaseCollabService, WorkspaceDatabaseManager};
use collab_document::blocks::DocumentData;
use collab_document::document::Document;
use collab_entity::{CollabObject, CollabType};
@@ -249,17 +249,17 @@ impl AppFlowyCollabBuilder {
#[allow(clippy::too_many_arguments)]
#[instrument(level = "trace", skip_all)]
- pub fn create_workspace_database(
+ pub fn create_workspace_database_manager(
&self,
object: CollabObject,
collab: Collab,
_collab_db: Weak<CollabKVDB>,
builder_config: CollabBuilderConfig,
collab_service: impl DatabaseCollabService,
- ) -> Result<Arc<RwLock<WorkspaceDatabase>>, Error> {
+ ) -> Result<Arc<RwLock<WorkspaceDatabaseManager>>, Error> {
let expected_collab_type = CollabType::WorkspaceDatabase;
assert_eq!(object.collab_type, expected_collab_type);
- let workspace = WorkspaceDatabase::open(&object.object_id, collab, collab_service)?;
+ let workspace = WorkspaceDatabaseManager::open(&object.object_id, collab, collab_service)?;
let workspace = Arc::new(RwLock::new(workspace));
self.finalize(object, builder_config, workspace)
}
diff --git a/frontend/rust-lib/flowy-core/src/deps_resolve/folder_deps.rs b/frontend/rust-lib/flowy-core/src/deps_resolve/folder_deps.rs
index 9f417e2ef8..f794de6662 100644
--- a/frontend/rust-lib/flowy-core/src/deps_resolve/folder_deps.rs
+++ b/frontend/rust-lib/flowy-core/src/deps_resolve/folder_deps.rs
@@ -497,8 +497,7 @@ impl FolderOperationHandler for DatabaseFolderOperation {
) -> Result<Vec<ImportedData>, FlowyError> {
let format = match import_type {
ImportType::CSV => CSVFormat::Original,
- ImportType::HistoryDatabase => CSVFormat::META,
- ImportType::RawDatabase => CSVFormat::META,
+ ImportType::AFDatabase => CSVFormat::META,
_ => CSVFormat::Original,
};
let content = tokio::task::spawn_blocking(move || {
diff --git a/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs b/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs
index 70f6b02be7..4b860bba16 100644
--- a/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs
+++ b/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs
@@ -246,13 +246,11 @@ impl FolderCloudService for ServerProvider {
workspace_id: &str,
uid: &i64,
) -> Result<Option<FolderData>, Error> {
- let uid = *uid;
let server = self.get_server()?;
- let workspace_id = workspace_id.to_string();
server
.folder_service()
- .get_folder_data(&workspace_id, &uid)
+ .get_folder_data(workspace_id, uid)
.await
}
@@ -261,12 +259,11 @@ impl FolderCloudService for ServerProvider {
workspace_id: &str,
limit: usize,
) -> Result<Vec<FolderSnapshot>, Error> {
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
server
.folder_service()
- .get_folder_snapshots(&workspace_id, limit)
+ .get_folder_snapshots(workspace_id, limit)
.await
}
@@ -277,13 +274,11 @@ impl FolderCloudService for ServerProvider {
collab_type: CollabType,
object_id: &str,
) -> Result<Vec<u8>, Error> {
- let object_id = object_id.to_string();
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
server
.folder_service()
- .get_folder_doc_state(&workspace_id, uid, collab_type, &object_id)
+ .get_folder_doc_state(workspace_id, uid, collab_type, object_id)
.await
}
@@ -292,12 +287,11 @@ impl FolderCloudService for ServerProvider {
workspace_id: &str,
objects: Vec<FolderCollabParams>,
) -> Result<(), Error> {
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
server
.folder_service()
- .batch_create_folder_collab_objects(&workspace_id, objects)
+ .batch_create_folder_collab_objects(workspace_id, objects)
.await
}
@@ -313,29 +307,25 @@ impl FolderCloudService for ServerProvider {
workspace_id: &str,
payload: Vec<PublishPayload>,
) -> Result<(), Error> {
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
server
.folder_service()
- .publish_view(&workspace_id, payload)
+ .publish_view(workspace_id, payload)
.await
}
async fn unpublish_views(&self, workspace_id: &str, view_ids: Vec<String>) -> Result<(), Error> {
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
-
server
.folder_service()
- .unpublish_views(&workspace_id, view_ids)
+ .unpublish_views(workspace_id, view_ids)
.await
}
async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfoResponse, Error> {
- let view_id = view_id.to_string();
let server = self.get_server()?;
- server.folder_service().get_publish_info(&view_id).await
+ server.folder_service().get_publish_info(view_id).await
}
async fn set_publish_namespace(
@@ -343,23 +333,26 @@ impl FolderCloudService for ServerProvider {
workspace_id: &str,
new_namespace: &str,
) -> Result<(), Error> {
- let workspace_id = workspace_id.to_string();
- let new_namespace = new_namespace.to_string();
let server = self.get_server()?;
-
server
.folder_service()
- .set_publish_namespace(&workspace_id, &new_namespace)
+ .set_publish_namespace(workspace_id, new_namespace)
.await
}
async fn get_publish_namespace(&self, workspace_id: &str) -> Result<String, Error> {
- let workspace_id = workspace_id.to_string();
let server = self.get_server()?;
-
server
.folder_service()
- .get_publish_namespace(&workspace_id)
+ .get_publish_namespace(workspace_id)
+ .await
+ }
+
+ async fn import_zip(&self, file_path: &str) -> Result<(), Error> {
+ self
+ .get_server()?
+ .folder_service()
+ .import_zip(file_path)
.await
}
}
diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs
index 1b8d72779a..48181bc8cb 100644
--- a/frontend/rust-lib/flowy-database2/src/manager.rs
+++ b/frontend/rust-lib/flowy-database2/src/manager.rs
@@ -13,7 +13,7 @@ use collab_database::template::csv::CSVTemplate;
use collab_database::views::DatabaseLayout;
use collab_database::workspace_database::{
CollabPersistenceImpl, DatabaseCollabPersistenceService, DatabaseCollabService, DatabaseMeta,
- EncodeCollabByOid, WorkspaceDatabase,
+ EncodeCollabByOid, WorkspaceDatabaseManager,
};
use collab_entity::{CollabObject, CollabType, EncodedCollab};
use collab_plugins::local_storage::kv::KVTransactionDB;
@@ -53,7 +53,7 @@ pub trait DatabaseUser: Send + Sync {
pub(crate) type DatabaseEditorMap = HashMap<String, Arc<DatabaseEditor>>;
pub struct DatabaseManager {
user: Arc<dyn DatabaseUser>,
- workspace_database: ArcSwapOption<RwLock<WorkspaceDatabase>>,
+ workspace_database_manager: ArcSwapOption<RwLock<WorkspaceDatabaseManager>>,
task_scheduler: Arc<TokioRwLock<TaskDispatcher>>,
pub(crate) editors: Mutex<DatabaseEditorMap>,
removing_editor: Arc<Mutex<HashMap<String, Arc<DatabaseEditor>>>>,
@@ -72,7 +72,7 @@ impl DatabaseManager {
) -> Self {
Self {
user: database_user,
- workspace_database: Default::default(),
+ workspace_database_manager: Default::default(),
task_scheduler,
editors: Default::default(),
removing_editor: Default::default(),
@@ -93,7 +93,7 @@ impl DatabaseManager {
self.editors.lock().await.clear();
self.removing_editor.lock().await.clear();
// 3. Clear the workspace database
- if let Some(old_workspace_database) = self.workspace_database.swap(None) {
+ if let Some(old_workspace_database) = self.workspace_database_manager.swap(None) {
info!("Close the old workspace database");
let wdb = old_workspace_database.read().await;
wdb.close();
@@ -117,7 +117,7 @@ impl DatabaseManager {
.await?;
let collab_object = collab_service
.build_collab_object(&workspace_database_object_id, CollabType::WorkspaceDatabase)?;
- let workspace_database = self.collab_builder.create_workspace_database(
+ let workspace_database = self.collab_builder.create_workspace_database_manager(
collab_object,
workspace_database_collab,
collab_db,
@@ -125,7 +125,9 @@ impl DatabaseManager {
collab_service,
)?;
- self.workspace_database.store(Some(workspace_database));
+ self
+ .workspace_database_manager
+ .store(Some(workspace_database));
Ok(())
}
@@ -155,7 +157,7 @@ impl DatabaseManager {
pub async fn get_all_databases_meta(&self) -> Vec<DatabaseMeta> {
let mut items = vec![];
- if let Some(lock) = self.workspace_database.load_full() {
+ if let Some(lock) = self.workspace_database_manager.load_full() {
let wdb = lock.read().await;
items = wdb.get_all_database_meta()
}
@@ -515,9 +517,9 @@ impl DatabaseManager {
Ok(snapshots)
}
- fn workspace_database(&self) -> FlowyResult<Arc<RwLock<WorkspaceDatabase>>> {
+ fn workspace_database(&self) -> FlowyResult<Arc<RwLock<WorkspaceDatabaseManager>>> {
self
- .workspace_database
+ .workspace_database_manager
.load_full()
.ok_or_else(|| FlowyError::internal().with_context("Workspace database not initialized"))
}
@@ -1053,7 +1055,7 @@ impl DatabaseCollabPersistenceService for DatabasePersistenceImpl {
}
}
async fn open_database_with_retry(
- workspace_database: Arc<RwLock<WorkspaceDatabase>>,
+ workspace_database_manager: Arc<RwLock<WorkspaceDatabaseManager>>,
database_id: &str,
) -> Result<Arc<RwLock<Database>>, DatabaseError> {
let max_retries = 3;
@@ -1065,7 +1067,7 @@ async fn open_database_with_retry(
database_id
);
- let result = workspace_database
+ let result = workspace_database_manager
.try_read()
.map_err(|err| DatabaseError::Internal(anyhow!("workspace database lock fail: {}", err)))?
.get_or_init_database(database_id)
diff --git a/frontend/rust-lib/flowy-folder-pub/src/cloud.rs b/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
index 19c3422984..763470e233 100644
--- a/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
+++ b/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
@@ -63,6 +63,8 @@ pub trait FolderCloudService: Send + Sync + 'static {
) -> Result<(), Error>;
async fn get_publish_namespace(&self, workspace_id: &str) -> Result<String, Error>;
+
+ async fn import_zip(&self, file_path: &str) -> Result<(), Error>;
}
#[derive(Debug)]
diff --git a/frontend/rust-lib/flowy-folder/src/entities/import.rs b/frontend/rust-lib/flowy-folder/src/entities/import.rs
index af34938361..6a14b922aa 100644
--- a/frontend/rust-lib/flowy-folder/src/entities/import.rs
+++ b/frontend/rust-lib/flowy-folder/src/entities/import.rs
@@ -1,18 +1,18 @@
use crate::entities::parser::empty_str::NotEmptyStr;
use crate::entities::ViewLayoutPB;
use crate::share::{ImportParams, ImportType, ImportValue};
-use collab_entity::CollabType;
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
use flowy_error::FlowyError;
-use lib_infra::validator_fn::{required_not_empty_str, required_valid_path};
+use lib_infra::validator_fn::required_not_empty_str;
use validator::Validate;
#[derive(Clone, Debug, ProtoBuf_Enum)]
pub enum ImportTypePB {
HistoryDocument = 0,
HistoryDatabase = 1,
- RawDatabase = 2,
- CSV = 3,
+ Markdown = 2,
+ AFDatabase = 3,
+ CSV = 4,
}
impl From<ImportTypePB> for ImportType {
@@ -20,26 +20,16 @@ impl From<ImportTypePB> for ImportType {
match pb {
ImportTypePB::HistoryDocument => ImportType::HistoryDocument,
ImportTypePB::HistoryDatabase => ImportType::HistoryDatabase,
- ImportTypePB::RawDatabase => ImportType::RawDatabase,
+ ImportTypePB::Markdown => ImportType::Markdown,
+ ImportTypePB::AFDatabase => ImportType::AFDatabase,
ImportTypePB::CSV => ImportType::CSV,
}
}
}
-impl From<ImportType> for CollabType {
- fn from(import_type: ImportType) -> Self {
- match import_type {
- ImportType::HistoryDocument => CollabType::Document,
- ImportType::HistoryDatabase => CollabType::Database,
- ImportType::RawDatabase => CollabType::Database,
- ImportType::CSV => CollabType::Database,
- }
- }
-}
-
impl Default for ImportTypePB {
fn default() -> Self {
- Self::HistoryDocument
+ Self::Markdown
}
}
@@ -78,17 +68,6 @@ pub struct ImportPayloadPB {
pub values: Vec<ImportValuePayloadPB>,
}
-#[derive(Clone, Debug, Validate, ProtoBuf, Default)]
-pub struct ImportZipPB {
- #[pb(index = 1)]
- #[validate(custom(function = "required_not_empty_str"))]
- pub parent_view_id: String,
-
- #[pb(index = 2)]
- #[validate(custom(function = "required_valid_path"))]
- pub file_path: String,
-}
-
impl TryInto<ImportParams> for ImportPayloadPB {
type Error = FlowyError;
@@ -132,3 +111,10 @@ impl TryInto<ImportParams> for ImportPayloadPB {
})
}
}
+
+#[derive(Clone, Debug, Validate, ProtoBuf, Default)]
+pub struct ImportZipPB {
+ #[pb(index = 1)]
+ #[validate(custom(function = "required_not_empty_str"))]
+ pub file_path: String,
+}
diff --git a/frontend/rust-lib/flowy-folder/src/event_handler.rs b/frontend/rust-lib/flowy-folder/src/event_handler.rs
index 4d342a3ab3..eb7573f224 100644
--- a/frontend/rust-lib/flowy-folder/src/event_handler.rs
+++ b/frontend/rust-lib/flowy-folder/src/event_handler.rs
@@ -387,13 +387,11 @@ pub(crate) async fn import_data_handler(
pub(crate) async fn import_zip_file_handler(
data: AFPluginData<ImportZipPB>,
folder: AFPluginState<Weak<FolderManager>>,
-) -> DataResult<RepeatedViewPB, FlowyError> {
+) -> Result<(), FlowyError> {
let folder = upgrade_folder(folder)?;
let data = data.try_into_inner()?;
- folder
- .import_zip_file(&data.parent_view_id, &data.file_path)
- .await?;
- todo!()
+ folder.import_zip_file(&data.file_path).await?;
+ Ok(())
}
#[tracing::instrument(level = "debug", skip(folder), err)]
diff --git a/frontend/rust-lib/flowy-folder/src/event_map.rs b/frontend/rust-lib/flowy-folder/src/event_map.rs
index 2069fa12af..e458576692 100644
--- a/frontend/rust-lib/flowy-folder/src/event_map.rs
+++ b/frontend/rust-lib/flowy-folder/src/event_map.rs
@@ -32,7 +32,7 @@ pub fn init(folder: Weak<FolderManager>) -> AFPlugin {
.event(FolderEvent::RecoverAllTrashItems, restore_all_trash_handler)
.event(FolderEvent::PermanentlyDeleteAllTrashItem, delete_my_trash_handler)
.event(FolderEvent::ImportData, import_data_handler)
- // .event(FolderEvent::ImportZipFile, import_zip_file_handler)
+ .event(FolderEvent::ImportZipFile, import_zip_file_handler)
.event(FolderEvent::GetFolderSnapshots, get_folder_snapshots_handler)
.event(FolderEvent::UpdateViewIcon, update_view_icon_handler)
.event(FolderEvent::ReadFavorites, read_favorites_handler)
@@ -198,6 +198,6 @@ pub enum FolderEvent {
#[event(input = "UnpublishViewsPayloadPB")]
UnpublishViews = 47,
- #[event(input = "ImportZipPB", output = "RepeatedViewPB")]
+ #[event(input = "ImportZipPB")]
ImportZipFile = 48,
}
diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs
index 69c85c928c..f47ffa3a70 100644
--- a/frontend/rust-lib/flowy-folder/src/manager.rs
+++ b/frontend/rust-lib/flowy-folder/src/manager.rs
@@ -1587,13 +1587,9 @@ impl FolderManager {
Ok((view, encoded_collab))
}
- #[allow(dead_code)]
- pub(crate) async fn import_zip_file(
- &self,
- _parent_view_id: &str,
- _zip_file_path: &str,
- ) -> FlowyResult<RepeatedViewPB> {
- todo!()
+ pub(crate) async fn import_zip_file(&self, zip_file_path: &str) -> FlowyResult<()> {
+ self.cloud_service.import_zip(zip_file_path).await?;
+ Ok(())
}
/// Import function to handle the import of data.
diff --git a/frontend/rust-lib/flowy-folder/src/share/import.rs b/frontend/rust-lib/flowy-folder/src/share/import.rs
index 0b9fbcbf22..2140c0f4ee 100644
--- a/frontend/rust-lib/flowy-folder/src/share/import.rs
+++ b/frontend/rust-lib/flowy-folder/src/share/import.rs
@@ -4,8 +4,9 @@ use collab_folder::ViewLayout;
pub enum ImportType {
HistoryDocument = 0,
HistoryDatabase = 1,
- RawDatabase = 2,
- CSV = 3,
+ Markdown = 2,
+ AFDatabase = 3,
+ CSV = 4,
}
#[derive(Clone, Debug)]
diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
index ec9bf53d1d..2c34e23153 100644
--- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
+++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
@@ -8,6 +8,7 @@ use collab::core::origin::CollabOrigin;
use collab_entity::CollabType;
use collab_folder::RepeatedViewIdentifier;
use serde_json::to_vec;
+use std::path::PathBuf;
use std::sync::Arc;
use tracing::instrument;
use uuid::Uuid;
@@ -260,11 +261,18 @@ where
async fn get_publish_namespace(&self, workspace_id: &str) -> Result<String, Error> {
let workspace_id = workspace_id.to_string();
- let try_get_client = self.inner.try_get_client();
- let namespace = try_get_client?
+ let namespace = self
+ .inner
+ .try_get_client()?
.get_workspace_publish_namespace(&workspace_id)
.await
.map_err(FlowyError::from)?;
Ok(namespace)
}
+
+ async fn import_zip(&self, file_path: &str) -> Result<(), Error> {
+ let file_path = PathBuf::from(file_path);
+ self.inner.try_get_client()?.import_file(&file_path).await?;
+ Ok(())
+ }
}
diff --git a/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs b/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
index 01b828dfa6..9cae8a8b22 100644
--- a/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
+++ b/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
@@ -112,4 +112,10 @@ impl FolderCloudService for LocalServerFolderCloudServiceImpl {
"Local server doesn't support get publish namespace"
))
}
+
+ async fn import_zip(&self, _file_path: &str) -> Result<(), Error> {
+ Err(anyhow!(
+ "Local server doesn't support get publish namespace"
+ ))
+ }
}
diff --git a/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs b/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs
index a1781517a0..ed9a198838 100644
--- a/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs
+++ b/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs
@@ -16,7 +16,7 @@ use collab_database::database::{
is_database_collab, mut_database_views_with_collab, reset_inline_view_id,
};
use collab_database::rows::{database_row_document_id_from_row_id, mut_row_with_collab, RowId};
-use collab_database::workspace_database::WorkspaceDatabaseBody;
+use collab_database::workspace_database::WorkspaceDatabase;
use collab_document::document_data::default_document_collab_data;
use collab_entity::CollabType;
use collab_folder::hierarchy_builder::{NestedChildViewBuilder, NestedViews, ParentChildViews};
@@ -505,11 +505,11 @@ where
&mut workspace_database_collab.transact_mut(),
)?;
- let workspace_database_body = init_workspace_database_body(
+ let workspace_database = init_workspace_database(
&imported_session.user_workspace.workspace_database_id,
workspace_database_collab,
);
- for database_meta_list in workspace_database_body.get_all_database_meta() {
+ for database_meta_list in workspace_database.get_all_database_meta() {
database_view_ids_by_database_id.insert(
old_to_new_id_map.exchange_new_id(&database_meta_list.database_id),
database_meta_list
@@ -528,8 +528,8 @@ where
Ok(())
}
-fn init_workspace_database_body(object_id: &str, collab: Collab) -> WorkspaceDatabaseBody {
- match WorkspaceDatabaseBody::open(collab) {
+fn init_workspace_database(object_id: &str, collab: Collab) -> WorkspaceDatabase {
+ match WorkspaceDatabase::open(collab) {
Ok(body) => body,
Err(err) => {
error!(
@@ -537,7 +537,7 @@ fn init_workspace_database_body(object_id: &str, collab: Collab) -> WorkspaceDat
err
);
let collab = Collab::new_with_origin(CollabOrigin::Empty, object_id, vec![], false);
- WorkspaceDatabaseBody::create(collab)
+ WorkspaceDatabase::create(collab)
},
}
}