@karmaniverous/smoz
    Preparing search index...
    • Curried builder that binds application env schemas and keys to a function config.

      • First call with env { global: { paramsSchema, envKeys }, stage: { paramsSchema, envKeys } }.
      • Then provide the per-function config object; returns a branded FunctionConfig.

      EventSchema/ResponseSchema are inferred from the functionConfig argument. EventType is explicit (binds to the project-local EventTypeMap). Global/Stage params types are derived from the provided schemas.

      Type Parameters

      • GlobalParamsSchema extends ZodObject<
            Readonly<
                {
                    [k: string]: $ZodType<
                        unknown,
                        unknown,
                        $ZodTypeInternals<unknown, unknown>,
                    >;
                },
            >,
            $strip,
        >

        global params schema

      • StageParamsSchema extends ZodObject<
            Readonly<
                {
                    [k: string]: $ZodType<
                        unknown,
                        unknown,
                        $ZodTypeInternals<unknown, unknown>,
                    >;
                },
            >,
            $strip,
        >

        stage params schema

      Parameters

      Returns <
          EventType extends
              | "rest"
              | "http"
              | "alb"
              | "sqs"
              | "sns"
              | "s3"
              | "dynamodb"
              | "kinesis"
              | "eventbridge"
              | "cloudwatch-logs"
              | "ses"
              | "cloudfront"
              | "firehose"
              | "cognito-userpool"
              | "step",
          EventSchema extends
              | undefined
              | ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
          ResponseSchema extends
              | undefined
              | ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
      >(
          functionConfig: FunctionConfig<
              EventSchema,
              ResponseSchema,
              output<GlobalParamsSchema>,
              output<StageParamsSchema>,
              {
                  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,
          >,
      ) => {
          events?: (
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
              | {}
          )[];
          eventSchema?: EventSchema;
          eventType: EventType;
          fnEnvKeys?: readonly (
              keyof output<GlobalParamsSchema>
              | keyof output<StageParamsSchema>
          )[];
          functionName: string;
          logger?: ConsoleLogger;
          responseSchema?: ResponseSchema;
      } & (
          EventType extends "rest"
          | "http"
              ? {
                  basePath?: string;
                  contentType?: string;
                  httpContexts?: readonly HttpContext[];
                  method?:
                      | "options"
                      | "head"
                      | "trace"
                      | "get"
                      | "put"
                      | "post"
                      | "delete"
                      | "patch"
                      | `x-${string}`
                      | "$ref"
                      | "summary"
                      | "description"
                      | "servers"
                      | "parameters";
              }
              : {
                  basePath?: undefined;
                  contentType?: undefined;
                  httpContexts?: undefined;
                  method?: undefined;
              }
      ) & EnvAttached<GlobalParamsSchema, StageParamsSchema>

      a function that brands a FunctionConfig with env and preserves types