refactor: import/export use cases (#2397)
This commit is contained in:
@@ -12,13 +12,14 @@ import {
|
||||
StatusServiceInterface,
|
||||
MfaServiceInterface,
|
||||
GenerateUuid,
|
||||
CreateDecryptedBackupFile,
|
||||
} from '@standardnotes/services'
|
||||
import { VaultLockServiceInterface } from './../VaultLock/VaultLockServiceInterface'
|
||||
import { HistoryServiceInterface } from './../History/HistoryServiceInterface'
|
||||
import { InternalEventBusInterface } from './../Internal/InternalEventBusInterface'
|
||||
import { PreferenceServiceInterface } from './../Preferences/PreferenceServiceInterface'
|
||||
import { AsymmetricMessageServiceInterface } from './../AsymmetricMessage/AsymmetricMessageServiceInterface'
|
||||
import { ImportDataReturnType } from './../Mutator/ImportDataUseCase'
|
||||
import { ImportDataResult } from '../Import/ImportDataResult'
|
||||
import { ChallengeServiceInterface } from './../Challenge/ChallengeServiceInterface'
|
||||
import { VaultServiceInterface } from '../Vault/VaultServiceInterface'
|
||||
import { ApplicationIdentifier } from '@standardnotes/common'
|
||||
@@ -42,6 +43,8 @@ import { UserServiceInterface } from '../User/UserServiceInterface'
|
||||
import { SessionsClientInterface } from '../Session/SessionsClientInterface'
|
||||
import { HomeServerServiceInterface } from '../HomeServer/HomeServerServiceInterface'
|
||||
import { EncryptionProviderInterface } from '../Encryption/EncryptionProviderInterface'
|
||||
import { Result } from '@standardnotes/domain-core'
|
||||
import { CreateEncryptedBackupFile } from '../Import/CreateEncryptedBackupFile'
|
||||
|
||||
export interface ApplicationInterface {
|
||||
deinit(mode: DeinitMode, source: DeinitSource): void
|
||||
@@ -51,9 +54,6 @@ export interface ApplicationInterface {
|
||||
addEventObserver(callback: ApplicationEventCallback, singleEvent?: ApplicationEvent): () => void
|
||||
addSingleEventObserver(event: ApplicationEvent, callback: ApplicationEventCallback): () => void
|
||||
hasProtectionSources(): boolean
|
||||
createEncryptedBackupFileForAutomatedDesktopBackups(): Promise<BackupFile | undefined>
|
||||
createEncryptedBackupFile(): Promise<BackupFile | undefined>
|
||||
createDecryptedBackupFile(): Promise<BackupFile | undefined>
|
||||
hasPasscode(): boolean
|
||||
lock(): Promise<void>
|
||||
setValue(key: string, value: unknown, mode?: StorageValueModes): void
|
||||
@@ -68,12 +68,17 @@ export interface ApplicationInterface {
|
||||
setCustomHost(host: string): Promise<void>
|
||||
isUsingHomeServer(): Promise<boolean>
|
||||
|
||||
importData(data: BackupFile, awaitSync?: boolean): Promise<ImportDataReturnType>
|
||||
importData(data: BackupFile, awaitSync?: boolean): Promise<Result<ImportDataResult>>
|
||||
|
||||
// Use cases
|
||||
get changeAndSaveItem(): ChangeAndSaveItem
|
||||
get createDecryptedBackupFile(): CreateDecryptedBackupFile
|
||||
get createEncryptedBackupFile(): CreateEncryptedBackupFile
|
||||
get generateUuid(): GenerateUuid
|
||||
get getHost(): GetHost
|
||||
get setHost(): SetHost
|
||||
|
||||
// Services
|
||||
get alerts(): AlertService
|
||||
get asymmetric(): AsymmetricMessageServiceInterface
|
||||
get challenges(): ChallengeServiceInterface
|
||||
@@ -85,7 +90,6 @@ export interface ApplicationInterface {
|
||||
get files(): FilesClientInterface
|
||||
get history(): HistoryServiceInterface
|
||||
get homeServer(): HomeServerServiceInterface | undefined
|
||||
get generateUuid(): GenerateUuid
|
||||
get items(): ItemManagerInterface
|
||||
get legacyApi(): LegacyApiServiceInterface
|
||||
get mfa(): MfaServiceInterface
|
||||
|
||||
Reference in New Issue
Block a user