/** * Static catalog of every storage provider the SDK ships, plus the * environment variables each one reads. This module is pure data — it imports * no provider SDKs and no adapter code, so it stays zero-dependency and safe to * pull into bundles, build tools, sync engines, or config UIs without dragging * in `@aws-sdk/client-s3` and friends. * * It is the single source of truth behind the docs catalog and the CLI's * provider list; a test (`test/providers.test.ts`) keeps the env declarations * here in sync with the `readEnv(...)` calls in each adapter. * * @example List every provider and its required env vars. * ```typescript * import { PROVIDER_NAMES, getProvider } from "files-sdk/providers"; * * for (const slug of PROVIDER_NAMES) { * const { name, env } = getProvider(slug)!; * console.log(name, env.required?.map((v) => v.key) ?? []); * } * ``` * * @example Find which secrets to inject for one provider. * ```typescript * import { getSecretEnvVars } from "files-sdk/providers"; * * const secrets = getSecretEnvVars("s3").map((v) => v.key); * ``` */ /** A single environment variable an adapter looks for. */ export interface EnvVar { /** * Alternative names accepted for the same value, in the order the adapter * falls back through them. Empty/absent when there is only one name. */ aliases?: readonly string[]; /** Short description of what the value is. */ description: string; /** The canonical environment variable name. */ key: string; /** * Who actually reads this variable: * - `"files-sdk"` — the adapter reads it directly via `readEnv`. * - `"sdk-chain"` — files-sdk never reads it; the underlying provider SDK's * credential chain resolves it (e.g. the AWS SDK reading * `AWS_ACCESS_KEY_ID`, or Google Application Default Credentials). Listed * here for completeness so callers know what to set, but it is resolved * outside of files-sdk and may also come from an IAM role, profile, or * metadata server. */ readBy: "files-sdk" | "sdk-chain"; /** Whether the value is a secret (token, key, password) and should be masked. */ secret: boolean; } /** * One way to authenticate. When a provider exposes several * {@link ProviderEnvSpec.credentialModes}, the caller satisfies exactly one of * them — e.g. Azure accepts a connection string OR an account key OR a SAS * token. A flat "is this var required" flag can't express that, which is why * credentials are grouped. */ export interface EnvGroup { /** Human-readable name for this mode (e.g. "Account key", "SAS token"). */ label: string; /** * The variables that together satisfy this mode. May be empty for a mode * that needs no env vars at all (e.g. an in-code binding or anonymous read). */ vars: readonly EnvVar[]; } /** The environment a provider expects. */ export interface ProviderEnvSpec { /** * Non-env configuration the adapter still requires, passed as constructor * options (or CLI flags) rather than environment variables — e.g. `bucket`, * `region`, `endpoint`, `container`. Informational; not every option is * listed, only the ones without a sensible default. */ config?: readonly string[]; /** * Mutually exclusive credential modes; the caller satisfies exactly one. * Omitted for providers that take no credentials (the local filesystem) or * whose credentials are only ever passed in code. */ credentialModes?: readonly EnvGroup[]; /** Free-form caveats that the structured fields can't capture. */ notes?: string; /** Optional tuning variables — safe to omit. */ optional?: readonly EnvVar[]; /** * Variables needed regardless of which credential mode is used (e.g. a * bucket name read from the environment, or the project URL). */ required?: readonly EnvVar[]; } /** A storage provider available as a `files-sdk/` subpath import. */ export interface Provider { /** One-line summary of the provider and how it authenticates. */ description: string; /** Environment the adapter reads. */ env: ProviderEnvSpec; /** Display name (e.g. "AWS S3"). */ name: string; /** * Native provider SDKs the adapter imports, listed as optional peer * dependencies on `files-sdk`. Empty for adapters that depend only on the * runtime (Bun's native S3 client, Node's `node:fs`). */ peerDeps: readonly string[]; /** Import subpath suffix and CLI `--provider` value (e.g. "s3"). */ slug: string; } /** * Every storage provider, keyed by slug. The `env` of each describes what the * adapter reads; see {@link ProviderEnvSpec} for how credential modes work. */ export declare const PROVIDERS: { akamai: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; alibaba: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; appwrite: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; optional: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; required: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; archil: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; azure: { description: string; env: { config: string[]; credentialModes: ({ label: string; vars: ({ aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; } | { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; })[]; } | { label: string; vars: ({ aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; } | { aliases?: undefined; description: string; key: string; readBy: "files-sdk"; secret: true; })[]; })[]; }; name: string; peerDeps: string[]; slug: string; }; "backblaze-b2": { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; box: { description: string; env: { credentialModes: { label: string; vars: { description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; notes: string; }; name: string; peerDeps: string[]; slug: string; }; "bun-s3": { description: string; env: { config: string[]; credentialModes: { label: string; vars: { aliases: string[]; description: string; key: string; readBy: "sdk-chain"; secret: true; }[]; }[]; notes: string; optional: ({ aliases: string[]; description: string; key: string; readBy: "sdk-chain"; secret: false; } | { aliases: string[]; description: string; key: string; readBy: "sdk-chain"; secret: true; })[]; }; name: string; peerDeps: never[]; slug: string; }; "bunny-storage": { description: string; env: { credentialModes: { label: string; vars: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; optional: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; required: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; cloudinary: { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; }; name: string; peerDeps: string[]; slug: string; }; convex: { description: string; env: { config: string[]; notes: string; }; name: string; peerDeps: string[]; slug: string; }; "digitalocean-spaces": { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; dropbox: { description: string; env: { credentialModes: { label: string; vars: { description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; }; name: string; peerDeps: string[]; slug: string; }; exoscale: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; filebase: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; "firebase-storage": { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; optional: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; fs: { description: string; env: { config: string[]; notes: string; }; name: string; peerDeps: never[]; slug: string; }; ftp: { description: string; env: { config: string[]; credentialModes: { label: string; vars: ({ aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; } | { aliases?: undefined; description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; notes: string; optional: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; gcs: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { description: string; key: string; readBy: "sdk-chain"; secret: false; }[]; }[]; notes: string; optional: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; "google-drive": { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; notes: string; optional: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; hetzner: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; "ibm-cos": { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; "idrive-e2": { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; memory: { description: string; env: { config: string[]; notes: string; }; name: string; peerDeps: never[]; slug: string; }; minio: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; neon: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { description: string; key: string; readBy: "sdk-chain"; secret: true; }[]; }[]; notes: string; optional: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; "netlify-blobs": { description: string; env: { config: string[]; credentialModes: ({ label: string; vars: ({ aliases?: undefined; description: string; key: string; readBy: "files-sdk"; secret: false; } | { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; })[]; } | { label: string; vars: { description: string; key: string; readBy: "sdk-chain"; secret: true; }[]; })[]; notes: string; }; name: string; peerDeps: string[]; slug: string; }; onedrive: { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; optional: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: readonly ["@azure/identity", "@microsoft/microsoft-graph-client"]; slug: string; }; "oracle-cloud": { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; ovhcloud: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; pocketbase: { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; notes: string; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; r2: { description: string; env: { config: string[]; credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; notes: string; }; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; s3: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { description: string; key: string; readBy: "sdk-chain"; secret: true; }[]; }[]; notes: string; optional: { description: string; key: string; readBy: "sdk-chain"; secret: true; }[]; required: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; scaleway: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; sftp: { description: string; env: { config: string[]; credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: false; } | { description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; notes: string; optional: ({ description: string; key: string; readBy: "files-sdk"; secret: true; } | { description: string; key: string; readBy: "files-sdk"; secret: false; })[]; required: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; sharepoint: { description: string; env: { credentialModes: { label: string; vars: ({ aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; } | { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; })[]; }[]; optional: { description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: readonly ["@azure/identity", "@microsoft/microsoft-graph-client"]; slug: string; }; storj: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; supabase: { description: string; env: { config: string[]; credentialModes: { label: string; vars: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; required: { aliases: string[]; description: string; key: string; readBy: "files-sdk"; secret: false; }[]; }; name: string; peerDeps: string[]; slug: string; }; tencent: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; tigris: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; uploadthing: { description: string; env: { credentialModes: { label: string; vars: { description: string; key: string; readBy: "files-sdk"; secret: true; }[]; }[]; }; name: string; peerDeps: string[]; slug: string; }; "vercel-blob": { description: string; env: { credentialModes: { label: string; vars: ({ description: string; key: string; readBy: "files-sdk"; secret: true; } | { description: string; key: string; readBy: "files-sdk"; secret: false; })[]; }[]; notes: string; }; name: string; peerDeps: string[]; slug: string; }; vultr: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; wasabi: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; yandex: { description: string; env: ProviderEnvSpec; name: string; peerDeps: readonly ["@aws-sdk/client-s3", "@aws-sdk/s3-presigned-post", "@aws-sdk/s3-request-presigner"]; slug: string; }; }; /** Slug of any provider in the catalog. */ export type ProviderSlug = keyof typeof PROVIDERS; /** All provider slugs, sorted alphabetically. */ export declare const PROVIDER_NAMES: ProviderSlug[]; /** Look up a provider by slug. Returns `undefined` for unknown slugs. */ export declare const getProvider: (slug: string) => Provider | undefined; /** * Every env var a provider references, flattened across required, all * credential modes, and optional — de-duplicated by key (a var that appears in * several credential modes is returned once). Empty for unknown slugs. */ export declare const listEnvVars: (slug: string) => EnvVar[]; /** The secret env vars a provider references (tokens, keys, passwords). */ export declare const getSecretEnvVars: (slug: string) => EnvVar[]; //# sourceMappingURL=index.d.ts.map