import { randomBytes } from 'node:crypto'; import { Prisma } from '../generated/prisma'; import { decryptMfaSecret, encryptMfaSecret, } from '../src/auth/mfa/mfa-crypto.util'; import { generateTotpSecret } from '../src/auth/mfa/totp.util'; import { gcmSeal, legacyJwtKey } from '../src/common/crypto/key-ring'; import { RekeyJob } from '../src/jobs/rekey.job'; import { runCli } from '../src/jobs/run-cli'; import { PrismaService } from '../src/prisma/prisma.service'; import { openWebhookSecret, sealWebhookSecret, } from '../src/webhooks/webhook-secret'; type Form = 'legacy' | 'previous' | 'current' | 'plaintext'; type MfaForm = Exclude