import { Extension, ExtensionConfig } from '../patterns/securedCloudFront'; export interface ComposerConfig { readonly tenantId?: string; readonly cognitoDomain?: string; readonly clientId?: string; readonly redirectUri?: string; readonly cookieDomain?: string; readonly requireMfa?: boolean; /** Enable header stripping and injection from JWT claims. @default false */ readonly enableHeaderInjection?: boolean; /** Map of header name → JWT claim key. e.g. { 'x-customer-id': 'customer_id' } */ readonly headerInjectionClaims?: Record; /** Enable refresh redirect for expired-but-valid tokens. @default false */ readonly enableRefresh?: boolean; /** * Custom-UI mode: first-party path to redirect unauthenticated users to * (e.g. '/login'). When set, the shared auth-check module is used with a * relative redirect instead of an external IdP authorize URL. */ readonly loginRedirectPath?: string; } /** * Minify CloudFront Function source with terser. * * CloudFront Functions have a hard 10KB code-size limit. Both the composed * (multi-module) path and the standalone auth-check path must minify, using * the SAME options, so a function that fits in one path fits in the other. * * `minify_sync` throws on a parse error and, in its documented failure mode, * can return `{ error }` with no `code`. An earlier `minified.code || assembled` * fallback caught that second case and silently shipped the UN-minified source, * which is how an 11KB function reached CloudFront and 413'd at deploy. This * helper never falls back: a thrown error propagates, and a missing `code` is * turned into a thrown error too — a minify failure is always a build error. * * The `reserved` names are the CloudFront-required top-level identifiers that * must survive mangling. */ export declare function minifyFunctionCode(source: string): string; /** * Generates a combined CloudFront Function from modular check functions * based on requested extensions */ export declare class FunctionComposer { private readonly modulesDir; constructor(); /** * Generate combined function code based on requested extensions */ compose(extensions: Extension[], config?: ExtensionConfig, composerConfig?: ComposerConfig): string; private loadModule; private generateHandler; }