import { JSONSchema } from 'json-schema-to-ts'; import { StringDictionaryJSONSchema } from '../../types/constrainedJSONSchema'; import { HttpMethod, HttpStatusCodes } from '../../types/http'; import { ApiGatewayAuthorizerType, ApiGatewayIntegrationType } from './types/constants'; /** * ApiGatewayContract: * * a contract used to define a type-safe interaction between AWS Services through Api Gateway. * * Main features: * - input and output dynamic validation with JSONSchemas on both end of the contract; * - type inference for both input and output; * - generation of a contract document that can be checked for breaking changes; * - generation of open api documentation */ export declare class ApiGatewayContract> | undefined = undefined, OutputSchemas = Exclude> { contractType: "apiGateway"; id: string; path: Path; method: Method; integrationType: IntegrationType; authorizerType: AuthorizerType; pathParametersSchema: PathParametersSchema; queryStringParametersSchema: QueryStringParametersSchema; headersSchema: HeadersSchema; requestContextSchema: RequestContextSchema; bodySchema: BodySchema; outputSchemas: OutputSchemas; inputSchema: JSONSchema; /** * Builds a new ApiGateway contract * * @param props - the contract properties */ constructor(props: { /** * An id to uniquely identify the contract among services. Beware of uniqueness! */ id: string; /** * The path on which the lambda will be triggered */ path: Path; /** * The http method */ method: Method; /** * `'httpApi'` or `'restApi'`, see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html */ integrationType: IntegrationType; /** * Indicates which type of authorizer is used for this contract. */ authorizerType?: AuthorizerType; /** * A JSONSchema used to validate the path parameters and infer their types. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ pathParametersSchema?: PathParametersSchema; /** * A JSONSchema used to validate the query parameters and infer their types. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ queryStringParametersSchema?: QueryStringParametersSchema; /** * A JSONSchema used to validate the headers and infer their types. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ headersSchema?: HeadersSchema; /** * A JSONSchema used to validate the requestContext and infer its type. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ requestContextSchema?: RequestContextSchema; /** * A JSONSchema used to validate the body and infer its type. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ bodySchema?: BodySchema; /** * A record of JSONSchemas used to validate different outputs and infer their types depending on the return status code. * * Please note that the `as const` directive is necessary to properly infer the type from the schema. * See https://github.com/ThomasAribart/json-schema-to-ts#fromschema. */ outputSchemas?: PropsOutputSchemas; }); private getInputSchema; } /** * The type of an ApiGateway contract using all default types. * * It is used internally to type contract features input */ export type GenericApiGatewayContract = ApiGatewayContract>>; //# sourceMappingURL=apiGatewayContract.d.ts.map