/** * `renderToLambda` — start a distributed render against an already-deployed * SAM/CDK stack and return a handle the caller can poll with * {@link getRenderProgress}. * * The function does *not* wait for the render to finish. Step Functions * standard workflows can run for hours; blocking the caller's process on * the SFN execution is the wrong default. The returned `RenderHandle` * carries everything the progress / cost / download paths need. * * Wire order: * 1. Validate config (typed throw before any AWS call). * 2. `deploySite` if no `siteHandle` was provided. * 3. `StartExecution` against the state machine with the same input * shape `examples/aws-lambda/scripts/smoke.sh` builds. * 4. Return handle. The S3 `outputKey` is deterministic from the * execution name so the caller can predict the final object URL. */ import { SFNClient } from "@aws-sdk/client-sfn"; import type { S3Client } from "@aws-sdk/client-s3"; import type { LambdaPlanProtocol, SerializableDistributedRenderConfig } from "../events.js"; import { type SiteHandle } from "./deploySite.js"; /** Options for {@link renderToLambda}. */ export interface RenderToLambdaOptions { /** Local project directory. Required when `siteHandle` is not supplied. */ projectDir?: string; /** Re-use an existing `deploySite` upload (skips tar+S3 PUT). */ siteHandle?: SiteHandle; /** Validated `SerializableDistributedRenderConfig` (no logger / abortSignal). */ config: SerializableDistributedRenderConfig; /** * Distributed plan transport. Defaults to `"v2"`. Select `"v1"` * explicitly only for deprecated compatibility with the monolithic plan. */ planProtocol?: LambdaPlanProtocol; /** S3 bucket from the SAM stack output (`RenderBucketName`). */ bucketName: string; /** State machine ARN from the SAM stack output (`RenderStateMachineArn`). */ stateMachineArn: string; /** AWS region; defaults to the SDK default chain. */ region?: string; /** * Final output S3 key. Defaults to `renders//output.` * where `` is derived from `config.format`. */ outputKey?: string; /** * Step Functions execution name. Defaults to `hf-render-`. * Used as `renderId` everywhere downstream (history queries, cost * accounting, predictable S3 key prefix). */ executionName?: string; /** Test injection seam — production callers leave unset. */ sfn?: SFNClient; /** Test injection seam — propagated to `deploySite` when applicable. */ s3?: S3Client; } /** Stable identifier + every URL/ARN the caller needs to follow the render. */ export interface RenderHandle { /** Same as the Step Functions execution name. */ renderId: string; /** Full execution ARN; pass to {@link getRenderProgress}. */ executionArn: string; bucketName: string; stateMachineArn: string; outputS3Uri: string; projectS3Uri: string; startedAt: string; } export declare function renderToLambda(opts: RenderToLambdaOptions): Promise; //# sourceMappingURL=renderToLambda.d.ts.map