const pool = require('../src/config/database'); const { ensureBootstrapAdmin, readBootstrapAdminConfig } = require('../src/utils/bootstrapAdmin'); async function createAdmin() { const config = readBootstrapAdminConfig(); try { const result = await ensureBootstrapAdmin({ resetPassword: true, createIfActiveAdminExists: true, }); console.log('Master account is ready:', result.user); console.log(`Username: ${config.username}`); console.log(`Password: ${config.password}`); console.log('Change this password after the first login.'); } catch (error) { console.error('Error:', error); process.exitCode = 1; } finally { await pool.end(); } } createAdmin();