/** * 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 { AdminUsersRepository } from '../admin-users/repository.js'; import type { AccountResponse, ChangeAccountPasswordRequest, UpdateAccountRequest } from './schemas.js'; /** * Self-service business logic for the currently signed-in admin user. * * Reuses `AdminUsersRepository` rather than introducing a parallel * repository — the underlying table is the same, and self-service is * just a narrower surface over it. The narrowing is structural: * * - Every method takes `actorId` (sourced server-side from the * authenticated `RequestContext`) and uses it as the target id. * Callers cannot supply a target id; commands look it up from * `actor.id` and pass it in. * - `updateAccount` excludes `is_super_admin`, `is_enabled`, and * `is_email_verified` from the writable surface. The schema * already strips them, but the service signature reinforces it. * - `changePassword` verifies the *current* password before swapping * in the new hash. A hijacked session cannot use this flow to lock * out the legitimate owner. * * Native adapter password writes atomically advance the session generation and * revoke every refresh session. External providers own their own revocation. */ export declare class AdminAccountService { #private; constructor(deps: { repo: AdminUsersRepository; }); getAccount(actorId: string): Promise; updateAccount(actorId: string, request: UpdateAccountRequest): Promise; setPreferredLocale(actorId: string, locale: string | null): Promise; changePassword(actorId: string, request: ChangeAccountPasswordRequest): Promise; }