import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js"; import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js"; import * as BunnyStorageSDK from '@bunny.net/storage-sdk'; import 'node:stream'; import 'node:timers'; import 'node:crypto'; import 'node:http'; import 'lru-cache'; declare class BunnyFile extends File { /** * SHA-256 checksum reported by Bunny Storage (when present on the * stored object). */ bunnyChecksum?: string; /** * Server-side path within the Storage Zone (always prefixed with `/`). */ bunnyPath?: string; } declare class BunnyMetaStorage extends LocalMetaStorage { constructor(config?: LocalMetaStorageOptions); } /** * Bunny Storage region code. Mirrors the SDK's `StorageRegion` enum values * (e.g. `"de"`, `"ny"`, `"syd"`). */ type BunnyStorageRegion = `${BunnyStorageSDK.regions.StorageRegion}`; /** * A connected Bunny Storage zone produced by * `BunnyStorageSDK.zone.connect_with_accesskey(...)`. */ type BunnyStorageClient = ReturnType; interface BunnyStorageOptions extends BaseStorageOptions { /** * Bunny Storage zone password / API access key. Falls back to * `BUNNY_STORAGE_ACCESS_KEY`, then `BUNNY_ACCESS_KEY`, then the * SDK-documented `STORAGE_ACCESS_KEY`. Ignored when `client` is supplied. */ accessKey?: string; /** * Pre-built `StorageZone` instance. Use this to share an instance across * adapters or inject test stubs. Mutually exclusive with `zone` / * `accessKey` / `region`. */ client?: BunnyStorageClient; /** * Configure metafiles storage for resumable-upload bookkeeping. */ metaStorageConfig?: LocalMetaStorageOptions; /** * Origin used to build URLs from `getReadUrl`, typically a Bunny Pull * Zone or custom CDN hostname in front of the Storage Zone. When unset, * `getReadUrl` throws because the Storage API requires an `AccessKey` * header and has no signed-read URL primitive. */ publicBaseUrl?: string; /** * Primary Bunny Storage region. Pass one of * `BunnyStorageSDK.regions.StorageRegion.*`, e.g. `"de"`, `"ny"`, `"syd"`. * Falls back to `BUNNY_STORAGE_REGION`, then `STORAGE_REGION`. Ignored * when `client` is supplied. */ region?: BunnyStorageRegion; /** * Bunny Storage zone name. Falls back to `BUNNY_STORAGE_ZONE`, then the * SDK-documented `STORAGE_ZONE`. Ignored when `client` is supplied. */ zone?: string; } /** * Bunny Storage backend. * * Uses `@bunny.net/storage-sdk`. Writes go through the Storage API with an `AccessKey` header; reads either go through `data()` (server-side fetch) or, when a public Pull Zone is configured, through `publicBaseUrl`. * * **Limitations**: * * - No native server-side `copy` — implemented as download + re-upload. * - No `signedUploadUrl` / presigned PUT — Bunny has no such primitive. * - `getReadUrl` requires `publicBaseUrl` (Pull Zone / CDN hostname) and returns an unsigned URL — Bunny has no signed-read URL primitive, so `expiresIn` is accepted for parity with other adapters but ignored. * - `getReadUrl` rejects `responseContentDisposition` — no override exists on Bunny Storage / Pull Zone URLs. * - `list` is non-recursive: `BunnyStorageSDK.file.list(client, "/")` returns only the immediate children of the zone root. Directory entries are filtered out client-side; the adapter does not descend. * - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored. */ declare class BunnyStorage extends BaseStorage { static override readonly name: string; override checksumTypes: string[]; protected meta: MetaStorage; private readonly client; private readonly publicBaseUrl; private readonly zoneName; constructor(config: BunnyStorageOptions); override get raw(): BunnyStorageClient; /** Name of the connected Bunny Storage zone. */ get zone(): string; create(config: FileInit, _options?: OperationOptions): Promise; write(part: FilePart | FileQuery | BunnyFile, options?: OperationOptions): Promise; delete({ id }: FileQuery, options?: OperationOptions): Promise; get({ id }: FileQuery, options?: OperationOptions): Promise; copy(name: string, destination: string, options?: OperationOptions & { storageClass?: string; }): Promise; move(name: string, destination: string, options?: OperationOptions): Promise; override list(limit?: number, options?: OperationOptions): Promise; override getReadUrl(key: string, options?: { expiresIn?: number; responseContentDisposition?: string; responseContentType?: string; }): Promise; override getUploadUrl(_key: string, _options?: { contentLength?: number; contentType?: string; expiresIn?: number; }): Promise; private internalOnComplete; } export { BunnyFile, BunnyMetaStorage, BunnyStorage, type BunnyStorageClient, type BunnyStorageOptions, type BunnyStorageRegion };