@resistdesign/voltra
    Preparing search index...

    Type Alias CloudFunctionEventRouter

    CloudFunctionEventRouter: (
        event: any,
        eventTransformer: CloudFunctionEventTransformer,
        routeMap: RouteMap,
        allowedOrigins: CORSPattern[],
        errorShouldBeExposedToClient?: (error: unknown) => boolean,
        debug?: boolean,
        getAuthInfo?: CloudFunctionAuthInfoGetter,
    ) => Promise<CloudFunctionResponse>

    A function that routes an event to a route handler based on a RouteMap.

    Type Declaration

      • (
            event: any,
            eventTransformer: CloudFunctionEventTransformer,
            routeMap: RouteMap,
            allowedOrigins: CORSPattern[],
            errorShouldBeExposedToClient?: (error: unknown) => boolean,
            debug?: boolean,
            getAuthInfo?: CloudFunctionAuthInfoGetter,
        ): Promise<CloudFunctionResponse>
      • Parameters

        • event: any

          Raw cloud function event object.

        • eventTransformer: CloudFunctionEventTransformer

          Transformer used to normalize the event.

        • routeMap: RouteMap

          Route lookup map keyed by path.

        • allowedOrigins: CORSPattern[]

          Allowed origins for CORS responses.

        • OptionalerrorShouldBeExposedToClient: (error: unknown) => boolean

          Optional error filter for response payloads.

        • Optionaldebug: boolean

          When true, log handler inputs and outputs.

        • OptionalgetAuthInfo: CloudFunctionAuthInfoGetter

          Optional auth resolver. When supplied, its result replaces auth information produced by the event transformer. Resolution is intentionally non-blocking for routing: missing, invalid, or failed authentication is treated as anonymous so public routes remain reachable, while protected routes still enforce their auth configuration. Use an upstream gateway authorizer when unauthenticated requests must be rejected before routing.

        Returns Promise<CloudFunctionResponse>

        Cloud function response object.