/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { AdminStore } from '../../store.js'; export interface SeedSuperAdminInput { email: string; /** Plaintext — hashed before insert. */ password: string; given_name?: string; family_name?: string; /** Role machine_name. Defaults to `'super-admin'`. */ roleMachineName?: string; /** Role display name. Defaults to `'Super Admin'`. */ roleName?: string; } export interface SeedSuperAdminResult { userId: string; roleId: string; created: { user: boolean; role: boolean; assignment: boolean; }; } /** * Idempotently create the super-admin role + user and assign them to each * other. Safe to re-run against an existing database — reports what was * newly created via the `created` flags so scripts can log meaningfully. * * This is the only built-in seed we ship for auth. Everything else is * configured through the admin UI (or directly via the repositories) once * the super-admin is in. * * The user row has `is_super_admin: true` and `is_enabled: true` set * explicitly — the default for `is_enabled` is false so UI-created * accounts require deliberate enablement, but the seed always produces a * usable account. */ export declare function seedSuperAdmin(store: AdminStore, input: SeedSuperAdminInput): Promise;