import { aws_apigateway } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { OpenAPI3, OperationObject } from 'openapi-typescript'; import { BaseApi, BaseApiProps } from './base-api'; import { LambdaFunction, LambdaOptions } from './func'; export interface RestApiProps extends BaseApiProps { /** * Domain name of the API (e.g. example.com) * * @default - No custom domain is configured */ domainName?: string; /** * Hostname of the API if a domain name is specified * * @default api */ apiHostname?: string; /** * Generate routes for all endpoints configured in the openapi.yaml file * * @default true */ autoGenerateRoutes?: boolean; /** * custom options for the created HttpApi * * @default - */ restApiProps?: aws_apigateway.RestApiBaseProps; /** * additional options for the underlying Lambda function construct per operationId * * @default - */ lambdaOptionsByOperation?: { [operationId in keyof OPS]?: LambdaOptions; }; definitionFileName: string; } export declare class RestApi extends BaseApi { private props; readonly api: aws_apigateway.SpecRestApi; readonly apiSpec: OpenAPI3; private _functions; constructor(scope: Construct, id: string, props: RestApiProps); protected cleanupSpec(spec: { [key: string]: any; }): { [key: string]: any; }; /** * return the generated Lambda function for the specified API operation */ getFunctionForOperation(operationId: keyof OPS): LambdaFunction; /** * return a list of all generated Lambda functions */ getFunctions(): LambdaFunction[]; addRestResource

(path: P, method: keyof PATHS[P]): LambdaFunction | undefined; addCustomRestResource(operation: OperationObject, method: string, description: string, additionalLambdaOptions?: LambdaOptions): LambdaFunction | undefined; private tableWriteAccessForMethod; /** * AWS does not properly apply the 'security' option to every single path-method. * According to documentation, global security gets applied, if there is no security * set for the particular path-method. If there is any, even empty, it will get precedence. * THIS DOES NOT HAPPEN ON AWS. IT JUST ALWAYS USES THE GLOBAL SETTING! * * 'security applies [...] schemes globally to all API operations, unless overridden on the operation level' * @see https://swagger.io/docs/specification/authentication/ */ protected patchSecurity(spec: OpenAPI3): void; }