Fake Mirrors
    Preparing search index...

    Interface MessageRepository

    Represents a message repository.

    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

    Methods

    • Creates a message with complete HTTP transaction details.

      Parameters

      • campaignId: string

        The ID of the campaign to create the message in

      • messageId: string

        The unique identifier for the message

      • 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 request URL

      • requestHeaders: HttpHeaders

        The request headers

      • requestBody: HttpBody

        The request body

      • status: number

        The HTTP status code

      • responseHeaders: HttpHeaders

        The response headers

      • responseBody: HttpBody

        The response body

      • connection: HttpConnection

        Connection details

      • payload: HttpPayload

        Payload information

      • errors: HttpError[]

        Array of errors that occurred during processing

      • analyze: string

        Analyze identifier

      • startTime: number

        Start timestamp

      • finishTime: number

        Finish timestamp

      Returns Promise<void>

      DatabaseError If any of the referenced entities does not exist

      DatabaseError If a message with the same ID already exists

    • Creates a dummy message.

      Parameters

      • campaignId: string

        The ID of the campaign to create the message in

      • messageId: string

        The unique identifier for the message

      • 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 any of the referenced entities does not exist

      DatabaseError If a message with the same ID already exists