import { BucketAccessLevel, Config, NeonApi, NeonBranchSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonEndpointSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot } from "@neon/config"; //#region src/lib/pull-config.d.ts interface PullConfigOptions { /** Neon project id (``). Required — the API addresses branches by project. */ projectId: string; /** Neon branch id (`br-…`). Required. Resolve names to ids before calling. */ branchId: string; /** Neon API key. Falls back to `NEON_API_KEY` / neonctl credentials. */ apiKey?: string; /** Neon API base URL. Falls back to `NEON_API_HOST`, then production. */ apiHost?: string; /** Inject a custom NeonApi adapter (primarily for tests). */ api?: NeonApi; } /** * Live Preview-feature state read back from a branch. Surfaced alongside `config` rather * than inside it because functions cannot round-trip: the remote only knows the deployed * bundle, not the local `source` path a {@link FunctionConfig} requires, so a pulled * function is reported as `{ slug, name }` (no `source`). */ interface PulledPreview { buckets: Array<{ name: string; access: BucketAccessLevel; }>; functions: Array<{ slug: string; name: string; }>; /** * Secret-free metadata for the credentials issued on the branch (Preview). Surfaced so * `config status` can show issued credentials (id, scopes, last used) without ever * exposing the one-time `api_token` / `s3_secret_access_key`. Empty when none / the * credentials endpoint is unavailable for the project. */ credentials: NeonCredentialMeta[]; } interface PulledBranchConfig { project: { id: string; name: string; region: string; pgVersion: number; orgId?: string; }; branch: { id: string; name: string; parent?: string; isDefault: boolean; protected: boolean; expiresAt?: string; }; /** * The branch's live state expressed as a {@link Config}: static `auth` / `dataApi` * toggles, any object-storage `preview.buckets`, plus a `branch` closure carrying the * branch's lifecycle/compute tuning. Buckets are included here (not just in * {@link PulledBranchConfig.preview}) because they round-trip cleanly — name + access * level is all a {@link Config} needs — so the no-policy env path (`neon dev` / * `neon env pull`) can resolve the branch's storage credentials without a local * `neon.ts`. Preview **functions** are reported only in * {@link PulledBranchConfig.preview}: they cannot round-trip (the remote has no local * `source` path). The AI Gateway is omitted from both — it has no branch-level "enabled" * state to read back (it is always available, credential-gated), so `pullConfig` cannot * tell whether a policy would enable it. */ config: Config; /** * Live Preview-feature state, when the branch has any buckets/functions or issued * credentials. Omitted entirely when there is nothing to report. The AI Gateway is not * included: it is always available (credential-gated), not per-branch state. */ preview?: PulledPreview; } declare function pullConfig(options: PullConfigOptions): Promise; declare function buildPulledBranchConfig(project: NeonProjectSnapshot, branch: NeonBranchSnapshot, branches: NeonBranchSnapshot[], endpoint: NeonEndpointSnapshot | undefined, previewState?: { buckets: NeonBucketSnapshot[]; functions: NeonFunctionSnapshot[]; credentials?: NeonCredentialMeta[]; /** Whether a Neon Auth integration is enabled on the branch. */ authEnabled?: boolean; /** Whether a Neon Data API integration is enabled on the branch. */ dataApiEnabled?: boolean; }): PulledBranchConfig; //#endregion export { PullConfigOptions, PulledBranchConfig, PulledPreview, buildPulledBranchConfig, pullConfig }; //# sourceMappingURL=pull-config.d.ts.map