import { KeyObject } from 'node:crypto'; import { CID } from 'multiformats/cid'; import { IdResolver } from '@atproto/identity'; import { StatusAttr } from '../lexicon/types/com/atproto/admin/defs'; import { AccountDb, EmailTokenPurpose } from './db'; import * as account from './helpers/account'; import { AccountStatus, ActorAccount } from './helpers/account'; import * as invite from './helpers/invite'; import * as password from './helpers/password'; export { AccountStatus, formatAccountStatus } from './helpers/account'; export type AccountManagerDbConfig = { accountDbLoc: string; disableWalAutoCheckpoint: boolean; }; export declare class AccountManager { readonly idResolver: IdResolver; readonly jwtKey: KeyObject; readonly serviceDid: string; readonly serviceHandleDomains: string[]; readonly db: AccountDb; constructor(idResolver: IdResolver, jwtKey: KeyObject, serviceDid: string, serviceHandleDomains: string[], db: AccountManagerDbConfig); migrateOrThrow(): Promise; close(): void; getAccount(handleOrDid: string, flags?: account.AvailabilityFlags): Promise; getAccounts(dids: string[], flags?: account.AvailabilityFlags): Promise>; getAccountByEmail(email: string, flags?: account.AvailabilityFlags): Promise; isAccountActivated(did: string): Promise; getDidForActor(handleOrDid: string, flags?: account.AvailabilityFlags): Promise; getAccountStatus(handleOrDid: string): Promise; normalizeAndValidateHandle(handle: string, { did, allowAnyValid, }?: { did?: string; allowAnyValid?: boolean; }): Promise; createAccount({ did, handle, email, password, repoCid, repoRev, inviteCode, deactivated, refreshJwt, }: { did: string; handle: string; email?: string; password?: string; repoCid: CID; repoRev: string; inviteCode?: string; deactivated?: boolean; refreshJwt?: string; }): Promise; createAccountAndSession(opts: { did: string; handle: string; email?: string; password?: string; repoCid: CID; repoRev: string; inviteCode?: string; deactivated?: boolean; }): Promise<{ accessJwt: string; refreshJwt: string; }>; updateHandle(did: string, handle: string): Promise; deleteAccount(did: string): Promise; takedownAccount(did: string, takedown: StatusAttr): Promise; getAccountAdminStatus(did: string): Promise<{ takedown: StatusAttr; deactivated: StatusAttr; } | null>; updateRepoRoot(did: string, cid: CID, rev: string): Promise; deactivateAccount(did: string, deleteAfter: string | null): Promise; activateAccount(did: string): Promise; createSession(did: string, appPassword: password.AppPassDescript | null, isSoftDeleted?: boolean): Promise<{ accessJwt: string; refreshJwt: string; }>; rotateRefreshToken(id: string): any; revokeRefreshToken(id: string): Promise; login({ identifier, password, }: { identifier: string; password: string; }): Promise<{ user: ActorAccount; appPassword: password.AppPassDescript | null; isSoftDeleted: boolean; }>; createAppPassword(did: string, name: string, privileged: boolean): Promise; listAppPasswords(did: string): Promise<{ name: string; createdAt: string; privileged: boolean; }[]>; verifyAccountPassword(did: string, passwordStr: string): Promise; verifyAppPassword(did: string, passwordStr: string): Promise; revokeAppPassword(did: string, name: string): Promise; ensureInviteIsAvailable(code: string): Promise; createInviteCodes(toCreate: { account: string; codes: string[]; }[], useCount: number): Promise; createAccountInviteCodes(forAccount: string, codes: string[], expectedTotal: number, disabled: 0 | 1): Promise; getAccountInvitesCodes(did: string): Promise; getAccountsInvitesCodes(dids: string[]): Promise>; getInvitedByForAccounts(dids: string[]): Promise>; getInviteCodesUses(codes: string[]): Promise>; setAccountInvitesDisabled(did: string, disabled: boolean): Promise; disableInviteCodes(opts: { codes: string[]; accounts: string[]; }): Promise; createEmailToken(did: string, purpose: EmailTokenPurpose): Promise; assertValidEmailToken(did: string, purpose: EmailTokenPurpose, token: string): Promise; assertValidEmailTokenAndCleanup(did: string, purpose: EmailTokenPurpose, token: string): Promise; confirmEmail(opts: { did: string; token: string; }): Promise; updateEmail(opts: { did: string; email: string; }): Promise; resetPassword(opts: { password: string; token: string; }): Promise; updateAccountPassword(opts: { did: string; password: string; }): Promise; } //# sourceMappingURL=account-manager.d.ts.map