Skip to content

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

feat: custom domain (#6518)

Zack73e8b476fbfe
diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock
index 9a2e54f71b..044c622f1a 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=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
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=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"bytes",
@@ -210,7 +210,7 @@ dependencies = [
"tokio-stream",
"tokio-util",
"tracing",
- "zip",
+ "zip 2.2.0",
"zip-extensions",
]
@@ -279,8 +279,8 @@ dependencies = [
"memchr",
"pin-project-lite",
"xz2",
- "zstd",
- "zstd-safe",
+ "zstd 0.13.2",
+ "zstd-safe 7.2.0",
]
[[package]]
@@ -450,6 +450,12 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
+[[package]]
+name = "base64ct"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
+
[[package]]
name = "bincode"
version = "1.3.3"
@@ -774,7 +780,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"again",
"anyhow",
@@ -829,7 +835,7 @@ dependencies = [
[[package]]
name = "client-api-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"collab-entity",
"collab-rt-entity",
@@ -842,7 +848,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"futures-channel",
"futures-util",
@@ -885,7 +891,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"arc-swap",
@@ -910,7 +916,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"async-trait",
@@ -949,7 +955,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"arc-swap",
@@ -970,7 +976,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"bytes",
@@ -990,7 +996,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"arc-swap",
@@ -1012,7 +1018,7 @@ dependencies = [
[[package]]
name = "collab-importer"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"async-recursion",
@@ -1044,6 +1050,7 @@ dependencies = [
"tracing",
"uuid",
"walkdir",
+ "zip 0.6.6",
]
[[package]]
@@ -1071,7 +1078,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"async-stream",
@@ -1109,7 +1116,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"bincode",
@@ -1134,7 +1141,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"async-trait",
@@ -1151,7 +1158,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c57466ae765669d79879c7d1d3fca219044f2a16#c57466ae765669d79879c7d1d3fca219044f2a16"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=e77fd84e0e32b4dc1dcfa271547517e5b0d8e987#e77fd84e0e32b4dc1dcfa271547517e5b0d8e987"
dependencies = [
"anyhow",
"collab",
@@ -1225,6 +1232,12 @@ dependencies = [
"tracing-subscriber",
]
+[[package]]
+name = "constant_time_eq"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
+
[[package]]
name = "constant_time_eq"
version = "0.3.0"
@@ -1523,7 +1536,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"app-error",
@@ -1830,7 +1843,7 @@ dependencies = [
"tracing",
"uuid",
"walkdir",
- "zip",
+ "zip 2.2.0",
]
[[package]]
@@ -2015,7 +2028,7 @@ dependencies = [
"tracing-subscriber",
"uuid",
"validator 0.18.1",
- "zip",
+ "zip 2.2.0",
"zip-extensions",
]
@@ -2284,7 +2297,7 @@ dependencies = [
"base64 0.21.5",
"getrandom 0.2.10",
"hmac",
- "pbkdf2",
+ "pbkdf2 0.12.2",
"rand 0.8.5",
"sha2",
]
@@ -2326,6 +2339,7 @@ dependencies = [
"async-trait",
"bytes",
"chrono",
+ "client-api",
"collab",
"collab-document",
"collab-entity",
@@ -2362,6 +2376,7 @@ name = "flowy-folder-pub"
version = "0.1.0"
dependencies = [
"anyhow",
+ "client-api",
"collab",
"collab-entity",
"collab-folder",
@@ -2961,7 +2976,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"futures-util",
@@ -2978,7 +2993,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"app-error",
@@ -3340,7 +3355,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"bytes",
@@ -3542,7 +3557,7 @@ dependencies = [
"tracing",
"validator 0.18.1",
"walkdir",
- "zip",
+ "zip 2.2.0",
]
[[package]]
@@ -4237,6 +4252,29 @@ dependencies = [
"regex",
]
+[[package]]
+name = "password-hash"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700"
+dependencies = [
+ "base64ct",
+ "rand_core 0.6.4",
+ "subtle",
+]
+
+[[package]]
+name = "pbkdf2"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
+dependencies = [
+ "digest",
+ "hmac",
+ "password-hash",
+ "sha2",
+]
+
[[package]]
name = "pbkdf2"
version = "0.12.2"
@@ -5617,7 +5655,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=d3e4a6870d10b04e4aedac4addb17915a7acdde2#d3e4a6870d10b04e4aedac4addb17915a7acdde2"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2f715c3136c5000d21ec27aa29897867947c9fd4#2f715c3136c5000d21ec27aa29897867947c9fd4"
dependencies = [
"anyhow",
"app-error",
@@ -6078,7 +6116,7 @@ dependencies = [
"tantivy-bitpacker",
"tantivy-common",
"tantivy-fst",
- "zstd",
+ "zstd 0.13.2",
]
[[package]]
@@ -7414,6 +7452,26 @@ dependencies = [
"syn 2.0.47",
]
+[[package]]
+name = "zip"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
+dependencies = [
+ "aes",
+ "byteorder",
+ "bzip2",
+ "constant_time_eq 0.1.5",
+ "crc32fast",
+ "crossbeam-utils",
+ "flate2",
+ "hmac",
+ "pbkdf2 0.11.0",
+ "sha1",
+ "time",
+ "zstd 0.11.2+zstd.1.5.2",
+]
+
[[package]]
name = "zip"
version = "2.2.0"
@@ -7423,7 +7481,7 @@ dependencies = [
"aes",
"arbitrary",
"bzip2",
- "constant_time_eq",
+ "constant_time_eq 0.3.0",
"crc32fast",
"crossbeam-utils",
"deflate64",
@@ -7433,14 +7491,14 @@ dependencies = [
"indexmap 2.1.0",
"lzma-rs",
"memchr",
- "pbkdf2",
+ "pbkdf2 0.12.2",
"rand 0.8.5",
"sha1",
"thiserror",
"time",
"zeroize",
"zopfli",
- "zstd",
+ "zstd 0.13.2",
]
[[package]]
@@ -7449,7 +7507,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb0a99499b3497d765525c5d05e3ade9ca4a731c184365c19472c3fd6ba86341"
dependencies = [
- "zip",
+ "zip 2.2.0",
]
[[package]]
@@ -7466,13 +7524,32 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "zstd"
+version = "0.11.2+zstd.1.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
+dependencies = [
+ "zstd-safe 5.0.2+zstd.1.5.2",
+]
+
[[package]]
name = "zstd"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
dependencies = [
- "zstd-safe",
+ "zstd-safe 7.2.0",
+]
+
+[[package]]
+name = "zstd-safe"
+version = "5.0.2+zstd.1.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
+dependencies = [
+ "libc",
+ "zstd-sys",
]
[[package]]
diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml
index b8ae880277..20a5f8cb07 100644
--- a/frontend/rust-lib/Cargo.toml
+++ b/frontend/rust-lib/Cargo.toml
@@ -106,8 +106,8 @@ dashmap = "6.0.1"
# Run the script.add_workspace_members:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d3e4a6870d10b04e4aedac4addb17915a7acdde2" }
-client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "d3e4a6870d10b04e4aedac4addb17915a7acdde2" }
+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "2f715c3136c5000d21ec27aa29897867947c9fd4" }
+client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "2f715c3136c5000d21ec27aa29897867947c9fd4" }
[profile.dev]
opt-level = 0
@@ -142,14 +142,14 @@ rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
-collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
-collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c57466ae765669d79879c7d1d3fca219044f2a16" }
+collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
+collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e77fd84e0e32b4dc1dcfa271547517e5b0d8e987" }
# Working directory: frontend
# To update the commit ID, run:
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 4b860bba16..3ca01060f8 100644
--- a/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs
+++ b/frontend/rust-lib/flowy-core/src/integrate/trait_impls.rs
@@ -2,7 +2,8 @@ use anyhow::Error;
use client_api::collab_sync::{SinkConfig, SyncObject, SyncPlugin};
use client_api::entity::ai_dto::{CompletionType, RepeatedRelatedQuestion};
use client_api::entity::search_dto::SearchDocumentResponseItem;
-use client_api::entity::ChatMessageType;
+use client_api::entity::workspace_dto::PublishInfoView;
+use client_api::entity::{ChatMessageType, PublishInfo};
use collab::core::origin::{CollabClient, CollabOrigin};
use collab::entity::EncodedCollab;
use collab::preclude::CollabPlugin;
@@ -34,7 +35,7 @@ use flowy_error::{FlowyError, FlowyResult};
use flowy_folder_pub::cloud::{
FolderCloudService, FolderCollabParams, FolderData, FolderSnapshot, Workspace, WorkspaceRecord,
};
-use flowy_folder_pub::entities::{PublishInfoResponse, PublishPayload};
+use flowy_folder_pub::entities::PublishPayload;
use flowy_server_pub::af_cloud_config::AFCloudConfiguration;
use flowy_storage_pub::cloud::{ObjectIdentity, ObjectValue, StorageCloudService};
use flowy_storage_pub::storage::{CompletedPartRequest, CreateUploadResponse, UploadPartResponse};
@@ -323,7 +324,7 @@ impl FolderCloudService for ServerProvider {
.await
}
- async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfoResponse, Error> {
+ async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfo, Error> {
let server = self.get_server()?;
server.folder_service().get_publish_info(view_id).await
}
@@ -348,6 +349,38 @@ impl FolderCloudService for ServerProvider {
.await
}
+ async fn get_default_published_view_info(
+ &self,
+ workspace_id: &str,
+ ) -> Result<PublishInfo, Error> {
+ let server = self.get_server()?;
+ server
+ .folder_service()
+ .get_default_published_view_info(workspace_id)
+ .await
+ }
+
+ async fn set_default_published_view(
+ &self,
+ workspace_id: &str,
+ view_id: uuid::Uuid,
+ ) -> Result<(), Error> {
+ let server = self.get_server()?;
+ server
+ .folder_service()
+ .set_default_published_view(workspace_id, view_id)
+ .await
+ }
+
+ /// List all published views of the current workspace.
+ async fn list_published_views(&self, workspace_id: &str) -> Result<Vec<PublishInfoView>, Error> {
+ let server = self.get_server()?;
+ server
+ .folder_service()
+ .list_published_views(workspace_id)
+ .await
+ }
+
async fn import_zip(&self, file_path: &str) -> Result<(), Error> {
self
.get_server()?
diff --git a/frontend/rust-lib/flowy-error/src/code.rs b/frontend/rust-lib/flowy-error/src/code.rs
index dbeb62cf11..ba83d9e18f 100644
--- a/frontend/rust-lib/flowy-error/src/code.rs
+++ b/frontend/rust-lib/flowy-error/src/code.rs
@@ -317,6 +317,15 @@ pub enum ErrorCode {
#[error("Group name is empty")]
GroupNameIsEmpty = 109,
+
+ #[error("Not available for current workspace plan")]
+ LimitedByWorkspacePlan = 110,
+
+ #[error("Invalid namespace")]
+ InvalidNamespace = 111,
+
+ #[error("Invalid publish name")]
+ InvalidPublishName = 112,
}
impl ErrorCode {
diff --git a/frontend/rust-lib/flowy-folder-pub/Cargo.toml b/frontend/rust-lib/flowy-folder-pub/Cargo.toml
index 1eac1f5540..b6d7a10b43 100644
--- a/frontend/rust-lib/flowy-folder-pub/Cargo.toml
+++ b/frontend/rust-lib/flowy-folder-pub/Cargo.toml
@@ -14,6 +14,7 @@ uuid.workspace = true
anyhow.workspace = true
serde = { version = "1.0.202", features = ["derive"] }
serde_json.workspace = true
+client-api = { workspace = true }
[dev-dependencies]
tokio.workspace = true
diff --git a/frontend/rust-lib/flowy-folder-pub/src/cloud.rs b/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
index 763470e233..484911cf90 100644
--- a/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
+++ b/frontend/rust-lib/flowy-folder-pub/src/cloud.rs
@@ -1,5 +1,6 @@
-use crate::entities::{PublishInfoResponse, PublishPayload};
+use crate::entities::PublishPayload;
pub use anyhow::Error;
+use client_api::entity::{workspace_dto::PublishInfoView, PublishInfo};
use collab_entity::CollabType;
pub use collab_folder::{Folder, FolderData, Workspace};
use lib_infra::async_trait::async_trait;
@@ -54,7 +55,7 @@ pub trait FolderCloudService: Send + Sync + 'static {
async fn unpublish_views(&self, workspace_id: &str, view_ids: Vec<String>) -> Result<(), Error>;
- async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfoResponse, Error>;
+ async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfo, Error>;
async fn set_publish_namespace(
&self,
@@ -62,6 +63,17 @@ pub trait FolderCloudService: Send + Sync + 'static {
new_namespace: &str,
) -> Result<(), Error>;
+ async fn list_published_views(&self, workspace_id: &str) -> Result<Vec<PublishInfoView>, Error>;
+
+ async fn get_default_published_view_info(&self, workspace_id: &str)
+ -> Result<PublishInfo, Error>;
+
+ async fn set_default_published_view(
+ &self,
+ workspace_id: &str,
+ view_id: uuid::Uuid,
+ ) -> Result<(), Error>;
+
async fn get_publish_namespace(&self, workspace_id: &str) -> Result<String, Error>;
async fn import_zip(&self, file_path: &str) -> Result<(), Error>;
diff --git a/frontend/rust-lib/flowy-folder-pub/src/entities.rs b/frontend/rust-lib/flowy-folder-pub/src/entities.rs
index dc1676f09d..d06eb50e25 100644
--- a/frontend/rust-lib/flowy-folder-pub/src/entities.rs
+++ b/frontend/rust-lib/flowy-folder-pub/src/entities.rs
@@ -116,11 +116,3 @@ pub enum PublishPayload {
Database(PublishDatabasePayload),
Unknown,
}
-
-#[derive(Clone, Debug, Eq, PartialEq)]
-pub struct PublishInfoResponse {
- pub view_id: String,
- /// One part of publish url: /{namespace}/{publish_name}
- pub namespace: Option<String>,
- pub publish_name: String,
-}
diff --git a/frontend/rust-lib/flowy-folder/Cargo.toml b/frontend/rust-lib/flowy-folder/Cargo.toml
index 20a131cf6c..b6878ee9a1 100644
--- a/frontend/rust-lib/flowy-folder/Cargo.toml
+++ b/frontend/rust-lib/flowy-folder/Cargo.toml
@@ -39,6 +39,7 @@ serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
validator.workspace = true
async-trait.workspace = true
+client-api = { workspace = true }
regex = "1.9.5"
futures = "0.3.30"
diff --git a/frontend/rust-lib/flowy-folder/src/entities/icon.rs b/frontend/rust-lib/flowy-folder/src/entities/icon.rs
index 1169c320ea..62e1760293 100644
--- a/frontend/rust-lib/flowy-folder/src/entities/icon.rs
+++ b/frontend/rust-lib/flowy-folder/src/entities/icon.rs
@@ -31,6 +31,16 @@ impl From<IconType> for ViewIconTypePB {
}
}
+impl From<client_api::entity::workspace_dto::IconType> for ViewIconTypePB {
+ fn from(val: client_api::entity::workspace_dto::IconType) -> Self {
+ match val {
+ client_api::entity::workspace_dto::IconType::Emoji => ViewIconTypePB::Emoji,
+ client_api::entity::workspace_dto::IconType::Url => ViewIconTypePB::Url,
+ client_api::entity::workspace_dto::IconType::Icon => ViewIconTypePB::Icon,
+ }
+ }
+}
+
#[derive(Default, ProtoBuf, Debug, Clone, PartialEq, Eq)]
pub struct ViewIconPB {
#[pb(index = 1)]
@@ -57,6 +67,15 @@ impl From<ViewIcon> for ViewIconPB {
}
}
+impl From<client_api::entity::workspace_dto::ViewIcon> for ViewIconPB {
+ fn from(val: client_api::entity::workspace_dto::ViewIcon) -> Self {
+ ViewIconPB {
+ ty: val.ty.into(),
+ value: val.value,
+ }
+ }
+}
+
#[derive(Default, ProtoBuf)]
pub struct UpdateViewIconPayloadPB {
#[pb(index = 1)]
diff --git a/frontend/rust-lib/flowy-folder/src/entities/publish.rs b/frontend/rust-lib/flowy-folder/src/entities/publish.rs
index 4915fc745b..9eb14e2ea6 100644
--- a/frontend/rust-lib/flowy-folder/src/entities/publish.rs
+++ b/frontend/rust-lib/flowy-folder/src/entities/publish.rs
@@ -1,7 +1,8 @@
+use client_api::entity::workspace_dto::{FolderViewMinimal, PublishInfoView};
+use client_api::entity::PublishInfo;
use flowy_derive::ProtoBuf;
-use flowy_folder_pub::entities::PublishInfoResponse;
-use super::RepeatedViewIdPB;
+use super::{RepeatedViewIdPB, ViewIconPB, ViewLayoutPB};
#[derive(Default, ProtoBuf)]
pub struct PublishViewParamsPB {
@@ -21,6 +22,46 @@ pub struct UnpublishViewsPayloadPB {
pub view_ids: Vec<String>,
}
+#[derive(Default, ProtoBuf)]
+pub struct PublishInfoViewPB {
+ #[pb(index = 1)]
+ pub view: FolderViewMinimalPB,
+ #[pb(index = 2)]
+ pub info: PublishInfoResponsePB,
+}
+
+impl From<PublishInfoView> for PublishInfoViewPB {
+ fn from(info_view: PublishInfoView) -> Self {
+ Self {
+ view: info_view.view.into(),
+ info: info_view.info.into(),
+ }
+ }
+}
+
+#[derive(Default, ProtoBuf)]
+pub struct FolderViewMinimalPB {
+ #[pb(index = 1)]
+ pub view_id: String,
+ #[pb(index = 2)]
+ pub name: String,
+ #[pb(index = 3, one_of)]
+ pub icon: Option<ViewIconPB>,
+ #[pb(index = 4)]
+ pub layout: ViewLayoutPB,
+}
+
+impl From<FolderViewMinimal> for FolderViewMinimalPB {
+ fn from(view: FolderViewMinimal) -> Self {
+ Self {
+ view_id: view.view_id,
+ name: view.name,
+ icon: view.icon.map(Into::into),
+ layout: view.layout.into(),
+ }
+ }
+}
+
#[derive(Default, ProtoBuf)]
pub struct PublishInfoResponsePB {
#[pb(index = 1)]
@@ -29,18 +70,30 @@ pub struct PublishInfoResponsePB {
pub publish_name: String,
#[pb(index = 3, one_of)]
pub namespace: Option<String>,
+ #[pb(index = 4)]
+ pub publisher_email: String,
+ #[pb(index = 5)]
+ pub publish_timestamp_sec: i64,
}
-impl From<PublishInfoResponse> for PublishInfoResponsePB {
- fn from(info: PublishInfoResponse) -> Self {
+impl From<PublishInfo> for PublishInfoResponsePB {
+ fn from(info: PublishInfo) -> Self {
Self {
- view_id: info.view_id,
+ view_id: info.view_id.to_string(),
publish_name: info.publish_name,
namespace: info.namespace,
+ publisher_email: info.publisher_email,
+ publish_timestamp_sec: info.publish_timestamp.timestamp(),
}
}
}
+#[derive(Default, ProtoBuf)]
+pub struct RepeatedPublishInfoViewPB {
+ #[pb(index = 1)]
+ pub items: Vec<PublishInfoViewPB>,
+}
+
#[derive(Default, ProtoBuf)]
pub struct SetPublishNamespacePayloadPB {
#[pb(index = 1)]
diff --git a/frontend/rust-lib/flowy-folder/src/entities/view.rs b/frontend/rust-lib/flowy-folder/src/entities/view.rs
index 9b75ea34c2..037859de0c 100644
--- a/frontend/rust-lib/flowy-folder/src/entities/view.rs
+++ b/frontend/rust-lib/flowy-folder/src/entities/view.rs
@@ -160,6 +160,18 @@ impl std::convert::From<ViewLayout> for ViewLayoutPB {
}
}
+impl From<client_api::entity::workspace_dto::ViewLayout> for ViewLayoutPB {
+ fn from(val: client_api::entity::workspace_dto::ViewLayout) -> Self {
+ match val {
+ client_api::entity::workspace_dto::ViewLayout::Document => ViewLayoutPB::Document,
+ client_api::entity::workspace_dto::ViewLayout::Grid => ViewLayoutPB::Grid,
+ client_api::entity::workspace_dto::ViewLayout::Board => ViewLayoutPB::Board,
+ client_api::entity::workspace_dto::ViewLayout::Calendar => ViewLayoutPB::Calendar,
+ client_api::entity::workspace_dto::ViewLayout::Chat => ViewLayoutPB::Chat,
+ }
+ }
+}
+
#[derive(Eq, PartialEq, Debug, Default, ProtoBuf, Clone)]
pub struct SectionViewsPB {
#[pb(index = 1)]
diff --git a/frontend/rust-lib/flowy-folder/src/event_handler.rs b/frontend/rust-lib/flowy-folder/src/event_handler.rs
index eb7573f224..5fcc31969c 100644
--- a/frontend/rust-lib/flowy-folder/src/event_handler.rs
+++ b/frontend/rust-lib/flowy-folder/src/event_handler.rs
@@ -477,3 +477,39 @@ pub(crate) async fn get_publish_namespace_handler(
let namespace = folder.get_publish_namespace().await?;
data_result_ok(PublishNamespacePB { namespace })
}
+
+#[tracing::instrument(level = "debug", skip(folder), err)]
+pub(crate) async fn list_published_views_handler(
+ folder: AFPluginState<Weak<FolderManager>>,
+) -> DataResult<RepeatedPublishInfoViewPB, FlowyError> {
+ let folder = upgrade_folder(folder)?;
+ let published_views = folder.list_published_views().await?;
+ let items: Vec<PublishInfoViewPB> = published_views
+ .into_iter()
+ .map(|view| view.into())
+ .collect();
+ data_result_ok(RepeatedPublishInfoViewPB { items })
+}
+
+#[tracing::instrument(level = "debug", skip(folder))]
+pub(crate) async fn get_default_publish_info_handler(
+ folder: AFPluginState<Weak<FolderManager>>,
+) -> DataResult<PublishInfoResponsePB, FlowyError> {
+ let folder = upgrade_folder(folder)?;
+ let default_published_view = folder.get_default_published_view_info().await?;
+ data_result_ok(default_published_view.into())
+}
+
+#[tracing::instrument(level = "debug", skip(folder))]
+pub(crate) async fn set_default_publish_view_handler(
+ data: AFPluginData<ViewIdPB>,
+ folder: AFPluginState<Weak<FolderManager>>,
+) -> Result<(), FlowyError> {
+ let folder = upgrade_folder(folder)?;
+ let view_id: uuid::Uuid = data.into_inner().value.parse().map_err(|err| {
+ tracing::error!("Failed to parse view id: {}", err);
+ FlowyError::invalid_data()
+ })?;
+ folder.set_default_published_view(view_id).await?;
+ Ok(())
+}
diff --git a/frontend/rust-lib/flowy-folder/src/event_map.rs b/frontend/rust-lib/flowy-folder/src/event_map.rs
index e458576692..c85cbf2f63 100644
--- a/frontend/rust-lib/flowy-folder/src/event_map.rs
+++ b/frontend/rust-lib/flowy-folder/src/event_map.rs
@@ -48,6 +48,9 @@ pub fn init(folder: Weak<FolderManager>) -> AFPlugin {
.event(FolderEvent::UnpublishViews, unpublish_views_handler)
.event(FolderEvent::SetPublishNamespace, set_publish_namespace_handler)
.event(FolderEvent::GetPublishNamespace, get_publish_namespace_handler)
+ .event(FolderEvent::ListPublishedViews, list_published_views_handler)
+ .event(FolderEvent::GetDefaultPublishInfo, get_default_publish_info_handler)
+ .event(FolderEvent::SetDefaultPublishInfo, set_default_publish_view_handler)
}
#[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
@@ -200,4 +203,13 @@ pub enum FolderEvent {
#[event(input = "ImportZipPB")]
ImportZipFile = 48,
+
+ #[event(output = "RepeatedPublishInfoViewPB")]
+ ListPublishedViews = 49,
+
+ #[event(output = "PublishInfoResponsePB")]
+ GetDefaultPublishInfo = 50,
+
+ #[event(input = "ViewIdPB")]
+ SetDefaultPublishInfo = 51,
}
diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs
index 285c817d0c..a9736a655e 100644
--- a/frontend/rust-lib/flowy-folder/src/manager.rs
+++ b/frontend/rust-lib/flowy-folder/src/manager.rs
@@ -19,6 +19,8 @@ use crate::view_operation::{
create_view, EncodedCollabWrapper, FolderOperationHandler, FolderOperationHandlers,
};
use arc_swap::ArcSwapOption;
+use client_api::entity::workspace_dto::PublishInfoView;
+use client_api::entity::PublishInfo;
use collab::core::collab::DataSource;
use collab::lock::RwLock;
use collab_entity::{CollabType, EncodedCollab};
@@ -34,8 +36,8 @@ use collab_integrate::CollabKVDB;
use flowy_error::{internal_error, ErrorCode, FlowyError, FlowyResult};
use flowy_folder_pub::cloud::{gen_view_id, FolderCloudService, FolderCollabParams};
use flowy_folder_pub::entities::{
- PublishDatabaseData, PublishDatabasePayload, PublishDocumentPayload, PublishInfoResponse,
- PublishPayload, PublishViewInfo, PublishViewMeta, PublishViewMetaData,
+ PublishDatabaseData, PublishDatabasePayload, PublishDocumentPayload, PublishPayload,
+ PublishViewInfo, PublishViewMeta, PublishViewMetaData,
};
use flowy_search_pub::entities::FolderIndexManager;
use flowy_sqlite::kv::KVStorePreferences;
@@ -1249,7 +1251,7 @@ impl FolderManager {
/// Get the publish info of the view with the given view id.
/// The publish info contains the namespace and publish_name of the view.
#[tracing::instrument(level = "debug", skip(self))]
- pub async fn get_publish_info(&self, view_id: &str) -> FlowyResult<PublishInfoResponse> {
+ pub async fn get_publish_info(&self, view_id: &str) -> FlowyResult<PublishInfo> {
let publish_info = self.cloud_service.get_publish_info(view_id).await?;
Ok(publish_info)
}
@@ -1277,6 +1279,37 @@ impl FolderManager {
Ok(namespace)
}
+ /// List all published views of the current workspace.
+ #[tracing::instrument(level = "debug", skip(self), err)]
+ pub async fn list_published_views(&self) -> FlowyResult<Vec<PublishInfoView>> {
+ let workspace_id = self.user.workspace_id()?;
+ let published_views = self
+ .cloud_service
+ .list_published_views(&workspace_id)
+ .await?;
+ Ok(published_views)
+ }
+
+ #[tracing::instrument(level = "debug", skip(self), err)]
+ pub async fn get_default_published_view_info(&self) -> FlowyResult<PublishInfo> {
+ let workspace_id = self.user.workspace_id()?;
+ let default_published_view_info = self
+ .cloud_service
+ .get_default_published_view_info(&workspace_id)
+ .await?;
+ Ok(default_published_view_info)
+ }
+
+ #[tracing::instrument(level = "debug", skip(self), err)]
+ pub async fn set_default_published_view(&self, view_id: uuid::Uuid) -> FlowyResult<()> {
+ let workspace_id = self.user.workspace_id()?;
+ self
+ .cloud_service
+ .set_default_published_view(&workspace_id, view_id)
+ .await?;
+ Ok(())
+ }
+
/// Retrieves the publishing payload for a specified view and optionally its child views.
///
/// # Arguments
diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/chat.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/chat.rs
index b9e7433c0f..b7fa9a3b77 100644
--- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/chat.rs
+++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/chat.rs
@@ -159,9 +159,11 @@ where
text: &str,
completion_type: CompletionType,
) -> Result<StreamComplete, FlowyError> {
+ // TODO(Nathan): Check if this is correct after updating to latest client-api
let params = CompleteTextParams {
text: text.to_string(),
- completion_type,
+ completion_type: Some(completion_type),
+ custom_prompt: None,
};
let stream = self
.inner
diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
index 2c34e23153..0816360523 100644
--- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
+++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/folder.rs
@@ -1,4 +1,6 @@
use anyhow::Error;
+use client_api::entity::workspace_dto::PublishInfoView;
+use client_api::entity::PublishInfo;
use client_api::entity::{
workspace_dto::CreateWorkspaceParam, CollabParams, PublishCollabItem, PublishCollabMetadata,
QueryCollab, QueryCollabParams,
@@ -18,7 +20,7 @@ use flowy_folder_pub::cloud::{
Folder, FolderCloudService, FolderCollabParams, FolderData, FolderSnapshot, Workspace,
WorkspaceRecord,
};
-use flowy_folder_pub::entities::{PublishInfoResponse, PublishPayload};
+use flowy_folder_pub::entities::PublishPayload;
use lib_infra::async_trait::async_trait;
use crate::af_cloud::define::ServerUser;
@@ -227,7 +229,7 @@ where
Ok(())
}
- async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfoResponse, Error> {
+ async fn get_publish_info(&self, view_id: &str) -> Result<PublishInfo, Error> {
let try_get_client = self.inner.try_get_client();
let view_id = Uuid::parse_str(view_id)
.map_err(|_| FlowyError::new(ErrorCode::InvalidParams, "Invalid view id"));
@@ -237,11 +239,7 @@ where
.get_published_collab_info(&view_id)
.await
.map_err(FlowyError::from)?;
- Ok(PublishInfoResponse {
- view_id: info.view_id.to_string(),
- publish_name: info.publish_name,
- namespace: info.namespace,
- })
+ Ok(info)
}
async fn set_publish_namespace(
@@ -270,6 +268,44 @@ where
Ok(namespace)
}
+ async fn list_published_views(&self, workspace_id: &str) -> Result<Vec<PublishInfoView>, Error> {
+ let workspace_id = workspace_id.to_string();
+ let published_views = self
+ .inner
+ .try_get_client()?
+ .list_published_views(&workspace_id)
+ .await
+ .map_err(FlowyError::from)?;
+ Ok(published_views)
+ }
+
+ async fn get_default_published_view_info(
+ &self,
+ workspace_id: &str,
+ ) -> Result<PublishInfo, Error> {
+ let default_published_view_info = self
+ .inner
+ .try_get_client()?
+ .get_default_publish_view_info(workspace_id)
+ .await
+ .map_err(FlowyError::from)?;
+ Ok(default_published_view_info)
+ }
+
+ async fn set_default_published_view(
+ &self,
+ workspace_id: &str,
+ view_id: uuid::Uuid,
+ ) -> Result<(), Error> {
+ self
+ .inner
+ .try_get_client()?
+ .set_default_publish_view(workspace_id, view_id)
+ .await
+ .map_err(FlowyError::from)?;
+ Ok(())
+ }
+
async fn import_zip(&self, file_path: &str) -> Result<(), Error> {
let file_path = PathBuf::from(file_path);
self.inner.try_get_client()?.import_file(&file_path).await?;
diff --git a/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs b/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
index 9cae8a8b22..84d3c9ba26 100644
--- a/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
+++ b/frontend/rust-lib/flowy-server/src/local_server/impls/folder.rs
@@ -1,6 +1,8 @@
use std::sync::Arc;
use anyhow::{anyhow, Error};
+use client_api::entity::workspace_dto::PublishInfoView;
+use client_api::entity::PublishInfo;
use collab_entity::CollabType;
use crate::local_server::LocalServerDB;
@@ -8,7 +10,7 @@ use flowy_folder_pub::cloud::{
gen_workspace_id, FolderCloudService, FolderCollabParams, FolderData, FolderSnapshot, Workspace,
WorkspaceRecord,
};
-use flowy_folder_pub::entities::{PublishInfoResponse, PublishPayload};
+use flowy_folder_pub::entities::PublishPayload;
use lib_infra::async_trait::async_trait;
pub(crate) struct LocalServerFolderCloudServiceImpl {
@@ -91,7 +93,7 @@ impl FolderCloudService for LocalServerFolderCloudServiceImpl {
Err(anyhow!("Local server doesn't support unpublish views"))
}
- async fn get_publish_info(&self, _view_id: &str) -> Result<PublishInfoResponse, Error> {
+ async fn get_publish_info(&self, _view_id: &str) -> Result<PublishInfo, Error> {
Err(anyhow!(
"Local server doesn't support get publish info from remote"
))
@@ -113,6 +115,25 @@ impl FolderCloudService for LocalServerFolderCloudServiceImpl {
))
}
+ async fn list_published_views(&self, _workspace_id: &str) -> Result<Vec<PublishInfoView>, Error> {
+ Err(anyhow!("Local server doesn't support list published views"))
+ }
+
+ async fn get_default_published_view_info(
+ &self,
+ _workspace_id: &str,
+ ) -> Result<PublishInfo, Error> {
+ Err(anyhow!("Local server doesn't support list published views"))
+ }
+
+ async fn set_default_published_view(
+ &self,
+ _workspace_id: &str,
+ _view_id: uuid::Uuid,
+ ) -> Result<(), Error> {
+ Err(anyhow!("Local server doesn't support list published views"))
+ }
+
async fn import_zip(&self, _file_path: &str) -> Result<(), Error> {
Err(anyhow!(
"Local server doesn't support get publish namespace"
diff --git a/frontend/rust-lib/flowy-server/src/supabase/api/folder.rs b/frontend/rust-lib/flowy-server/src/supabase/api/folder.rs
index 647fb7a5e7..9ce7d4d6ef 100644
--- a/frontend/rust-lib/flowy-server/src/supabase/api/folder.rs
+++ b/frontend/rust-lib/flowy-server/src/supabase/api/folder.rs
@@ -13,7 +13,7 @@ use flowy_folder_pub::cloud::{
gen_workspace_id, Folder, FolderCloudService, FolderCollabParams, FolderData, FolderSnapshot,
Workspace, WorkspaceRecord,
};
-use flowy_folder_pub::entities::{PublishInfoResponse, PublishPayload};
+use flowy_folder_pub::entities::PublishPayload;
use lib_dispatch::prelude::af_spawn;
use lib_infra::future::FutureResult;
use lib_infra::util::timestamp;