Something went wrong. Try again.
Our Personal Data Server from scratch!
Something went wrong. Try again.
1.3 kB · 56 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import type { MigrationProgress, ServerDescription, VerificationChannel,} from "../migration/types.ts";import type { AtprotoClient } from "../migration/atproto-client.ts";
export function createInitialProgress(): MigrationProgress { return { repoExported: false, repoImported: false, blobsTotal: 0, blobsMigrated: 0, blobsFailed: [], prefsMigrated: false, plcSigned: false, activated: false, deactivated: false, currentOperation: "", };}
export async function checkHandleAvailabilityViaClient( client: AtprotoClient, handle: string,): Promise<boolean> { try { await client.resolveHandle(handle); return false; } catch { return true; }}
export function resolveVerificationIdentifier( channel: VerificationChannel, email: string, discordUsername: string, telegramUsername: string, signalUsername: string,): string { switch (channel) { case "email": return email; case "discord": return discordUsername; case "telegram": return telegramUsername; case "signal": return signalUsername; }}
export async function loadServerInfo( client: AtprotoClient, cached: ServerDescription | null,): Promise<ServerDescription> { if (cached) return cached; return client.describeServer();}