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 { AccessOptions } from 'basic-ftp'; import 'node:stream'; import 'node:timers'; import 'node:crypto'; import 'node:http'; import 'lru-cache'; declare class FtpFile extends File { path?: string; } declare class FtpMetaStorage extends LocalMetaStorage { constructor(config?: LocalMetaStorageOptions); } interface FtpStorageOptions extends BaseStorageOptions { /** * `basic-ftp` access options (`host`, `port`, `user`, `password`, * `secure` for FTPS, …). A fresh connection is opened and closed around * every storage operation — an FTP control connection is single-session, * so the adapter does not pool connections. */ connection: AccessOptions; /** * Configure metafile storage. FTP has no native arbitrary-metadata * field, so upload metadata is stored as sidecar JSON on the local * disk (defaults to the OS temp directory). */ metaStorageConfig?: LocalMetaStorageOptions; /** * Logical "bucket root" — virtual keys live under this remote directory. * The adapter creates intermediate directories on write. Leading/trailing * slashes are normalized. Defaults to the connection's working directory. */ rootFolderPath?: string; } /** * FTP / FTPS storage backend (built on `basic-ftp`). * * Routes virtual keys onto remote paths under `rootFolderPath`. FTP has no * native metadata store, so upload metadata is kept as sidecar JSON on the * local disk (see `FtpMetaStorage`). * * A fresh FTP connection is opened and closed around every operation: an FTP * control connection is single-session, so the adapter does not pool * connections. * * **Limitations**: * - `write()` buffers the full part in memory before uploading (no remote append), so chunked uploads overwrite rather than append. * - `getReadUrl` / `getUploadUrl` are not supported — FTP has no signed-URL concept. */ declare class FtpStorage extends BaseStorage { static override readonly name: string; override checksumTypes: string[]; override readonly supportsRange: boolean; protected meta: MetaStorage; private readonly connection; private readonly rootFolderPath; constructor(config: FtpStorageOptions); create(config: FileInit, _options?: OperationOptions): Promise; write(part: FilePart | FileQuery | FtpFile, options?: OperationOptions): Promise; get({ id }: FileQuery, options?: OperationOptions & { range?: { end?: number; start: number; }; }): Promise; delete({ 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 exists({ id }: FileQuery, options?: OperationOptions): Promise; private walkList; /** * Opens a fresh single-session FTP connection for one operation. `basic-ftp` * has no `AbortSignal` hook, so cancellation is best-effort: an abort * destroys the control/data connection via `client.close()`, which rejects * any in-flight transfer. The rejection is normalized to an `AbortError`. */ private run; private ensureRemoteDirectory; private keyToPath; private pathToKey; } export { FtpFile, FtpMetaStorage, FtpStorage, type FtpStorageOptions };