import { F as File, L as LocalMetaStorageOptions, f as BaseStorageOptions, M as MetaStorage, e as FileInit, O as OperationOptions, h as FilePart, i as FileQuery, c as FileReturn, S as StoredObject, B as BaseStorage } from "../../packem_shared/storage.d-Cnjmzau5.js"; import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-DuAe8gC_.js"; import { AccessOptions } from 'basic-ftp'; import 'node:stream'; import "../../packem_shared/types.d-DFh9698o.js"; 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. * A leading `/` makes it absolute; otherwise it resolves against the * login directory. Trailing slashes are ignored. The adapter creates * intermediate directories on write. Defaults to the login directory. */ rootFolderPath?: string; } /** * FTP / FTPS storage backend (built on `basic-ftp`). * * Routes virtual keys onto remote paths under `rootFolderPath`, which resolves against the login * directory unless it starts with `/`. 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 only a whole-file write at offset 0 is accepted; chunked writes are rejected with `METHOD_NOT_ALLOWED`. * - `getReadUrl` / `getUploadUrl` are not supported — FTP has no signed-URL concept. */ declare class FtpStorage extends BaseStorage { static override readonly name: string; override readonly storageKind: string; /** Stores each object in a single request, so chunked/resumable uploads are rejected. */ override readonly supportsResumableWrites: boolean; override checksumTypes: string[]; override readonly supportsRange: boolean; protected meta: MetaStorage; private readonly connection; private readonly rootFolderPath; /** An absolute `rootFolderPath` ("/srv/uploads") stays absolute; a relative one resolves against the login directory. */ private readonly absoluteRoot; 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; protected override statObject(id: string, 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 };