Fake Mirrors
    Preparing search index...

    Class RedisCampaignRepository

    Redis campaign repository implementation.

    Hierarchy (View Summary)

    Implements

    Constructors

    Methods

    • Creates a new campaign.

      Parameters

      • campaignId: string

        The unique identifier for the new campaign

      • mirrorDomain: string

        The public-facing mirror domain

      • description: string

        Human-readable description

      • cryptSecret: string

        Secret used for encrypting session data

      • upgradeSessionPath: string

        URL path that triggers session upgrade

      • sessionCookieName: string

        Name of the cookie used to track sessions

      • sessionExpire: number

        TTL for an authorized session

      • newSessionExpire: number

        TTL for a newly created, not-yet-authorized session

      • messageExpire: number

        TTL for message logs

      Returns Promise<void>

      DatabaseError If a campaign with the same ID already exists

      DatabaseError If mirrorDomain is already used by another campaign

      DatabaseError If sessionCookieName is already used by another campaign

    • Updates specific fields of a campaign.

      Parameters

      • campaignId: string

        The campaign ID to update

      • description: string | null | undefined

        New description

      • sessionExpire: number | null | undefined

        New session expire TTL

      • newSessionExpire: number | null | undefined

        New new-session expire TTL

      • messageExpire: number | null | undefined

        New message expire TTL

      • lockSecret: string

        The lock secret obtained from lock()

      Returns Promise<void>

      DatabaseError If the campaign does not exist

      DatabaseError If the campaign is not locked

      DatabaseError If the lock secret does not match