import type { Adapter } from "../index.js"; /** * One registry entry per provider. Each entry knows how to lazy-import its * adapter module and construct an instance from a flat opts blob. * * Provider-specific env vars are read by the adapter itself (every adapter * calls `readEnv` for its own conventions — `AWS_*`, `BLOB_READ_WRITE_TOKEN`, * etc.), so the registry only needs to thread the values the CLI captured * from flags or `--config-json`. */ export interface ProviderRegistration { /** * The typed flags this provider can't construct without (e.g. `--bucket`, * `--region`). Metadata only: nothing in the CLI renders or enforces it — * each adapter validates its own options and names the missing one — but * it documents the entry and tests pin it against the adapter's contract. * Empty when configuration comes from `--config-json` or env vars instead. */ required: readonly string[]; /** * Optional one-line hint appended to the adapter's error when `load()` * throws (see `loadFiles`). Use this for providers whose configuration * doesn't fit the typed flag set — most commonly the OAuth-token * providers, where the only path is `--config-json` (or the adapter's own * env vars). `--config-json` is merged shallowly, so nested auth shapes * must be passed whole. */ notes?: string; /** Construct the adapter from a flat opts object. */ load: (opts: ProviderOpts) => Promise; } /** * Union of every shortcut flag the CLI surfaces, plus a passthrough * `extra` blob populated from `--config-json`. Each provider's `load` * picks the fields it knows about and ignores the rest. */ export interface ProviderOpts { bucket?: string; region?: string; endpoint?: string; forcePathStyle?: boolean; accessKeyId?: string; secretAccessKey?: string; sessionToken?: string; publicBaseUrl?: string; defaultUrlExpiresIn?: number; root?: string; urlBaseUrl?: string; token?: string; access?: "public" | "private"; accountName?: string; accountKey?: string; container?: string; connectionString?: string; siteId?: string; storeName?: string; accountId?: string; url?: string; serviceRoleKey?: string; applicationKeyId?: string; applicationKey?: string; projectId?: string; keyFilename?: string; extra?: object; } /** Provider slug → registration. Looked up by the runtime `--provider` string. */ export interface ProviderRegistry { [name: string]: ProviderRegistration; } export declare const PROVIDERS: ProviderRegistry; /** * Providers in the `files-sdk/providers` catalog that the CLI deliberately * does not surface. `bun-s3` is Bun-only; the CLI runs under Node, where * `Bun.S3Client` doesn't exist — Node users reach for the `s3` provider * instead. `convex` is constructed from a live in-function context * (`ctx.storage`) that only exists inside a running Convex function, so it * can't be built from CLI config/env. `memory` is process-local and * non-persistent — each `files` invocation is a fresh process with an empty * store, so a CLI command could only ever see what it just wrote in the same * run, which is useless. The `providers.test.ts` drift guard treats these as * the only allowed gaps between the catalog and this registry. */ export declare const CLI_EXCLUDED_PROVIDERS: Set; export declare const PROVIDER_NAMES: string[]; //# sourceMappingURL=registry.d.ts.map