Migration plan v1
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface ILegacyLocalMigrationService
|
||||
{
|
||||
Task<LegacyLocalMigrationPreview> DetectAsync(CancellationToken cancellationToken = default);
|
||||
Task<LegacyLocalMigrationResult> ImportAsync(CancellationToken cancellationToken = default);
|
||||
void MarkPromptDeferred();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
public sealed class LegacyLocalMigrationPreview
|
||||
{
|
||||
public string SourceDatabasePath { get; init; } = string.Empty;
|
||||
public bool LegacyDatabaseExists { get; init; }
|
||||
public bool HasCompletedMigration { get; init; }
|
||||
public bool IsPromptDeferred { get; init; }
|
||||
public bool ShouldPrompt { get; init; }
|
||||
public int LegacyAccountCount { get; init; }
|
||||
public int ImportableAccountCount { get; init; }
|
||||
public int DuplicateAccountCount { get; init; }
|
||||
public int SkippedAccountCount { get; init; }
|
||||
public int ImportableMergedInboxCount { get; init; }
|
||||
public int SkippedMergedInboxCount { get; init; }
|
||||
public IReadOnlyList<LegacyLocalMigrationProviderCount> ProviderCounts { get; init; } = [];
|
||||
public IReadOnlyList<LegacyLocalMigrationAccountPreview> Accounts { get; init; } = [];
|
||||
public IReadOnlyList<string> Warnings { get; init; } = [];
|
||||
|
||||
public bool HasImportableData => LegacyDatabaseExists && ImportableAccountCount > 0;
|
||||
}
|
||||
|
||||
public sealed class LegacyLocalMigrationProviderCount
|
||||
{
|
||||
public MailProviderType ProviderType { get; init; }
|
||||
public int TotalAccountCount { get; init; }
|
||||
public int ImportableAccountCount { get; init; }
|
||||
public int DuplicateAccountCount { get; init; }
|
||||
}
|
||||
|
||||
public sealed class LegacyLocalMigrationAccountPreview
|
||||
{
|
||||
public Guid LegacyAccountId { get; init; }
|
||||
public string Address { get; init; } = string.Empty;
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
public MailProviderType ProviderType { get; init; }
|
||||
public SpecialImapProvider SpecialImapProvider { get; init; }
|
||||
public int Order { get; init; }
|
||||
public bool CanImport { get; init; }
|
||||
public bool IsDuplicate { get; init; }
|
||||
public bool IsCalendarEnabled { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
public sealed class LegacyLocalMigrationResult
|
||||
{
|
||||
public LegacyLocalMigrationPreview Preview { get; init; } = new();
|
||||
public int ImportedAccountCount { get; init; }
|
||||
public int SkippedDuplicateAccountCount { get; init; }
|
||||
public int FailedAccountCount { get; init; }
|
||||
public int ImportedMergedInboxCount { get; init; }
|
||||
public int SkippedMergedInboxCount { get; init; }
|
||||
public IReadOnlyList<LegacyLocalMigrationFailure> Failures { get; init; } = [];
|
||||
public IReadOnlyList<string> Warnings { get; init; } = [];
|
||||
|
||||
public bool HasImportedData => ImportedAccountCount > 0 || ImportedMergedInboxCount > 0;
|
||||
}
|
||||
|
||||
public sealed class LegacyLocalMigrationFailure
|
||||
{
|
||||
public string Address { get; init; } = string.Empty;
|
||||
public MailProviderType ProviderType { get; init; }
|
||||
public string Message { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -1368,6 +1368,26 @@
|
||||
"WelcomeWindow_ImportInProgress": "Importing preferences and accounts...",
|
||||
"WelcomeWindow_ImportNoAccountsFound": "No accounts were found to import. If preferences were available, they were restored. Use Get started to add an account manually.",
|
||||
"WelcomeWindow_ImportDuplicateAccountsSkipped": "{0} imported accounts are already available on this device. Use Get started to add another account manually if needed.",
|
||||
"LegacyLocalMigration_WelcomeSectionTitle": "Import from your previous Wino version",
|
||||
"LegacyLocalMigration_WelcomeSectionDescription": "Wino found account details in an older local database on this device. Import them now, then sign in again to finish reconnecting each account.",
|
||||
"LegacyLocalMigration_PromptTitle": "Import accounts from your previous Wino version?",
|
||||
"LegacyLocalMigration_ImportAction": "Import previous accounts",
|
||||
"LegacyLocalMigration_PreviewSummary": "Found {0} account(s) ready to import: {1}.",
|
||||
"LegacyLocalMigration_PreviewDuplicateSummary": "{0} account(s) already exist on this device and will be skipped.",
|
||||
"LegacyLocalMigration_PreviewMergedSummary": "{0} merged inbox group(s) can be recreated after import.",
|
||||
"LegacyLocalMigration_Provider_Outlook": "Outlook",
|
||||
"LegacyLocalMigration_Provider_Gmail": "Gmail",
|
||||
"LegacyLocalMigration_Provider_Imap": "IMAP",
|
||||
"LegacyLocalMigration_Warning_OAuth": "Outlook and Gmail accounts will need you to sign in again to restore mail and calendar access.",
|
||||
"LegacyLocalMigration_Warning_Imap": "IMAP and CalDAV passwords are never copied. Open the account settings afterward and enter them again.",
|
||||
"LegacyLocalMigration_Warning_Merged": "Merged inboxes are recreated only when every member account imports successfully.",
|
||||
"LegacyLocalMigration_Warning_SkippedAccounts": "Skipped {0} legacy account(s) because their provider or primary address could not be read safely.",
|
||||
"LegacyLocalMigration_Warning_ReadFailed": "Wino found a previous local database, but it could not be read safely for migration.",
|
||||
"LegacyLocalMigration_ImportAccountsSucceeded": "Imported {0} accounts from the previous local database.",
|
||||
"LegacyLocalMigration_ImportMergedInboxesSucceeded": "Recreated {0} merged inbox group(s).",
|
||||
"LegacyLocalMigration_ImportMergedInboxesSkipped": "Skipped {0} merged inbox group(s) because at least one member account could not be imported.",
|
||||
"LegacyLocalMigration_ImportFailedAccounts": "{0} account(s) could not be imported.",
|
||||
"LegacyLocalMigration_ImportEmpty": "There are no additional legacy accounts to import from this device.",
|
||||
"WelcomeWindow_SetupTitle": "Set up your account",
|
||||
"WelcomeWindow_SetupSubtitle": "Choose your email provider to get started",
|
||||
"WelcomeWindow_AddAccountButton": "Add account",
|
||||
@@ -1444,6 +1464,7 @@
|
||||
"WinoAccount_Management_ExportDialog_AccountsDisclaimer": "Passwords, tokens, and other sensitive information are not synced.",
|
||||
"WinoAccount_Management_ExportDialog_AccountsRelogin": "Imported accounts on another PC will still need you to sign in again before they can be used.",
|
||||
"WinoAccount_Management_ExportDialog_InProgress": "Exporting your selected Wino data...",
|
||||
"LegacyLocalMigration_SettingsSectionTitle": "Import from a previous Wino version",
|
||||
"WinoAccount_Management_LocalDataSectionTitle": "Transfer with a JSON file",
|
||||
"WinoAccount_Management_LocalDataSectionDescription": "Import from or export to a local JSON file. Passwords, tokens, and other sensitive information are not included.",
|
||||
"WinoAccount_Management_LocalDataImportAction": "Import",
|
||||
|
||||
Reference in New Issue
Block a user