Type Parameters
- GlobalParamsSchema extends ZodObj
- StageParamsSchema extends ZodObj
- EventTypeMapResolved extends {
alb: ALBEvent;
cloudfront: CloudFrontRequestEvent;
"cloudwatch-logs": CloudWatchLogsEvent;
"cognito-userpool": CognitoUserPoolTriggerEvent;
dynamodb: DynamoDBStreamEvent;
eventbridge: EventBridgeEvent<string, unknown>;
firehose: FirehoseTransformationEvent;
http: APIGatewayProxyEventV2;
kinesis: KinesisStreamEvent;
rest: APIGatewayProxyEvent;
s3: S3Event;
ses: SESEvent;
sns: SNSEvent;
sqs: SQSEvent;
step: { Payload?: unknown; [key: string]: unknown };
}
- EventType extends string | number | symbol
- EventSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined
- ResponseSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined
Returns (
functionConfig: {
events?: (
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
| {}
)[];
eventSchema?: EventSchema;
eventType: EventType;
fnEnvKeys?: readonly (
keyof output<GlobalParamsSchema>
| keyof output<StageParamsSchema>
)[];
functionName: string;
logger?: ConsoleLogger;
responseSchema?: ResponseSchema;
} & (
EventType extends "http"
| "rest"
? {
basePath?: string;
contentType?: string;
httpContexts?: readonly ("my" | "private" | "public")[];
method?:
| "options"
| "head"
| "trace"
| "get"
| "put"
| "post"
| "delete"
| "patch"
| "query"
| "additionalOperations"
| "parameters"
| `x-${string}`
| "$ref"
| "summary"
| "description"
| "servers";
}
: {
basePath?: undefined;
contentType?: undefined;
httpContexts?: undefined;
method?: undefined;
}
) & EnvAttached<GlobalParamsSchema, StageParamsSchema>,
business: Handler<
EventSchema,
ResponseSchema,
EventTypeMapResolved[EventType],
>,
) => (event: unknown, context: unknown) => Promise<unknown>
a function that binds a branded FunctionConfig and a business handler, producing a Lambda handler
handlerFactory