mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3317 Account | Tech | Space store migration + UI (#2074)
This commit is contained in:
parent
20a95fbaea
commit
73cd7aba94
38 changed files with 643 additions and 572 deletions
|
@ -3,6 +3,7 @@ package com.anytypeio.anytype.data.auth.repo
|
|||
import com.anytypeio.anytype.core_models.AccountSetup
|
||||
import com.anytypeio.anytype.core_models.AccountStatus
|
||||
import com.anytypeio.anytype.core_models.Command
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.NetworkModeConfig
|
||||
import com.anytypeio.anytype.data.auth.model.AccountEntity
|
||||
import com.anytypeio.anytype.data.auth.model.WalletEntity
|
||||
|
@ -93,4 +94,15 @@ class AuthCacheDataStore(private val cache: AuthCache) : AuthDataStore {
|
|||
override suspend fun debugExportLogs(dir: String): String {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override suspend fun migrateAccount(
|
||||
account: Id,
|
||||
path: String
|
||||
) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override suspend fun cancelAccountMigration(account: Id) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.anytypeio.anytype.core_models.Account
|
|||
import com.anytypeio.anytype.core_models.AccountSetup
|
||||
import com.anytypeio.anytype.core_models.AccountStatus
|
||||
import com.anytypeio.anytype.core_models.Command
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.NetworkModeConfig
|
||||
import com.anytypeio.anytype.data.auth.mapper.toDomain
|
||||
import com.anytypeio.anytype.data.auth.mapper.toEntity
|
||||
|
@ -93,6 +94,22 @@ class AuthDataRepository(
|
|||
|
||||
override suspend fun getVersion(): String = factory.remote.getVersion()
|
||||
|
||||
override suspend fun migrateAccount(
|
||||
account: Id,
|
||||
path: String
|
||||
) {
|
||||
factory.remote.migrateAccount(
|
||||
account = account,
|
||||
path = path
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun cancelAccountMigration(account: Id) {
|
||||
factory.remote.cancelAccountMigration(
|
||||
account = account
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getNetworkMode(): NetworkModeConfig {
|
||||
return factory.cache.getNetworkMode()
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.anytypeio.anytype.data.auth.repo
|
|||
import com.anytypeio.anytype.core_models.AccountSetup
|
||||
import com.anytypeio.anytype.core_models.AccountStatus
|
||||
import com.anytypeio.anytype.core_models.Command
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.NetworkModeConfig
|
||||
import com.anytypeio.anytype.data.auth.model.AccountEntity
|
||||
import com.anytypeio.anytype.data.auth.model.WalletEntity
|
||||
|
@ -16,6 +17,9 @@ interface AuthDataStore {
|
|||
suspend fun deleteAccount() : AccountStatus
|
||||
suspend fun restoreAccount() : AccountStatus
|
||||
|
||||
suspend fun migrateAccount(account: Id, path: String)
|
||||
suspend fun cancelAccountMigration(account: Id)
|
||||
|
||||
suspend fun recoverAccount()
|
||||
|
||||
suspend fun saveAccount(account: AccountEntity)
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.anytypeio.anytype.data.auth.repo
|
|||
import com.anytypeio.anytype.core_models.AccountSetup
|
||||
import com.anytypeio.anytype.core_models.AccountStatus
|
||||
import com.anytypeio.anytype.core_models.Command
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.data.auth.model.AccountEntity
|
||||
import com.anytypeio.anytype.data.auth.model.WalletEntity
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
@ -10,6 +11,10 @@ import kotlinx.coroutines.flow.Flow
|
|||
interface AuthRemote {
|
||||
suspend fun selectAccount(command: Command.AccountSelect): AccountSetup
|
||||
suspend fun createAccount(command: Command.AccountCreate): AccountSetup
|
||||
|
||||
suspend fun migrateAccount(account: Id, path: String)
|
||||
suspend fun cancelAccountMigration(account: Id)
|
||||
|
||||
suspend fun deleteAccount() : AccountStatus
|
||||
suspend fun restoreAccount() : AccountStatus
|
||||
suspend fun recoverAccount()
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.anytypeio.anytype.data.auth.repo
|
|||
import com.anytypeio.anytype.core_models.AccountSetup
|
||||
import com.anytypeio.anytype.core_models.AccountStatus
|
||||
import com.anytypeio.anytype.core_models.Command
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.NetworkModeConfig
|
||||
import com.anytypeio.anytype.data.auth.model.AccountEntity
|
||||
import com.anytypeio.anytype.data.auth.model.WalletEntity
|
||||
|
@ -23,6 +24,22 @@ class AuthRemoteDataStore(
|
|||
|
||||
override suspend fun restoreAccount(): AccountStatus = authRemote.restoreAccount()
|
||||
|
||||
override suspend fun migrateAccount(
|
||||
account: Id,
|
||||
path: String
|
||||
) {
|
||||
authRemote.migrateAccount(
|
||||
account = account,
|
||||
path = path
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun cancelAccountMigration(account: Id) {
|
||||
authRemote.cancelAccountMigration(
|
||||
account = account
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun recoverAccount() {
|
||||
authRemote.recoverAccount()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue