import { AuthSession, DeviceSession } from "@slackwsh/contracts";
import { EmailService } from "./email.service";
import { JwtService } from "./jwt.service";
export interface RequestMeta {
    deviceLabel?: string;
    ip?: string;
    userAgent?: string;
}
export declare class AuthService {
    private readonly email;
    private readonly jwt;
    constructor(email: EmailService, jwt: JwtService);
    signup(input: {
        email: string;
        password: string;
        name: string;
    }): Promise<{
        userId: number;
        verificationLink: string;
    }>;
    verifyEmail(token: string): Promise<void>;
    login(input: {
        email: string;
        password: string;
    }, meta: RequestMeta): Promise<AuthSession>;
    refresh(refreshToken: string, meta: RequestMeta): Promise<{
        tokens: {
            accessToken: string;
            refreshToken: string;
            expiresIn: number;
        };
    }>;
    logout(refreshToken: string): Promise<void>;
    listDevices(userId: number, currentRefreshTokenHash?: string): Promise<DeviceSession[]>;
    revokeSession(userId: number, sessionId: number): Promise<void>;
    requestPasswordReset(emailAddress: string): Promise<void>;
    confirmPasswordReset(token: string, newPassword: string): Promise<void>;
    requestMagicLink(emailAddress: string): Promise<void>;
    consumeMagicLink(token: string, meta: RequestMeta): Promise<AuthSession>;
    /**
     * Username is auto-generated from the email local-part (never exposed as
     * a signup field yet — this just needs to exist and be unique so
     * @mention resolution, added after the fact, has something to join on).
     * A conflict on retry can't be recovered inside the same failed insert
     * (see the postgres.js SAVEPOINT lesson in libs/messaging/sendMessage) —
     * each attempt here is its own fresh statement, which is simpler still
     * since there's nothing else in the same transaction to roll back.
     */
    private insertUserWithUniqueUsername;
    private createSession;
    private revokeChain;
    private issueToken;
    private consumeToken;
    private toPublicUser;
}
//# sourceMappingURL=auth.service.d.ts.map