chore: fix compile (#5733)

This commit is contained in:
Zack 2024-07-15 09:01:34 +08:00 committed by GitHub
parent a2336f5bf7
commit d2e3fdfefd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 24 deletions

View File

@ -163,7 +163,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -183,7 +183,7 @@ dependencies = [
[[package]] [[package]]
name = "appflowy-ai-client" name = "appflowy-ai-client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -698,7 +698,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -719,6 +719,7 @@ dependencies = [
"getrandom 0.2.10", "getrandom 0.2.10",
"gotrue", "gotrue",
"infra", "infra",
"lazy_static",
"mime", "mime",
"parking_lot 0.12.1", "parking_lot 0.12.1",
"percent-encoding", "percent-encoding",
@ -747,7 +748,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api-entity" name = "client-api-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"collab-entity", "collab-entity",
"collab-rt-entity", "collab-rt-entity",
@ -759,7 +760,7 @@ dependencies = [
[[package]] [[package]]
name = "client-websocket" name = "client-websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -968,7 +969,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-entity" name = "collab-rt-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -993,7 +994,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-protocol" name = "collab-rt-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -1310,7 +1311,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2616,7 +2617,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2633,7 +2634,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2998,7 +2999,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -5099,7 +5100,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=a2f92bb#a2f92bb13e7c3d33783359d02235ba4a5058a32f" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4d9108643b6b39b557f594a031f4fa20e9125ec8#4d9108643b6b39b557f594a031f4fa20e9125ec8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",

View File

@ -97,8 +97,8 @@ validator = { version = "0.16.1", features = ["derive"] }
# Run the script.add_workspace_members: # Run the script.add_workspace_members:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "a2f92bb" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "4d9108643b6b39b557f594a031f4fa20e9125ec8" }
client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "a2f92bb" } client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "4d9108643b6b39b557f594a031f4fa20e9125ec8" }
[profile.dev] [profile.dev]
opt-level = 1 opt-level = 1

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use anyhow::anyhow; use anyhow::anyhow;
use client_api::entity::billing_dto::{ use client_api::entity::billing_dto::{
SubscriptionPlan, SubscriptionStatus, WorkspaceSubscriptionPlan, WorkspaceSubscriptionStatus, SubscriptionPlan, SubscriptionStatus, WorkspaceSubscriptionStatus,
}; };
use client_api::entity::workspace_dto::{ use client_api::entity::workspace_dto::{
CreateWorkspaceParam, PatchWorkspaceParam, WorkspaceMemberChangeset, WorkspaceMemberInvitation, CreateWorkspaceParam, PatchWorkspaceParam, WorkspaceMemberChangeset, WorkspaceMemberInvitation,
@ -543,7 +543,7 @@ where
let try_get_client = self.server.try_get_client(); let try_get_client = self.server.try_get_client();
FutureResult::new(async move { FutureResult::new(async move {
let client = try_get_client?; let client = try_get_client?;
client.cancel_subscription(&workspace_id).await?; client.cancel_subscription(&workspace_id, &SubscriptionPlan::Pro).await?; // TODO:
Ok(()) Ok(())
}) })
} }
@ -552,12 +552,12 @@ where
let try_get_client = self.server.try_get_client(); let try_get_client = self.server.try_get_client();
FutureResult::new(async move { FutureResult::new(async move {
let client = try_get_client?; let client = try_get_client?;
let usage = client.get_billing_workspace_usage(&workspace_id).await?; let usage = client.get_workspace_usage_and_limit(&workspace_id).await?;
Ok(WorkspaceUsage { Ok(WorkspaceUsage {
member_count: usage.member_count, member_count: usage.member_count as usize,
member_count_limit: usage.member_count_limit, member_count_limit: usage.member_count_limit as usize,
total_blob_bytes: usage.total_blob_bytes, total_blob_bytes: usage.storage_bytes as usize,
total_blob_bytes_limit: usage.total_blob_bytes_limit, total_blob_bytes_limit: usage.storage_bytes_limit as usize,
}) })
}) })
} }
@ -726,8 +726,8 @@ fn to_workspace_subscription(s: WorkspaceSubscriptionStatus) -> WorkspaceSubscri
WorkspaceSubscription { WorkspaceSubscription {
workspace_id: s.workspace_id, workspace_id: s.workspace_id,
subscription_plan: match s.workspace_plan { subscription_plan: match s.workspace_plan {
WorkspaceSubscriptionPlan::Pro => flowy_user_pub::entities::SubscriptionPlan::Pro, // WorkspaceSubscriptionPlan::Pro => flowy_user_pub::entities::SubscriptionPlan::Pro,
WorkspaceSubscriptionPlan::Team => flowy_user_pub::entities::SubscriptionPlan::Team, // WorkspaceSubscriptionPlan::Team => flowy_user_pub::entities::SubscriptionPlan::Team,
_ => flowy_user_pub::entities::SubscriptionPlan::None, _ => flowy_user_pub::entities::SubscriptionPlan::None,
}, },
recurring_interval: match s.recurring_interval { recurring_interval: match s.recurring_interval {
@ -739,6 +739,6 @@ fn to_workspace_subscription(s: WorkspaceSubscriptionStatus) -> WorkspaceSubscri
}, },
}, },
is_active: matches!(s.subscription_status, SubscriptionStatus::Active), is_active: matches!(s.subscription_status, SubscriptionStatus::Active),
canceled_at: s.canceled_at, canceled_at: s.cancel_at,
} }
} }