Fake Mirrors
    Preparing search index...

    Class RedisMessageRepository

    Redis-based message repository implementation.

    Depends:

    import { DIContainer } from '@famir/common'
    import { MESSAGE_REPOSITORY, MessageRepository, RedisMessageRepository } from '@famir/database'

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

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

    // Resolve dependency from container
    const messageRepository = container.resolve<MessageRepository>(MESSAGE_REPOSITORY)

    // TODO more examples

    Implements

    • Creates a new message.

      Parameters

      • campaignId: string

        The ID of the campaign to create the message in.

      • messageId: string

        The new message ID to create.

      • proxyId: string

        The ID of the proxy that processed this message.

      • targetId: string

        The ID of the target that handled this message.

      • sessionId: string

        The ID of the session that generated this message.

      • type:
            | "normal-simple"
            | "normal-stream-request"
            | "normal-stream-response"
            | "websocket"

        The message type.

      • method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"

        The HTTP method.

      • url: string

        The HTTP request URL.

      • requestHeaders: HttpHeaders

        The HTTP request headers.

      • requestBody: HttpBody

        The HTTP request body.

      • status: number

        The HTTP status code.

      • responseHeaders: HttpHeaders

        The HTTP response headers.

      • responseBody: HttpBody

        The HTTP response body.

      • connection: HttpConnection

        The connection details.

      • payload: HttpPayload

        The payload data extracted from the transaction.

      • errors: HttpError[]

        The list of errors that occurred during processing.

      • analyze: string

        The analyze identifier.

      • startTime: number

        The start processing timestamp.

      • finishTime: number

        The finish processing timestamp.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the proxy does not exist.

      DatabaseError If the target does not exist.

      DatabaseError If the session does not exist.

      DatabaseError If a message with the same ID already exists.

      DatabaseError If the data validation fails.

    • Creates a new dummy message.

      This method only increments counters and does not store the actual message data. Useful for tracking traffic without storing full transaction details.

      Parameters

      • campaignId: string

        The ID of the campaign to create the message in.

      • messageId: string

        The new message ID to create.

      • proxyId: string

        The ID of the proxy that processed this message.

      • targetId: string

        The ID of the target that handled this message.

      • sessionId: string

        The ID of the session that generated this message.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the proxy does not exist.

      DatabaseError If the target does not exist.

      DatabaseError If the session does not exist.

      DatabaseError If a message with the same ID already exists.

      DatabaseError If the data validation fails.