import type { AwsClient } from "aws4fetch"; import type { Adapter } from "../index.js"; export interface S3FetchAdapterOptions { /** Bucket name. All operations are scoped to it. */ bucket: string; /** * Service endpoint origin, e.g. `https://s3.us-east-1.amazonaws.com`, * `http://localhost:9000`, or `https://t3.storage.dev`. Only the origin is * used — a path component is dropped, so front the service with a host, not * a route prefix. */ endpoint: string; /** * SigV4 signing region. Falls back to `AWS_REGION` / `AWS_DEFAULT_REGION`, * then `us-east-1`. Every S3-compatible service needs *some* region in the * signature; most ignore it for routing. */ region?: string; /** * Static credentials. Falls back to `AWS_ACCESS_KEY_ID`; required if that * env var isn't set. No credential chain — there is no IAM role, shared * profile, or SSO resolution here, which is what keeps this engine * `@aws-sdk/*`-free. */ accessKeyId?: string; /** * Static credentials. Falls back to `AWS_SECRET_ACCESS_KEY`; required if * that env var isn't set. */ secretAccessKey?: string; /** * Session token for temporary credentials. Falls back to * `AWS_SESSION_TOKEN`, but only when `accessKeyId` and `secretAccessKey` * also come from the environment. Explicit keys never pick up an env token. */ sessionToken?: string; /** * Use path-style addressing (`https://endpoint/bucket/key`) instead of the * default virtual-hosted style (`https://bucket.endpoint/key`). Set it for * MinIO and other self-hosted services without per-bucket DNS, and for * bucket names containing dots (virtual-hosted TLS breaks on them). */ forcePathStyle?: boolean; /** * Origin used to build URLs from `url()`. When set, `url(key)` returns * `${publicBaseUrl}/${key}` — for a public bucket policy or a CDN in front * of it. When unset, `url()` falls back to a presigned GetObject. An * explicit `url(key, { expiresIn })` or `responseContentDisposition` still * presigns, since a permanent link can't expire or carry the override. */ publicBaseUrl?: string; /** * Default expiry, in seconds, for the presigned URLs returned by `url()` * when no per-call `expiresIn` is given. Defaults to 3600 (1 hour). */ defaultUrlExpiresIn?: number; /** * Override the `fetch` implementation used for every request — for tests, * or runtimes that hand out a bound/instrumented fetch. Defaults to * `globalThis.fetch`. */ fetch?: (request: Request) => Promise; } export type S3FetchAdapter = Adapter & { readonly bucket: string; }; export declare const s3Fetch: (opts: S3FetchAdapterOptions) => S3FetchAdapter; //# sourceMappingURL=index.d.ts.map