Fake Mirrors
    Preparing search index...

    Class RedisRedirectorRepository

    Redis-based redirector repository implementation.

    Depends:

    import { DIContainer } from '@famir/common'
    import { REDIRECTOR_REPOSITORY, RedirectorRepository, RedisRedirectorRepository } from '@famir/database'

    // Get container singleton
    const container = DIContainer.getInstance()

    // Register dependency in container
    RedisRedirectorRepository.register(container)

    // Resolve dependency from container
    const redirectorRepository = container.resolve<RedirectorRepository>(REDIRECTOR_REPOSITORY)

    // TODO more examples

    Implements

    • Appends a required field to the redirector.

      When rendering a redirector with required fields, all specified fields must be provided in the parameters. If the fields array is empty, the redirector is 'loose' and accepts any parameters.

      Parameters

      • campaignId: string

        The ID of the campaign containing the redirector.

      • redirectorId: string

        The redirector ID to append field to.

      • field: string

        The field name to append to the fields list.

      • lockSecret: string

        The campaign lock secret obtained from CampaignRepository.lock.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the campaign is not locked.

      DatabaseError If the campaign lock secret does not match.

      DatabaseError If the redirector does not exist.

      DatabaseError If the data validation fails.

    • Updates the redirector specific fields.

      All update parameters are optional. Only provided fields will be updated.

      Parameters

      • campaignId: string

        The ID of the campaign containing the redirector.

      • redirectorId: string

        The redirector ID to update.

      • page: string | null | undefined

        The page template.

      • lockSecret: string

        The campaign lock secret obtained from CampaignRepository.lock.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the campaign is not locked.

      DatabaseError If the campaign lock secret does not match.

      DatabaseError If the redirector does not exist.

      DatabaseError If the data validation fails.