Libraries v5.0.0
    Preparing search index...

    Type Alias EndpointOptions<E>

    Server-only callbacks, inferred from the endpoint's validated request and DI.

    type EndpointOptions<E> = {
        errors?: keyof ResponsesOf<E> extends never
            ? never
            : ErrorMap<ErrorResponsesOf<E>>;
        idempotency?: EndpointIdempotencyLimits & {
            scope: (
                ...args: Parameters<Handler<E>>,
            ) => IdempotencyScope | Promise<IdempotencyScope>;
        };
        middlewares?: Middleware[];
        prepare?: (
            ...args: Parameters<Handler<E>>,
        ) => ActionContext<E> | Promise<ActionContext<E>>;
    }

    Type Parameters

    • E
    Index
    errors?: keyof ResponsesOf<E> extends never
        ? never
        : ErrorMap<ErrorResponsesOf<E>>
    idempotency?: EndpointIdempotencyLimits & {
        scope: (
            ...args: Parameters<Handler<E>>,
        ) => IdempotencyScope | Promise<IdempotencyScope>;
    }
    middlewares?: Middleware[]
    prepare?: (
        ...args: Parameters<Handler<E>>,
    ) => ActionContext<E> | Promise<ActionContext<E>>

    Runs on every request, including replays; return the request used by scope and handler.