feat: folder web (#4580)

* chore: folder wasm

* chore: folder wasm

* chore: resolve deps

* chore: fix trait

* chore: try localset

* chore: fix

* chore: fix

* chore: fix

* chore: async init sdk

* chore: fix test

* chore: fix test
This commit is contained in:
Nathan.fooo
2024-02-04 05:50:23 +08:00
committed by GitHub
parent 08938b8c70
commit fda70ff560
65 changed files with 818 additions and 558 deletions

View File

@ -14,8 +14,8 @@ use uuid::Uuid;
use flowy_error::{ErrorCode, FlowyError};
use lib_infra::box_any::BoxAny;
use lib_infra::conditional_send_sync_trait;
use lib_infra::future::FutureResult;
use lib_infra::{if_native, if_wasm};
use crate::entities::{
AuthResponse, Authenticator, Role, UpdateUserProfileParams, UserCredentials, UserProfile,
@ -57,21 +57,12 @@ impl Display for UserCloudConfig {
}
}
if_native! {
pub trait UserCloudServiceProvider: UserCloudServiceProviderBase + Send + Sync + 'static {}
}
conditional_send_sync_trait! {
"This trait is intended for implementation by providers that offer cloud-based services for users.
It includes methods for handling authentication tokens, enabling/disabling synchronization,
setting network reachability, managing encryption secrets, and accessing user-specific cloud services.";
if_wasm! {
pub trait UserCloudServiceProvider: UserCloudServiceProviderBase + 'static {}
}
/// `UserCloudServiceProvider` defines a set of methods for managing user cloud services,
/// including token management, synchronization settings, network reachability, and authentication.
///
/// This trait is intended for implementation by providers that offer cloud-based services for users.
/// It includes methods for handling authentication tokens, enabling/disabling synchronization,
/// setting network reachability, managing encryption secrets, and accessing user-specific cloud services.
pub trait UserCloudServiceProviderBase {
UserCloudServiceProvider {
/// Sets the authentication token for the cloud service.
///
/// # Arguments
@ -126,8 +117,8 @@ pub trait UserCloudServiceProviderBase {
/// # Returns
/// A `String` representing the service URL.
fn service_url(&self) -> String;
}
}
/// Provide the generic interface for the user cloud service
/// The user cloud service is responsible for the user authentication and user profile management
#[allow(unused_variables)]