Fake Mirrors
    Preparing search index...

    Interface SessionRepository

    Defines the public contract for a session repository.

    A session tracks a user's interaction with the mirror, including their assigned proxy, upgrade status, and message count.

    interface SessionRepository {
        auth(campaignId: string, sessionId: string): Promise<SessionModel>;
        create(campaignId: string): Promise<SessionModel>;
        read(campaignId: string, sessionId: string): Promise<SessionModel | null>;
        upgrade(
            campaignId: string,
            lureId: string,
            sessionId: string,
            secret: string,
        ): Promise<void>;
    }

    Implemented by

    • Upgrades the session by its ID and secret.

      Parameters

      • campaignId: string

        The ID of the campaign containing the session.

      • lureId: string

        The Lure ID through which the session is upgraded.

      • sessionId: string

        The session ID to upgrade.

      • secret: string

        The session secret.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the lure does not exist.

      DatabaseError If the session does not exist.

      DatabaseError If the secret does not match.

      DatabaseError If the data validation fails.