Fake Mirrors
    Preparing search index...

    Interface MessageRepository

    Defines the public contract for a message repository.

    A message contains a complete HTTP request/response transaction for analysis. Messages are immutable records that capture all details of a processed request.

    interface MessageRepository {
        create(
            campaignId: string,
            messageId: string,
            proxyId: string,
            targetId: string,
            sessionId: string,
            type:
                | "normal-simple"
                | "normal-stream-request"
                | "normal-stream-response"
                | "websocket",
            method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS",
            url: string,
            requestHeaders: HttpHeaders,
            requestBody: HttpBody,
            status: number,
            responseHeaders: HttpHeaders,
            responseBody: HttpBody,
            connection: HttpConnection,
            payload: HttpPayload,
            errors: HttpError[],
            analyze: string,
            startTime: number,
            finishTime: number,
        ): Promise<void>;
        createDummy(
            campaignId: string,
            messageId: string,
            proxyId: string,
            targetId: string,
            sessionId: string,
        ): Promise<void>;
        read(campaignId: string, messageId: string): Promise<MessageModel | null>;
        readFull(
            campaignId: string,
            messageId: string,
        ): Promise<FullMessageModel | null>;
    }

    Implemented by

    • 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.