UNPKG

@upv/ushi-shared

Version:

Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).

15 lines (14 loc) 600 B
import type { APIGatewayProxyResultV2 } from 'aws-lambda'; import { ApiError } from '../errors'; /** * A serializable object to be returned in an API Gateway response. */ export type ResponsePayload = Record<string, unknown> | ApiError; /** * Builds a standard API Gateway response with consistent headers. * * @param body - The response body object to serialize. * @param statusCode - HTTP status code (e.g., 200, 404). * @returns Formatted APIGatewayProxyResultV2 response. */ export declare const buildResponse: <T extends object>(body: T, statusCode?: number) => APIGatewayProxyResultV2;