UNPKG

@swarmion/serverless-contracts

Version:

Generate and use type-safe contracts between your Serverless services.

21 lines 881 B
import { HttpMethod } from '../../../types/http'; import { BodyType, HeadersType, PathParametersType, QueryStringParametersType } from './common'; import { DefinedProperties } from './utils'; import { GenericApiGatewayContract } from '../apiGatewayContract'; /** * Computed request parameters. This enables the call to the contract to be type-safe */ export interface RequestParameters<BodyType> { method: HttpMethod; path: string; body?: BodyType; headers?: Record<string, string>; queryStringParameters?: Record<string, string>; } export type RequestArguments<Contract extends GenericApiGatewayContract> = DefinedProperties<{ pathParameters: PathParametersType<Contract>; queryStringParameters: QueryStringParametersType<Contract>; headers: HeadersType<Contract>; body: BodyType<Contract>; }>; //# sourceMappingURL=requestParameters.d.ts.map