import { BucketAccessLevel, ComputeSettings, ConflictReport, DataApiSettings, ResolvedBranchConfig, ResolvedFunctionConfig } from "./types.js"; import { EnableDataApiInput, NeonBranchSnapshot, NeonBucketSnapshot, NeonEndpointSnapshot, NeonFunctionSnapshot } from "./neon-api.js"; //#region src/lib/diff.d.ts /** * A planned action to perform a single mutation against the Neon API. The diff engine * produces a list of these for `pushConfig` to execute (or report). */ type PlanStep = { kind: "update-branch-ttl"; projectId: string; branchId: string; branchName: string; expiresAt: string | null; } | { kind: "update-branch-protected"; projectId: string; branchId: string; branchName: string; protected: boolean; } | { kind: "update-endpoint"; projectId: string; branchName: string; endpointId: string; settings: ComputeSettings; } | { kind: "enable-auth"; projectId: string; branchId: string; branchName: string; databaseName?: string; } | { kind: "enable-data-api"; projectId: string; branchId: string; branchName: string; databaseName: string; /** Create-time auth wiring + initial settings from the policy. */ input?: EnableDataApiInput; } | { /** * Reconcile the runtime settings of an already-enabled Data API integration. * Only `settings` are mutable post-create, so this is the lone Data API * *update* step — and it is an override (requires `updateExisting`). */ kind: "update-data-api"; projectId: string; branchId: string; branchName: string; databaseName: string; settings: DataApiSettings; } | { kind: "create-bucket"; projectId: string; branchId: string; branchName: string; bucketName: string; accessLevel: BucketAccessLevel; } | { /** * Deploy code to a function. Planned for every desired function — deployments are * versioned and the newest becomes active, so a push ships the current source each * time. Neon has no separate "create function" endpoint: the first deployment to a * slug creates the function. `functionExists` therefore only drives whether this * surfaces as a `create` (first deploy) or an `update` (re-deploy). */ kind: "deploy-function"; projectId: string; branchId: string; branchName: string; fn: ResolvedFunctionConfig; /** Whether the function already existed remotely when the plan was computed. */ functionExists: boolean; }; interface RemoteServiceState { databaseName: string; authEnabled: boolean; dataApiEnabled: boolean; /** * Current Data API runtime settings, when the integration is enabled and the API reports * them (SubZero only). `null`/absent means "not reported" — settings drift can't be * computed, so no update step is planned. */ dataApiSettings?: DataApiSettings | null; } /** * Snapshot of the branch's current Preview-feature state. Absent (`undefined`) when the * policy has no `preview` block — `pushConfig` only fetches this when needed. */ interface RemotePreviewState { buckets: NeonBucketSnapshot[]; functions: NeonFunctionSnapshot[]; } interface RemoteState { projectId: string; branch: NeonBranchSnapshot; endpoint?: NeonEndpointSnapshot; services: RemoteServiceState; preview?: RemotePreviewState; } interface DiffOptions { /** * Apply mutable drift on the selected branch as plan steps instead of conflicts. * Default: `false`. */ updateExisting: boolean; } interface DiffResult { plan: PlanStep[]; conflicts: ConflictReport[]; } /** * Diff desired branch policy against the selected remote branch. Pure function. */ declare function diffConfig(config: ResolvedBranchConfig, remote: RemoteState, options: DiffOptions): DiffResult; //#endregion export { DiffOptions, DiffResult, PlanStep, RemotePreviewState, RemoteServiceState, RemoteState, diffConfig }; //# sourceMappingURL=diff.d.ts.map