Interface FactoryFunctionPropsWithoutRequestBody<TPathParams, TQueryParams, TResponseBody>

Interface representing the properties for a factory function to create HTTP requests without a request body.

interface FactoryFunctionPropsWithoutRequestBody<TPathParams, TQueryParams, TResponseBody> {
    endpointTemplate?: string;
    headers?: Headers;
    logger?: Logger;
    pathParamsSchema: ZodType<TPathParams, ZodTypeDef, TPathParams>;
    queryParamsSchema: ZodType<TQueryParams, ZodTypeDef, TQueryParams>;
    responseBodySchema?: ZodType<TResponseBody, ZodTypeDef, TResponseBody>;
    responseType?: ResponseType;
    retryOptions?: {
        backoffMultiplier?: number;
        initialDelay?: number;
        retries?: number;
    };
    timeout?: number;
}

Type Parameters

  • TPathParams = PathParams

    Type of the path parameters.

  • TQueryParams = QueryParams

    Type of the query parameters.

  • TResponseBody = any

    Type of the response body.

Hierarchy

Properties

endpointTemplate?: string

Optional template for the endpoint URL.

headers?: Headers

Optional headers to include in the request.

logger?: Logger

Optional logger function to log request details.

pathParamsSchema: ZodType<TPathParams, ZodTypeDef, TPathParams>

Schema for validating the path parameters.

queryParamsSchema: ZodType<TQueryParams, ZodTypeDef, TQueryParams>

Schema for validating the query parameters.

responseBodySchema?: ZodType<TResponseBody, ZodTypeDef, TResponseBody>

Optional schema to validate the response body.

responseType?: ResponseType

Optional response type for the request (e.g., json, blob).

retryOptions?: {
    backoffMultiplier?: number;
    initialDelay?: number;
    retries?: number;
}

Optional retry options for the request.

Type declaration

  • OptionalbackoffMultiplier?: number

    The multiplier to apply to the delay between subsequent retries. Optional and must be between 1 and 2.

  • OptionalinitialDelay?: number

    The initial delay before the first retry attempt in milliseconds. Optional and must be between 100 and 5000 ms.

  • Optionalretries?: number

    The number of retry attempts. Optional and must be between 0 and 5.

timeout?: number

Optional timeout for the request in milliseconds.