/** * `deploySite` — upload a project directory to S3 once per content hash * and return a reusable handle. * * `renderToLambda` calls this implicitly when no `siteHandle` is passed, * but exposing it as a standalone verb lets adopters bundle a project * ahead of time and reuse the handle across many renders without * re-tarring the project tree on every call. * * The handle is **content-addressed**: `siteId` is derived from a SHA-256 * over the project files. Two `deploySite` calls on an unchanged tree * produce the same `siteId` and `HeadObject`-short-circuit the upload. */ import { S3Client } from "@aws-sdk/client-s3"; /** Options for {@link deploySite}. */ export interface DeploySiteOptions { /** Local project directory containing `index.html` (and any composition assets). */ projectDir: string; /** S3 bucket the SAM stack / CDK construct provisioned. */ bucketName: string; /** AWS region for the S3 client. Defaults to the SDK's default chain (env / config / IMDS). */ region?: string; /** * Override the content-addressed site id. Useful when the caller has a * stable external identifier they want to use (e.g. a git SHA); if * unset, the hash of the project tree picks it. */ siteId?: string; /** Injection seam for tests. Production callers leave unset. */ s3?: S3Client; } /** Stable handle returned by {@link deploySite}. Pass back to {@link renderToLambda}. */ export interface SiteHandle { /** Content-addressed (or caller-supplied) identifier; stable across re-uploads of the same tree. */ siteId: string; /** Bucket the site landed in. Surfaced separately so callers don't have to re-parse `projectS3Uri`. */ bucketName: string; /** Full `s3://bucket/sites//project.tar.gz` URI; pass through to `renderToLambda`. */ projectS3Uri: string; /** Tarball size in bytes; useful for "did we actually skip the upload?" assertions. */ bytes: number; /** ISO timestamp of the most recent upload OR the existing object the short-circuit found. */ uploadedAt: string; /** `false` if the object already existed and we skipped the PUT. */ uploaded: boolean; } /** * Upload `projectDir` to `s3://bucketName/sites//project.tar.gz`. * * Short-circuits when an object with the same key already exists in the * bucket — `siteId` derives from the project's content hash, so the same * bytes produce the same key, and re-uploading would be redundant. */ export declare function deploySite(opts: DeploySiteOptions): Promise; //# sourceMappingURL=deploySite.d.ts.map