From 805cbcb518e8780a7f59a61458359c069ffba42c Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 13 Jun 2024 14:55:58 +0800 Subject: [PATCH 1/3] chore: integrate ai tag --- frontend/appflowy_flutter/pubspec.lock | 24 +++ frontend/appflowy_tauri/src-tauri/Cargo.lock | 129 +++++++++++--- frontend/appflowy_tauri/src-tauri/Cargo.toml | 2 +- frontend/appflowy_web/wasm-libs/Cargo.lock | 129 +++++++++++--- frontend/appflowy_web/wasm-libs/Cargo.toml | 2 +- .../appflowy_web_app/src-tauri/Cargo.lock | 157 +++++++++++++++--- .../appflowy_web_app/src-tauri/Cargo.toml | 2 +- frontend/rust-lib/Cargo.lock | 129 +++++++++++--- frontend/rust-lib/Cargo.toml | 2 +- .../tests/database/af_cloud/util.rs | 10 ++ .../flowy-core/src/integrate/trait_impls.rs | 19 ++- .../rust-lib/flowy-database-pub/src/cloud.rs | 12 +- .../src/entities/field_entities.rs | 7 +- .../src/entities/filter_entities/util.rs | 7 + .../flowy-database2/src/entities/macros.rs | 1 + .../src/entities/type_option_entities/mod.rs | 2 + .../type_option_entities/tag_entities.rs | 36 ++++ .../rust-lib/flowy-database2/src/manager.rs | 58 ++++++- .../src/services/cell/cell_operation.rs | 3 + .../src/services/field/type_options/mod.rs | 1 + .../field/type_options/tag_type_option/mod.rs | 2 + .../field/type_options/tag_type_option/tag.rs | 132 +++++++++++++++ .../tag_type_option/tag_entities.rs | 46 +++++ .../text_type_option/text_type_option.rs | 1 + .../field/type_options/type_option.rs | 9 +- .../field/type_options/type_option_cell.rs | 16 ++ .../src/services/filter/entities.rs | 5 + .../database/mock_data/board_mock_data.rs | 1 + .../database/mock_data/grid_mock_data.rs | 8 + .../tests/database/share_test/export_test.rs | 2 + .../src/af_cloud/impls/database.rs | 20 ++- .../src/local_server/impls/database.rs | 11 +- .../flowy-server/src/supabase/api/database.rs | 11 +- 33 files changed, 895 insertions(+), 101 deletions(-) create mode 100644 frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs create mode 100644 frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/mod.rs create mode 100644 frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs create mode 100644 frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag_entities.rs diff --git a/frontend/appflowy_flutter/pubspec.lock b/frontend/appflowy_flutter/pubspec.lock index 8ad8a3f762e5c..ffdf26e42aee4 100644 --- a/frontend/appflowy_flutter/pubspec.lock +++ b/frontend/appflowy_flutter/pubspec.lock @@ -1041,6 +1041,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.19.0" + intl_utils: + dependency: transitive + description: + name: intl_utils + sha256: c2b1f5c72c25512cbeef5ab015c008fc50fe7e04813ba5541c25272300484bf4 + url: "https://pub.dev" + source: hosted + version: "2.8.7" io: dependency: transitive description: @@ -2192,6 +2200,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + universal_html: + dependency: transitive + description: + name: universal_html + sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971" + url: "https://pub.dev" + source: hosted + version: "2.2.4" + universal_io: + dependency: transitive + description: + name: universal_io + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.dev" + source: hosted + version: "2.2.2" universal_platform: dependency: transitive description: diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index 277f884e743bf..26dc1c27828f0 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=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -189,6 +189,38 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "app-error" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +dependencies = [ + "anyhow", + "getrandom 0.2.10", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tsify", + "url", + "uuid", + "wasm-bindgen", +] + +[[package]] +name = "appflowy-ai-client" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "bytes", + "futures", + "serde", + "serde_json", + "serde_repr", + "thiserror", +] + [[package]] name = "appflowy-ai-client" version = "0.1.0" @@ -212,7 +244,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "tokio", "yrs", ] @@ -786,11 +818,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "again", "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "async-trait", "bincode", "brotli", @@ -801,12 +833,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "futures-core", "futures-util", "getrandom 0.2.10", "gotrue", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "mime", "parking_lot 0.12.1", "prost", @@ -817,7 +849,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "thiserror", "tokio", "tokio-retry", @@ -833,7 +865,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "futures-channel", "futures-util", @@ -1073,7 +1105,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -1083,7 +1115,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "prost", "prost-build", "protoc-bin-vendored", @@ -1098,7 +1130,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "async-trait", @@ -1452,13 +1484,32 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "database-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bincode", + "chrono", + "collab-entity", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tracing", + "uuid", + "validator", +] + [[package]] name = "database-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bincode", "chrono", "collab-entity", @@ -2876,12 +2927,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.10", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "infra", "reqwest", "serde", @@ -2890,13 +2941,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "gotrue-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "chrono", + "jsonwebtoken", + "lazy_static", + "serde", + "serde_json", +] + [[package]] name = "gotrue-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "chrono", "jsonwebtoken", "lazy_static", @@ -3325,7 +3390,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "reqwest", @@ -5812,20 +5877,44 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bytes", + "chrono", + "collab-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "futures", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "log", + "pin-project", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "uuid", +] + [[package]] name = "shared-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", - "appflowy-ai-client", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bytes", "chrono", "collab-entity", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "futures", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index c21aa283d9698..0e6920e96d4f5 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -114,5 +114,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/appflowy_web/wasm-libs/Cargo.lock b/frontend/appflowy_web/wasm-libs/Cargo.lock index 183530fefdee7..bad5850f55f74 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.lock +++ b/frontend/appflowy_web/wasm-libs/Cargo.lock @@ -216,7 +216,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -233,6 +233,38 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "app-error" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +dependencies = [ + "anyhow", + "getrandom 0.2.12", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tsify", + "url", + "uuid", + "wasm-bindgen", +] + +[[package]] +name = "appflowy-ai-client" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "bytes", + "futures", + "serde", + "serde_json", + "serde_repr", + "thiserror", +] + [[package]] name = "appflowy-ai-client" version = "0.1.0" @@ -256,7 +288,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "tokio", "yrs", ] @@ -576,11 +608,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "again", "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "async-trait", "bincode", "brotli", @@ -591,12 +623,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "futures-core", "futures-util", "getrandom 0.2.12", "gotrue", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "mime", "parking_lot 0.12.1", "prost", @@ -607,7 +639,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "thiserror", "tokio", "tokio-retry", @@ -623,7 +655,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "futures-channel", "futures-util", @@ -801,7 +833,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -811,7 +843,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "prost", "prost-build", "protoc-bin-vendored", @@ -826,7 +858,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "async-trait", @@ -1037,13 +1069,32 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "database-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bincode", + "chrono", + "collab-entity", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tracing", + "uuid", + "validator", +] + [[package]] name = "database-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bincode", "chrono", "collab-entity", @@ -1901,12 +1952,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.12", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "infra", "reqwest", "serde", @@ -1915,13 +1966,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "gotrue-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "chrono", + "jsonwebtoken", + "lazy_static", + "serde", + "serde_json", +] + [[package]] name = "gotrue-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "chrono", "jsonwebtoken", "lazy_static", @@ -2219,7 +2284,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "reqwest", @@ -3918,20 +3983,44 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bytes", + "chrono", + "collab-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "futures", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "log", + "pin-project", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "uuid", +] + [[package]] name = "shared-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", - "appflowy-ai-client", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bytes", "chrono", "collab-entity", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "futures", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_web/wasm-libs/Cargo.toml b/frontend/appflowy_web/wasm-libs/Cargo.toml index 6f3221b392876..f61236d282c40 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.toml +++ b/frontend/appflowy_web/wasm-libs/Cargo.toml @@ -76,5 +76,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6febf0397e66ebf0a281980a2e7602d7af00c975" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6febf0397e66ebf0a281980a2e7602d7af00c975" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.lock b/frontend/appflowy_web_app/src-tauri/Cargo.lock index 844f7d57c23d9..70c41acb0e60a 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.lock +++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock @@ -163,7 +163,7 @@ checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -180,6 +180,38 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "app-error" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +dependencies = [ + "anyhow", + "getrandom 0.2.12", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tsify", + "url", + "uuid", + "wasm-bindgen", +] + +[[package]] +name = "appflowy-ai-client" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "bytes", + "futures", + "serde", + "serde_json", + "serde_repr", + "thiserror", +] + [[package]] name = "appflowy-ai-client" version = "0.1.0" @@ -194,6 +226,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "appflowy-cloud-billing-client" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6#9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6" +dependencies = [ + "client-api", + "reqwest", + "serde", + "serde_json", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "tokio", + "yrs", +] + [[package]] name = "appflowy_tauri" version = "0.0.0" @@ -746,11 +792,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "again", "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "async-trait", "bincode", "brotli", @@ -761,12 +807,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "futures-core", "futures-util", "getrandom 0.2.12", "gotrue", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "mime", "parking_lot 0.12.1", "prost", @@ -777,7 +823,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "thiserror", "tokio", "tokio-retry", @@ -793,7 +839,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "futures-channel", "futures-util", @@ -1042,7 +1088,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -1052,7 +1098,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "prost", "prost-build", "protoc-bin-vendored", @@ -1067,7 +1113,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "async-trait", @@ -1317,7 +1363,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.10", - "phf 0.11.2", + "phf 0.8.0", "smallvec", ] @@ -1425,13 +1471,32 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "database-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bincode", + "chrono", + "collab-entity", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tracing", + "uuid", + "validator", +] + [[package]] name = "database-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bincode", "chrono", "collab-entity", @@ -2248,6 +2313,7 @@ dependencies = [ "flowy-codegen", "flowy-derive", "flowy-error", + "flowy-folder", "flowy-notification", "flowy-search-pub", "flowy-sqlite", @@ -2284,6 +2350,7 @@ name = "flowy-server" version = "0.1.0" dependencies = [ "anyhow", + "appflowy-cloud-billing-client", "bytes", "chrono", "client-api", @@ -2934,12 +3001,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.12", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "infra", "reqwest", "serde", @@ -2948,13 +3015,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "gotrue-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "chrono", + "jsonwebtoken", + "lazy_static", + "serde", + "serde_json", +] + [[package]] name = "gotrue-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "chrono", "jsonwebtoken", "lazy_static", @@ -3388,7 +3469,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "reqwest", @@ -4895,7 +4976,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck 0.4.1", - "itertools 0.11.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -4916,7 +4997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.55", @@ -5891,20 +5972,44 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bytes", + "chrono", + "collab-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "futures", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "log", + "pin-project", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "uuid", +] + [[package]] name = "shared-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", - "appflowy-ai-client", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bytes", "chrono", "collab-entity", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "futures", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "log", "pin-project", "reqwest", @@ -6873,9 +6978,9 @@ checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8" [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -6893,9 +6998,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml index 54e0f746440bd..f4334bd7225f5 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.toml +++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml @@ -115,5 +115,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index 17bd8e164685f..f44d35b527bf6 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=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -180,6 +180,38 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "app-error" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +dependencies = [ + "anyhow", + "getrandom 0.2.10", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tsify", + "url", + "uuid", + "wasm-bindgen", +] + +[[package]] +name = "appflowy-ai-client" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "bytes", + "futures", + "serde", + "serde_json", + "serde_repr", + "thiserror", +] + [[package]] name = "appflowy-ai-client" version = "0.1.0" @@ -203,7 +235,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "tokio", "yrs", ] @@ -678,11 +710,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "again", "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "async-trait", "bincode", "brotli", @@ -693,12 +725,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "futures-core", "futures-util", "getrandom 0.2.10", "gotrue", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "mime", "parking_lot 0.12.1", "prost", @@ -709,7 +741,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "thiserror", "tokio", "tokio-retry", @@ -725,7 +757,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "futures-channel", "futures-util", @@ -934,7 +966,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "bincode", @@ -944,7 +976,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "prost", "prost-build", "protoc-bin-vendored", @@ -959,7 +991,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "async-trait", @@ -1276,13 +1308,32 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "database-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bincode", + "chrono", + "collab-entity", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tracing", + "uuid", + "validator", +] + [[package]] name = "database-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bincode", "chrono", "collab-entity", @@ -2546,12 +2597,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.10", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", "infra", "reqwest", "serde", @@ -2560,13 +2611,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "gotrue-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "chrono", + "jsonwebtoken", + "lazy_static", + "serde", + "serde_json", +] + [[package]] name = "gotrue-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "chrono", "jsonwebtoken", "lazy_static", @@ -2928,7 +2993,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" dependencies = [ "anyhow", "reqwest", @@ -5009,20 +5074,44 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-entity" +version = "0.1.0" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +dependencies = [ + "anyhow", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "bytes", + "chrono", + "collab-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "futures", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "log", + "pin-project", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "uuid", +] + [[package]] name = "shared-entity" version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" dependencies = [ "anyhow", - "app-error", - "appflowy-ai-client", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "bytes", "chrono", "collab-entity", - "database-entity", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "futures", - "gotrue-entity", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", "log", "pin-project", "reqwest", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 039f280eef89a..53eab30d5f6f3 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -122,7 +122,7 @@ lto = false incremental = false [patch.crates-io] -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } # TODO(Lucas.Xu) Upgrade to the latest version of RocksDB once PR(https://github.com/rust-rocksdb/rust-rocksdb/pull/869) is merged. diff --git a/frontend/rust-lib/event-integration-test/tests/database/af_cloud/util.rs b/frontend/rust-lib/event-integration-test/tests/database/af_cloud/util.rs index 25ef9920c844c..0e93cb1e78972 100644 --- a/frontend/rust-lib/event-integration-test/tests/database/af_cloud/util.rs +++ b/frontend/rust-lib/event-integration-test/tests/database/af_cloud/util.rs @@ -6,6 +6,7 @@ use collab_database::fields::Field; use collab_database::rows::Row; use flowy_database2::entities::FieldType; use flowy_database2::services::field::summary_type_option::summary::SummarizationTypeOption; +use flowy_database2::services::field::tag_type_option::tag::TagTypeOption; use flowy_database2::services::field::translate_type_option::translate::TranslateTypeOption; use flowy_database2::services::field::{ FieldBuilder, NumberFormat, NumberTypeOption, SelectOption, SelectOptionColor, @@ -63,6 +64,7 @@ fn create_fields() -> Vec { FieldType::SingleSelect => fields.push(create_single_select_field("Status")), FieldType::Summary => fields.push(create_summary_field("AI summary")), FieldType::Translate => fields.push(create_translate_field("AI Translate")), + FieldType::Tag => fields.push(create_tag_field("AI Tag")), _ => {}, } } @@ -137,3 +139,11 @@ fn create_translate_field(name: &str) -> Field { .name(name) .build() } + +#[allow(dead_code)] +fn create_tag_field(name: &str) -> Field { + let type_option = TagTypeOption::default(); + FieldBuilder::new(FieldType::Tag, type_option) + .name(name) + .build() +} 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 1853fd12d3291..3e58b039db49d 100644 --- a/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs +++ b/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use anyhow::Error; use client_api::collab_sync::{SinkConfig, SyncObject, SyncPlugin}; -use client_api::entity::ai_dto::RepeatedRelatedQuestion; +use client_api::entity::ai_dto::{RepeatedRelatedQuestion, TagRowResponse}; use client_api::entity::ChatMessageType; use collab::core::origin::{CollabClient, CollabOrigin}; @@ -23,7 +23,7 @@ use flowy_chat_pub::cloud::{ StreamAnswer, }; use flowy_database_pub::cloud::{ - CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, + CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, TagRowContent, TranslateRowContent, TranslateRowResponse, }; use flowy_document::deps::DocumentData; @@ -313,6 +313,21 @@ impl DatabaseCloudService for ServerProvider { .await }) } + + fn tag_database_row( + &self, + workspace_id: &str, + tag_row: TagRowContent, + ) -> FutureResult { + let workspace_id = workspace_id.to_string(); + let server = self.get_server(); + FutureResult::new(async move { + server? + .database_service() + .tag_database_row(&workspace_id, tag_row) + .await + }) + } } impl DocumentCloudService for ServerProvider { diff --git a/frontend/rust-lib/flowy-database-pub/src/cloud.rs b/frontend/rust-lib/flowy-database-pub/src/cloud.rs index 3a43eb36da8c2..11a39685476df 100644 --- a/frontend/rust-lib/flowy-database-pub/src/cloud.rs +++ b/frontend/rust-lib/flowy-database-pub/src/cloud.rs @@ -1,5 +1,7 @@ use anyhow::Error; -pub use client_api::entity::ai_dto::{TranslateItem, TranslateRowResponse}; +pub use client_api::entity::ai_dto::{ + TagItem, TagRowData, TagRowResponse, TranslateItem, TranslateRowResponse, +}; use collab::core::collab::DataSource; use collab_entity::CollabType; use lib_infra::future::FutureResult; @@ -8,6 +10,8 @@ use std::collections::HashMap; pub type CollabDocStateByOid = HashMap; pub type SummaryRowContent = HashMap; pub type TranslateRowContent = Vec; + +pub type TagRowContent = TagRowData; /// A trait for database cloud service. /// Each kind of server should implement this trait. Check out the [AppFlowyServerProvider] of /// [flowy-server] crate for more information. @@ -48,6 +52,12 @@ pub trait DatabaseCloudService: Send + Sync { translate_row: TranslateRowContent, language: &str, ) -> FutureResult; + + fn tag_database_row( + &self, + workspace_id: &str, + tag_row: TagRowContent, + ) -> FutureResult; } pub struct DatabaseSnapshot { diff --git a/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs b/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs index 3a1dd63b2facb..298111389d1e7 100644 --- a/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs +++ b/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs @@ -450,6 +450,7 @@ pub enum FieldType { Relation = 10, Summary = 11, Translate = 12, + Tag = 13, } impl Display for FieldType { @@ -491,12 +492,16 @@ impl FieldType { FieldType::Relation => "Relation", FieldType::Summary => "Summarize", FieldType::Translate => "Translate", + FieldType::Tag => "Tag", }; s.to_string() } pub fn is_ai_field(&self) -> bool { - matches!(self, FieldType::Summary | FieldType::Translate) + matches!( + self, + FieldType::Summary | FieldType::Translate | FieldType::Tag + ) } pub fn is_number(&self) -> bool { diff --git a/frontend/rust-lib/flowy-database2/src/entities/filter_entities/util.rs b/frontend/rust-lib/flowy-database2/src/entities/filter_entities/util.rs index d4f3bedb7c3be..ada6212fab1b3 100644 --- a/frontend/rust-lib/flowy-database2/src/entities/filter_entities/util.rs +++ b/frontend/rust-lib/flowy-database2/src/entities/filter_entities/util.rs @@ -113,6 +113,10 @@ impl From<&Filter> for FilterPB { .cloned::() .unwrap() .try_into(), + FieldType::Tag => condition_and_content + .cloned::() + .unwrap() + .try_into(), }; Self { @@ -163,6 +167,9 @@ impl TryFrom for FilterInner { FieldType::Translate => { BoxAny::new(TextFilterPB::try_from(bytes).map_err(|_| ErrorCode::ProtobufSerde)?) }, + FieldType::Tag => { + BoxAny::new(TextFilterPB::try_from(bytes).map_err(|_| ErrorCode::ProtobufSerde)?) + }, }; Ok(Self::Data { diff --git a/frontend/rust-lib/flowy-database2/src/entities/macros.rs b/frontend/rust-lib/flowy-database2/src/entities/macros.rs index 35c594a07e1cf..463b936964f8c 100644 --- a/frontend/rust-lib/flowy-database2/src/entities/macros.rs +++ b/frontend/rust-lib/flowy-database2/src/entities/macros.rs @@ -17,6 +17,7 @@ macro_rules! impl_into_field_type { 10 => FieldType::Relation, 11 => FieldType::Summary, 12 => FieldType::Translate, + 13 => FieldType::Tag, _ => { tracing::error!("🔴Can't parse FieldType from value: {}", ty); FieldType::RichText diff --git a/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/mod.rs b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/mod.rs index ceeeab38744ab..b3ad1c4c7e817 100644 --- a/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/mod.rs +++ b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/mod.rs @@ -5,6 +5,7 @@ mod number_entities; mod relation_entities; mod select_option_entities; mod summary_entities; +mod tag_entities; mod text_entities; mod timestamp_entities; mod translate_entities; @@ -17,6 +18,7 @@ pub use number_entities::*; pub use relation_entities::*; pub use select_option_entities::*; pub use summary_entities::*; +pub use tag_entities::*; pub use text_entities::*; pub use timestamp_entities::*; pub use translate_entities::*; diff --git a/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs new file mode 100644 index 0000000000000..b1dca5d3f6769 --- /dev/null +++ b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs @@ -0,0 +1,36 @@ +use crate::entities::TranslateTypeOptionPB; +use crate::services::field::tag_type_option::tag::{TagOption, TagTypeOption}; +use flowy_derive::ProtoBuf; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Default, ProtoBuf)] +pub struct TagTypeOptionPB { + #[pb(index = 1)] + pub tags: Vec, +} + +#[derive(ProtoBuf, Debug, Clone, Default)] +pub struct TagItemPB { + #[pb(index = 1)] + color: String, + + #[pb(index = 2)] + text: String, +} + +impl From for TagItemPB { + fn from(value: TagOption) -> Self { + Self { + color: value.color, + text: value.text, + } + } +} + +impl From for TagTypeOptionPB { + fn from(value: TagTypeOption) -> Self { + Self { + tags: value.tags.into_iter().map(TagItemPB::from).collect(), + } + } +} diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 598d3cec37cdc..1dff9435a6314 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -18,7 +18,8 @@ use tracing::{event, instrument, trace}; use collab_integrate::collab_builder::{AppFlowyCollabBuilder, CollabBuilderConfig}; use collab_integrate::{CollabKVAction, CollabKVDB, CollabPersistenceConfig}; use flowy_database_pub::cloud::{ - DatabaseCloudService, SummaryRowContent, TranslateItem, TranslateRowContent, + DatabaseCloudService, SummaryRowContent, TagItem, TagRowContent, TranslateItem, + TranslateRowContent, }; use flowy_error::{internal_error, FlowyError, FlowyResult}; use lib_infra::box_any::BoxAny; @@ -28,6 +29,7 @@ use crate::entities::{DatabaseLayoutPB, DatabaseSnapshotPB, FieldType}; use crate::services::cell::stringify_cell; use crate::services::database::DatabaseEditor; use crate::services::database_view::DatabaseLayoutDepsResolver; +use crate::services::field::tag_type_option::tag::{TagOption, TagTypeOption}; use crate::services::field::translate_type_option::translate::TranslateTypeOption; use crate::services::field_settings::default_field_settings_by_layout_map; @@ -506,7 +508,6 @@ impl DatabaseManager { } } - // Call the cloud service to summarize the row. trace!( "[AI]:translate to {}, content:{:?}", language, @@ -539,6 +540,59 @@ impl DatabaseManager { Ok(()) } + #[instrument(level = "debug", skip_all)] + pub async fn tag_row(&self, view_id: String, row_id: RowId, field_id: String) -> FlowyResult<()> { + let database = self.get_database_with_view_id(&view_id).await?; + let mut tag_row = TagRowContent { + existing_tags: vec![], + items: vec![], + num_tags: 5, + }; + if let Some(row) = database.get_row(&view_id, &row_id) { + let fields = database.get_fields(&view_id, None); + for field in fields { + if field.id != field_id { + if FieldType::from(field.field_type).is_ai_field() { + continue; + } + + if let Some(cell) = row.cells.get(&field.id) { + tag_row.items.push(TagItem { + title: field.name.clone(), + content: stringify_cell(cell, &field), + }) + } + } else { + tag_row.existing_tags.extend( + field + .type_options + .get(&FieldType::Tag.to_string()) + .cloned() + .map(TagTypeOption::from) + .unwrap_or_default() + .tags + .into_iter() + .map(|tag| tag.text) + .collect(), + ) + } + } + } + + let response = self + .cloud_service + .tag_database_row(&self.user.workspace_id()?, tag_row) + .await?; + + // Format the response items into a single string + let content = response.tags.map(|v| v).collect::>().join(", "); + trace!("[AI]:tag row response: {}", content); + database + .update_cell_with_changeset(&view_id, &row_id, &field_id, BoxAny::new(content)) + .await?; + Ok(()) + } + /// Only expose this method for testing #[cfg(debug_assertions)] pub fn get_cloud_service(&self) -> &Arc { diff --git a/frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs b/frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs index 068eea5da4d62..9d42cc735a74f 100644 --- a/frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs +++ b/frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs @@ -265,6 +265,9 @@ impl<'a> CellBuilder<'a> { FieldType::Translate => { cells.insert(field_id, insert_text_cell(cell_str, field)); }, + FieldType::Tag => { + cells.insert(field_id, insert_text_cell(cell_str, field)); + }, } } } diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/mod.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/mod.rs index 49451f38204a0..bd032a064cc97 100644 --- a/frontend/rust-lib/flowy-database2/src/services/field/type_options/mod.rs +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/mod.rs @@ -5,6 +5,7 @@ pub mod number_type_option; pub mod relation_type_option; pub mod selection_type_option; pub mod summary_type_option; +pub mod tag_type_option; pub mod text_type_option; pub mod timestamp_type_option; pub mod translate_type_option; diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/mod.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/mod.rs new file mode 100644 index 0000000000000..b699081b93d4e --- /dev/null +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/mod.rs @@ -0,0 +1,2 @@ +pub mod tag; +pub mod tag_entities; diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs new file mode 100644 index 0000000000000..0a723286ea393 --- /dev/null +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs @@ -0,0 +1,132 @@ +use crate::entities::TextFilterPB; +use crate::services::cell::{CellDataChangeset, CellDataDecoder}; +use crate::services::field::type_options::tag_type_option::tag_entities::TagCellData; +use crate::services::field::type_options::util::ProtobufStr; +use crate::services::field::{ + TypeOption, TypeOptionCellData, TypeOptionCellDataCompare, TypeOptionCellDataFilter, + TypeOptionCellDataSerde, TypeOptionTransform, +}; +use crate::services::sort::SortCondition; +use collab::core::any_map::{AnyMap, AnyMapExtension}; +use collab_database::fields::{TypeOptionData, TypeOptionDataBuilder}; +use collab_database::rows::Cell; +use flowy_error::FlowyResult; +use serde::{Deserialize, Serialize}; +use std::cmp::Ordering; + +#[derive(Debug, Clone, Default)] +pub struct TagTypeOption { + pub tags: Vec, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct TagOption { + pub color: String, + pub text: String, +} + +impl From for TagOption { + fn from(value: AnyMap) -> Self { + let color = value.get_string("color").unwrap_or_default(); + let text = value.get_string("text").unwrap_or_default(); + Self { color, text } + } +} + +impl From for AnyMap { + fn from(value: TagOption) -> Self { + let mut map = AnyMap::new(); + map.insert_string("color", value.color); + map.insert_string("text", value.text); + map + } +} +impl From for TagTypeOption { + fn from(value: TypeOptionData) -> Self { + let tags = value.get_array("tags"); + Self { tags } + } +} + +impl From for TypeOptionData { + fn from(value: TagTypeOption) -> Self { + TypeOptionDataBuilder::new() + .insert_maps("tags", value.tags) + .build() + } +} + +impl TypeOption for TagTypeOption { + type CellData = TagCellData; + type CellChangeset = String; + type CellProtobufType = ProtobufStr; + type CellFilter = TextFilterPB; +} + +impl CellDataChangeset for TagTypeOption { + fn apply_changeset( + &self, + changeset: String, + _cell: Option, + ) -> FlowyResult<(Cell, TagCellData)> { + let cell_data = TagCellData(changeset); + Ok((cell_data.clone().into(), cell_data)) + } +} + +impl TypeOptionCellDataFilter for TagTypeOption { + fn apply_filter( + &self, + filter: &::CellFilter, + cell_data: &::CellData, + ) -> bool { + filter.is_visible(cell_data) + } +} + +impl TypeOptionCellDataCompare for TagTypeOption { + fn apply_cmp( + &self, + cell_data: &::CellData, + other_cell_data: &::CellData, + sort_condition: SortCondition, + ) -> Ordering { + match (cell_data.is_cell_empty(), other_cell_data.is_cell_empty()) { + (true, true) => Ordering::Equal, + (true, false) => Ordering::Greater, + (false, true) => Ordering::Less, + (false, false) => { + let order = cell_data.0.cmp(&other_cell_data.0); + sort_condition.evaluate_order(order) + }, + } + } +} + +impl CellDataDecoder for TagTypeOption { + fn decode_cell(&self, cell: &Cell) -> FlowyResult { + Ok(TagCellData::from(cell)) + } + + fn stringify_cell_data(&self, cell_data: TagCellData) -> String { + cell_data.to_string() + } + + fn numeric_cell(&self, _cell: &Cell) -> Option { + None + } +} +impl TypeOptionTransform for TagTypeOption {} + +impl TypeOptionCellDataSerde for TagTypeOption { + fn protobuf_encode( + &self, + cell_data: ::CellData, + ) -> ::CellProtobufType { + ProtobufStr::from(cell_data.0) + } + + fn parse_cell(&self, cell: &Cell) -> FlowyResult<::CellData> { + Ok(TagCellData::from(cell)) + } +} diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag_entities.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag_entities.rs new file mode 100644 index 0000000000000..cdad1eff46ef1 --- /dev/null +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag_entities.rs @@ -0,0 +1,46 @@ +use crate::entities::FieldType; +use crate::services::field::{TypeOptionCellData, CELL_DATA}; +use collab::core::any_map::AnyMapExtension; +use collab_database::rows::{new_cell_builder, Cell}; + +#[derive(Default, Debug, Clone)] +pub struct TagCellData(pub String); +impl std::ops::Deref for TagCellData { + type Target = String; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl TypeOptionCellData for TagCellData { + fn is_cell_empty(&self) -> bool { + self.0.is_empty() + } +} + +impl From<&Cell> for TagCellData { + fn from(cell: &Cell) -> Self { + Self(cell.get_str_value(CELL_DATA).unwrap_or_default()) + } +} + +impl From for Cell { + fn from(data: TagCellData) -> Self { + new_cell_builder(FieldType::Tag) + .insert_str_value(CELL_DATA, data.0) + .build() + } +} + +impl ToString for TagCellData { + fn to_string(&self) -> String { + self.0.clone() + } +} + +impl AsRef for TagCellData { + fn as_ref(&self) -> &str { + &self.0 + } +} diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs index 1627b044656aa..d9f557128a5ca 100644 --- a/frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs @@ -86,6 +86,7 @@ impl CellDataDecoder for RichTextTypeOption { | FieldType::Relation => None, FieldType::Summary => Some(StringCellData::from(stringify_cell(cell, field))), FieldType::Translate => Some(StringCellData::from(stringify_cell(cell, field))), + FieldType::Tag => Some(StringCellData::from(stringify_cell(cell, field))), } } diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs index c283d39bbcafb..32069fb344fb9 100644 --- a/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs @@ -11,12 +11,13 @@ use flowy_error::FlowyResult; use crate::entities::{ CheckboxTypeOptionPB, ChecklistTypeOptionPB, DateTypeOptionPB, FieldType, MultiSelectTypeOptionPB, NumberTypeOptionPB, RelationTypeOptionPB, RichTextTypeOptionPB, - SingleSelectTypeOptionPB, SummarizationTypeOptionPB, TimestampTypeOptionPB, + SingleSelectTypeOptionPB, SummarizationTypeOptionPB, TagTypeOptionPB, TimestampTypeOptionPB, TranslateTypeOptionPB, URLTypeOptionPB, }; use crate::services::cell::CellDataDecoder; use crate::services::field::checklist_type_option::ChecklistTypeOption; use crate::services::field::summary_type_option::summary::SummarizationTypeOption; +use crate::services::field::tag_type_option::tag::TagTypeOption; use crate::services::field::translate_type_option::translate::TranslateTypeOption; use crate::services::field::{ CheckboxTypeOption, DateTypeOption, MultiSelectTypeOption, NumberTypeOption, RelationTypeOption, @@ -190,6 +191,7 @@ pub fn type_option_data_from_pb>( FieldType::Translate => { TranslateTypeOptionPB::try_from(bytes).map(|pb| TranslateTypeOption::from(pb).into()) }, + FieldType::Tag => TagTypeOptionPB::try_from(bytes).map(|pb| TagTypeOption::from(pb).into()), } } @@ -263,6 +265,10 @@ pub fn type_option_to_pb(type_option: TypeOptionData, field_type: &FieldType) -> .try_into() .unwrap() }, + FieldType::Tag => { + let tag_type_option: TagTypeOption = type_option.into(); + TagTypeOptionPB::from(tag_type_option).try_into().unwrap() + }, } } @@ -284,5 +290,6 @@ pub fn default_type_option_data_from_type(field_type: FieldType) -> TypeOptionDa FieldType::Relation => RelationTypeOption::default().into(), FieldType::Summary => SummarizationTypeOption::default().into(), FieldType::Translate => TranslateTypeOption::default().into(), + FieldType::Tag => TagTypeOption::default().into(), } } diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs index 19f7faf31ba54..d1a5f729639e6 100644 --- a/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs @@ -11,6 +11,7 @@ use lib_infra::box_any::BoxAny; use crate::entities::FieldType; use crate::services::cell::{CellCache, CellDataChangeset, CellDataDecoder, CellProtobufBlob}; use crate::services::field::summary_type_option::summary::SummarizationTypeOption; +use crate::services::field::tag_type_option::tag::TagTypeOption; use crate::services::field::translate_type_option::translate::TranslateTypeOption; use crate::services::field::{ CheckboxTypeOption, ChecklistTypeOption, DateTypeOption, MultiSelectTypeOption, NumberTypeOption, @@ -460,6 +461,18 @@ impl<'a> TypeOptionCellExt<'a> { self.cell_data_cache.clone(), ) }), + FieldType::Tag => { + self + .field + .get_type_option::(field_type) + .map(|type_option| { + TypeOptionCellDataHandlerImpl::new_with_boxed( + type_option, + field_type, + self.cell_data_cache.clone(), + ) + }) + }, } } @@ -566,6 +579,9 @@ fn get_type_option_transform_handler( FieldType::Translate => { Box::new(TranslateTypeOption::from(type_option_data)) as Box }, + FieldType::Tag => { + Box::new(TagTypeOption::from(type_option_data)) as Box + }, } } diff --git a/frontend/rust-lib/flowy-database2/src/services/filter/entities.rs b/frontend/rust-lib/flowy-database2/src/services/filter/entities.rs index 3b7d6444ef5fa..e0971eeb523af 100644 --- a/frontend/rust-lib/flowy-database2/src/services/filter/entities.rs +++ b/frontend/rust-lib/flowy-database2/src/services/filter/entities.rs @@ -282,6 +282,7 @@ impl FilterInner { FieldType::Relation => BoxAny::new(RelationFilterPB::parse(condition as u8, content)), FieldType::Summary => BoxAny::new(TextFilterPB::parse(condition as u8, content)), FieldType::Translate => BoxAny::new(TextFilterPB::parse(condition as u8, content)), + FieldType::Tag => BoxAny::new(TextFilterPB::parse(condition as u8, content)), }; FilterInner::Data { @@ -372,6 +373,10 @@ impl<'a> From<&'a Filter> for FilterMap { let filter = condition_and_content.cloned::()?; (filter.condition as u8, filter.content) }, + FieldType::Tag => { + let filter = condition_and_content.cloned::()?; + (filter.condition as u8, filter.content) + }, }; Some((condition, content)) }; diff --git a/frontend/rust-lib/flowy-database2/tests/database/mock_data/board_mock_data.rs b/frontend/rust-lib/flowy-database2/tests/database/mock_data/board_mock_data.rs index 70d3cd77a3603..e3bfb091d716a 100644 --- a/frontend/rust-lib/flowy-database2/tests/database/mock_data/board_mock_data.rs +++ b/frontend/rust-lib/flowy-database2/tests/database/mock_data/board_mock_data.rs @@ -135,6 +135,7 @@ pub fn make_test_board() -> DatabaseData { fields.push(relation_field); }, FieldType::Translate => {}, + FieldType::Tag => {}, } } diff --git a/frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs b/frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs index 0666d9171c5f6..a77f8cf1e6ccf 100644 --- a/frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs +++ b/frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs @@ -6,6 +6,7 @@ use crate::database::mock_data::{COMPLETED, FACEBOOK, GOOGLE, PAUSED, PLANNED, T use event_integration_test::database_event::TestRowBuilder; use flowy_database2::entities::FieldType; use flowy_database2::services::field::summary_type_option::summary::SummarizationTypeOption; +use flowy_database2::services::field::tag_type_option::tag::TagTypeOption; use flowy_database2::services::field::translate_type_option::translate::TranslateTypeOption; use flowy_database2::services::field::{ ChecklistTypeOption, DateFormat, DateTypeOption, FieldBuilder, MultiSelectTypeOption, @@ -143,6 +144,13 @@ pub fn make_test_grid() -> DatabaseData { .build(); fields.push(translate_field); }, + FieldType::Tag => { + let type_option = TagTypeOption { tags: vec![] }; + let translate_field = FieldBuilder::new(field_type, type_option) + .name("AI Tag") + .build(); + fields.push(translate_field); + }, } } diff --git a/frontend/rust-lib/flowy-database2/tests/database/share_test/export_test.rs b/frontend/rust-lib/flowy-database2/tests/database/share_test/export_test.rs index 5297ff14de004..2da7a320f3626 100644 --- a/frontend/rust-lib/flowy-database2/tests/database/share_test/export_test.rs +++ b/frontend/rust-lib/flowy-database2/tests/database/share_test/export_test.rs @@ -84,6 +84,7 @@ async fn export_and_then_import_meta_csv_test() { FieldType::Relation => {}, FieldType::Summary => {}, FieldType::Translate => {}, + FieldType::Tag => {}, } } else { panic!( @@ -168,6 +169,7 @@ async fn history_database_import_test() { FieldType::Relation => {}, FieldType::Summary => {}, FieldType::Translate => {}, + FieldType::Tag => {}, } } else { panic!( diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/database.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/database.rs index f44a82ad3e4d6..b708168922663 100644 --- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/database.rs +++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/database.rs @@ -1,6 +1,7 @@ use anyhow::Error; use client_api::entity::ai_dto::{ - SummarizeRowData, SummarizeRowParams, TranslateRowData, TranslateRowParams, + SummarizeRowData, SummarizeRowParams, TagRowData, TagRowParams, TagRowResponse, TranslateRowData, + TranslateRowParams, }; use client_api::entity::QueryCollabResult::{Failed, Success}; use client_api::entity::{QueryCollab, QueryCollabParams}; @@ -13,7 +14,7 @@ use std::sync::Arc; use tracing::{error, instrument}; use flowy_database_pub::cloud::{ - CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, + CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, TagRowContent, TranslateRowContent, TranslateRowResponse, }; use lib_infra::future::FutureResult; @@ -164,4 +165,19 @@ where Ok(data) }) } + + fn tag_database_row( + &self, + workspace_id: &str, + tag_row: TagRowContent, + ) -> FutureResult { + let workspace_id = workspace_id.to_string(); + let try_get_client = self.inner.try_get_client(); + FutureResult::new(async move { + let data = tag_row; + let params = TagRowParams { workspace_id, data }; + let data = try_get_client?.tag_row(params).await?; + Ok(data) + }) + } } diff --git a/frontend/rust-lib/flowy-server/src/local_server/impls/database.rs b/frontend/rust-lib/flowy-server/src/local_server/impls/database.rs index 6c923d7d8956f..cd7bfbd4fc195 100644 --- a/frontend/rust-lib/flowy-server/src/local_server/impls/database.rs +++ b/frontend/rust-lib/flowy-server/src/local_server/impls/database.rs @@ -1,11 +1,12 @@ use anyhow::Error; +use client_api::entity::ai_dto::TagRowResponse; use collab::preclude::Collab; use collab_entity::define::{DATABASE, DATABASE_ROW_DATA, WORKSPACE_DATABASES}; use collab_entity::CollabType; use yrs::{Any, MapPrelim}; use flowy_database_pub::cloud::{ - CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, + CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, TagRowContent, TranslateRowContent, TranslateRowResponse, }; use lib_infra::future::FutureResult; @@ -96,4 +97,12 @@ impl DatabaseCloudService for LocalServerDatabaseCloudServiceImpl { // TODO(lucas): local ai FutureResult::new(async move { Ok(TranslateRowResponse::default()) }) } + + fn tag_database_row( + &self, + workspace_id: &str, + tag_row: TagRowContent, + ) -> FutureResult { + FutureResult::new(async move { Ok(TagRowResponse::default()) }) + } } diff --git a/frontend/rust-lib/flowy-server/src/supabase/api/database.rs b/frontend/rust-lib/flowy-server/src/supabase/api/database.rs index afba36d585649..8d3742009a01a 100644 --- a/frontend/rust-lib/flowy-server/src/supabase/api/database.rs +++ b/frontend/rust-lib/flowy-server/src/supabase/api/database.rs @@ -1,9 +1,10 @@ use anyhow::Error; +use client_api::entity::ai_dto::TagRowResponse; use collab_entity::CollabType; use tokio::sync::oneshot::channel; use flowy_database_pub::cloud::{ - CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, + CollabDocStateByOid, DatabaseCloudService, DatabaseSnapshot, SummaryRowContent, TagRowContent, TranslateRowContent, TranslateRowResponse, }; use lib_dispatch::prelude::af_spawn; @@ -115,4 +116,12 @@ where ) -> FutureResult { FutureResult::new(async move { Ok(TranslateRowResponse::default()) }) } + + fn tag_database_row( + &self, + workspace_id: &str, + tag_row: TagRowContent, + ) -> FutureResult { + FutureResult::new(async move { Ok(TagRowResponse::default()) }) + } } From d7fae6fa7307fef852b03b7167e4a68e97807e4e Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 13 Jun 2024 15:14:41 +0800 Subject: [PATCH 2/3] chore: update client api --- .../field/type_option_editor/builder.dart | 2 + .../widgets/field/type_option_editor/tag.dart | 19 ++++++++ .../lib/util/field_type_extension.dart | 5 ++ frontend/appflowy_tauri/src-tauri/Cargo.lock | 46 +++++++++---------- frontend/appflowy_tauri/src-tauri/Cargo.toml | 2 +- frontend/appflowy_web/wasm-libs/Cargo.lock | 46 +++++++++---------- frontend/appflowy_web/wasm-libs/Cargo.toml | 2 +- .../appflowy_web_app/src-tauri/Cargo.lock | 46 +++++++++---------- .../appflowy_web_app/src-tauri/Cargo.toml | 2 +- frontend/resources/translations/en.json | 1 + frontend/rust-lib/Cargo.lock | 46 +++++++++---------- frontend/rust-lib/Cargo.toml | 2 +- 12 files changed, 123 insertions(+), 96 deletions(-) create mode 100644 frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/tag.dart diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart index 8ec91bdbaf3c8..ae44ebb54c139 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; +import 'package:appflowy/plugins/database/widgets/field/type_option_editor/tag.dart'; import 'package:appflowy/plugins/database/widgets/field/type_option_editor/translate.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; import 'package:appflowy_popover/appflowy_popover.dart'; @@ -35,6 +36,7 @@ abstract class TypeOptionEditorFactory { FieldType.Relation => const RelationTypeOptionEditorFactory(), FieldType.Summary => const SummaryTypeOptionEditorFactory(), FieldType.Translate => const TranslateTypeOptionEditorFactory(), + FieldType.Tag => const TagTypeOptionEditorFactory(), _ => throw UnimplementedError(), }; } diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/tag.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/tag.dart new file mode 100644 index 0000000000000..df70806bcfd08 --- /dev/null +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/tag.dart @@ -0,0 +1,19 @@ +import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; +import 'package:appflowy_popover/appflowy_popover.dart'; +import 'package:flutter/material.dart'; + +import 'builder.dart'; + +class TagTypeOptionEditorFactory implements TypeOptionEditorFactory { + const TagTypeOptionEditorFactory(); + + @override + Widget? build({ + required BuildContext context, + required String viewId, + required FieldPB field, + required PopoverMutex popoverMutex, + required TypeOptionDataCallback onTypeOptionUpdated, + }) => + null; +} diff --git a/frontend/appflowy_flutter/lib/util/field_type_extension.dart b/frontend/appflowy_flutter/lib/util/field_type_extension.dart index 99812b7c7f1f2..1816ab46d55f2 100644 --- a/frontend/appflowy_flutter/lib/util/field_type_extension.dart +++ b/frontend/appflowy_flutter/lib/util/field_type_extension.dart @@ -23,6 +23,7 @@ extension FieldTypeExtension on FieldType { FieldType.Relation => LocaleKeys.grid_field_relationFieldName.tr(), FieldType.Summary => LocaleKeys.grid_field_summaryFieldName.tr(), FieldType.Translate => LocaleKeys.grid_field_translateFieldName.tr(), + FieldType.Tag => LocaleKeys.grid_field_tagFieldName.tr(), _ => throw UnimplementedError(), }; @@ -40,12 +41,14 @@ extension FieldTypeExtension on FieldType { FieldType.Relation => FlowySvgs.relation_s, FieldType.Summary => FlowySvgs.ai_summary_s, FieldType.Translate => FlowySvgs.ai_translate_s, + FieldType.Tag => FlowySvgs.ai_tag_s, _ => throw UnimplementedError(), }; FlowySvgData? get rightIcon => switch (this) { FieldType.Summary => FlowySvgs.ai_indicator_s, FieldType.Translate => FlowySvgs.ai_indicator_s, + FieldType.Tag => FlowySvgs.ai_indicator_s, _ => null, }; @@ -63,6 +66,7 @@ extension FieldTypeExtension on FieldType { FieldType.Relation => const Color(0xFFFDEDA7), FieldType.Summary => const Color(0xFFBECCFF), FieldType.Translate => const Color(0xFFBECCFF), + FieldType.Tag => const Color(0xFFBECCFF), _ => throw UnimplementedError(), }; @@ -81,6 +85,7 @@ extension FieldTypeExtension on FieldType { FieldType.Relation => const Color(0xFFFDEDA7), FieldType.Summary => const Color(0xFF6859A7), FieldType.Translate => const Color(0xFF6859A7), + FieldType.Tag => const Color(0xFF6859A7), _ => throw UnimplementedError(), }; } diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index 26dc1c27828f0..d130ac444b33c 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=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -210,7 +210,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -818,11 +818,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "async-trait", "bincode", "brotli", @@ -833,12 +833,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures-core", "futures-util", "getrandom 0.2.10", "gotrue", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "mime", "parking_lot 0.12.1", "prost", @@ -849,7 +849,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "thiserror", "tokio", "tokio-retry", @@ -865,7 +865,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -1105,7 +1105,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -1115,7 +1115,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "prost", "prost-build", "protoc-bin-vendored", @@ -1130,7 +1130,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1487,10 +1487,10 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bincode", "chrono", "collab-entity", @@ -2927,12 +2927,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.10", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "infra", "reqwest", "serde", @@ -2944,10 +2944,10 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "chrono", "jsonwebtoken", "lazy_static", @@ -3390,7 +3390,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -5880,17 +5880,17 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bytes", "chrono", "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index 0e6920e96d4f5..f1b912f17479e 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -114,5 +114,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/appflowy_web/wasm-libs/Cargo.lock b/frontend/appflowy_web/wasm-libs/Cargo.lock index bad5850f55f74..08530bd9c7841 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.lock +++ b/frontend/appflowy_web/wasm-libs/Cargo.lock @@ -216,7 +216,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -254,7 +254,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -608,11 +608,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "async-trait", "bincode", "brotli", @@ -623,12 +623,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures-core", "futures-util", "getrandom 0.2.12", "gotrue", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "mime", "parking_lot 0.12.1", "prost", @@ -639,7 +639,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "thiserror", "tokio", "tokio-retry", @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -833,7 +833,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -843,7 +843,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "prost", "prost-build", "protoc-bin-vendored", @@ -858,7 +858,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1072,10 +1072,10 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bincode", "chrono", "collab-entity", @@ -1952,12 +1952,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.12", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "infra", "reqwest", "serde", @@ -1969,10 +1969,10 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "chrono", "jsonwebtoken", "lazy_static", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -3986,17 +3986,17 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bytes", "chrono", "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_web/wasm-libs/Cargo.toml b/frontend/appflowy_web/wasm-libs/Cargo.toml index f61236d282c40..ccd53b5f41fd7 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.toml +++ b/frontend/appflowy_web/wasm-libs/Cargo.toml @@ -76,5 +76,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6febf0397e66ebf0a281980a2e7602d7af00c975" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6febf0397e66ebf0a281980a2e7602d7af00c975" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.lock b/frontend/appflowy_web_app/src-tauri/Cargo.lock index 70c41acb0e60a..09ef46bcd1f17 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.lock +++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock @@ -163,7 +163,7 @@ checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -792,11 +792,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "async-trait", "bincode", "brotli", @@ -807,12 +807,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures-core", "futures-util", "getrandom 0.2.12", "gotrue", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "mime", "parking_lot 0.12.1", "prost", @@ -823,7 +823,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "thiserror", "tokio", "tokio-retry", @@ -839,7 +839,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -1088,7 +1088,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -1098,7 +1098,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "prost", "prost-build", "protoc-bin-vendored", @@ -1113,7 +1113,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1474,10 +1474,10 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bincode", "chrono", "collab-entity", @@ -3001,12 +3001,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.12", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "infra", "reqwest", "serde", @@ -3018,10 +3018,10 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "chrono", "jsonwebtoken", "lazy_static", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -5975,17 +5975,17 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bytes", "chrono", "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml index f4334bd7225f5..98935da975ab8 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.toml +++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml @@ -115,5 +115,5 @@ collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFl collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3a58d95" } -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json index 83c03c87ec97d..6decd74e61f8c 100644 --- a/frontend/resources/translations/en.json +++ b/frontend/resources/translations/en.json @@ -1011,6 +1011,7 @@ "relationFieldName": "Relation", "summaryFieldName": "AI Summary", "translateFieldName": "AI Translate", + "tagFieldName": "AI Tags", "translateTo": "Translate to", "numberFormat": "Number format", "dateFormat": "Date format", diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index f44d35b527bf6..13e617de56882 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=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -710,11 +710,11 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "async-trait", "bincode", "brotli", @@ -725,12 +725,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures-core", "futures-util", "getrandom 0.2.10", "gotrue", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "mime", "parking_lot 0.12.1", "prost", @@ -741,7 +741,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "thiserror", "tokio", "tokio-retry", @@ -757,7 +757,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -966,7 +966,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -976,7 +976,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "prost", "prost-build", "protoc-bin-vendored", @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1311,10 +1311,10 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bincode", "chrono", "collab-entity", @@ -2597,12 +2597,12 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", "getrandom 0.2.10", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "infra", "reqwest", "serde", @@ -2614,10 +2614,10 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "chrono", "jsonwebtoken", "lazy_static", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -5077,17 +5077,17 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685#d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "bytes", "chrono", "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685)", + "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", "log", "pin-project", "reqwest", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 53eab30d5f6f3..a27f4cd7441d2 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -122,7 +122,7 @@ lto = false incremental = false [patch.crates-io] -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d1c586ee56ee1f0a04c0364a80ab5eee6ef0e685" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } shared-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ff4384fbd07a4b7394a9af8c9159cd65715d3471" } # TODO(Lucas.Xu) Upgrade to the latest version of RocksDB once PR(https://github.com/rust-rocksdb/rust-rocksdb/pull/869) is merged. From 87e7c18185766fbc0814df6ccbf01fe368bfc5f2 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 17 Jun 2024 21:07:39 +0800 Subject: [PATCH 3/3] chore: ai tag --- .../application/cell/bloc/tag_cell.bloc.dart | 111 +++++++++++++++ .../cell/cell_controller_builder.dart | 1 + .../card_cell_skeleton/tag_card_cell.dart | 62 ++++++++ .../mobile_board_card_cell_style.dart | 8 +- .../widgets/field/field_type_list.dart | 1 + .../field/type_option_editor/builder.dart | 1 - frontend/appflowy_tauri/src-tauri/Cargo.lock | 28 ++-- frontend/appflowy_tauri/src-tauri/Cargo.toml | 2 +- frontend/appflowy_web/wasm-libs/Cargo.lock | 40 ++---- frontend/appflowy_web/wasm-libs/Cargo.toml | 2 +- .../appflowy_web_app/src-tauri/Cargo.lock | 134 ++---------------- .../appflowy_web_app/src-tauri/Cargo.toml | 2 +- frontend/rust-lib/Cargo.lock | 44 ++++-- frontend/rust-lib/Cargo.toml | 2 +- .../type_option_entities/tag_entities.rs | 17 +++ .../rust-lib/flowy-database2/src/manager.rs | 4 +- .../field/type_options/tag_type_option/tag.rs | 8 +- 17 files changed, 280 insertions(+), 187 deletions(-) create mode 100644 frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/tag_cell.bloc.dart create mode 100644 frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/tag_card_cell.dart diff --git a/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/tag_cell.bloc.dart b/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/tag_cell.bloc.dart new file mode 100644 index 0000000000000..0eabe03ee2e92 --- /dev/null +++ b/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/tag_cell.bloc.dart @@ -0,0 +1,111 @@ +import 'dart:async'; + +import 'package:appflowy/plugins/database/application/cell/cell_controller_builder.dart'; +import 'package:appflowy/plugins/database/application/field/field_info.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'tag_cell_bloc.freezed.dart'; + +class TagCellBloc extends Bloc { + TagCellBloc({ + required this.cellController, + }) : super(TagCellState.initial(cellController)) { + _dispatch(); + _startListening(); + } + + final TagCellController cellController; + void Function()? _onCellChangedFn; + + @override + Future close() async { + if (_onCellChangedFn != null) { + cellController.removeListener( + onCellChanged: _onCellChangedFn!, + onFieldChanged: _onFieldChangedListener, + ); + } + await cellController.dispose(); + return super.close(); + } + + void _dispatch() { + on( + (event, emit) async { + await event.when( + didReceiveCellUpdate: (cellData) { + emit( + state.copyWith(content: cellData ?? ""), + ); + }, + didUpdateField: (fieldInfo) { + final wrap = fieldInfo.wrapCellContent; + if (wrap != null) { + emit(state.copyWith(wrap: wrap)); + } + }, + updateCell: (text) async { + if (state.content != text) { + emit(state.copyWith(content: text)); + await cellController.saveCellData(text); + + // If the input content is "abc" that can't parsered as number then the data stored in the backend will be an empty string. + // So for every cell data that will be formatted in the backend. + // It needs to get the formatted data after saving. + add( + TagCellEvent.didReceiveCellUpdate( + cellController.getCellData() ?? "", + ), + ); + } + }, + ); + }, + ); + } + + void _startListening() { + _onCellChangedFn = cellController.addListener( + onCellChanged: (cellContent) { + if (!isClosed) { + add( + TagCellEvent.didReceiveCellUpdate(cellContent ?? ""), + ); + } + }, + onFieldChanged: _onFieldChangedListener, + ); + } + + void _onFieldChangedListener(FieldInfo fieldInfo) { + if (!isClosed) { + add(TagCellEvent.didUpdateField(fieldInfo)); + } + } +} + +@freezed +class TagCellEvent with _$TagCellEvent { + const factory TagCellEvent.didReceiveCellUpdate(String? cellContent) = + _DidReceiveCellUpdate; + const factory TagCellEvent.didUpdateField(FieldInfo fieldInfo) = + _DidUpdateField; + const factory TagCellEvent.updateCell(String text) = _UpdateCell; +} + +@freezed +class TagCellState with _$TagCellState { + const factory TagCellState({ + required String content, + required bool wrap, + }) = _TagCellState; + + factory TagCellState.initial(TagCellController cellController) { + final wrap = cellController.fieldInfo.wrapCellContent; + return TagCellState( + content: cellController.getCellData() ?? "", + wrap: wrap ?? true, + ); + } +} diff --git a/frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart b/frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart index 50ef7ccb74cd0..a7b5964e643ff 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart @@ -18,6 +18,7 @@ typedef RelationCellController = CellController; typedef SummaryCellController = CellController; typedef TimeCellController = CellController; typedef TranslateCellController = CellController; +typedef TagCellController = CellController; CellController makeCellController( DatabaseController databaseController, diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/tag_card_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/tag_card_cell.dart new file mode 100644 index 0000000000000..967e9b3153309 --- /dev/null +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/tag_card_cell.dart @@ -0,0 +1,62 @@ +import 'package:appflowy/plugins/database/application/cell/bloc/tag_cell.bloc.dart'; +import 'package:appflowy/plugins/database/application/cell/cell_controller.dart'; +import 'package:appflowy/plugins/database/application/cell/cell_controller_builder.dart'; +import 'package:appflowy/plugins/database/application/database_controller.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import 'card_cell.dart'; + +class TagCardCellStyle extends CardCellStyle { + const TagCardCellStyle({ + required super.padding, + required this.textStyle, + }); + + final TextStyle textStyle; +} + +class TagCardCell extends CardCell { + const TagCardCell({ + super.key, + required super.style, + required this.databaseController, + required this.cellContext, + }); + + final DatabaseController databaseController; + final CellContext cellContext; + + @override + State createState() => _TagCellState(); +} + +class _TagCellState extends State { + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) { + return TagCellBloc( + cellController: makeCellController( + widget.databaseController, + widget.cellContext, + ).as(), + ); + }, + child: BlocBuilder( + buildWhen: (previous, current) => previous.content != current.content, + builder: (context, state) { + if (state.content.isEmpty) { + return const SizedBox.shrink(); + } + + return Container( + alignment: AlignmentDirectional.centerStart, + padding: widget.style.padding, + child: Text(state.content, style: widget.style.textStyle), + ); + }, + ), + ); + } +} diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_style_maps/mobile_board_card_cell_style.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_style_maps/mobile_board_card_cell_style.dart index 952d20e7e5185..38e735400d1a1 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_style_maps/mobile_board_card_cell_style.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_style_maps/mobile_board_card_cell_style.dart @@ -1,3 +1,5 @@ +import 'package:appflowy/plugins/database/widgets/cell/card_cell_skeleton/tag_card_cell.dart'; +import 'package:appflowy/plugins/database/widgets/cell/card_cell_skeleton/translate_card_cell.dart'; import 'package:flutter/material.dart'; import 'package:appflowy/plugins/database/widgets/cell/card_cell_skeleton/summary_card_cell.dart'; @@ -89,7 +91,11 @@ CardCellStyleMap mobileBoardCardCellStyleMap(BuildContext context) { padding: padding, textStyle: textStyle, ), - FieldType.Translate: SummaryCardCellStyle( + FieldType.Translate: TranslateCardCellStyle( + padding: padding, + textStyle: textStyle, + ), + FieldType.Tag: TagCardCellStyle( padding: padding, textStyle: textStyle, ), diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/field_type_list.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/field_type_list.dart index 94ed2d84051c4..20a68e4b55503 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/field_type_list.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/field_type_list.dart @@ -24,6 +24,7 @@ const List _supportedFieldTypes = [ FieldType.Summary, FieldType.Time, FieldType.Translate, + FieldType.Tag, ]; class FieldTypeList extends StatelessWidget with FlowyOverlayDelegate { diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart index c4afde804e9a3..87e4624f594d5 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/field/type_option_editor/builder.dart @@ -1,6 +1,5 @@ import 'dart:typed_data'; -import 'package:appflowy/plugins/database/widgets/field/type_option_editor/tag.dart'; import 'package:flutter/material.dart'; import 'package:appflowy/plugins/database/widgets/field/type_option_editor/translate.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index c956efc49f4bf..fc0535b3a947b 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=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" 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=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -772,7 +772,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", @@ -819,7 +819,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -1059,7 +1059,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -1084,7 +1084,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1330,7 +1330,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.6", - "phf 0.11.2", + "phf 0.8.0", "smallvec", ] @@ -1441,7 +1441,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -2861,7 +2861,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", @@ -2878,7 +2878,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -3310,7 +3310,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -4815,7 +4815,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck 0.4.1", - "itertools 0.11.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -4836,7 +4836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.47", @@ -5800,7 +5800,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index ed266154e62a6..f95c67322e59e 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -52,7 +52,7 @@ collab-user = { version = "0.2" } # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9d3d28ad8937712cc688c20be7c0ee6e4d14a168" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } [dependencies] serde_json.workspace = true diff --git a/frontend/appflowy_web/wasm-libs/Cargo.lock b/frontend/appflowy_web/wasm-libs/Cargo.lock index 8a2679a6273c4..56f3ffacca339 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.lock +++ b/frontend/appflowy_web/wasm-libs/Cargo.lock @@ -216,7 +216,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -236,7 +236,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -787,7 +787,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -812,7 +812,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -981,7 +981,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.11.2", + "phf 0.8.0", "smallvec", ] @@ -1026,7 +1026,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -1886,7 +1886,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", @@ -1903,7 +1903,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -2204,7 +2204,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -2921,7 +2921,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", ] @@ -2941,7 +2941,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", ] @@ -3009,19 +3008,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.48", -] - [[package]] name = "phf_shared" version = "0.8.0" @@ -3906,7 +3892,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", diff --git a/frontend/appflowy_web/wasm-libs/Cargo.toml b/frontend/appflowy_web/wasm-libs/Cargo.toml index 1562e0b0edae6..0e0fd79773760 100644 --- a/frontend/appflowy_web/wasm-libs/Cargo.toml +++ b/frontend/appflowy_web/wasm-libs/Cargo.toml @@ -55,7 +55,7 @@ yrs = "0.18.8" # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9d3d28ad8937712cc688c20be7c0ee6e4d14a168" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } [profile.dev] opt-level = 0 diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.lock b/frontend/appflowy_web_app/src-tauri/Cargo.lock index 09ef46bcd1f17..ebe855c371397 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.lock +++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock @@ -180,24 +180,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "app-error" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" -dependencies = [ - "anyhow", - "getrandom 0.2.12", - "reqwest", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "tsify", - "url", - "uuid", - "wasm-bindgen", -] - [[package]] name = "appflowy-ai-client" version = "0.1.0" @@ -212,34 +194,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "appflowy-ai-client" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" -dependencies = [ - "anyhow", - "bytes", - "futures", - "serde", - "serde_json", - "serde_repr", - "thiserror", -] - -[[package]] -name = "appflowy-cloud-billing-client" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6#9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6" -dependencies = [ - "client-api", - "reqwest", - "serde", - "serde_json", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", - "tokio", - "yrs", -] - [[package]] name = "appflowy_tauri" version = "0.0.0" @@ -796,7 +750,7 @@ source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe36 dependencies = [ "again", "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "app-error", "async-trait", "bincode", "brotli", @@ -807,12 +761,12 @@ dependencies = [ "collab-entity", "collab-rt-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "database-entity", "futures-core", "futures-util", "getrandom 0.2.12", "gotrue", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "gotrue-entity", "mime", "parking_lot 0.12.1", "prost", @@ -823,7 +777,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "shared-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "shared-entity", "thiserror", "tokio", "tokio-retry", @@ -1098,7 +1052,7 @@ dependencies = [ "collab", "collab-entity", "collab-rt-protocol", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "database-entity", "prost", "prost-build", "protoc-bin-vendored", @@ -1363,7 +1317,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.10", - "phf 0.8.0", + "phf 0.11.2", "smallvec", ] @@ -1477,26 +1431,7 @@ version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "bincode", - "chrono", - "collab-entity", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "tracing", - "uuid", - "validator", -] - -[[package]] -name = "database-entity" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" -dependencies = [ - "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "app-error", "bincode", "chrono", "collab-entity", @@ -2350,7 +2285,6 @@ name = "flowy-server" version = "0.1.0" dependencies = [ "anyhow", - "appflowy-cloud-billing-client", "bytes", "chrono", "client-api", @@ -3006,7 +2940,7 @@ dependencies = [ "anyhow", "futures-util", "getrandom 0.2.12", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", + "gotrue-entity", "infra", "reqwest", "serde", @@ -3021,21 +2955,7 @@ version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "chrono", - "jsonwebtoken", - "lazy_static", - "serde", - "serde_json", -] - -[[package]] -name = "gotrue-entity" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" -dependencies = [ - "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "app-error", "chrono", "jsonwebtoken", "lazy_static", @@ -4976,7 +4896,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck 0.4.1", - "itertools 0.10.5", + "itertools 0.11.0", "log", "multimap", "once_cell", @@ -4997,7 +4917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.55", @@ -5978,38 +5898,14 @@ version = "0.1.0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "bytes", - "chrono", - "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358)", - "log", - "pin-project", - "reqwest", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "uuid", -] - -[[package]] -name = "shared-entity" -version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471#ff4384fbd07a4b7394a9af8c9159cd65715d3471" -dependencies = [ - "anyhow", - "app-error 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", - "appflowy-ai-client 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "app-error", + "appflowy-ai-client", "bytes", "chrono", "collab-entity", - "database-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "database-entity", "futures", - "gotrue-entity 0.1.0 (git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ff4384fbd07a4b7394a9af8c9159cd65715d3471)", + "gotrue-entity", "log", "pin-project", "reqwest", diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml index 99da587196656..4b22462b01bb8 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.toml +++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml @@ -52,7 +52,7 @@ collab-user = { version = "0.2" } # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9d3d28ad8937712cc688c20be7c0ee6e4d14a168" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } [dependencies] serde_json.workspace = true diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index 5e3d4f75de326..b830b73673d09 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=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" 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=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bytes", @@ -664,7 +664,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "again", "anyhow", @@ -711,7 +711,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "futures-channel", "futures-util", @@ -920,7 +920,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "bincode", @@ -945,7 +945,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "async-trait", @@ -1165,7 +1165,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.8.0", + "phf 0.11.2", "smallvec", ] @@ -1265,7 +1265,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -2531,7 +2531,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "futures-util", @@ -2548,7 +2548,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", @@ -2913,7 +2913,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "reqwest", @@ -3789,7 +3789,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ - "phf_macros", + "phf_macros 0.8.0", "phf_shared 0.8.0", "proc-macro-hack", ] @@ -3809,6 +3809,7 @@ 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", ] @@ -3876,6 +3877,19 @@ 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" @@ -4079,7 +4093,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck 0.4.1", - "itertools 0.10.5", + "itertools 0.11.0", "log", "multimap", "once_cell", @@ -4100,7 +4114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.47", @@ -4997,7 +5011,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=9d3d28ad8937712cc688c20be7c0ee6e4d14a168#9d3d28ad8937712cc688c20be7c0ee6e4d14a168" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=44ffc45c50e7fe362bd3f5ab4c7452e045d6b358#44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" dependencies = [ "anyhow", "app-error", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index cf4dc6fcbc915..4550cc39a33ce 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -94,7 +94,7 @@ yrs = "0.18.8" # 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 = "9d3d28ad8937712cc688c20be7c0ee6e4d14a168" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "44ffc45c50e7fe362bd3f5ab4c7452e045d6b358" } [profile.dev] opt-level = 1 diff --git a/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs index b1dca5d3f6769..90c1259b146c9 100644 --- a/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs +++ b/frontend/rust-lib/flowy-database2/src/entities/type_option_entities/tag_entities.rs @@ -27,6 +27,15 @@ impl From for TagItemPB { } } +impl From for TagOption { + fn from(value: TagItemPB) -> Self { + Self { + color: value.color, + text: value.text, + } + } +} + impl From for TagTypeOptionPB { fn from(value: TagTypeOption) -> Self { Self { @@ -34,3 +43,11 @@ impl From for TagTypeOptionPB { } } } + +impl From for TagTypeOption { + fn from(value: TagTypeOptionPB) -> Self { + Self { + tags: value.tags.into_iter().map(TagOption::from).collect(), + } + } +} diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 1dff9435a6314..c83372bcd81c1 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -573,7 +573,7 @@ impl DatabaseManager { .tags .into_iter() .map(|tag| tag.text) - .collect(), + .collect::>(), ) } } @@ -585,7 +585,7 @@ impl DatabaseManager { .await?; // Format the response items into a single string - let content = response.tags.map(|v| v).collect::>().join(", "); + let content = response.tags.join(", "); trace!("[AI]:tag row response: {}", content); database .update_cell_with_changeset(&view_id, &row_id, &field_id, BoxAny::new(content)) diff --git a/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs index 0a723286ea393..79814b1b8a436 100644 --- a/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs +++ b/frontend/rust-lib/flowy-database2/src/services/field/type_options/tag_type_option/tag.rs @@ -27,8 +27,8 @@ pub struct TagOption { impl From for TagOption { fn from(value: AnyMap) -> Self { - let color = value.get_string("color").unwrap_or_default(); - let text = value.get_string("text").unwrap_or_default(); + let color = value.get_str_value("color").unwrap_or_default(); + let text = value.get_str_value("text").unwrap_or_default(); Self { color, text } } } @@ -36,8 +36,8 @@ impl From for TagOption { impl From for AnyMap { fn from(value: TagOption) -> Self { let mut map = AnyMap::new(); - map.insert_string("color", value.color); - map.insert_string("text", value.text); + map.insert_str_value("color", value.color); + map.insert_str_value("text", value.text); map } }