// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/distilled-spec-neon). Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as Redacted from "effect/Redacted"; import * as API from "@distilled.cloud/core/api"; import * as C from "@distilled.cloud/core/category"; import * as T from "../traits.ts"; import { NeonProtocol, type NeonOpError, type NeonOpContext, } from "../protocol.ts"; import { paginateCursor } from "../pagination.ts"; import { UnknownNeonError } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { NeonOpError, NeonOpContext }; export class BadRequest extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("BadRequest", { code: S.Number, message: S.String, }).pipe(C.withBadRequestError), [{ status: 400 }], ) {} export class Conflict extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Conflict", { code: S.Number, message: S.String, }).pipe(C.withConflictError), [{ status: 409 }], ) {} export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }).pipe(C.withAuthError), [{ status: 403 }], ) {} export class NotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NotFound", { code: S.Number, message: S.String, }).pipe(C.withBadRequestError), [{ status: 404 }], ) {} export class UnprocessableEntity extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("UnprocessableEntity", { code: S.Number, message: S.String, }).pipe(C.withBadRequestError), [{ status: 422 }], ) {} export interface AcceptProjectTransferRequestRequest { /** The Neon project ID */ project_id: string; /** The Neon project transfer request ID */ request_id: string; /** The Neon organization ID to transfer the project to. If not provided, the project will be transferred to the current user or organization account. */ org_id?: string; } export const AcceptProjectTransferRequestRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), request_id: S.String.pipe(T.Label()), org_id: S.optional(S.String), }).pipe( T.Http({ method: "PUT", uri: "/projects/{project_id}/transfer_requests/{request_id}", code: 200, }), ), ).annotate({ identifier: "AcceptProjectTransferRequestRequest", }) as any as S.Schema; export interface AcceptProjectTransferRequestResponse {} export const AcceptProjectTransferRequestResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "AcceptProjectTransferRequestResponse", }) as any as S.Schema; export type NeonAuthOauthProviderId = | "google" | "github" | "microsoft" | "vercel"; export const NeonAuthOauthProviderId = S.String; export interface AddBranchNeonAuthOauthProviderRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** OAuth provider to configure for Neon Auth. Known values: `google`, `github`, `microsoft`, `vercel`. */ id: NeonAuthOauthProviderId | (string & {}); /** The client ID issued by the OAuth provider for your application. Used to identify the application during the OAuth flow. */ client_id?: string; /** OAuth client secret for the provider. */ client_secret?: string | Redacted.Redacted; /** Tenant ID for the Microsoft OAuth provider. Only relevant when the OAuth provider is Microsoft; omit or leave blank for other providers. */ microsoft_tenant_id?: string; } export const AddBranchNeonAuthOauthProviderRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), id: NeonAuthOauthProviderId, client_id: S.optional(S.String), client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), microsoft_tenant_id: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/auth/oauth_providers", code: 200, }), ), ).annotate({ identifier: "AddBranchNeonAuthOauthProviderRequest", }) as any as S.Schema; export type NeonAuthOauthProviderType = "standard" | "shared"; export const NeonAuthOauthProviderType = S.String; export interface NeonAuthOauthProvider { /** The OAuth provider's ID. */ id: NeonAuthOauthProviderId; /** OAuth provider key type. `standard` uses your own OAuth credentials. `shared` uses Neon-managed keys intended for development only; they display Neon branding on the OAuth consent screen and must not be used in production. */ type: NeonAuthOauthProviderType; /** Public identifier for the OAuth application, issued by the provider when the application is registered. */ client_id?: string; /** OAuth client secret for the provider. */ client_secret?: string | Redacted.Redacted; } export const NeonAuthOauthProvider = /*@__PURE__*/ S.suspend(() => S.Struct({ id: NeonAuthOauthProviderId, type: NeonAuthOauthProviderType, client_id: S.optional(S.String), client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), }), ).annotate({ identifier: "NeonAuthOauthProvider", }) as any as S.Schema; /** Authentication provider integrated with this Neon Auth configuration. `better_auth` integrates with Better Auth (the current, recommended provider). `stack` integrates with Stack Auth (deprecated). `mock` is a simulated provider for local development and testing only. */ export type NeonAuthSupportedAuthProvider = "mock" | "stack" | "better_auth"; export const NeonAuthSupportedAuthProvider = S.String; export interface AddBranchNeonAuthTrustedDomainRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** URI to add to the redirect URI allowlist for the auth provider. */ domain: string; auth_provider: NeonAuthSupportedAuthProvider | (string & {}); } export const AddBranchNeonAuthTrustedDomainRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), domain: S.String, auth_provider: NeonAuthSupportedAuthProvider, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/auth/domains", code: 200, }), ), ).annotate({ identifier: "AddBranchNeonAuthTrustedDomainRequest", }) as any as S.Schema; export interface AddBranchNeonAuthTrustedDomainResponse {} export const AddBranchNeonAuthTrustedDomainResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "AddBranchNeonAuthTrustedDomainResponse", }) as any as S.Schema; /** Deprecated. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated`, and `anonymous` roles. */ export type AddProjectJWKSRequestRoleNamesList = Array; export const AddProjectJWKSRequestRoleNamesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface AddProjectJWKSRequest { /** The Neon project ID */ project_id: string; /** URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** The name of the authentication provider (e.g., Clerk, Stytch, Auth0) */ provider_name: string; /** The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id?: string; /** Expected `aud` claim in incoming JWTs. When set, tokens with a different audience are rejected; tokens with no audience are still accepted. Omit to skip audience validation. */ jwt_audience?: string; /** Deprecated. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated`, and `anonymous` roles. */ role_names?: AddProjectJWKSRequestRoleNamesList; /** Deprecated. Only used with Neon RLS. If true, role creation is skipped. */ skip_role_creation?: boolean; } export const AddProjectJWKSRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), jwks_url: S.String, provider_name: S.String, branch_id: S.optional(S.String), jwt_audience: S.optional(S.String), role_names: S.optional(AddProjectJWKSRequestRoleNamesList), skip_role_creation: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/jwks", code: 200 }), ), ).annotate({ identifier: "AddProjectJWKSRequest", }) as any as S.Schema; /** Database role names that are permitted to authenticate using this JWKS configuration. */ export type JWKSRoleNamesList = Array; export const JWKSRoleNamesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface JWKS { /** The JWKS configuration's ID. */ id: string; /** The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; /** The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id?: string; /** URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** The name of the authentication provider (e.g., Clerk, Stytch, Auth0) */ provider_name: string; /** The date and time when the JWKS was created */ created_at: string; /** The date and time when the JWKS was last modified */ updated_at: string; /** Expected JWT `aud` claim value configured for this JWKS. */ jwt_audience?: string; /** Database role names that are permitted to authenticate using this JWKS configuration. */ role_names?: JWKSRoleNamesList; } export const JWKS = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, project_id: S.String, branch_id: S.optional(S.String), jwks_url: S.String, provider_name: S.String, created_at: S.String, updated_at: S.String, jwt_audience: S.optional(S.String), role_names: S.optional(JWKSRoleNamesList), }), ).annotate({ identifier: "JWKS" }) as any as S.Schema; /** The action performed by the operation */ export type OperationAction = | "create_compute" | "create_timeline" | "start_compute" | "suspend_compute" | "apply_config" | "check_availability" | "delete_timeline" | "create_branch" | "import_data" | "tenant_ignore" | "tenant_attach" | "tenant_detach" | "tenant_detach_safekeepers" | "tenant_attach_safekeepers" | "tenant_reattach" | "replace_safekeeper" | "disable_maintenance" | "apply_storage_config" | "prepare_secondary_pageserver" | "switch_pageserver" | "detach_parent_branch" | "timeline_archive" | "timeline_unarchive" | "start_reserved_compute" | "sync_dbs_and_roles_from_compute" | "apply_schema_from_branch" | "timeline_mark_invisible" | "timeline_update_protected_config" | "prewarm_replica" | "promote_replica" | "set_storage_non_dirty" | "swap_binding_id" | "finalize_migration" | "mark_migration_prepared" | "update_catalog" | "epc_sync"; export const OperationAction = S.String; /** Lifecycle state of the operation. `scheduling`: queued, not yet started. `running`: actively executing. `finished`: completed successfully. `failed`: ended with a failure. `error`: ended with a terminal error. `cancelling`: cancellation requested but not yet complete. `cancelled`: stopped before completion. `skipped`: bypassed without executing. */ export type OperationStatus = | "scheduling" | "running" | "finished" | "failed" | "error" | "cancelling" | "cancelled" | "skipped"; export const OperationStatus = S.String; /** An asynchronous action Neon performs on your resources (for example, starting a compute or creating a branch). Fields such as `action`, `status`, and `total_duration_ms` describe the operation and its progress. */ export interface Operation { /** The operation ID */ id: string; /** The ID of the project this operation ran on. */ project_id: string; /** The ID of the branch this operation ran on. */ branch_id?: string; /** The ID of the compute endpoint this operation ran on. */ endpoint_id?: string; action: OperationAction; /** Current lifecycle state of the operation. On `failed`, see `failures_count` and `retry_at` for retry detail. */ status: OperationStatus; /** Human-readable message describing why the operation failed. */ error?: string; /** The number of times the operation failed */ failures_count: number; /** A timestamp indicating when the operation was last retried */ retry_at?: string; /** A timestamp indicating when the operation was created */ created_at: string; /** A timestamp indicating when the operation status was last updated */ updated_at: string; /** The total duration of the operation in milliseconds */ total_duration_ms: number; } export const Operation = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, project_id: S.String, branch_id: S.optional(S.String), endpoint_id: S.optional(S.String), action: OperationAction, status: OperationStatus, error: S.optional(S.String), failures_count: S.Number, retry_at: S.optional(S.String), created_at: S.String, updated_at: S.String, total_duration_ms: S.Number, }), ).annotate({ identifier: "Operation" }) as any as S.Schema; export type AddProjectJWKSResponseOperationsList = Array; export const AddProjectJWKSResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface AddProjectJWKSResponse { /** JWKS configuration associated with the project. */ jwks: JWKS; operations: AddProjectJWKSResponseOperationsList; } export const AddProjectJWKSResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ jwks: JWKS, operations: AddProjectJWKSResponseOperationsList, }), ).annotate({ identifier: "AddProjectJWKSResponse", }) as any as S.Schema; export interface AssignOrganizationVPCEndpointRequest { /** The Neon organization ID */ org_id: string; /** The Neon region ID. Azure regions are currently not supported. */ region_id: string; /** The VPC endpoint ID */ vpc_endpoint_id: string; /** Human-readable name for the VPC endpoint assignment, used to identify it within the organization. */ label: string; } export const AssignOrganizationVPCEndpointRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ org_id: S.String.pipe(T.Label()), region_id: S.String.pipe(T.Label()), vpc_endpoint_id: S.String.pipe(T.Label()), label: S.String, }).pipe( T.Http({ method: "POST", uri: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}", code: 200, }), ), ).annotate({ identifier: "AssignOrganizationVPCEndpointRequest", }) as any as S.Schema; export interface AssignOrganizationVPCEndpointResponse {} export const AssignOrganizationVPCEndpointResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "AssignOrganizationVPCEndpointResponse", }) as any as S.Schema; export interface AssignProjectVPCEndpointRequest { /** The Neon project ID */ project_id: string; /** The VPC endpoint ID */ vpc_endpoint_id: string; /** Human-readable name for the VPC endpoint assignment, used to identify it within the organization. */ label: string; } export const AssignProjectVPCEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), vpc_endpoint_id: S.String.pipe(T.Label()), label: S.String, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}", code: 200, }), ), ).annotate({ identifier: "AssignProjectVPCEndpointRequest", }) as any as S.Schema; export interface AssignProjectVPCEndpointResponse {} export const AssignProjectVPCEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "AssignProjectVPCEndpointResponse", }) as any as S.Schema; export interface CountProjectBranchesRequest { /** The Neon project ID */ project_id: string; /** Count branches matching the `name` in search query */ search?: string; } export const CountProjectBranchesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), search: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/count", code: 200, }), ), ).annotate({ identifier: "CountProjectBranchesRequest", }) as any as S.Schema; export interface CountProjectBranchesResponse { /** Total number of branches in the project. */ count: number; } export const CountProjectBranchesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ count: S.Number, }), ).annotate({ identifier: "CountProjectBranchesResponse", }) as any as S.Schema; export interface CreateApiKeyRequest { /** A user-specified API key name. This value is required when creating an API key. */ key_name: string; } export const CreateApiKeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ key_name: S.String, }).pipe(T.Http({ method: "POST", uri: "/api_keys", code: 200 })), ).annotate({ identifier: "CreateApiKeyRequest", }) as any as S.Schema; export interface ApiKeyCreateResponse { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The generated 64-bit token required to access the Neon API */ key: string; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; /** ID of the user who created this API key */ created_by: string; } export const ApiKeyCreateResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, key: S.String, name: S.String, created_at: S.String, created_by: S.String, }), ).annotate({ identifier: "ApiKeyCreateResponse", }) as any as S.Schema; export interface CreateBranchNeonAuthNewUserRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Email address of the new Neon Auth user to create. */ email: string; /** Display name for the new user. Optional. Pair with the required email field when creating a new user. */ name?: string; } export const CreateBranchNeonAuthNewUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), email: S.String, name: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/auth/users", code: 200, }), ), ).annotate({ identifier: "CreateBranchNeonAuthNewUserRequest", }) as any as S.Schema; export interface NeonAuthCreateNewUserResponse { /** ID of newly created user */ id: string; } export const NeonAuthCreateNewUserResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, }), ).annotate({ identifier: "NeonAuthCreateNewUserResponse", }) as any as S.Schema; /** A single capability you may request when issuing a credential. A credential is granted a set of these; it may only perform actions explicitly listed in its scopes. This is the *requestable* set. Responses describing an existing credential use `GrantedCredentialScope`, which is deliberately wider: a credential may have been granted a scope that this endpoint does not offer, and a response must be able to report it. */ export type CredentialScope = | "storage:read" | "storage:write" | "ai_gateway:invoke" | "functions:invoke"; export const CredentialScope = S.String; export type CreateCredentialRequestScopesList = Array< CredentialScope | (string & {}) >; export const CreateCredentialRequestScopesList = /*@__PURE__*/ S.Array( CredentialScope, ) as any as S.Schema; /** Principal type for the credential. Only `user` is customer-managed and accepted here. `function` and `system` credentials are platform-internal (e.g. function-serve auto-mint, presign signer) and are never issued through the customer-facing API. */ export type CreateCredentialRequestPrincipalType = "user"; export const CreateCredentialRequestPrincipalType = S.String; export interface CreateCredentialRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Free-form customer label for the credential. */ name?: string; scopes: CreateCredentialRequestScopesList; /** Principal type for the credential. Only `user` is customer-managed and accepted here. `function` and `system` credentials are platform-internal (e.g. function-serve auto-mint, presign signer) and are never issued through the customer-facing API. */ principal_type: CreateCredentialRequestPrincipalType | (string & {}); } export const CreateCredentialRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), name: S.optional(S.String), scopes: CreateCredentialRequestScopesList, principal_type: CreateCredentialRequestPrincipalType, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/credentials", code: 200, }), ), ).annotate({ identifier: "CreateCredentialRequest", }) as any as S.Schema; /** A single capability a credential actually carries, as reported by responses that describe an existing credential. This set is a superset of `CredentialScope` (the requestable set) because a credential's scopes are not limited to what this API offers: the platform accepts additional scopes for customer-managed (`user`) credentials, so one may exist on your branch that was not issued through this endpoint. Responses must be able to report such a credential rather than fail to describe it — a client that rejected the value would, on rotate, discard the replacement secret after the rotation had already committed. Treat unknown values as opaque. */ export type GrantedCredentialScope = | "storage:read" | "storage:write" | "ai_gateway:invoke" | "telemetry:write" | "functions:invoke"; export const GrantedCredentialScope = S.String; export type CreateCredentialResponseScopesList = Array; export const CreateCredentialResponseScopesList = /*@__PURE__*/ S.Array( GrantedCredentialScope, ) as any as S.Schema; export interface CreateCredentialResponse { /** Opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; /** First 12 hex chars of token_id; safe to log. */ token_id_short: string; /** Customer-supplied label, echoed back from the request. Absent when not provided. */ name?: string; /** Bearer token; returned exactly once. */ api_token: string | Redacted.Redacted; /** nsk_live_<64 hex>; the AWS_SECRET_ACCESS_KEY, returned exactly once. */ s3_secret_access_key: string; scopes: CreateCredentialResponseScopesList; branch_id: string; created_at: string; /** When the credential expires; absent means never expires. */ expires_at?: string; } export const CreateCredentialResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ token_id: S.String, token_id_short: S.String, name: S.optional(S.String), api_token: S.String.pipe(T.SensitiveValue({})), s3_secret_access_key: S.String, scopes: CreateCredentialResponseScopesList, branch_id: S.String, created_at: S.String, expires_at: S.optional(S.String), }), ).annotate({ identifier: "CreateCredentialResponse", }) as any as S.Schema; export interface CreateNeonAuthRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; auth_provider: NeonAuthSupportedAuthProvider | (string & {}); /** Name of the database to enable Neon Auth on. When omitted, the integration uses the project's default database. */ database_name?: string; } export const CreateNeonAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), auth_provider: NeonAuthSupportedAuthProvider, database_name: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/auth", code: 200, }), ), ).annotate({ identifier: "CreateNeonAuthRequest", }) as any as S.Schema; export interface NeonAuthCreateIntegrationResponse { auth_provider: NeonAuthSupportedAuthProvider; /** Project ID assigned by the auth provider for this integration. */ auth_provider_project_id: string; /** Publishable SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. */ pub_client_key: string; /** Secret server-side SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. Treat as a credential. */ secret_server_key: string; /** URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** Postgres schema containing the auth integration tables. Defaults to `neon_auth`. */ schema_name: string; /** Postgres table in the integration schema where synced user records are stored. */ table_name: string; /** Base URL of the Neon Auth service for this integration. Set as the NEON_AUTH_BASE_URL environment variable in your application. */ base_url?: string; } export const NeonAuthCreateIntegrationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ auth_provider: NeonAuthSupportedAuthProvider, auth_provider_project_id: S.String, pub_client_key: S.String, secret_server_key: S.String, jwks_url: S.String, schema_name: S.String, table_name: S.String, base_url: S.optional(S.String), }), ).annotate({ identifier: "NeonAuthCreateIntegrationResponse", }) as any as S.Schema; export interface CreateNeonAuthProviderSDKKeysRequest { /** The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; auth_provider: NeonAuthSupportedAuthProvider | (string & {}); } export const CreateNeonAuthProviderSDKKeysRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String, auth_provider: NeonAuthSupportedAuthProvider, }).pipe(T.Http({ method: "POST", uri: "/projects/auth/keys", code: 200 })), ).annotate({ identifier: "CreateNeonAuthProviderSDKKeysRequest", }) as any as S.Schema; /** Organization member's role. `admin`: full administrative access. `editor` (and its legacy alias `member`): standard access governed by project permissions. `viewer` and `collaborator`: additional scoped project roles. Some values may not be available for all organizations. */ export type MemberRole = | "admin" | "member" | "editor" | "viewer" | "collaborator"; export const MemberRole = S.String; export interface OrganizationInviteCreateRequest { /** Email address of the person to invite to the organization. */ email: string; role: MemberRole | (string & {}); } export const OrganizationInviteCreateRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.String, role: MemberRole, }), ).annotate({ identifier: "OrganizationInviteCreateRequest", }) as any as S.Schema; /** Invitations to create for the organization. */ export type CreateOrganizationInvitationsRequestInvitationsList = Array; export const CreateOrganizationInvitationsRequestInvitationsList = /*@__PURE__*/ S.Array( OrganizationInviteCreateRequest, ) as any as S.Schema; export interface CreateOrganizationInvitationsRequest { /** The Neon organization ID */ org_id: string; /** Invitations to create for the organization. */ invitations: CreateOrganizationInvitationsRequestInvitationsList; } export const CreateOrganizationInvitationsRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ org_id: S.String.pipe(T.Label()), invitations: CreateOrganizationInvitationsRequestInvitationsList, }).pipe( T.Http({ method: "POST", uri: "/organizations/{org_id}/invitations", code: 200, }), ), ).annotate({ identifier: "CreateOrganizationInvitationsRequest", }) as any as S.Schema; export interface Invitation { /** The invitation ID. */ id: string; /** Email of the invited user */ email: string; /** Organization id as it is stored in Neon */ org_id: string; /** UUID for the user_id who extended the invitation */ invited_by: string; /** Timestamp when the invitation was created */ invited_at: string; role: MemberRole; } export const Invitation = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, email: S.String, org_id: S.String, invited_by: S.String, invited_at: S.String, role: MemberRole, }), ).annotate({ identifier: "Invitation" }) as any as S.Schema; /** List of pending invitations for the organization. */ export type OrganizationInvitationsResponseInvitationsList = Array; export const OrganizationInvitationsResponseInvitationsList = /*@__PURE__*/ S.Array( Invitation, ) as any as S.Schema; export interface OrganizationInvitationsResponse { /** List of pending invitations for the organization. */ invitations: OrganizationInvitationsResponseInvitationsList; } export const OrganizationInvitationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ invitations: OrganizationInvitationsResponseInvitationsList, }), ).annotate({ identifier: "OrganizationInvitationsResponse", }) as any as S.Schema; export interface CreateOrgApiKeyRequest { /** The Neon organization ID */ org_id: string; /** A user-specified API key name. This value is required when creating an API key. */ key_name: string; /** If set, the API key can access only this project */ project_id?: string; } export const CreateOrgApiKeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), key_name: S.String, project_id: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/organizations/{org_id}/api_keys", code: 200, }), ), ).annotate({ identifier: "CreateOrgApiKeyRequest", }) as any as S.Schema; export interface CreateOrgApiKeyResponse { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The generated 64-bit token required to access the Neon API */ key: string; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; /** ID of the user who created this API key */ created_by: string; /** If set, the API key can access only this project */ project_id?: string; } export const CreateOrgApiKeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, key: S.String, name: S.String, created_at: S.String, created_by: S.String, project_id: S.optional(S.String), }), ).annotate({ identifier: "CreateOrgApiKeyResponse", }) as any as S.Schema; /** Per-project consumption quotas. If a quota is exceeded, all active computes are automatically suspended and cannot be started via API calls or incoming connections. The exception is `logical_size_bytes`, which is enforced per branch. If a branch exceeds its `logical_size_bytes` quota, computes can still be started, but write operations will fail—allowing data to be deleted to free up space. Computes on other branches are not affected. Setting `logical_size_bytes` overrides any lower value set by the `neon.max_cluster_size` Postgres setting. Quotas are enforced using per-project consumption metrics with the same names. These metrics reset at the start of each billing period. `logical_size_bytes` is also an exception—it reflects the total data stored in a branch and does not reset. A zero or empty quota value means “unlimited.” */ export interface ProjectQuota { /** The total amount of wall-clock time allowed to be spent by the project's compute endpoints. */ active_time_seconds?: number; /** The total amount of CPU seconds allowed to be spent by the project's compute endpoints. */ compute_time_seconds?: number; /** Total amount of data written to all of a project's branches. */ written_data_bytes?: number; /** Total amount of data transferred from all of a project's branches using the proxy. */ data_transfer_bytes?: number; /** Limit on the logical size of every project's branch. If a branch exceeds its `logical_size_bytes` quota, computes can still be started, but write operations will fail—allowing data to be deleted to free up space. Computes on other branches are not affected. Setting `logical_size_bytes` overrides any lower value set by the `neon.max_cluster_size` Postgres setting. */ logical_size_bytes?: number; } export const ProjectQuota = /*@__PURE__*/ S.suspend(() => S.Struct({ active_time_seconds: S.optional(S.Number), compute_time_seconds: S.optional(S.Number), written_data_bytes: S.optional(S.Number), data_transfer_bytes: S.optional(S.Number), logical_size_bytes: S.optional(S.Number), }), ).annotate({ identifier: "ProjectQuota" }) as any as S.Schema; /** A list of IP addresses that are allowed to connect to the endpoint. */ export type AllowedIpsIpsList = Array; export const AllowedIpsIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** A list of IP addresses that are allowed to connect to the compute endpoint. If the list is empty or not set, all IP addresses are allowed. If protected_branches_only is true, the list will be applied only to protected branches. */ export interface AllowedIps { /** A list of IP addresses that are allowed to connect to the endpoint. */ ips?: AllowedIpsIpsList; /** If true, the list will be applied only to protected branches. */ protected_branches_only?: boolean; } export const AllowedIps = /*@__PURE__*/ S.suspend(() => S.Struct({ ips: S.optional(AllowedIpsIpsList), protected_branches_only: S.optional(S.Boolean), }), ).annotate({ identifier: "AllowedIps" }) as any as S.Schema; /** A list of weekdays when the maintenance window is active. Encoded as ints, where 1 - Monday, and 7 - Sunday. */ export type MaintenanceWindowWeekdaysList = Array; export const MaintenanceWindowWeekdaysList = /*@__PURE__*/ S.Array( S.Number, ) as any as S.Schema; /** A maintenance window is a time period during which Neon may perform maintenance on the project's infrastructure. During this time, the project's compute endpoints may be unavailable and existing connections can be interrupted. */ export interface MaintenanceWindow { /** A list of weekdays when the maintenance window is active. Encoded as ints, where 1 - Monday, and 7 - Sunday. */ weekdays: MaintenanceWindowWeekdaysList; /** Start time of the maintenance window, in the format of "HH:MM". Uses UTC. */ start_time: string; /** End time of the maintenance window, in the format of "HH:MM". Uses UTC. */ end_time: string; } export const MaintenanceWindow = /*@__PURE__*/ S.suspend(() => S.Struct({ weekdays: MaintenanceWindowWeekdaysList, start_time: S.String, end_time: S.String, }), ).annotate({ identifier: "MaintenanceWindow", }) as any as S.Schema; export type ProjectAuditLogLevel = "base" | "extended" | "full"; export const ProjectAuditLogLevel = S.String; /** Names of shared preload libraries to enable for the project. */ export type PreloadLibrariesEnabledLibrariesList = Array; export const PreloadLibrariesEnabledLibrariesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** The shared libraries to preload into the project's compute instances. */ export interface PreloadLibraries { /** When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`. */ use_defaults?: boolean; /** Names of shared preload libraries to enable for the project. */ enabled_libraries?: PreloadLibrariesEnabledLibrariesList; } export const PreloadLibraries = /*@__PURE__*/ S.suspend(() => S.Struct({ use_defaults: S.optional(S.Boolean), enabled_libraries: S.optional(PreloadLibrariesEnabledLibrariesList), }), ).annotate({ identifier: "PreloadLibraries", }) as any as S.Schema; export interface ProjectSettingsData { quota?: ProjectQuota; allowed_ips?: AllowedIps; /** Sets wal_level=logical for all compute endpoints in this project. All active endpoints will be suspended. Once enabled, logical replication cannot be disabled. */ enable_logical_replication?: boolean; maintenance_window?: MaintenanceWindow; /** When set, connections from the public internet are disallowed. This supersedes the AllowedIPs list. This parameter is under active development and its semantics may change in the future. */ block_public_connections?: boolean; /** When set, connections using VPC endpoints are disallowed. This parameter is under active development and its semantics may change in the future. */ block_vpc_connections?: boolean; /** Audit logging level, set only on HIPAA-enabled organizations (absent otherwise). Values: `base`, `extended`, `full`; HIPAA defaults to `extended`. Cannot be lowered back to `base` once `extended` or `full`. */ audit_log_level?: ProjectAuditLogLevel | (string & {}); /** Enables HIPAA compliance mode for the project, including audit logging. */ hipaa?: boolean; preload_libraries?: PreloadLibraries; } export const ProjectSettingsData = /*@__PURE__*/ S.suspend(() => S.Struct({ quota: S.optional(ProjectQuota), allowed_ips: S.optional(AllowedIps), enable_logical_replication: S.optional(S.Boolean), maintenance_window: S.optional(MaintenanceWindow), block_public_connections: S.optional(S.Boolean), block_vpc_connections: S.optional(S.Boolean), audit_log_level: S.optional(ProjectAuditLogLevel), hipaa: S.optional(S.Boolean), preload_libraries: S.optional(PreloadLibraries), }), ).annotate({ identifier: "ProjectSettingsData", }) as any as S.Schema; /** A free-form map of string key-value pairs for attaching metadata to a resource (for example, a git commit reference). Maximum 50 entries. */ export type AnnotationValueData = { [key: string]: string | undefined }; export const AnnotationValueData = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; /** Configuration for the initial branch created with the project. */ export interface CreateProjectRequestProjectBranch { /** The default branch name. If not specified, the default branch name, `main`, will be used. */ name?: string; /** The role name. If not specified, the default role name, `{database_name}_owner`, will be used. */ role_name?: string; /** The database name. If not specified, the default database name, `neondb`, will be used. */ database_name?: string; /** Arbitrary key-value metadata to attach to the branch. */ annotations?: AnnotationValueData; } export const CreateProjectRequestProjectBranch = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), role_name: S.optional(S.String), database_name: S.optional(S.String), annotations: S.optional(AnnotationValueData), }), ).annotate({ identifier: "CreateProjectRequestProjectBranch", }) as any as S.Schema; /** A raw representation of Postgres settings */ export type PgSettingsData = { [key: string]: string | undefined }; export const PgSettingsData = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; /** Deprecated. A raw representation of PgBouncer settings. Removal scheduled for June 20, 2026. */ export type PgbouncerSettingsData = { [key: string]: string | undefined }; export const PgbouncerSettingsData = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; /** A collection of settings for a Neon endpoint */ export interface DefaultEndpointSettings { pg_settings?: PgSettingsData; /** Deprecated. Use the endpoint-level connection pooler configuration instead. Removal scheduled for June 20, 2026. */ pgbouncer_settings?: PgbouncerSettingsData; /** Minimum number of Compute Units for this endpoint. At least 0.25 and no greater than `autoscaling_limit_max_cu`. */ autoscaling_limit_min_cu?: number; /** Default maximum number of Compute Units for endpoints created under this account. At least 0.25. */ autoscaling_limit_max_cu?: number; /** Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` uses the plan default; `-1` disables scale-to-zero (never suspends). Minimum is plan-dependent (Scale: 60); maximum 604800 (one week). Free cannot change it; Launch can only enable or disable; Scale can set any value. */ suspend_timeout_seconds?: number; } export const DefaultEndpointSettings = /*@__PURE__*/ S.suspend(() => S.Struct({ pg_settings: S.optional(PgSettingsData), pgbouncer_settings: S.optional(PgbouncerSettingsData), autoscaling_limit_min_cu: S.optional(S.Number), autoscaling_limit_max_cu: S.optional(S.Number), suspend_timeout_seconds: S.optional(S.Number), }), ).annotate({ identifier: "DefaultEndpointSettings", }) as any as S.Schema; /** Configuration for the new project, including name, region, and Postgres compute and storage settings. */ export interface CreateProjectRequestProject { /** Project-level settings applied at creation. */ settings?: ProjectSettingsData; /** The project name. If not specified, the name will be identical to the generated project ID */ name?: string; /** Configuration for the initial branch created with the project. */ branch?: CreateProjectRequestProjectBranch; /** Deprecated. Use `default_endpoint_settings.autoscaling_limit_min_cu` instead. The minimum number of Compute Units. The minimum value is `0.25`. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_min_cu?: number; /** Deprecated. Use `default_endpoint_settings.autoscaling_limit_max_cu` instead. The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_max_cu?: number; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner?: string; /** The region identifier. Refer to our [Regions](https://neon.com/docs/introduction/regions) documentation for supported regions. Values are specified in this format: `aws-us-east-1` */ region_id?: string; default_endpoint_settings?: DefaultEndpointSettings; pg_version?: number; /** Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization. */ store_passwords?: boolean; /** History window (point-in-time restore range) for all branches, in seconds. `0` disables it. Default 1 day (Free: 6 hours). Maximum depends on plan: Free 6 hours (21600), Launch 7 days (604800), Scale 30 days (2592000). */ history_retention_seconds?: number; /** ID of the organization that will own the project. If omitted when using an organization API key, it is inferred from the key. */ org_id?: string; } export const CreateProjectRequestProject = /*@__PURE__*/ S.suspend(() => S.Struct({ settings: S.optional(ProjectSettingsData), name: S.optional(S.String), branch: S.optional(CreateProjectRequestProjectBranch), autoscaling_limit_min_cu: S.optional(S.Number), autoscaling_limit_max_cu: S.optional(S.Number), provisioner: S.optional(S.String), region_id: S.optional(S.String), default_endpoint_settings: S.optional(DefaultEndpointSettings), pg_version: S.optional(S.Number), store_passwords: S.optional(S.Boolean), history_retention_seconds: S.optional(S.Number), org_id: S.optional(S.String), }), ).annotate({ identifier: "CreateProjectRequestProject", }) as any as S.Schema; export interface CreateProjectRequest { /** Configuration for the new project, including name, region, and Postgres compute and storage settings. */ project: CreateProjectRequestProject; } export const CreateProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project: CreateProjectRequestProject, }).pipe(T.Http({ method: "POST", uri: "/projects", code: 200 })), ).annotate({ identifier: "CreateProjectRequest", }) as any as S.Schema; /** Type of subscription to Neon Cloud. Notice that for users without billing account this will be "UNKNOWN" */ export type BillingSubscriptionType = | "UNKNOWN" | "direct_sales" | "direct_sales_v3" | "aws_marketplace" | "free_v2" | "free_v3" | "launch" | "launch_v3" | "scale" | "scale_v3" | "business" | "vercel_pg_legacy"; export const BillingSubscriptionType = S.String; export interface ProjectOwnerData { /** Email address of the project owner. */ email: string; /** Display name of the project owner. */ name: string; /** Maximum number of branches the owner is allowed to create across their projects. */ branches_limit: number; subscription_type: BillingSubscriptionType; } export const ProjectOwnerData = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.String, name: S.String, branches_limit: S.Number, subscription_type: BillingSubscriptionType, }), ).annotate({ identifier: "ProjectOwnerData", }) as any as S.Schema; /** The caller's effective permission for a project when per-project permissions are enabled. `VIEWER` grants read access, `EDITOR` adds update access, and `ADMIN` grants full management. Omitted for personal projects, flag-off organizations, and non-user subjects. */ export type ProjectPermissionLevel = "VIEWER" | "EDITOR" | "ADMIN"; export const ProjectPermissionLevel = S.String; export interface Project { /** Bytes-Hour. Project consumed that much Postgres storage hourly during the billing period. The value has some lag. The value is reset at the beginning of each billing period. */ data_storage_bytes_hour: number; /** Bytes. Egress traffic from the Neon cloud to the client for given project over the billing period. Includes deleted endpoints. The value has some lag. The value is reset at the beginning of each billing period. */ data_transfer_bytes: number; /** Bytes. Amount of WAL that travelled through Postgres storage for given project across all branches. The value has some lag. The value is reset at the beginning of each billing period. */ written_data_bytes: number; /** Seconds. The number of CPU seconds used by the project's compute endpoints, including compute endpoints that have been deleted. The value has some lag. The value is reset at the beginning of each billing period. Examples: 1. An endpoint that uses 1 CPU for 1 second is equal to `compute_time=1`. 2. An endpoint that uses 2 CPUs simultaneously for 1 second is equal to `compute_time=2`. */ compute_time_seconds: number; /** Seconds. Control plane observed endpoints of this project being active this amount of wall-clock time. The value has some lag. The value is reset at the beginning of each billing period. */ active_time_seconds: number; /** Deprecated. Use `compute_time_seconds` instead. */ cpu_used_sec: number; /** The Neon project ID. Use as the `project_id` path parameter in other endpoints. */ id: string; /** The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`. */ platform_id: string; /** Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`. */ region_id: string; /** The project name */ name: string; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner: string; default_endpoint_settings?: DefaultEndpointSettings; /** Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`. */ settings?: ProjectSettingsData; pg_version: number; /** The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`). */ proxy_host: string; /** The logical size limit for a branch. The value is in MiB. */ branch_logical_size_limit: number; /** The logical size limit for a branch. The value is in B. */ branch_logical_size_limit_bytes: number; /** Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization. */ store_passwords: boolean; /** A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time. */ maintenance_starts_at?: string; /** The project creation source */ creation_source: string; /** The number of seconds to retain the shared history for all branches in this project. */ history_retention_seconds: number; /** A timestamp indicating when the project was created */ created_at: string; /** A timestamp indicating when the project was last updated */ updated_at: string; /** The current space occupied by the project in Postgres storage, in bytes. Synthetic Postgres storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project. */ synthetic_storage_size?: number; /** A date-time indicating when Neon Cloud started measuring consumption for current consumption period. */ consumption_period_start: string; /** A date-time indicating when Neon Cloud plans to stop measuring consumption for current consumption period. */ consumption_period_end: string; /** Deprecated. Use the `consumption_period_end` field instead. A timestamp indicating when the project quota resets. */ quota_reset_at?: string; /** ID of the organization that owns the project. */ owner_id: string; /** Ownership details for the project, including the owner's name and email. */ owner?: ProjectOwnerData; /** The most recent time when any endpoint of this project was active. Omitted when observed no activity for endpoints of this project. */ compute_last_active_at?: string; /** The Neon organization ID. Returned as `id` from `GET /users/me/organizations`. */ org_id?: string; /** A timestamp indicating when project update begins. If set, computes might experience a brief restart around this time. */ maintenance_scheduled_for?: string; /** A timestamp indicating when HIPAA was enabled for this project */ hipaa_enabled_at?: string; effective_project_permission?: ProjectPermissionLevel | null; } export const Project = /*@__PURE__*/ S.suspend(() => S.Struct({ data_storage_bytes_hour: S.Number, data_transfer_bytes: S.Number, written_data_bytes: S.Number, compute_time_seconds: S.Number, active_time_seconds: S.Number, cpu_used_sec: S.Number, id: S.String, platform_id: S.String, region_id: S.String, name: S.String, provisioner: S.String, default_endpoint_settings: S.optional(DefaultEndpointSettings), settings: S.optional(ProjectSettingsData), pg_version: S.Number, proxy_host: S.String, branch_logical_size_limit: S.Number, branch_logical_size_limit_bytes: S.Number, store_passwords: S.Boolean, maintenance_starts_at: S.optional(S.String), creation_source: S.String, history_retention_seconds: S.Number, created_at: S.String, updated_at: S.String, synthetic_storage_size: S.optional(S.Number), consumption_period_start: S.String, consumption_period_end: S.String, quota_reset_at: S.optional(S.String), owner_id: S.String, owner: S.optional(ProjectOwnerData), compute_last_active_at: S.optional(S.String), org_id: S.optional(S.String), maintenance_scheduled_for: S.optional(S.String), hipaa_enabled_at: S.optional(S.String), effective_project_permission: S.optional(S.NullOr(ProjectPermissionLevel)), }), ).annotate({ identifier: "Project" }) as any as S.Schema; export interface ConnectionParameters { /** Name of the Postgres database used in the connection URI. */ database: string; /** Authentication password for the role, used in the connection URI. */ password: string | Redacted.Redacted; /** Postgres role used to authenticate the database connection. */ role: string; /** Hostname of the compute endpoint. Use `pooler_host` for the pooled connection hostname. */ host: string; /** PgBouncer (transaction mode) pooled host, the `-pooler` variant of `host`. Connect through it to work around the Postgres `max_connections` limit for serverless or connection-per-request workloads. */ pooler_host: string; } export const ConnectionParameters = /*@__PURE__*/ S.suspend(() => S.Struct({ database: S.String, password: S.String.pipe(T.SensitiveValue({})), role: S.String, host: S.String, pooler_host: S.String, }), ).annotate({ identifier: "ConnectionParameters", }) as any as S.Schema; export interface ConnectionDetails { /** The connection URI is defined as specified here: [Connection URIs](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS) The connection URI can be used to connect to a Postgres database with psql or defined in a DATABASE_URL environment variable. When creating a branch from a parent with more than one role or database, the response body does not include a connection URI. */ connection_uri: string | Redacted.Redacted; /** Individual components of the connection URI (host, port, database, role, and password) as discrete fields, for programmatic use rather than parsing the sibling `connection_uri` string. */ connection_parameters: ConnectionParameters; } export const ConnectionDetails = /*@__PURE__*/ S.suspend(() => S.Struct({ connection_uri: S.String.pipe(T.SensitiveValue({})), connection_parameters: ConnectionParameters, }), ).annotate({ identifier: "ConnectionDetails", }) as any as S.Schema; /** Connection URIs for the project. Each entry contains credentials and should be treated as sensitive. */ export type CreateProjectResponseConnectionUrisList = Array; export const CreateProjectResponseConnectionUrisList = /*@__PURE__*/ S.Array( ConnectionDetails, ) as any as S.Schema; export interface Role { /** The ID of the branch this role belongs to. */ branch_id: string; /** Postgres role name within the branch. */ name: string; /** The role password */ password?: string | Redacted.Redacted; /** Whether or not the role is system-protected */ protected?: boolean; /** Authentication method configured for this role: `password`, `oauth`, or `no_login`. */ authentication_method?: string; /** A timestamp indicating when the role was created */ created_at: string; /** A timestamp indicating when the role was last updated */ updated_at: string; } export const Role = /*@__PURE__*/ S.suspend(() => S.Struct({ branch_id: S.String, name: S.String, password: S.optional(S.String.pipe(T.SensitiveValue({}))), protected: S.optional(S.Boolean), authentication_method: S.optional(S.String), created_at: S.String, updated_at: S.String, }), ).annotate({ identifier: "Role" }) as any as S.Schema; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ export type CreateProjectResponseRolesList = Array; export const CreateProjectResponseRolesList = /*@__PURE__*/ S.Array( Role, ) as any as S.Schema; export interface Database { /** The database ID */ id: number; /** The ID of the branch this database belongs to. */ branch_id: string; /** The database name */ name: string; /** The name of role that owns the database */ owner_name: string; /** A timestamp indicating when the database was created */ created_at: string; /** A timestamp indicating when the database was last updated */ updated_at: string; } export const Database = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, branch_id: S.String, name: S.String, owner_name: S.String, created_at: S.String, updated_at: S.String, }), ).annotate({ identifier: "Database" }) as any as S.Schema; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ export type CreateProjectResponseDatabasesList = Array; export const CreateProjectResponseDatabasesList = /*@__PURE__*/ S.Array( Database, ) as any as S.Schema; export type CreateProjectResponseOperationsList = Array; export const CreateProjectResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; /** The resolved user model that contains details of the user/org/integration/api_key used for branch creation. This field is filled only in listing/get/create/get/update/delete methods, if it is empty when calling other handlers, it does not mean that it is empty in the system. */ export interface BranchCreatedBy { /** Display name of the user who created the branch. */ name?: string; /** The URL to the user's avatar image. */ image?: string; } export const BranchCreatedBy = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), image: S.optional(S.String), }), ).annotate({ identifier: "BranchCreatedBy", }) as any as S.Schema; /** An action that is currently restricted for the branch and the reason why. */ export interface BranchRestrictedAction { /** The name of a restricted action on a branch. `restore`: the branch cannot be used as a restore target. `delete-rw-endpoint`: the read-write endpoint for the branch cannot be deleted. */ name: string; /** A human-readable explanation of why the action is restricted. */ reason: string; } export const BranchRestrictedAction = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, reason: S.String, }), ).annotate({ identifier: "BranchRestrictedAction", }) as any as S.Schema; /** A list of actions that are currently restricted for this branch and the reason why. */ export type BranchRestrictedActionsList = Array; export const BranchRestrictedActionsList = /*@__PURE__*/ S.Array( BranchRestrictedAction, ) as any as S.Schema; /** How the branch was deleted: 'user' for manual deletion, 'ttl' for TTL expiration */ export type BranchRecoveryInfoDeletionMethod = "user" | "ttl"; export const BranchRecoveryInfoDeletionMethod = S.String; /** Recovery information for a deleted branch. Only present when listing deleted branches with `include_deleted=true`. This is part of the Branch Recovery feature, which is in preview and not available to all users. */ export interface BranchRecoveryInfo { /** Timestamp when the branch was deleted */ deleted_at: string; /** Timestamp when the recovery window expires and the branch will be permanently deleted */ recoverable_until: string; /** How the branch was deleted: 'user' for manual deletion, 'ttl' for TTL expiration */ deletion_method: BranchRecoveryInfoDeletionMethod; } export const BranchRecoveryInfo = /*@__PURE__*/ S.suspend(() => S.Struct({ deleted_at: S.String, recoverable_until: S.String, deletion_method: BranchRecoveryInfoDeletionMethod, }), ).annotate({ identifier: "BranchRecoveryInfo", }) as any as S.Schema; export interface Branch { /** The branch ID. This value is generated when a branch is created. A `branch_id` value has a `br` prefix. For example: `br-small-term-683261`. */ id: string; /** The ID of the project this branch belongs to. */ project_id: string; /** The `branch_id` of the parent branch */ parent_id?: string; /** The Log Sequence Number (LSN) on the parent branch from which this branch was created. When restoring a branch using the `POST /projects/{project_id}/branches/{branch_id}/restore` endpoint, this value isn’t finalized until all operations related to the restore have completed successfully. */ parent_lsn?: string; /** The point in time on the parent branch from which this branch was created. When restoring a branch using the `POST /projects/{project_id}/branches/{branch_id}/restore` endpoint, this value isn’t finalized until all operations related to the restore have completed successfully. After all the operations completed, this value might stay empty. */ parent_timestamp?: string; /** The branch name */ name: string; current_state: string; pending_state?: string; /** A UTC timestamp indicating when the `current_state` began */ state_changed_at: string; /** The logical size of the branch, in bytes */ logical_size?: number; /** The branch creation source */ creation_source: string; /** Deprecated. Use the `default` field. Whether the branch is the project's primary branch. */ primary?: boolean; /** Whether the branch is the project's default branch */ default: boolean; /** Whether the branch is protected. Protected branches (and their computes) cannot be deleted, archived, or reset, and block deletion of the project. */ protected: boolean; /** Deprecated. Use `compute_time_seconds` instead. CPU seconds used by all of the branch's compute endpoints, including deleted ones. This value is reset at the beginning of each billing period. */ cpu_used_sec: number; /** Total Postgres compute time consumed by this branch during the current billing period, in CU-seconds (weighted by compute size). Divide by 3600 for CU-hours. */ compute_time_seconds: number; /** Total time this branch's compute has been active during the current billing period, in seconds (not weighted by compute size). Distinct from `compute_time_seconds`, which is CU-weighted. */ active_time_seconds: number; /** Data written by this branch during the current billing period, in bytes. */ written_data_bytes: number; /** Total data transferred out of the branch, in bytes. Used as a consumption metric. */ data_transfer_bytes: number; /** A timestamp indicating when the branch was created */ created_at: string; /** A timestamp indicating when the branch was last updated */ updated_at: string; /** The time-to-live (TTL) duration originally configured for the branch, in seconds. This read-only value represents the interval between the time `expires_at` was set and the expiration timestamp itself. It is preserved to ensure the same TTL duration is reapplied when resetting the branch from its parent, and only updates when a new `expires_at` value is set. Access to this feature is currently limited to participants in the Early Access Program. */ ttl_interval_seconds?: number; /** The timestamp when the branch is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time. Access to this feature is currently limited to participants in the Early Access Program. */ expires_at?: string; /** A timestamp indicating when the branch was last reset */ last_reset_at?: string; /** The resolved user model that contains details of the user/org/integration/api_key used for branch creation. This field is filled only in listing/get/create/get/update/delete methods, if it is empty when calling other handlers, it does not mean that it is empty in the system. */ created_by?: BranchCreatedBy; /** Source of initialization for the branch. `parent-data` (default) copies schema and data from the parent. `parent-schema` copies schema only from the parent. `schema-only` creates a root branch with schema only. `import` initializes from an external import. */ init_source?: string; restore_status?: string; /** ID of the snapshot that was the restore source for this branch */ restored_from?: string; /** ID of the target branch which was replaced when this branch was restored */ restored_as?: string; /** A list of actions that are currently restricted for this branch and the reason why. */ restricted_actions?: BranchRestrictedActionsList; recovery?: BranchRecoveryInfo; } export const Branch = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, project_id: S.String, parent_id: S.optional(S.String), parent_lsn: S.optional(S.String), parent_timestamp: S.optional(S.String), name: S.String, current_state: S.String, pending_state: S.optional(S.String), state_changed_at: S.String, logical_size: S.optional(S.Number), creation_source: S.String, primary: S.optional(S.Boolean), default: S.Boolean, protected: S.Boolean, cpu_used_sec: S.Number, compute_time_seconds: S.Number, active_time_seconds: S.Number, written_data_bytes: S.Number, data_transfer_bytes: S.Number, created_at: S.String, updated_at: S.String, ttl_interval_seconds: S.optional(S.Number), expires_at: S.optional(S.String), last_reset_at: S.optional(S.String), created_by: S.optional(BranchCreatedBy), init_source: S.optional(S.String), restore_status: S.optional(S.String), restored_from: S.optional(S.String), restored_as: S.optional(S.String), restricted_actions: S.optional(BranchRestrictedActionsList), recovery: S.optional(BranchRecoveryInfo), }), ).annotate({ identifier: "Branch" }) as any as S.Schema; /** Compute endpoint type. `read_write`: the primary read-write endpoint (one per branch). `read_only`: a read replica endpoint (multiple allowed per branch). */ export type EndpointType = "read_only" | "read_write"; export const EndpointType = S.String; /** Lifecycle state of the compute endpoint. `init`: being initialized. `active`: running and accepting connections. `idle`: suspended (scaled to zero). */ export type EndpointState = "init" | "active" | "idle"; export const EndpointState = S.String; /** A collection of settings for a compute endpoint */ export interface EndpointSettingsData { pg_settings?: PgSettingsData; /** Deprecated. PgBouncer settings for the compute endpoint. Removal scheduled for June 20, 2026. */ pgbouncer_settings?: PgbouncerSettingsData; preload_libraries?: PreloadLibraries; } export const EndpointSettingsData = /*@__PURE__*/ S.suspend(() => S.Struct({ pg_settings: S.optional(PgSettingsData), pgbouncer_settings: S.optional(PgbouncerSettingsData), preload_libraries: S.optional(PreloadLibraries), }), ).annotate({ identifier: "EndpointSettingsData", }) as any as S.Schema; /** Deprecated. The connection pooler mode. Neon supports PgBouncer in `transaction` mode only. Removal scheduled for June 20, 2026. */ export type EndpointPoolerMode = "transaction"; export const EndpointPoolerMode = S.String; export interface Endpoint { /** The hostname of the compute endpoint. This is the hostname specified when connecting to a Neon database. */ host: string; /** The compute endpoint ID. Compute endpoint IDs have an `ep-` prefix. For example: `ep-little-smoke-851426` */ id: string; /** Optional name of the compute endpoint */ name?: string; /** The ID of the project this compute endpoint belongs to. */ project_id: string; /** The ID of the branch this compute endpoint belongs to. */ branch_id: string; /** The minimum number of Compute Units */ autoscaling_limit_min_cu: number; /** The maximum number of Compute Units */ autoscaling_limit_max_cu: number; /** Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`. */ region_id: string; type: EndpointType; current_state: EndpointState; /** Target state the compute endpoint is transitioning to. Omitted when no transition is in progress. */ pending_state?: EndpointState; settings: EndpointSettingsData; /** Deprecated. To use connection pooling, append `-pooler` to the endpoint ID in the connection string. */ pooler_enabled: boolean; /** Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026. */ pooler_mode: EndpointPoolerMode; /** Whether to restrict connections to the compute endpoint. Enabling this option schedules a suspend compute operation. A disabled compute endpoint cannot be enabled by a connection or console action. */ disabled: boolean; /** Whether to permit passwordless access to the compute endpoint */ passwordless_access: boolean; /** A timestamp indicating when the compute endpoint was last active */ last_active?: string; /** The compute endpoint creation source */ creation_source: string; /** A timestamp indicating when the compute endpoint was created */ created_at: string; /** A timestamp indicating when the compute endpoint was last updated */ updated_at: string; /** A timestamp indicating when the compute endpoint was last started */ started_at?: string; /** A timestamp indicating when the compute endpoint was last suspended */ suspended_at?: string; /** Deprecated. Use the `host` property instead. */ proxy_host: string; /** Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` means the plan default applies; `-1` means scale-to-zero is disabled (never suspends). */ suspend_timeout_seconds: number; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner: string; /** Attached compute's release version number. */ compute_release_version?: string; } export const Endpoint = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.String, id: S.String, name: S.optional(S.String), project_id: S.String, branch_id: S.String, autoscaling_limit_min_cu: S.Number, autoscaling_limit_max_cu: S.Number, region_id: S.String, type: EndpointType, current_state: EndpointState, pending_state: S.optional(EndpointState), settings: EndpointSettingsData, pooler_enabled: S.Boolean, pooler_mode: EndpointPoolerMode, disabled: S.Boolean, passwordless_access: S.Boolean, last_active: S.optional(S.String), creation_source: S.String, created_at: S.String, updated_at: S.String, started_at: S.optional(S.String), suspended_at: S.optional(S.String), proxy_host: S.String, suspend_timeout_seconds: S.Number, provisioner: S.String, compute_release_version: S.optional(S.String), }), ).annotate({ identifier: "Endpoint" }) as any as S.Schema; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ export type CreateProjectResponseEndpointsList = Array; export const CreateProjectResponseEndpointsList = /*@__PURE__*/ S.Array( Endpoint, ) as any as S.Schema; export interface CreateProjectResponse { /** Full details of the project, including configuration, consumption metrics, and ownership. */ project: Project; /** Connection URIs for the project. Each entry contains credentials and should be treated as sensitive. */ connection_uris: CreateProjectResponseConnectionUrisList; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ roles: CreateProjectResponseRolesList; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ databases: CreateProjectResponseDatabasesList; operations: CreateProjectResponseOperationsList; /** Branch returned by the request. */ branch: Branch; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ endpoints: CreateProjectResponseEndpointsList; } export const CreateProjectResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project: Project, connection_uris: CreateProjectResponseConnectionUrisList, roles: CreateProjectResponseRolesList, databases: CreateProjectResponseDatabasesList, operations: CreateProjectResponseOperationsList, branch: Branch, endpoints: CreateProjectResponseEndpointsList, }), ).annotate({ identifier: "CreateProjectResponse", }) as any as S.Schema; export interface BranchCreateRequestEndpointOptions { type: EndpointType | (string & {}); /** Compute endpoint settings: `pg_settings` (Postgres parameter overrides such as `work_mem`, `max_connections`) and `preload_libraries`. */ settings?: EndpointSettingsData; /** Minimum number of Compute Units the endpoint can scale down to. Minimum 0.25. */ autoscaling_limit_min_cu?: number; /** Maximum number of Compute Units the endpoint can scale up to. Minimum 0.25. */ autoscaling_limit_max_cu?: number; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner?: string; /** Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` uses the plan default; `-1` disables scale-to-zero (never suspends). Minimum is plan-dependent (Scale: 60); maximum 604800 (one week). Free cannot change it; Launch can only enable or disable; Scale can set any value. */ suspend_timeout_seconds?: number; } export const BranchCreateRequestEndpointOptions = /*@__PURE__*/ S.suspend(() => S.Struct({ type: EndpointType, settings: S.optional(EndpointSettingsData), autoscaling_limit_min_cu: S.optional(S.Number), autoscaling_limit_max_cu: S.optional(S.Number), provisioner: S.optional(S.String), suspend_timeout_seconds: S.optional(S.Number), }), ).annotate({ identifier: "BranchCreateRequestEndpointOptions", }) as any as S.Schema; /** Compute endpoints to create together with the branch. If omitted, the branch is created without any compute endpoint. Endpoints can be added to the branch separately after creation. */ export type CreateProjectBranchRequestEndpointsList = Array; export const CreateProjectBranchRequestEndpointsList = /*@__PURE__*/ S.Array( BranchCreateRequestEndpointOptions, ) as any as S.Schema; /** Optional configuration for the new branch, for example `name`, `parent_id` (fork from a branch), `parent_lsn` or `parent_timestamp` (point-in-time branching), and `protected`. */ export interface CreateProjectBranchRequestBranch { /** The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's default branch. */ parent_id?: string; /** The branch name */ name?: string; /** A Log Sequence Number (LSN) on the parent branch. The branch will be created with data from this LSN. */ parent_lsn?: string; /** A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time. RFC 3339 format. */ parent_timestamp?: string; /** Whether the branch is protected. Protected branches (and their computes) cannot be deleted, archived, or reset, and block deletion of the project. Can be gated by `protected_branches_only` in the IP allowlist. Paid plans only. */ protected?: boolean; /** Whether to create the branch in the archived state. When omitted, the branch is created as a normal (non-archived) branch. */ archived?: boolean; /** Source of initialization for the branch. `parent-data` copies schema and data from the parent branch. `parent-schema` copies schema only from the parent branch. `schema-only` creates a new root branch containing schema only, using `parent_id` as the source; optionally, `parent_lsn` or `parent_timestamp` can narrow the source point. `import` initializes the branch from an external import. */ init_source?: string; /** The timestamp when the branch is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time. Access to this feature is currently limited to participants in the Early Access Program. */ expires_at?: string; } export const CreateProjectBranchRequestBranch = /*@__PURE__*/ S.suspend(() => S.Struct({ parent_id: S.optional(S.String), name: S.optional(S.String), parent_lsn: S.optional(S.String), parent_timestamp: S.optional(S.String), protected: S.optional(S.Boolean), archived: S.optional(S.Boolean), init_source: S.optional(S.String), expires_at: S.optional(S.String), }), ).annotate({ identifier: "CreateProjectBranchRequestBranch", }) as any as S.Schema; export interface CreateProjectBranchRequest { /** The Neon project ID */ project_id: string; /** Compute endpoints to create together with the branch. If omitted, the branch is created without any compute endpoint. Endpoints can be added to the branch separately after creation. */ endpoints?: CreateProjectBranchRequestEndpointsList; /** Optional configuration for the new branch, for example `name`, `parent_id` (fork from a branch), `parent_lsn` or `parent_timestamp` (point-in-time branching), and `protected`. */ branch?: CreateProjectBranchRequestBranch; annotation_value?: AnnotationValueData; } export const CreateProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoints: S.optional(CreateProjectBranchRequestEndpointsList), branch: S.optional(CreateProjectBranchRequestBranch), annotation_value: S.optional(AnnotationValueData), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchRequest", }) as any as S.Schema; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ export type CreateProjectBranchResponseEndpointsList = Array; export const CreateProjectBranchResponseEndpointsList = /*@__PURE__*/ S.Array( Endpoint, ) as any as S.Schema; export type CreateProjectBranchResponseOperationsList = Array; export const CreateProjectBranchResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ export type CreateProjectBranchResponseRolesList = Array; export const CreateProjectBranchResponseRolesList = /*@__PURE__*/ S.Array( Role, ) as any as S.Schema; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ export type CreateProjectBranchResponseDatabasesList = Array; export const CreateProjectBranchResponseDatabasesList = /*@__PURE__*/ S.Array( Database, ) as any as S.Schema; /** Connection URIs for the compute endpoint, including credentials. */ export type CreateProjectBranchResponseConnectionUrisList = Array; export const CreateProjectBranchResponseConnectionUrisList = /*@__PURE__*/ S.Array( ConnectionDetails, ) as any as S.Schema; export interface CreateProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ endpoints: CreateProjectBranchResponseEndpointsList; operations: CreateProjectBranchResponseOperationsList; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ roles: CreateProjectBranchResponseRolesList; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ databases: CreateProjectBranchResponseDatabasesList; /** Connection URIs for the compute endpoint, including credentials. */ connection_uris?: CreateProjectBranchResponseConnectionUrisList; } export const CreateProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, endpoints: CreateProjectBranchResponseEndpointsList, operations: CreateProjectBranchResponseOperationsList, roles: CreateProjectBranchResponseRolesList, databases: CreateProjectBranchResponseDatabasesList, connection_uris: S.optional(CreateProjectBranchResponseConnectionUrisList), }), ).annotate({ identifier: "CreateProjectBranchResponse", }) as any as S.Schema; /** Compute endpoints to create together with the branch. If omitted, the branch is created without any compute endpoint. Endpoints can be added to the branch separately after creation. */ export type BranchCreateRequestEndpointsList = Array; export const BranchCreateRequestEndpointsList = /*@__PURE__*/ S.Array( BranchCreateRequestEndpointOptions, ) as any as S.Schema; /** Optional configuration for the new branch, for example `name`, `parent_id` (fork from a branch), `parent_lsn` or `parent_timestamp` (point-in-time branching), and `protected`. */ export type BranchCreateRequestBranch = CreateProjectBranchRequestBranch; export const BranchCreateRequestBranch = CreateProjectBranchRequestBranch; export interface BranchCreateRequest { /** Compute endpoints to create together with the branch. If omitted, the branch is created without any compute endpoint. Endpoints can be added to the branch separately after creation. */ endpoints?: BranchCreateRequestEndpointsList; /** Optional configuration for the new branch, for example `name`, `parent_id` (fork from a branch), `parent_lsn` or `parent_timestamp` (point-in-time branching), and `protected`. */ branch?: CreateProjectBranchRequestBranch; } export const BranchCreateRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoints: S.optional(BranchCreateRequestEndpointsList), branch: S.optional(CreateProjectBranchRequestBranch), }), ).annotate({ identifier: "BranchCreateRequest", }) as any as S.Schema; export interface MaskingRule { /** The name of the database containing the table to be masked */ database_name: string; /** The name of the schema containing the table to be masked */ schema_name: string; /** The name of the table containing the column to be masked */ table_name: string; /** The name of the column to be masked */ column_name: string; /** The PostgreSQL Anonymizer masking function to apply. Can be a predefined function (e.g., 'anon.random_string(10)', 'anon.fake_email()') or a custom function definition (e.g., 'anon.hash(column_name)') */ masking_function?: string; /** A literal value to set on the column when masking. */ masking_value?: string; } export const MaskingRule = /*@__PURE__*/ S.suspend(() => S.Struct({ database_name: S.String, schema_name: S.String, table_name: S.String, column_name: S.String, masking_function: S.optional(S.String), masking_value: S.optional(S.String), }), ).annotate({ identifier: "MaskingRule" }) as any as S.Schema; /** List of masking rules to apply to the branch. */ export type CreateProjectBranchAnonymizedRequestMaskingRulesList = Array; export const CreateProjectBranchAnonymizedRequestMaskingRulesList = /*@__PURE__*/ S.Array( MaskingRule, ) as any as S.Schema; export interface CreateProjectBranchAnonymizedRequest { /** The Neon project ID */ project_id: string; annotation_value?: AnnotationValueData; branch_create?: BranchCreateRequest; /** List of masking rules to apply to the branch. */ masking_rules?: CreateProjectBranchAnonymizedRequestMaskingRulesList; /** If true, automatically start anonymization after the branch is created. Defaults to false. */ start_anonymization?: boolean; } export const CreateProjectBranchAnonymizedRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), annotation_value: S.optional(AnnotationValueData), branch_create: S.optional(BranchCreateRequest), masking_rules: S.optional( CreateProjectBranchAnonymizedRequestMaskingRulesList, ), start_anonymization: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branch_anonymized", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchAnonymizedRequest", }) as any as S.Schema; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ export type CreateProjectBranchAnonymizedResponseEndpointsList = Array; export const CreateProjectBranchAnonymizedResponseEndpointsList = /*@__PURE__*/ S.Array( Endpoint, ) as any as S.Schema; export type CreateProjectBranchAnonymizedResponseOperationsList = Array; export const CreateProjectBranchAnonymizedResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ export type CreateProjectBranchAnonymizedResponseRolesList = Array; export const CreateProjectBranchAnonymizedResponseRolesList = /*@__PURE__*/ S.Array( Role, ) as any as S.Schema; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ export type CreateProjectBranchAnonymizedResponseDatabasesList = Array; export const CreateProjectBranchAnonymizedResponseDatabasesList = /*@__PURE__*/ S.Array( Database, ) as any as S.Schema; /** Connection URIs for the compute endpoint, including credentials. */ export type CreateProjectBranchAnonymizedResponseConnectionUrisList = Array; export const CreateProjectBranchAnonymizedResponseConnectionUrisList = /*@__PURE__*/ S.Array( ConnectionDetails, ) as any as S.Schema; export interface CreateProjectBranchAnonymizedResponse { /** Branch returned by the request. */ branch: Branch; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ endpoints: CreateProjectBranchAnonymizedResponseEndpointsList; operations: CreateProjectBranchAnonymizedResponseOperationsList; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ roles: CreateProjectBranchAnonymizedResponseRolesList; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ databases: CreateProjectBranchAnonymizedResponseDatabasesList; /** Connection URIs for the compute endpoint, including credentials. */ connection_uris?: CreateProjectBranchAnonymizedResponseConnectionUrisList; } export const CreateProjectBranchAnonymizedResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ branch: Branch, endpoints: CreateProjectBranchAnonymizedResponseEndpointsList, operations: CreateProjectBranchAnonymizedResponseOperationsList, roles: CreateProjectBranchAnonymizedResponseRolesList, databases: CreateProjectBranchAnonymizedResponseDatabasesList, connection_uris: S.optional( CreateProjectBranchAnonymizedResponseConnectionUrisList, ), }), ).annotate({ identifier: "CreateProjectBranchAnonymizedResponse", }) as any as S.Schema; /** Access level for the bucket. Defaults to `private`. Set to `public_read` to allow anonymous `GetObject`/`HeadObject` on objects in this bucket. */ export type CreateProjectBranchBucketRequestAccessLevel = | "private" | "public_read"; export const CreateProjectBranchBucketRequestAccessLevel = S.String; export interface CreateProjectBranchBucketRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name. */ name: string; /** Access level for the bucket. Defaults to `private`. Set to `public_read` to allow anonymous `GetObject`/`HeadObject` on objects in this bucket. */ access_level?: CreateProjectBranchBucketRequestAccessLevel | (string & {}); } export const CreateProjectBranchBucketRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), name: S.String, access_level: S.optional(CreateProjectBranchBucketRequestAccessLevel), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/buckets", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchBucketRequest", }) as any as S.Schema; /** Controls anonymous access to objects in the bucket. - `private`: all reads and writes require authenticated requests (default). - `public_read`: anonymous `GetObject`/`HeadObject` requests succeed; listing, writes, and deletes still require authenticated requests. */ export type BucketAccessLevel = "private" | "public_read"; export const BucketAccessLevel = S.String; export interface Bucket { /** The bucket name (unique within a branch). */ name: string; access_level: BucketAccessLevel; /** When the bucket was created. For a bucket inherited from an ancestor branch this is the ancestor's creation time (the branch fork never re-creates the bucket). */ created_at: string; } export const Bucket = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, access_level: BucketAccessLevel, created_at: S.String, }), ).annotate({ identifier: "Bucket" }) as any as S.Schema; export interface BucketResponse { bucket: Bucket; } export const BucketResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ bucket: Bucket, }), ).annotate({ identifier: "BucketResponse" }) as any as S.Schema; /** Authentication provider for the Neon Data API. `neon_auth`: use Neon's built-in managed authentication (no JWKS configuration required). `external`: use an external JWT provider, which requires `jwks_url`. When omitted, no auth provider is configured (existing setup is kept). */ export type CreateProjectBranchDataAPIRequestAuthProvider = | "neon_auth" | "external"; export const CreateProjectBranchDataAPIRequestAuthProvider = S.String; /** List of schemas to expose via the API. Default: ["public"] */ export type DataAPISettingsDbSchemasList = Array; export const DataAPISettingsDbSchemasList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Configuration settings for the Neon Data API */ export interface DataAPISettings { /** Enable aggregates feature */ db_aggregates_enabled?: boolean; /** Database role to use for anonymous requests */ db_anon_role?: string; /** Extra schemas to add to the search path */ db_extra_search_path?: string; /** Hard limit on the number of rows returned in a single Data API response. No limit when unset. */ db_max_rows?: number; /** List of schemas to expose via the API. Default: ["public"] */ db_schemas?: DataAPISettingsDbSchemasList; /** JWT claim key to use for role extraction */ jwt_role_claim_key?: string; /** Maximum lifetime of the Data API's JWT cache, in seconds. */ jwt_cache_max_lifetime?: number; /** OpenAPI specification mode (ignore-privileges, disabled) */ openapi_mode?: string; /** CORS allowed origins */ server_cors_allowed_origins?: string; /** When enabled, the Data API adds `Server-Timing` headers to each response showing database execution and internal processing time. Default: disabled. */ server_timing_enabled?: boolean; } export const DataAPISettings = /*@__PURE__*/ S.suspend(() => S.Struct({ db_aggregates_enabled: S.optional(S.Boolean), db_anon_role: S.optional(S.String), db_extra_search_path: S.optional(S.String), db_max_rows: S.optional(S.Number), db_schemas: S.optional(DataAPISettingsDbSchemasList), jwt_role_claim_key: S.optional(S.String), jwt_cache_max_lifetime: S.optional(S.Number), openapi_mode: S.optional(S.String), server_cors_allowed_origins: S.optional(S.String), server_timing_enabled: S.optional(S.Boolean), }), ).annotate({ identifier: "DataAPISettings", }) as any as S.Schema; export interface CreateProjectBranchDataAPIRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The database name */ database_name: string; /** Authentication provider for the Neon Data API. `neon_auth`: use Neon's built-in managed authentication (no JWKS configuration required). `external`: use an external JWT provider, which requires `jwks_url`. When omitted, no auth provider is configured (existing setup is kept). */ auth_provider?: CreateProjectBranchDataAPIRequestAuthProvider | (string & {}); /** URL of the JWKS endpoint used to verify JWTs for this Data API. Required when configuring JWT-based authentication; omit when using a non-JWT auth provider. */ jwks_url?: string; /** Display name for the authentication provider. Accepted values include "Clerk", "Stytch", and "Auth0", but any non-empty string is valid. Optional field. */ provider_name?: string; /** Expected `aud` claim in incoming JWTs. When set, tokens with a different audience are rejected; tokens with no audience are still accepted. Omit to skip audience validation. */ jwt_audience?: string; /** Grant all permissions to the tables in the public schema to authenticated users */ add_default_grants?: boolean; /** Skip creating the auth schema and RLS functions */ skip_auth_schema?: boolean; /** Auth and schema configuration for the Data API. */ settings?: DataAPISettings; } export const CreateProjectBranchDataAPIRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), auth_provider: S.optional(CreateProjectBranchDataAPIRequestAuthProvider), jwks_url: S.optional(S.String), provider_name: S.optional(S.String), jwt_audience: S.optional(S.String), add_default_grants: S.optional(S.Boolean), skip_auth_schema: S.optional(S.Boolean), settings: S.optional(DataAPISettings), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchDataAPIRequest", }) as any as S.Schema; /** Neon Data API created successfully */ export interface DataAPICreateResponse { /** URL of the created Data API endpoint. */ url: string; } export const DataAPICreateResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ url: S.String, }), ).annotate({ identifier: "DataAPICreateResponse", }) as any as S.Schema; /** Configuration for the new Postgres database. */ export interface CreateProjectBranchDatabaseRequestDatabase { /** Name of the database to create. */ name: string; /** The name of the role that owns the database */ owner_name: string; } export const CreateProjectBranchDatabaseRequestDatabase = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, owner_name: S.String, }), ).annotate({ identifier: "CreateProjectBranchDatabaseRequestDatabase", }) as any as S.Schema; export interface CreateProjectBranchDatabaseRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** Configuration for the new Postgres database. */ database: CreateProjectBranchDatabaseRequestDatabase; } export const CreateProjectBranchDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database: CreateProjectBranchDatabaseRequestDatabase, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/databases", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchDatabaseRequest", }) as any as S.Schema; export type CreateProjectBranchDatabaseResponseOperationsList = Array; export const CreateProjectBranchDatabaseResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface CreateProjectBranchDatabaseResponse { /** Database object returned by the operation. */ database: Database; operations: CreateProjectBranchDatabaseResponseOperationsList; } export const CreateProjectBranchDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ database: Database, operations: CreateProjectBranchDatabaseResponseOperationsList, }), ).annotate({ identifier: "CreateProjectBranchDatabaseResponse", }) as any as S.Schema; export type CreateProjectBranchFunctionDeploymentRequestRuntime = "nodejs24"; export const CreateProjectBranchFunctionDeploymentRequestRuntime = S.String; export interface CreateProjectBranchFunctionDeploymentRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The function slug */ slug: string; /** Optional ZIP archive of the function source code. Omit to reuse the latest version's bundle (a config-only change). Required for the first deployment of a function. */ zip?: string; runtime?: CreateProjectBranchFunctionDeploymentRequestRuntime | (string & {}); /** Optional JSON object (a string-to-string map) of environment variables for the deployment, e.g. {"KEY":"VALUE"}. Carried as a JSON-encoded string because multipart form data does not support typed object parts. Values are write-only: they are encrypted at rest, and responses carry only the variable names (the `environment` array), never the values. */ environment?: string; } export const CreateProjectBranchFunctionDeploymentRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), slug: S.String.pipe(T.Label()), zip: S.optional(S.String), runtime: S.optional(CreateProjectBranchFunctionDeploymentRequestRuntime), environment: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments", code: 200, contentType: "multipart", }), ), ).annotate({ identifier: "CreateProjectBranchFunctionDeploymentRequest", }) as any as S.Schema; /** Build lifecycle status of the deployment. */ export type NeonFunctionDeploymentStatus = | "pending" | "building" | "completed" | "failed"; export const NeonFunctionDeploymentStatus = S.String; /** The NAMES of the deployment's environment variables, sorted. Values are encrypted at rest and are never returned — they are write-only. To change a value, deploy the variable with the new value; to remove a variable, deploy it with an empty value. */ export type NeonFunctionDeploymentEnvironmentList = Array; export const NeonFunctionDeploymentEnvironmentList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface NeonFunctionDeployment { /** The deployment id, which is the platform version number (monotonic per function). */ id: number; /** Build lifecycle status of the deployment. */ status: NeonFunctionDeploymentStatus; memory_mib: number; runtime: string; created_at: string; /** The NAMES of the deployment's environment variables, sorted. Values are encrypted at rest and are never returned — they are write-only. To change a value, deploy the variable with the new value; to remove a variable, deploy it with an empty value. */ environment?: NeonFunctionDeploymentEnvironmentList; /** Human-readable reason the deployment build failed. Present only when `status` is `failed`. */ error?: string; } export const NeonFunctionDeployment = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, status: NeonFunctionDeploymentStatus, memory_mib: S.Number, runtime: S.String, created_at: S.String, environment: S.optional(NeonFunctionDeploymentEnvironmentList), error: S.optional(S.String), }), ).annotate({ identifier: "NeonFunctionDeployment", }) as any as S.Schema; export interface NeonFunctionDeploymentResponse { deployment: NeonFunctionDeployment; } export const NeonFunctionDeploymentResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ deployment: NeonFunctionDeployment, }), ).annotate({ identifier: "NeonFunctionDeploymentResponse", }) as any as S.Schema; /** Properties of the role to create. */ export interface CreateProjectBranchRoleRequestRole { /** The role name. Cannot exceed 63 bytes in length. */ name: string; /** Whether to create a role that cannot login. */ no_login?: boolean; } export const CreateProjectBranchRoleRequestRole = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, no_login: S.optional(S.Boolean), }), ).annotate({ identifier: "CreateProjectBranchRoleRequestRole", }) as any as S.Schema; export interface CreateProjectBranchRoleRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** Properties of the role to create. */ role: CreateProjectBranchRoleRequestRole; } export const CreateProjectBranchRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), role: CreateProjectBranchRoleRequestRole, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/roles", code: 200, }), ), ).annotate({ identifier: "CreateProjectBranchRoleRequest", }) as any as S.Schema; export type CreateProjectBranchRoleResponseOperationsList = Array; export const CreateProjectBranchRoleResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface CreateProjectBranchRoleResponse { /** Role details for the requested database role. The `password` field is included in the response when a role is created or its password is reset, and is not returned in subsequent read requests. Store it securely at that time. */ role: Role; operations: CreateProjectBranchRoleResponseOperationsList; } export const CreateProjectBranchRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ role: Role, operations: CreateProjectBranchRoleResponseOperationsList, }), ).annotate({ identifier: "CreateProjectBranchRoleResponse", }) as any as S.Schema; /** Configuration for the compute endpoint to create. */ export interface CreateProjectEndpointRequestEndpoint { /** The ID of the branch the compute endpoint will be associated with */ branch_id: string; /** The region where the compute endpoint will be created. Only the project's `region_id` is permitted. */ region_id?: string; type: EndpointType | (string & {}); settings?: EndpointSettingsData; /** The minimum number of Compute Units. The minimum value is `0.25`. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_min_cu?: number; /** The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_max_cu?: number; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner?: string; /** Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string. See [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling) */ pooler_enabled?: boolean; /** Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026. */ pooler_mode?: EndpointPoolerMode | (string & {}); /** Whether to restrict connections to the compute endpoint. Enabling this option schedules a suspend compute operation. A disabled compute endpoint cannot be enabled by a connection or console action. However, the compute endpoint is periodically enabled by check_availability operations. */ disabled?: boolean; /** NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint. */ passwordless_access?: boolean; /** Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` uses the plan default; `-1` disables scale-to-zero (never suspends). Minimum is plan-dependent (Scale: 60); maximum 604800 (one week). Free cannot change it; Launch can only enable or disable; Scale can set any value. */ suspend_timeout_seconds?: number; /** Optional name of the compute endpoint */ name?: string; } export const CreateProjectEndpointRequestEndpoint = /*@__PURE__*/ S.suspend( () => S.Struct({ branch_id: S.String, region_id: S.optional(S.String), type: EndpointType, settings: S.optional(EndpointSettingsData), autoscaling_limit_min_cu: S.optional(S.Number), autoscaling_limit_max_cu: S.optional(S.Number), provisioner: S.optional(S.String), pooler_enabled: S.optional(S.Boolean), pooler_mode: S.optional(EndpointPoolerMode), disabled: S.optional(S.Boolean), passwordless_access: S.optional(S.Boolean), suspend_timeout_seconds: S.optional(S.Number), name: S.optional(S.String), }), ).annotate({ identifier: "CreateProjectEndpointRequestEndpoint", }) as any as S.Schema; export interface CreateProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** Configuration for the compute endpoint to create. */ endpoint: CreateProjectEndpointRequestEndpoint; } export const CreateProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint: CreateProjectEndpointRequestEndpoint, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/endpoints", code: 200, }), ), ).annotate({ identifier: "CreateProjectEndpointRequest", }) as any as S.Schema; export type CreateProjectEndpointResponseOperationsList = Array; export const CreateProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface CreateProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: CreateProjectEndpointResponseOperationsList; } export const CreateProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: CreateProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "CreateProjectEndpointResponse", }) as any as S.Schema; export interface CreateProjectTransferRequestRequest { /** The Neon project ID */ project_id: string; /** Number of seconds the transfer request stays valid before it expires. Defaults to 86400 (24 hours). */ ttl_seconds?: number; } export const CreateProjectTransferRequestRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), ttl_seconds: S.optional(S.Number), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/transfer_requests", code: 200, }), ), ).annotate({ identifier: "CreateProjectTransferRequestRequest", }) as any as S.Schema; export interface ProjectTransferRequestResponse { /** The unique identifier for the transfer request */ id: string; /** The ID of the project that is being transferred */ project_id: string; /** The timestamp when the transfer request was created */ created_at: string; /** The timestamp when the transfer request will expire */ expires_at: string; } export const ProjectTransferRequestResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, project_id: S.String, created_at: S.String, expires_at: S.String, }), ).annotate({ identifier: "ProjectTransferRequestResponse", }) as any as S.Schema; export interface CreateSnapshotRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The target Log Sequence Number (LSN) to take the snapshot from. Must fall within the restore window. Cannot be used with `timestamp` */ lsn?: string; /** The target timestamp for the snapshot. Must fall within the restore window. RFC 3339 format. Cannot be used with `lsn`. */ timestamp?: string; /** A name for the snapshot. */ name?: string; /** The time at which the snapshot will be automatically deleted. RFC 3339 format. */ expires_at?: string; } export const CreateSnapshotRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), lsn: S.optional(S.String.pipe(T.Query())), timestamp: S.optional(S.String.pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), expires_at: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/snapshot", code: 200, }), ), ).annotate({ identifier: "CreateSnapshotRequest", }) as any as S.Schema; export interface Snapshot { /** The snapshot ID. */ id: string; /** Human-readable label for the snapshot. */ name: string; /** WAL position (Log Sequence Number) at which the snapshot was captured, in Postgres LSN format (for example, `0/3000000`). */ lsn?: string; /** Point in time captured by the snapshot, in RFC 3339 format (UTC). */ timestamp?: string; /** Branch from which this snapshot was created. */ source_branch_id?: string; /** Timestamp when the snapshot was created, in RFC 3339 format (UTC). */ created_at: string; /** RFC 3339 timestamp when the snapshot expires and is eligible for deletion. Null if the snapshot does not have an expiry. */ expires_at?: string; /** True if the snapshot was created manually rather than by a schedule. */ manual?: boolean; /** Full logical size of the snapshot in bytes at the time it was taken. When absent, the logical size has not been calculated yet and the snapshot is not being charged. When present, a value of 0 means the snapshot is not being charged. */ full_size?: number; /** Incremental Postgres storage size in bytes since the previous scheduled snapshot, when the snapshot is billed on incremental (diff) usage. When absent, either the incremental size has not been calculated yet and the snapshot is not being charged, or the snapshot is charged at full logical size (in that case `full_size` is set). */ diff_size?: number; } export const Snapshot = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, lsn: S.optional(S.String), timestamp: S.optional(S.String), source_branch_id: S.optional(S.String), created_at: S.String, expires_at: S.optional(S.String), manual: S.optional(S.Boolean), full_size: S.optional(S.Number), diff_size: S.optional(S.Number), }), ).annotate({ identifier: "Snapshot" }) as any as S.Schema; export type CreateSnapshotResponseOperationsList = Array; export const CreateSnapshotResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface CreateSnapshotResponse { snapshot: Snapshot; operations: CreateSnapshotResponseOperationsList; } export const CreateSnapshotResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ snapshot: Snapshot, operations: CreateSnapshotResponseOperationsList, }), ).annotate({ identifier: "CreateSnapshotResponse", }) as any as S.Schema; export type DeleteBranchNeonAuthOauthProviderRequestOauthProviderId = | "google" | "github" | "microsoft" | "vercel"; export const DeleteBranchNeonAuthOauthProviderRequestOauthProviderId = S.String; export interface DeleteBranchNeonAuthOauthProviderRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The OAuth provider ID */ oauth_provider_id: | DeleteBranchNeonAuthOauthProviderRequestOauthProviderId | (string & {}); } export const DeleteBranchNeonAuthOauthProviderRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), oauth_provider_id: DeleteBranchNeonAuthOauthProviderRequestOauthProviderId.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}", code: 200, }), ), ).annotate({ identifier: "DeleteBranchNeonAuthOauthProviderRequest", }) as any as S.Schema; export interface DeleteBranchNeonAuthOauthProviderResponse {} export const DeleteBranchNeonAuthOauthProviderResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteBranchNeonAuthOauthProviderResponse", }) as any as S.Schema; export interface NeonAuthDeleteDomainFromRedirectURIWhitelistItem { /** URI to remove from the redirect URI whitelist. */ domain: string; } export const NeonAuthDeleteDomainFromRedirectURIWhitelistItem = /*@__PURE__*/ S.suspend(() => S.Struct({ domain: S.String, }), ).annotate({ identifier: "NeonAuthDeleteDomainFromRedirectURIWhitelistItem", }) as any as S.Schema; /** Domain names to remove from the redirect URI whitelist for the specified auth provider. */ export type DeleteBranchNeonAuthTrustedDomainRequestDomainsList = Array; export const DeleteBranchNeonAuthTrustedDomainRequestDomainsList = /*@__PURE__*/ S.Array( NeonAuthDeleteDomainFromRedirectURIWhitelistItem, ) as any as S.Schema; export interface DeleteBranchNeonAuthTrustedDomainRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; auth_provider: NeonAuthSupportedAuthProvider | (string & {}); /** Domain names to remove from the redirect URI whitelist for the specified auth provider. */ domains: DeleteBranchNeonAuthTrustedDomainRequestDomainsList; } export const DeleteBranchNeonAuthTrustedDomainRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), auth_provider: NeonAuthSupportedAuthProvider, domains: DeleteBranchNeonAuthTrustedDomainRequestDomainsList, }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/auth/domains", code: 200, }), ), ).annotate({ identifier: "DeleteBranchNeonAuthTrustedDomainRequest", }) as any as S.Schema; export interface DeleteBranchNeonAuthTrustedDomainResponse {} export const DeleteBranchNeonAuthTrustedDomainResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteBranchNeonAuthTrustedDomainResponse", }) as any as S.Schema; export interface DeleteBranchNeonAuthUserRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The Neon user ID */ auth_user_id: string; } export const DeleteBranchNeonAuthUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), auth_user_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}", code: 200, }), ), ).annotate({ identifier: "DeleteBranchNeonAuthUserRequest", }) as any as S.Schema; export interface DeleteBranchNeonAuthUserResponse {} export const DeleteBranchNeonAuthUserResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteBranchNeonAuthUserResponse", }) as any as S.Schema; export interface DeleteOrganizationSpendingLimitRequest { /** The Neon organization ID */ org_id: string; } export const DeleteOrganizationSpendingLimitRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/organizations/{org_id}/billing/spending_limit", code: 200, }), ), ).annotate({ identifier: "DeleteOrganizationSpendingLimitRequest", }) as any as S.Schema; export type DeleteOrganizationSpendingLimitResponse = unknown; export const DeleteOrganizationSpendingLimitResponse = /*@__PURE__*/ S.suspend( () => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "DeleteOrganizationSpendingLimitResponse", }) as any as S.Schema; export interface DeleteOrganizationVPCEndpointRequest { /** The Neon organization ID */ org_id: string; /** The Neon region ID. Azure regions are currently not supported. */ region_id: string; /** The VPC endpoint ID */ vpc_endpoint_id: string; } export const DeleteOrganizationVPCEndpointRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ org_id: S.String.pipe(T.Label()), region_id: S.String.pipe(T.Label()), vpc_endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}", code: 200, }), ), ).annotate({ identifier: "DeleteOrganizationVPCEndpointRequest", }) as any as S.Schema; export interface DeleteOrganizationVPCEndpointResponse {} export const DeleteOrganizationVPCEndpointResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "DeleteOrganizationVPCEndpointResponse", }) as any as S.Schema; export interface DeleteProjectRequest { /** The Neon project ID */ project_id: string; } export const DeleteProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}", code: 200 }), ), ).annotate({ identifier: "DeleteProjectRequest", }) as any as S.Schema; export interface ProjectResponse { /** Full details of the project, including configuration, consumption metrics, and ownership. */ project: Project; } export const ProjectResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project: Project, }), ).annotate({ identifier: "ProjectResponse", }) as any as S.Schema; export interface DeleteProjectBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** If true, the branch is permanently deleted immediately without a recovery window. If false (default), the branch can be recovered within 7 days via the recover endpoint. This parameter is part of the Branch Recovery feature, which is in preview and not available to all users. */ hard_delete?: boolean; } export const DeleteProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), hard_delete: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchRequest", }) as any as S.Schema; export type DeleteProjectBranchResponseOperationsList = Array; export const DeleteProjectBranchResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface DeleteProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; operations: DeleteProjectBranchResponseOperationsList; } export const DeleteProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, operations: DeleteProjectBranchResponseOperationsList, }), ).annotate({ identifier: "DeleteProjectBranchResponse", }) as any as S.Schema; export interface DeleteProjectBranchBucketRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; } export const DeleteProjectBranchBucketRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchBucketRequest", }) as any as S.Schema; export interface DeleteProjectBranchBucketResponse {} export const DeleteProjectBranchBucketResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteProjectBranchBucketResponse", }) as any as S.Schema; export interface DeleteProjectBranchBucketObjectRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; /** The object key. Keys may contain `/`; the `/` characters of nested keys must be percent-encoded (`%2F`) in the path segment. */ object_key: string; } export const DeleteProjectBranchBucketObjectRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), object_key: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchBucketObjectRequest", }) as any as S.Schema; export interface DeleteProjectBranchBucketObjectResponse {} export const DeleteProjectBranchBucketObjectResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "DeleteProjectBranchBucketObjectResponse", }) as any as S.Schema; export interface DeleteProjectBranchBucketObjectsByPrefixRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; /** The key prefix (folder) to delete. Must be non-empty and end with `/`. Every object on this branch whose key starts with this prefix is soft-deleted. */ prefix: string; } export const DeleteProjectBranchBucketObjectsByPrefixRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), prefix: S.String.pipe(T.Query()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects-by-prefix", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchBucketObjectsByPrefixRequest", }) as any as S.Schema; export interface BucketObjectsDeletePrefixResponse { /** The number of objects soft-deleted under the prefix. 0 when no live object matched the prefix on this branch. */ deleted: number; } export const BucketObjectsDeletePrefixResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ deleted: S.Number, }), ).annotate({ identifier: "BucketObjectsDeletePrefixResponse", }) as any as S.Schema; export interface DeleteProjectBranchCustomDomainRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The registered custom domain (case-insensitive). */ domain: string; } export const DeleteProjectBranchCustomDomainRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), domain: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/custom-domains/{domain}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchCustomDomainRequest", }) as any as S.Schema; export interface DeleteProjectBranchCustomDomainResponse {} export const DeleteProjectBranchCustomDomainResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "DeleteProjectBranchCustomDomainResponse", }) as any as S.Schema; export interface DeleteProjectBranchDataAPIRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The database name */ database_name: string; } export const DeleteProjectBranchDataAPIRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchDataAPIRequest", }) as any as S.Schema; export type DeleteProjectBranchDataAPIResponse = unknown; export const DeleteProjectBranchDataAPIResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "DeleteProjectBranchDataAPIResponse", }) as any as S.Schema; export interface DeleteProjectBranchDatabaseRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The database name */ database_name: string; } export const DeleteProjectBranchDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchDatabaseRequest", }) as any as S.Schema; export type DeleteProjectBranchDatabaseResponseOperationsList = Array; export const DeleteProjectBranchDatabaseResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface DeleteProjectBranchDatabaseResponse { /** Database object returned by the operation. */ database: Database; operations: DeleteProjectBranchDatabaseResponseOperationsList; } export const DeleteProjectBranchDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ database: Database, operations: DeleteProjectBranchDatabaseResponseOperationsList, }), ).annotate({ identifier: "DeleteProjectBranchDatabaseResponse", }) as any as S.Schema; export interface DeleteProjectBranchFunctionRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The function slug */ slug: string; } export const DeleteProjectBranchFunctionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), slug: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/functions/{slug}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchFunctionRequest", }) as any as S.Schema; export interface DeleteProjectBranchFunctionResponse {} export const DeleteProjectBranchFunctionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteProjectBranchFunctionResponse", }) as any as S.Schema; export interface DeleteProjectBranchRoleRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The role name */ role_name: string; } export const DeleteProjectBranchRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), role_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectBranchRoleRequest", }) as any as S.Schema; export type DeleteProjectBranchRoleResponseOperationsList = Array; export const DeleteProjectBranchRoleResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface DeleteProjectBranchRoleResponse { /** Role details for the requested database role. The `password` field is included in the response when a role is created or its password is reset, and is not returned in subsequent read requests. Store it securely at that time. */ role: Role; operations: DeleteProjectBranchRoleResponseOperationsList; } export const DeleteProjectBranchRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ role: Role, operations: DeleteProjectBranchRoleResponseOperationsList, }), ).annotate({ identifier: "DeleteProjectBranchRoleResponse", }) as any as S.Schema; export interface DeleteProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; } export const DeleteProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/endpoints/{endpoint_id}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectEndpointRequest", }) as any as S.Schema; export type DeleteProjectEndpointResponseOperationsList = Array; export const DeleteProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface DeleteProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: DeleteProjectEndpointResponseOperationsList; } export const DeleteProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: DeleteProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "DeleteProjectEndpointResponse", }) as any as S.Schema; export interface DeleteProjectJWKSRequest { /** The Neon project ID */ project_id: string; /** The JWKS ID */ jwks_id: string; } export const DeleteProjectJWKSRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), jwks_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/jwks/{jwks_id}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectJWKSRequest", }) as any as S.Schema; export interface DeleteProjectVPCEndpointRequest { /** The Neon project ID */ project_id: string; /** The VPC endpoint ID */ vpc_endpoint_id: string; } export const DeleteProjectVPCEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), vpc_endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}", code: 200, }), ), ).annotate({ identifier: "DeleteProjectVPCEndpointRequest", }) as any as S.Schema; export interface DeleteProjectVPCEndpointResponse {} export const DeleteProjectVPCEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteProjectVPCEndpointResponse", }) as any as S.Schema; export interface DeleteSnapshotRequest { /** The Neon project ID */ project_id: string; /** The snapshot ID */ snapshot_id: string; } export const DeleteSnapshotRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), snapshot_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/snapshots/{snapshot_id}", code: 200, }), ), ).annotate({ identifier: "DeleteSnapshotRequest", }) as any as S.Schema; export interface DeleteSnapshotResponse {} export const DeleteSnapshotResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteSnapshotResponse", }) as any as S.Schema; export interface DisableNeonAuthRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** If true, deletes the `neon_auth` schema from the database */ delete_data?: boolean; } export const DisableNeonAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), delete_data: S.optional(S.Boolean), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/auth", code: 200, }), ), ).annotate({ identifier: "DisableNeonAuthRequest", }) as any as S.Schema; export interface DisableNeonAuthResponse {} export const DisableNeonAuthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DisableNeonAuthResponse", }) as any as S.Schema; export interface FinalizeRestoreBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** Name for the replaced branch. If omitted, a unique name is generated. */ name?: string; } export const FinalizeRestoreBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), name: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/finalize_restore", code: 200, }), ), ).annotate({ identifier: "FinalizeRestoreBranchRequest", }) as any as S.Schema; export type OperationsResponseOperationsList = Array; export const OperationsResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface OperationsResponse { operations: OperationsResponseOperationsList; } export const OperationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ operations: OperationsResponseOperationsList, }), ).annotate({ identifier: "OperationsResponse", }) as any as S.Schema; export interface GetActiveRegionsRequest { /** Organization ID. When provided, returns only regions available to this organization. Recommended for accurate region availability. */ org_id?: string; } export const GetActiveRegionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/regions", code: 200 })), ).annotate({ identifier: "GetActiveRegionsRequest", }) as any as S.Schema; export interface RegionResponse { /** Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`. */ region_id: string; /** A short description of the region. */ name: string; /** True if this region is selected by default when no region is specified during project creation. */ default: boolean; /** The geographical latitude (approximate) for the region. Empty if unknown. */ geo_lat: string; /** The geographical longitude (approximate) for the region. Empty if unknown. */ geo_long: string; } export const RegionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ region_id: S.String, name: S.String, default: S.Boolean, geo_lat: S.String, geo_long: S.String, }), ).annotate({ identifier: "RegionResponse" }) as any as S.Schema; /** The list of active regions */ export type ActiveRegionsResponseRegionsList = Array; export const ActiveRegionsResponseRegionsList = /*@__PURE__*/ S.Array( RegionResponse, ) as any as S.Schema; export interface ActiveRegionsResponse { /** The list of active regions */ regions: ActiveRegionsResponseRegionsList; } export const ActiveRegionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ regions: ActiveRegionsResponseRegionsList, }), ).annotate({ identifier: "ActiveRegionsResponse", }) as any as S.Schema; export interface GetAnonymizedBranchStatusRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const GetAnonymizedBranchStatusRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/anonymized_status", code: 200, }), ), ).annotate({ identifier: "GetAnonymizedBranchStatusRequest", }) as any as S.Schema; /** Metadata about the most recent anonymization attempt for the branch. */ export interface AnonymizationRunMetadata { /** Timestamp indicating when the latest anonymization attempt started. */ started_at?: string; /** Timestamp indicating when the latest anonymization attempt completed. Populated even if the attempt failed. */ completed_at?: string; /** UUID of the user who triggered the latest anonymization attempt. */ triggered_by?: string; /** Username of the user who triggered the latest anonymization attempt. */ triggered_by_username?: string; /** Number of columns that had masking rules applied during the attempt. */ masked_columns?: number; } export const AnonymizationRunMetadata = /*@__PURE__*/ S.suspend(() => S.Struct({ started_at: S.optional(S.String), completed_at: S.optional(S.String), triggered_by: S.optional(S.String), triggered_by_username: S.optional(S.String), masked_columns: S.optional(S.Number), }), ).annotate({ identifier: "AnonymizationRunMetadata", }) as any as S.Schema; export interface AnonymizedBranchStatusResponse { /** The ID of the project this branch belongs to. */ project_id: string; /** The ID of the anonymized branch. */ branch_id: string; /** The current state of the anonymized branch. `created`: branch record exists but setup has not started. `initialized`: setup is complete and the branch is ready for anonymization. `initialization_error`: an error occurred during setup. `anonymizing`: the anonymization process is currently running. `anonymized`: anonymization completed successfully. `error`: an error occurred during anonymization. */ state: string; /** A descriptive message about the current status or any errors */ status_message?: string; /** A timestamp indicating when the anonymized branch was created */ created_at: string; /** A timestamp indicating when the anonymized branch status was last updated */ updated_at: string; /** A timestamp indicating when the anonymized branch operation failed (if applicable) */ failed_at?: string; last_run?: AnonymizationRunMetadata; } export const AnonymizedBranchStatusResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String, branch_id: S.String, state: S.String, status_message: S.optional(S.String), created_at: S.String, updated_at: S.String, failed_at: S.optional(S.String), last_run: S.optional(AnonymizationRunMetadata), }), ).annotate({ identifier: "AnonymizedBranchStatusResponse", }) as any as S.Schema; export interface GetAuthDetailsRequest {} export const GetAuthDetailsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/auth", code: 200 })), ).annotate({ identifier: "GetAuthDetailsRequest", }) as any as S.Schema; /** Authentication method used for the request: - `keycloak`: Keycloak identity provider authentication. - `session_cookie`: Browser session cookie authentication. - `api_key_user`: API key scoped to a user account. - `api_key_org`: API key scoped to an organization. - `oauth`: OAuth-based authentication. */ export type AuthDetailsResponseAuthMethod = | "keycloak" | "session_cookie" | "api_key_user" | "api_key_org" | "oauth"; export const AuthDetailsResponseAuthMethod = S.String; export interface AuthDetailsResponse { /** The ID of the account associated with this authentication record. */ account_id: string; /** Authentication method used for the request: - `keycloak`: Keycloak identity provider authentication. - `session_cookie`: Browser session cookie authentication. - `api_key_user`: API key scoped to a user account. - `api_key_org`: API key scoped to an organization. - `oauth`: OAuth-based authentication. */ auth_method: AuthDetailsResponseAuthMethod; auth_data?: string; } export const AuthDetailsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ account_id: S.String, auth_method: AuthDetailsResponseAuthMethod, auth_data: S.optional(S.String), }), ).annotate({ identifier: "AuthDetailsResponse", }) as any as S.Schema; export interface GetAvailablePreloadLibrariesRequest { project_id: string; } export const GetAvailablePreloadLibrariesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/available_preload_libraries", code: 200, }), ), ).annotate({ identifier: "GetAvailablePreloadLibrariesRequest", }) as any as S.Schema; export interface AvailablePreloadLibrary { /** Name of the Postgres shared preload library as it appears in the `shared_preload_libraries` parameter (for example, `pg_stat_statements`). */ library_name: string; /** Human-readable explanation of the library's purpose and behavior. */ description: string; /** Whether this library is loaded by default in the `shared_preload_libraries` configuration for new compute endpoints. */ is_default: boolean; /** Marks the library as experimental. Experimental libraries may be unstable, subject to breaking changes, or not recommended for production use. */ is_experimental: boolean; /** Version of the preload library. */ version: string; } export const AvailablePreloadLibrary = /*@__PURE__*/ S.suspend(() => S.Struct({ library_name: S.String, description: S.String, is_default: S.Boolean, is_experimental: S.Boolean, version: S.String, }), ).annotate({ identifier: "AvailablePreloadLibrary", }) as any as S.Schema; /** Preload libraries available for the project's Postgres version. Each entry includes `library_name`, `description`, `is_default`, `is_experimental`, and `version`. */ export type AvailablePreloadLibrariesLibrariesList = Array; export const AvailablePreloadLibrariesLibrariesList = /*@__PURE__*/ S.Array( AvailablePreloadLibrary, ) as any as S.Schema; export interface AvailablePreloadLibraries { /** Preload libraries available for the project's Postgres version. Each entry includes `library_name`, `description`, `is_default`, `is_experimental`, and `version`. */ libraries?: AvailablePreloadLibrariesLibrariesList; } export const AvailablePreloadLibraries = /*@__PURE__*/ S.suspend(() => S.Struct({ libraries: S.optional(AvailablePreloadLibrariesLibrariesList), }), ).annotate({ identifier: "AvailablePreloadLibraries", }) as any as S.Schema; export interface GetConnectionURIRequest { /** The Neon project ID */ project_id: string; /** The branch ID. Defaults to your project's default `branch_id` if not specified. */ branch_id?: string; /** The endpoint ID. Defaults to the read-write `endpoint_id` associated with the `branch_id` if not specified. */ endpoint_id?: string; /** The database name */ database_name: string; /** The role name */ role_name: string; /** Adds the `-pooler` option to the connection URI when set to `true`, creating a pooled connection URI. */ pooled?: boolean; } export const GetConnectionURIRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.optional(S.String.pipe(T.Query())), endpoint_id: S.optional(S.String.pipe(T.Query())), database_name: S.String.pipe(T.Query()), role_name: S.String.pipe(T.Query()), pooled: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/connection_uri", code: 200, }), ), ).annotate({ identifier: "GetConnectionURIRequest", }) as any as S.Schema; export interface ConnectionURIResponse { /** The connection URI. */ uri: string; } export const ConnectionURIResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ uri: S.String, }), ).annotate({ identifier: "ConnectionURIResponse", }) as any as S.Schema; export type GetConsumptionHistoryPerBranchV2RequestProjectIdsList = Array; export const GetConsumptionHistoryPerBranchV2RequestProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetConsumptionHistoryPerBranchV2RequestBranchIdsList = Array; export const GetConsumptionHistoryPerBranchV2RequestBranchIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConsumptionHistoryGranularity = "hourly" | "daily" | "monthly"; export const ConsumptionHistoryGranularity = S.String; export type ConsumptionHistoryQueryMetrics = Array; export const ConsumptionHistoryQueryMetrics = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetConsumptionHistoryPerBranchV2Request { /** Cursor from the previous response (`pagination.cursor`). Pass it to fetch the next page of branches. Pages are ordered by project ID, then branch ID. */ cursor?: string; /** Maximum number of branches per page. Allowed range: 1 to 1000. Default: 100. */ limit?: number; /** Project IDs to include (required, 1 to 100). Returns metrics for branches in these projects. Pass multiple IDs as repeated query parameters or a comma-separated list: - `project_ids=cold-poetry-09157238&project_ids=quiet-snow-71788278` - `project_ids=cold-poetry-09157238,quiet-snow-71788278` */ project_ids: GetConsumptionHistoryPerBranchV2RequestProjectIdsList; /** Optional branch IDs to filter the response (up to 100). If omitted, all branches in the listed projects are included. Pass multiple IDs as repeated query parameters or a comma-separated list: - `branch_ids=br-aged-salad-637688&branch_ids=br-sweet-breeze-497520` - `branch_ids=br-aged-salad-637688,br-sweet-breeze-497520` */ branch_ids?: GetConsumptionHistoryPerBranchV2RequestBranchIdsList; /** Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. Branch-level metrics are returned from when the account first ingests branch-level consumption data. Periods before that time contain no branch metrics. */ from: string; /** Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. */ to: string; /** Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively. */ granularity: ConsumptionHistoryGranularity | (string & {}); /** Organization ID. Metrics are returned for projects in this organization. */ org_id: string; /** Required. List the metrics to return. Only these values are supported: - `compute_unit_seconds` - `root_branch_bytes_month` - `child_branch_bytes_month` - `instant_restore_bytes_month` - `public_network_transfer_bytes` - `private_network_transfer_bytes` Not supported on this endpoint: `extra_branches_month`, `snapshot_storage_bytes_month`. Use `GET /consumption_history/v2/projects` for those. Pass multiple values as repeated query parameters or a comma-separated list: - `metrics=compute_unit_seconds&metrics=public_network_transfer_bytes` - `metrics=compute_unit_seconds,public_network_transfer_bytes` */ metrics: ConsumptionHistoryQueryMetrics; } export const GetConsumptionHistoryPerBranchV2Request = /*@__PURE__*/ S.suspend( () => S.Struct({ cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), project_ids: GetConsumptionHistoryPerBranchV2RequestProjectIdsList.pipe( T.Query(), ), branch_ids: S.optional( GetConsumptionHistoryPerBranchV2RequestBranchIdsList.pipe(T.Query()), ), from: S.String.pipe(T.Query()), to: S.String.pipe(T.Query()), granularity: ConsumptionHistoryGranularity.pipe(T.Query()), org_id: S.String.pipe(T.Query()), metrics: ConsumptionHistoryQueryMetrics.pipe(T.Query()), }).pipe( T.Http({ method: "GET", uri: "/consumption_history/v2/branches", code: 200, }), ), ).annotate({ identifier: "GetConsumptionHistoryPerBranchV2Request", }) as any as S.Schema; export interface ConsumptionMetricValue { /** Name of the consumption metric, such as compute_time or data_storage_bytes_hour. */ metric_name: string; /** Measured quantity for the metric named by `metric_name`. */ value: number; } export const ConsumptionMetricValue = /*@__PURE__*/ S.suspend(() => S.Struct({ metric_name: S.String, value: S.Number, }), ).annotate({ identifier: "ConsumptionMetricValue", }) as any as S.Schema; /** Consumption metric values recorded for the timeframe. */ export type ConsumptionHistoryPerTimeframeV2MetricsList = Array; export const ConsumptionHistoryPerTimeframeV2MetricsList = /*@__PURE__*/ S.Array( ConsumptionMetricValue, ) as any as S.Schema; export interface ConsumptionHistoryPerTimeframeV2 { /** The specified start date-time for the reported consumption. */ timeframe_start?: string; /** The specified end date-time for the reported consumption. */ timeframe_end?: string; /** Consumption metric values recorded for the timeframe. */ metrics?: ConsumptionHistoryPerTimeframeV2MetricsList; } export const ConsumptionHistoryPerTimeframeV2 = /*@__PURE__*/ S.suspend(() => S.Struct({ timeframe_start: S.optional(S.String), timeframe_end: S.optional(S.String), metrics: S.optional(ConsumptionHistoryPerTimeframeV2MetricsList), }), ).annotate({ identifier: "ConsumptionHistoryPerTimeframeV2", }) as any as S.Schema; /** Consumption metric records for the billing period. */ export type ConsumptionHistoryPerPeriodV2ConsumptionList = Array; export const ConsumptionHistoryPerPeriodV2ConsumptionList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerTimeframeV2, ) as any as S.Schema; export interface ConsumptionHistoryPerPeriodV2 { /** The ID assigned to the specified billing period. */ period_id: string; /** The billing plan applicable during the billing period. */ period_plan: string; /** The start date-time of the billing period. */ period_start: string; /** The end date-time of the billing period, available for the past periods only. */ period_end?: string; /** Consumption metric records for the billing period. */ consumption: ConsumptionHistoryPerPeriodV2ConsumptionList; } export const ConsumptionHistoryPerPeriodV2 = /*@__PURE__*/ S.suspend(() => S.Struct({ period_id: S.String, period_plan: S.String, period_start: S.String, period_end: S.optional(S.String), consumption: ConsumptionHistoryPerPeriodV2ConsumptionList, }), ).annotate({ identifier: "ConsumptionHistoryPerPeriodV2", }) as any as S.Schema; /** Consumption history records for the branch, grouped by billing period. */ export type ConsumptionHistoryPerBranchV2PeriodsList = Array; export const ConsumptionHistoryPerBranchV2PeriodsList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerPeriodV2, ) as any as S.Schema; export interface ConsumptionHistoryPerBranchV2 { /** The ID of the project that owns this branch. */ project_id: string; /** The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id: string; /** Consumption history records for the branch, grouped by billing period. */ periods: ConsumptionHistoryPerBranchV2PeriodsList; } export const ConsumptionHistoryPerBranchV2 = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String, branch_id: S.String, periods: ConsumptionHistoryPerBranchV2PeriodsList, }), ).annotate({ identifier: "ConsumptionHistoryPerBranchV2", }) as any as S.Schema; /** Per-branch consumption history records returned for the requested time range. */ export type GetConsumptionHistoryPerBranchV2ResponseBranchesList = Array; export const GetConsumptionHistoryPerBranchV2ResponseBranchesList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerBranchV2, ) as any as S.Schema; /** Cursor-based pagination. The `cursor` value reflects the endpoint's sort field (for example, an ID or timestamp), so pass it back unchanged. */ export interface Pagination { /** Cursor marking the last item in this response. Pass it unchanged as the `cursor` query parameter to fetch the next page. */ cursor: string; } export const Pagination = /*@__PURE__*/ S.suspend(() => S.Struct({ cursor: S.String, }), ).annotate({ identifier: "Pagination" }) as any as S.Schema; export interface GetConsumptionHistoryPerBranchV2Response { /** Per-branch consumption history records returned for the requested time range. */ branches: GetConsumptionHistoryPerBranchV2ResponseBranchesList; pagination?: Pagination; } export const GetConsumptionHistoryPerBranchV2Response = /*@__PURE__*/ S.suspend( () => S.Struct({ branches: GetConsumptionHistoryPerBranchV2ResponseBranchesList, pagination: S.optional(Pagination), }), ).annotate({ identifier: "GetConsumptionHistoryPerBranchV2Response", }) as any as S.Schema; export type GetConsumptionHistoryPerProjectRequestProjectIdsList = Array; export const GetConsumptionHistoryPerProjectRequestProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetConsumptionHistoryPerProjectRequest { /** Specify the cursor value from the previous response to get the next batch of projects. */ cursor?: string; /** Specify a value from 1 to 100 to limit number of projects in the response. */ limit?: number; /** Specify a list of project IDs to filter the response. If omitted, the response will contain all projects. A list of project IDs can be specified as an array of parameter values or as a comma-separated list in a single parameter value. - As an array of parameter values: `project_ids=cold-poetry-09157238%20&project_ids=quiet-snow-71788278` - As a comma-separated list in a single parameter value: `project_ids=cold-poetry-09157238,quiet-snow-71788278` */ project_ids?: GetConsumptionHistoryPerProjectRequestProjectIdsList; /** Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. The consumption history is available starting from `March 1, 2024, at 00:00:00 UTC`. */ from: string; /** Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified granularity. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. */ to: string; /** Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively. */ granularity: ConsumptionHistoryGranularity | (string & {}); /** Specify the organization for which the project consumption metrics should be returned. If this parameter is not provided, the endpoint will return the metrics for the authenticated user's projects. */ org_id?: string; /** The field is deprecated. Please use `metrics` instead. If `metrics` is specified, this field is ignored. Include metrics utilized in previous pricing models. - **data_storage_bytes_hour**: The sum of the maximum observed storage values for each hour, which never decreases. */ include_v1_metrics?: boolean; /** Specify a list of metrics to include in the response. If omitted, active_time, compute_time, written_data, synthetic_storage_size are returned. Possible values: - `active_time_seconds` - `compute_time_seconds` - `written_data_bytes` - `synthetic_storage_size_bytes` - `data_storage_bytes_hour` - `logical_size_bytes` - `logical_size_bytes_hour` A list of metrics can be specified as an array of parameter values or as a comma-separated list in a single parameter value. - As an array of parameter values: `metrics=cpu_seconds&metrics=ram_bytes` - As a comma-separated list in a single parameter value: `metrics=cpu_seconds,ram_bytes` */ metrics?: ConsumptionHistoryQueryMetrics; } export const GetConsumptionHistoryPerProjectRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), project_ids: S.optional( GetConsumptionHistoryPerProjectRequestProjectIdsList.pipe(T.Query()), ), from: S.String.pipe(T.Query()), to: S.String.pipe(T.Query()), granularity: ConsumptionHistoryGranularity.pipe(T.Query()), org_id: S.optional(S.String.pipe(T.Query())), include_v1_metrics: S.optional(S.Boolean.pipe(T.Query())), metrics: S.optional(ConsumptionHistoryQueryMetrics.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/consumption_history/projects", code: 200, }), ), ).annotate({ identifier: "GetConsumptionHistoryPerProjectRequest", }) as any as S.Schema; export interface ConsumptionHistoryPerTimeframe { /** The specified start date-time for the reported consumption. */ timeframe_start: string; /** The specified end date-time for the reported consumption. */ timeframe_end: string; /** Seconds. The amount of time the compute endpoints have been active. */ active_time_seconds: number; /** Seconds. The number of CPU seconds used by compute endpoints, including compute endpoints that have been deleted. */ compute_time_seconds: number; /** Bytes. The amount of written data for all branches. */ written_data_bytes: number; /** Bytes. The space occupied in Postgres storage. Synthetic Postgres storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches. */ synthetic_storage_size_bytes: number; /** Bytes-Hour. The amount of Postgres storage consumed hourly. */ data_storage_bytes_hour?: number; /** Bytes. The amount of logical size consumed. */ logical_size_bytes?: number; /** Bytes-Hour. The amount of logical size consumed hourly. */ logical_size_bytes_hour?: number; } export const ConsumptionHistoryPerTimeframe = /*@__PURE__*/ S.suspend(() => S.Struct({ timeframe_start: S.String, timeframe_end: S.String, active_time_seconds: S.Number, compute_time_seconds: S.Number, written_data_bytes: S.Number, synthetic_storage_size_bytes: S.Number, data_storage_bytes_hour: S.optional(S.Number), logical_size_bytes: S.optional(S.Number), logical_size_bytes_hour: S.optional(S.Number), }), ).annotate({ identifier: "ConsumptionHistoryPerTimeframe", }) as any as S.Schema; /** Consumption metric records for the billing period. */ export type ConsumptionHistoryPerPeriodConsumptionList = Array; export const ConsumptionHistoryPerPeriodConsumptionList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerTimeframe, ) as any as S.Schema; export interface ConsumptionHistoryPerPeriod { /** The ID assigned to the specified billing period. */ period_id: string; /** The billing plan applicable during the billing period. */ period_plan: string; /** The start date-time of the billing period. */ period_start: string; /** The end date-time of the billing period, available for the past periods only. */ period_end?: string; /** Consumption metric records for the billing period. */ consumption: ConsumptionHistoryPerPeriodConsumptionList; } export const ConsumptionHistoryPerPeriod = /*@__PURE__*/ S.suspend(() => S.Struct({ period_id: S.String, period_plan: S.String, period_start: S.String, period_end: S.optional(S.String), consumption: ConsumptionHistoryPerPeriodConsumptionList, }), ).annotate({ identifier: "ConsumptionHistoryPerPeriod", }) as any as S.Schema; /** Consumption periods for the project, each covering a discrete billing interval. */ export type ConsumptionHistoryPerProjectPeriodsList = Array; export const ConsumptionHistoryPerProjectPeriodsList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerPeriod, ) as any as S.Schema; export interface ConsumptionHistoryPerProject { /** The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; /** Consumption periods for the project, each covering a discrete billing interval. */ periods: ConsumptionHistoryPerProjectPeriodsList; } export const ConsumptionHistoryPerProject = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String, periods: ConsumptionHistoryPerProjectPeriodsList, }), ).annotate({ identifier: "ConsumptionHistoryPerProject", }) as any as S.Schema; /** Per-project consumption history records included in the response. */ export type GetConsumptionHistoryPerProjectResponseProjectsList = Array; export const GetConsumptionHistoryPerProjectResponseProjectsList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerProject, ) as any as S.Schema; export interface GetConsumptionHistoryPerProjectResponse { /** Per-project consumption history records included in the response. */ projects: GetConsumptionHistoryPerProjectResponseProjectsList; pagination?: Pagination; } export const GetConsumptionHistoryPerProjectResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ projects: GetConsumptionHistoryPerProjectResponseProjectsList, pagination: S.optional(Pagination), }), ).annotate({ identifier: "GetConsumptionHistoryPerProjectResponse", }) as any as S.Schema; export type GetConsumptionHistoryPerProjectV2RequestProjectIdsList = Array; export const GetConsumptionHistoryPerProjectV2RequestProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetConsumptionHistoryPerProjectV2Request { /** Cursor from the previous response (`pagination.cursor`). Pass it to fetch the next page of projects. Pages are ordered by project creation order (newest first). */ cursor?: string; /** Maximum number of projects per page. Allowed range: 1 to 100. Default: 10. */ limit?: number; /** Optional project IDs to filter the response (up to 100). If omitted, projects in the organization are included across pages (use `cursor` and `limit`). Pass multiple IDs as repeated query parameters or a comma-separated list: - `project_ids=cold-poetry-09157238&project_ids=quiet-snow-71788278` - `project_ids=cold-poetry-09157238,quiet-snow-71788278` */ project_ids?: GetConsumptionHistoryPerProjectV2RequestProjectIdsList; /** Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. The earliest allowed `from` value is `March 1, 2024, at 00:00:00 UTC`. Metrics are returned from when the account upgraded to an eligible plan, which may be later than that date. */ from: string; /** Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year. */ to: string; /** Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively. */ granularity: ConsumptionHistoryGranularity | (string & {}); /** Organization ID. Metrics are returned for projects in this organization. */ org_id: string; /** Required. List the metrics to return. Supported values: - `compute_unit_seconds` - `root_branch_bytes_month` - `child_branch_bytes_month` - `instant_restore_bytes_month` - `public_network_transfer_bytes` - `private_network_transfer_bytes` - `extra_branches_month` - `snapshot_storage_bytes_month` Pass multiple values as repeated query parameters or a comma-separated list: - `metrics=compute_unit_seconds&metrics=extra_branches_month` - `metrics=compute_unit_seconds,extra_branches_month` */ metrics: ConsumptionHistoryQueryMetrics; } export const GetConsumptionHistoryPerProjectV2Request = /*@__PURE__*/ S.suspend( () => S.Struct({ cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), project_ids: S.optional( GetConsumptionHistoryPerProjectV2RequestProjectIdsList.pipe(T.Query()), ), from: S.String.pipe(T.Query()), to: S.String.pipe(T.Query()), granularity: ConsumptionHistoryGranularity.pipe(T.Query()), org_id: S.String.pipe(T.Query()), metrics: ConsumptionHistoryQueryMetrics.pipe(T.Query()), }).pipe( T.Http({ method: "GET", uri: "/consumption_history/v2/projects", code: 200, }), ), ).annotate({ identifier: "GetConsumptionHistoryPerProjectV2Request", }) as any as S.Schema; /** Consumption periods recorded for this project. */ export type ConsumptionHistoryPerProjectV2PeriodsList = Array; export const ConsumptionHistoryPerProjectV2PeriodsList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerPeriodV2, ) as any as S.Schema; export interface ConsumptionHistoryPerProjectV2 { /** The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; /** Consumption periods recorded for this project. */ periods: ConsumptionHistoryPerProjectV2PeriodsList; } export const ConsumptionHistoryPerProjectV2 = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String, periods: ConsumptionHistoryPerProjectV2PeriodsList, }), ).annotate({ identifier: "ConsumptionHistoryPerProjectV2", }) as any as S.Schema; /** Per-project consumption history entries for the requested time range. */ export type GetConsumptionHistoryPerProjectV2ResponseProjectsList = Array; export const GetConsumptionHistoryPerProjectV2ResponseProjectsList = /*@__PURE__*/ S.Array( ConsumptionHistoryPerProjectV2, ) as any as S.Schema; export interface GetConsumptionHistoryPerProjectV2Response { /** Per-project consumption history entries for the requested time range. */ projects: GetConsumptionHistoryPerProjectV2ResponseProjectsList; pagination?: Pagination; } export const GetConsumptionHistoryPerProjectV2Response = /*@__PURE__*/ S.suspend(() => S.Struct({ projects: GetConsumptionHistoryPerProjectV2ResponseProjectsList, pagination: S.optional(Pagination), }), ).annotate({ identifier: "GetConsumptionHistoryPerProjectV2Response", }) as any as S.Schema; export interface GetCurrentUserInfoRequest {} export const GetCurrentUserInfoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users/me", code: 200 })), ).annotate({ identifier: "GetCurrentUserInfoRequest", }) as any as S.Schema; /** State of the billing account. */ export type BillingAccountState = | "UNKNOWN" | "active" | "suspended" | "deactivated" | "deleted"; export const BillingAccountState = S.String; /** Card network reported by the payment processor. Set to `unknown` when the network cannot be determined. */ export type PaymentSourceBankCardBrand = | "amex" | "diners" | "discover" | "jcb" | "mastercard" | "unionpay" | "unknown" | "visa"; export const PaymentSourceBankCardBrand = S.String; export interface PaymentSourceBankCard { /** Last 4 digits of the card. */ last4: string; /** Card network reported by the payment processor. Set to `unknown` when the network cannot be determined. */ brand?: PaymentSourceBankCardBrand; /** Credit card expiration month */ exp_month?: number; /** Credit card expiration year */ exp_year?: number; } export const PaymentSourceBankCard = /*@__PURE__*/ S.suspend(() => S.Struct({ last4: S.String, brand: S.optional(PaymentSourceBankCardBrand), exp_month: S.optional(S.Number), exp_year: S.optional(S.Number), }), ).annotate({ identifier: "PaymentSourceBankCard", }) as any as S.Schema; export interface PaymentSource { /** Type of payment source. E.g. "card". */ type: string; /** Bank card details for this payment source. */ card?: PaymentSourceBankCard; } export const PaymentSource = /*@__PURE__*/ S.suspend(() => S.Struct({ type: S.String, card: S.optional(PaymentSourceBankCard), }), ).annotate({ identifier: "PaymentSource" }) as any as S.Schema; /** Indicates whether and how an account makes payments. */ export type BillingPaymentMethod = | "UNKNOWN" | "none" | "stripe" | "direct_payment" | "aws_mp" | "azure_mp" | "vercel_mp" | "staff" | "trial" | "sponsorship" | "shared_payment_token"; export const BillingPaymentMethod = S.String; export interface PlanVersion { major: number; minor: number; } export const PlanVersion = /*@__PURE__*/ S.suspend(() => S.Struct({ major: S.Number, minor: S.Number, }), ).annotate({ identifier: "PlanVersion" }) as any as S.Schema; export interface PlanDetails { /** Plan name, for example `free`, `launch`, or `scale`. */ name: string; /** Version of the plan, expressed as `major` and `minor` components. */ version?: PlanVersion; } export const PlanDetails = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, version: S.optional(PlanVersion), }), ).annotate({ identifier: "PlanDetails" }) as any as S.Schema; export interface BillingAccount { /** State of the billing account. `UNKNOWN`: state is not determined. `active`: the account is active and in normal operation. `suspended`: the account has been suspended. `deactivated`: the account has been deactivated. `deleted`: the account has been deleted. */ state: BillingAccountState; /** Payment source attached to the billing account, such as a credit card on file. */ payment_source: PaymentSource; subscription_type: BillingSubscriptionType; payment_method: BillingPaymentMethod; /** Timestamp of the last quota reset. Set to the account creation time when the account is first created. */ quota_reset_at_last: string; /** The full name of the individual or entity that owns the billing account. This name appears on invoices. */ name: string; /** Billing email, to receive emails related to invoices and subscriptions. */ email: string; /** Billing address city. */ address_city: string; /** Billing address country code defined by ISO 3166-1 alpha-2. */ address_country: string; /** Billing address country name. */ address_country_name?: string; /** Billing address line 1. */ address_line1: string; /** Billing address line 2. */ address_line2: string; /** Billing address postal code. */ address_postal_code: string; /** Billing address state or region. */ address_state: string; /** Orb user portal url */ orb_portal_url?: string; /** The tax identification number for the billing account, displayed on invoices. */ tax_id?: string; /** The type of the tax identification number based on the country. */ tax_id_type?: string; /** Details of the subscription plan associated with the billing account. */ plan_details?: PlanDetails; /** Monthly spending cap in cents for V3 paid plans. When set, notifications are sent at 80% and 100% of this limit. `null` means no limit is configured. */ spending_limit_cents?: number | null; } export const BillingAccount = /*@__PURE__*/ S.suspend(() => S.Struct({ state: BillingAccountState, payment_source: PaymentSource, subscription_type: BillingSubscriptionType, payment_method: BillingPaymentMethod, quota_reset_at_last: S.String, name: S.String, email: S.String, address_city: S.String, address_country: S.String, address_country_name: S.optional(S.String), address_line1: S.String, address_line2: S.String, address_postal_code: S.String, address_state: S.String, orb_portal_url: S.optional(S.String), tax_id: S.optional(S.String), tax_id_type: S.optional(S.String), plan_details: S.optional(PlanDetails), spending_limit_cents: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "BillingAccount" }) as any as S.Schema; /** Identity provider id from keycloak */ export type IdentityProviderId = | "github" | "google" | "hasura" | "microsoft" | "microsoftv2" | "vercelmp" | "keycloak"; export const IdentityProviderId = S.String; export interface CurrentUserAuthAccount { /** Email address associated with this auth account. */ email: string; /** URL of the user's profile picture as provided by the identity provider. */ image: string; /** Deprecated. Use the `email` field. */ login: string; /** Display name of the account as provided by the identity provider. */ name: string; provider: IdentityProviderId; } export const CurrentUserAuthAccount = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.String, image: S.String, login: S.String, name: S.String, provider: IdentityProviderId, }), ).annotate({ identifier: "CurrentUserAuthAccount", }) as any as S.Schema; /** Authentication provider accounts linked to the current user. */ export type CurrentUserInfoResponseAuthAccountsList = Array; export const CurrentUserInfoResponseAuthAccountsList = /*@__PURE__*/ S.Array( CurrentUserAuthAccount, ) as any as S.Schema; export interface CurrentUserInfoResponse { /** Control plane observes active endpoints of a user this amount of wall-clock time. */ active_seconds_limit: number; /** Billing account associated with the current user, including plan and subscription details. */ billing_account?: BillingAccount; /** Authentication provider accounts linked to the current user. */ auth_accounts: CurrentUserInfoResponseAuthAccountsList; /** Email address of the authenticated user. */ email: string; /** The Neon user ID. */ id: string; /** URL of the user's profile avatar image. */ image: string; /** Deprecated. Use the `email` field. */ login: string; /** First name of the current user. */ name: string; /** Last name of the current user. */ last_name: string; /** Maximum number of projects the account is allowed to create under the current plan. */ projects_limit: number; /** Maximum number of branches allowed for the account under the current plan. */ branches_limit: number; /** The maximum autoscaling limit in Compute Units. A value of 0 indicates no limit is configured. */ max_autoscaling_limit: number; /** Maximum Postgres compute time, in seconds, allowed under the account's current plan. */ compute_seconds_limit?: number; /** Current billing plan for the user's account. */ plan: string; } export const CurrentUserInfoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ active_seconds_limit: S.Number, billing_account: S.optional(BillingAccount), auth_accounts: CurrentUserInfoResponseAuthAccountsList, email: S.String, id: S.String, image: S.String, login: S.String, name: S.String, last_name: S.String, projects_limit: S.Number, branches_limit: S.Number, max_autoscaling_limit: S.Number, compute_seconds_limit: S.optional(S.Number), plan: S.String, }), ).annotate({ identifier: "CurrentUserInfoResponse", }) as any as S.Schema; export interface GetCurrentUserOrganizationsRequest {} export const GetCurrentUserOrganizationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe( T.Http({ method: "GET", uri: "/users/me/organizations", code: 200 }), ), ).annotate({ identifier: "GetCurrentUserOrganizationsRequest", }) as any as S.Schema; export interface Organization { /** The Neon organization ID. Use as the `org_id` path parameter in other endpoints. */ id: string; /** Human-readable display name of the organization. */ name: string; /** URL-safe identifier for the organization, used in API paths. Distinct from the display name. */ handle: string; /** Billing plan for the organization, for example `free`, `launch`, or `scale`. */ plan: string; /** A timestamp indicting when the organization was created */ created_at: string; /** Organizations created via the Console or the API are managed by `console`. Organizations created by other methods can't be deleted via the Console or the API. */ managed_by: string; /** A timestamp indicating when the organization was updated */ updated_at: string; /** If true, allow account to mark projects as HIPAA */ allow_hipaa_projects?: boolean; /** If true, all members must have MFA enabled to access this organization */ require_mfa?: boolean; } export const Organization = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, handle: S.String, plan: S.String, created_at: S.String, managed_by: S.String, updated_at: S.String, allow_hipaa_projects: S.optional(S.Boolean), require_mfa: S.optional(S.Boolean), }), ).annotate({ identifier: "Organization" }) as any as S.Schema; /** Organizations returned by the request. Each includes `id`, `name`, `handle`, and `plan`. */ export type OrganizationsResponseOrganizationsList = Array; export const OrganizationsResponseOrganizationsList = /*@__PURE__*/ S.Array( Organization, ) as any as S.Schema; export interface OrganizationsResponse { /** Organizations returned by the request. Each includes `id`, `name`, `handle`, and `plan`. */ organizations: OrganizationsResponseOrganizationsList; } export const OrganizationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ organizations: OrganizationsResponseOrganizationsList, }), ).annotate({ identifier: "OrganizationsResponse", }) as any as S.Schema; export interface GetMaskingRulesRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const GetMaskingRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/masking_rules", code: 200, }), ), ).annotate({ identifier: "GetMaskingRulesRequest", }) as any as S.Schema; /** List of masking rules for the branch */ export type MaskingRulesResponseMaskingRulesList = Array; export const MaskingRulesResponseMaskingRulesList = /*@__PURE__*/ S.Array( MaskingRule, ) as any as S.Schema; export interface MaskingRulesResponse { /** List of masking rules for the branch */ masking_rules: MaskingRulesResponseMaskingRulesList; } export const MaskingRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ masking_rules: MaskingRulesResponseMaskingRulesList, }), ).annotate({ identifier: "MaskingRulesResponse", }) as any as S.Schema; export interface GetNeonAuthRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthRequest", }) as any as S.Schema; export type NeonAuthProviderProjectOwnedBy = "user" | "neon"; export const NeonAuthProviderProjectOwnedBy = S.String; export type NeonAuthProviderProjectTransferStatus = "initiated" | "finished"; export const NeonAuthProviderProjectTransferStatus = S.String; export interface NeonAuthIntegration { auth_provider: NeonAuthSupportedAuthProvider; /** Project identifier assigned by the auth provider for this integration. */ auth_provider_project_id: string; /** The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id: string; /** Name of the database used by the Neon Auth integration. */ db_name: string; /** Timestamp when the Neon Auth integration was created, in RFC 3339 format (UTC). */ created_at: string; /** Owner of the auth provider project. `neon` means the project is created and managed by Neon on your behalf. `user` means the project was created in your own auth provider account and is self-managed. */ owned_by: NeonAuthProviderProjectOwnedBy; /** Ownership transfer state for the auth provider project. `initiated` means a transfer was requested but not completed. `finished` means it completed successfully. */ transfer_status?: NeonAuthProviderProjectTransferStatus; /** URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** Base URL of the Neon Auth service endpoint for this integration. Injected into the project environment as `NEON_AUTH_BASE_URL`. */ base_url?: string; /** Application name shown in auth emails and communications. Defaults to the project name. */ name?: string; } export const NeonAuthIntegration = /*@__PURE__*/ S.suspend(() => S.Struct({ auth_provider: NeonAuthSupportedAuthProvider, auth_provider_project_id: S.String, branch_id: S.String, db_name: S.String, created_at: S.String, owned_by: NeonAuthProviderProjectOwnedBy, transfer_status: S.optional(NeonAuthProviderProjectTransferStatus), jwks_url: S.String, base_url: S.optional(S.String), name: S.optional(S.String), }), ).annotate({ identifier: "NeonAuthIntegration", }) as any as S.Schema; export interface GetNeonAuthAllowLocalhostRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthAllowLocalhostRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/allow_localhost", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthAllowLocalhostRequest", }) as any as S.Schema; export interface NeonAuthAllowLocalhostResponse { /** Whether to allow localhost connections */ allow_localhost: boolean; } export const NeonAuthAllowLocalhostResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ allow_localhost: S.Boolean, }), ).annotate({ identifier: "NeonAuthAllowLocalhostResponse", }) as any as S.Schema; export interface GetNeonAuthEmailAndPasswordConfigRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthEmailAndPasswordConfigRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/email_and_password", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthEmailAndPasswordConfigRequest", }) as any as S.Schema; /** The email verification method to use. - `link`: Sends a verification link via email - `otp`: Sends a one-time password (OTP) via email */ export type NeonAuthEmailVerificationMethod = "link" | "otp"; export const NeonAuthEmailVerificationMethod = S.String; export interface NeonAuthEmailAndPasswordConfig { /** Whether email and password authentication is enabled */ enabled: boolean; /** Controls how email addresses are verified during sign-up or sign-in. - `link`: sends a verification link to the user's email address - `otp`: sends a one-time password to the user's email address */ email_verification_method: NeonAuthEmailVerificationMethod; /** Whether email verification is required before users can sign in */ require_email_verification: boolean; /** Whether users are automatically signed in after verifying their email */ auto_sign_in_after_verification: boolean; /** Whether to send a verification email when users sign up */ send_verification_email_on_sign_up: boolean; /** Whether to send a verification email when users sign in */ send_verification_email_on_sign_in: boolean; /** Whether to disable new user sign ups */ disable_sign_up: boolean; } export const NeonAuthEmailAndPasswordConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, email_verification_method: NeonAuthEmailVerificationMethod, require_email_verification: S.Boolean, auto_sign_in_after_verification: S.Boolean, send_verification_email_on_sign_up: S.Boolean, send_verification_email_on_sign_in: S.Boolean, disable_sign_up: S.Boolean, }), ).annotate({ identifier: "NeonAuthEmailAndPasswordConfig", }) as any as S.Schema; export interface GetNeonAuthEmailProviderRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthEmailProviderRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/email_provider", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthEmailProviderRequest", }) as any as S.Schema; export interface StandardEmailServerResponse { /** Hostname of the email server. */ host: string; /** TCP port of the SMTP server. Common values: 25 (SMTP), 465 (SMTPS), 587 (submission). */ port: number; /** Username for authenticating with the SMTP server. */ username: string; /** On GET, returned redacted (empty) for ordinary callers, while callers with project-credential read permission receive the stored password — do not assume this field is empty. Update (PATCH) responses always return it redacted (empty) regardless of permission. Provide a value on update to set or rotate the password. */ password: string | Redacted.Redacted; /** Email address used as the From address on outgoing auth emails. */ sender_email: string; /** Display name shown as the sender in outgoing emails. */ sender_name: string; } export const StandardEmailServerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.String, port: S.Number, username: S.String, password: S.String.pipe(T.SensitiveValue({})), sender_email: S.String, sender_name: S.String, }), ).annotate({ identifier: "StandardEmailServerResponse", }) as any as S.Schema; export interface SharedEmailServer { /** Email address used as the sender for outgoing messages from this shared email server. */ sender_email?: string; /** Display name shown as the sender in outgoing emails. */ sender_name?: string; } export const SharedEmailServer = /*@__PURE__*/ S.suspend(() => S.Struct({ sender_email: S.optional(S.String), sender_name: S.optional(S.String), }), ).annotate({ identifier: "SharedEmailServer", }) as any as S.Schema; export type NeonAuthEmailServerConfigResponse = | StandardEmailServerResponse | SharedEmailServer; export const NeonAuthEmailServerConfigResponse = S.Unknown as any as S.Schema; export type GetNeonAuthEmailProviderResponse = NeonAuthEmailServerConfigResponse; export const GetNeonAuthEmailProviderResponse = /*@__PURE__*/ S.suspend(() => NeonAuthEmailServerConfigResponse.pipe(T.RawResponseRoot()), ).annotate({ identifier: "GetNeonAuthEmailProviderResponse", }) as any as S.Schema; export interface GetNeonAuthPhoneNumberPluginRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthPhoneNumberPluginRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/plugins/phone-number", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthPhoneNumberPluginRequest", }) as any as S.Schema; export interface NeonAuthPhoneNumberConfig { /** Whether the phone number plugin is enabled. */ enabled: boolean; /** Time in seconds before the OTP expires */ otp_expires_in?: number; } export const NeonAuthPhoneNumberConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, otp_expires_in: S.optional(S.Number), }), ).annotate({ identifier: "NeonAuthPhoneNumberConfig", }) as any as S.Schema; export interface GetNeonAuthPluginConfigsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthPluginConfigsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/plugins", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthPluginConfigsRequest", }) as any as S.Schema; /** Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ export type NeonAuthOrganizationConfigCreatorRole = "admin" | "owner"; export const NeonAuthOrganizationConfigCreatorRole = S.String; export interface NeonAuthOrganizationConfig { /** Whether the organization plugin is enabled. */ enabled: boolean; /** Maximum organizations a user can belong to (created or joined). At the limit, the user cannot create or join more. */ organization_limit: number; /** Maximum number of members per organization. */ membership_limit: number; /** Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ creator_role: NeonAuthOrganizationConfigCreatorRole; /** Whether to send invitation emails when inviting members to an organization. */ send_invitation_email: boolean; } export const NeonAuthOrganizationConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, organization_limit: S.Number, membership_limit: S.Number, creator_role: NeonAuthOrganizationConfigCreatorRole, send_invitation_email: S.Boolean, }), ).annotate({ identifier: "NeonAuthOrganizationConfig", }) as any as S.Schema; export interface NeonAuthMagicLinkConfig { /** Whether the magic link plugin is enabled. */ enabled: boolean; /** Minutes until the magic link expires. */ expires_in: number; /** Whether to disable sign-up via magic link. */ disable_sign_up: boolean; } export const NeonAuthMagicLinkConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, expires_in: S.Number, disable_sign_up: S.Boolean, }), ).annotate({ identifier: "NeonAuthMagicLinkConfig", }) as any as S.Schema; /** OAuth provider configurations enabled for this auth setup. */ export type NeonAuthPluginConfigsOauthProvidersList = Array; export const NeonAuthPluginConfigsOauthProvidersList = /*@__PURE__*/ S.Array( NeonAuthOauthProvider, ) as any as S.Schema; /** Aggregated plugin configurations for Neon Auth */ export interface NeonAuthPluginConfigs { /** Configuration for the Neon Auth organization plugin, which enables user organizations within the authentication system. This is distinct from a Neon platform organization. */ organization?: NeonAuthOrganizationConfig; /** Configuration for passwordless magic-link email authentication. */ magic_link?: NeonAuthMagicLinkConfig; /** Configuration for the phone number authentication plugin. */ phone_number?: NeonAuthPhoneNumberConfig; /** Email server configuration used to send authentication emails. */ email_provider?: NeonAuthEmailServerConfigResponse; /** Configuration for email and password authentication. */ email_and_password?: NeonAuthEmailAndPasswordConfig; /** OAuth provider configurations enabled for this auth setup. */ oauth_providers?: NeonAuthPluginConfigsOauthProvidersList; /** Permits authentication requests from localhost origins when true. Intended for local development; disable in production environments. */ allow_localhost?: boolean; } export const NeonAuthPluginConfigs = /*@__PURE__*/ S.suspend(() => S.Struct({ organization: S.optional(NeonAuthOrganizationConfig), magic_link: S.optional(NeonAuthMagicLinkConfig), phone_number: S.optional(NeonAuthPhoneNumberConfig), email_provider: S.optional(NeonAuthEmailServerConfigResponse), email_and_password: S.optional(NeonAuthEmailAndPasswordConfig), oauth_providers: S.optional(NeonAuthPluginConfigsOauthProvidersList), allow_localhost: S.optional(S.Boolean), }), ).annotate({ identifier: "NeonAuthPluginConfigs", }) as any as S.Schema; export interface GetNeonAuthWebhookConfigRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetNeonAuthWebhookConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/webhooks", code: 200, }), ), ).annotate({ identifier: "GetNeonAuthWebhookConfigRequest", }) as any as S.Schema; export type NeonAuthWebhookConfigEnabledEventsItem = | "user.before_create" | "user.created" | "send.otp" | "send.magic_link" | "organization.invitation.created" | "organization.invitation.accepted" | "phone_number.verified"; export const NeonAuthWebhookConfigEnabledEventsItem = S.String; /** Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values. */ export type NeonAuthWebhookConfigEnabledEventsList = Array; export const NeonAuthWebhookConfigEnabledEventsList = /*@__PURE__*/ S.Array( NeonAuthWebhookConfigEnabledEventsItem, ) as any as S.Schema; export interface NeonAuthWebhookConfig { /** Whether the webhook is active. */ enabled: boolean; /** Destination URL that receives webhook event payloads. */ webhook_url?: string; /** Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values. */ enabled_events?: NeonAuthWebhookConfigEnabledEventsList; /** Maximum time, in seconds, to wait for a response from the webhook endpoint. */ timeout_seconds?: number; } export const NeonAuthWebhookConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, webhook_url: S.optional(S.String), enabled_events: S.optional(NeonAuthWebhookConfigEnabledEventsList), timeout_seconds: S.optional(S.Number), }), ).annotate({ identifier: "NeonAuthWebhookConfig", }) as any as S.Schema; export interface GetOrganizationRequest { /** The Neon organization ID */ org_id: string; } export const GetOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/organizations/{org_id}", code: 200 })), ).annotate({ identifier: "GetOrganizationRequest", }) as any as S.Schema; export interface GetOrganizationInvitationsRequest { /** The Neon organization ID */ org_id: string; } export const GetOrganizationInvitationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/invitations", code: 200, }), ), ).annotate({ identifier: "GetOrganizationInvitationsRequest", }) as any as S.Schema; export interface GetOrganizationMemberRequest { /** The Neon organization ID */ org_id: string; /** The Neon organization member ID */ member_id: string; } export const GetOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), member_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/members/{member_id}", code: 200, }), ), ).annotate({ identifier: "GetOrganizationMemberRequest", }) as any as S.Schema; export interface Member { /** The organization member's ID. */ id: string; /** The Neon user ID. */ user_id: string; /** The Neon organization ID. Returned as `id` from `GET /users/me/organizations`. */ org_id: string; role: MemberRole; /** Timestamp when the user joined the organization. */ joined_at?: string; } export const Member = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, user_id: S.String, org_id: S.String, role: MemberRole, joined_at: S.optional(S.String), }), ).annotate({ identifier: "Member" }) as any as S.Schema; export type GetOrganizationMembersRequestSortBy = | "email" | "role" | "joined_at"; export const GetOrganizationMembersRequestSortBy = S.String; export type GetOrganizationMembersRequestSortOrder = "asc" | "desc"; export const GetOrganizationMembersRequestSortOrder = S.String; export interface GetOrganizationMembersRequest { /** The Neon organization ID */ org_id: string; /** Sort the members by the specified field. Defaults to `joined_at`. */ sort_by?: GetOrganizationMembersRequestSortBy | (string & {}); /** A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list. */ cursor?: string; /** Defines the sorting order of entities. */ sort_order?: GetOrganizationMembersRequestSortOrder | (string & {}); /** The maximum number of members to return in the response */ limit?: number; } export const GetOrganizationMembersRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), sort_by: S.optional(GetOrganizationMembersRequestSortBy.pipe(T.Query())), cursor: S.optional(S.String.pipe(T.Query())), sort_order: S.optional( GetOrganizationMembersRequestSortOrder.pipe(T.Query()), ), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/members", code: 200, }), ), ).annotate({ identifier: "GetOrganizationMembersRequest", }) as any as S.Schema; export interface MemberUserInfo { /** Email address of the organization member's user account. */ email: string; /** Whether the member has MFA (TOTP) enabled */ has_mfa?: boolean; /** Timestamp of when the user account was deactivated. Absent for active users. When present, the UI should render a "Deactivated" badge inline next to the member. */ deactivated_at?: string; } export const MemberUserInfo = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.String, has_mfa: S.optional(S.Boolean), deactivated_at: S.optional(S.String), }), ).annotate({ identifier: "MemberUserInfo" }) as any as S.Schema; export interface MemberWithUser { /** Membership record for the user in the organization. */ member: Member; /** Profile information for the organization member. */ user: MemberUserInfo; } export const MemberWithUser = /*@__PURE__*/ S.suspend(() => S.Struct({ member: Member, user: MemberUserInfo, }), ).annotate({ identifier: "MemberWithUser" }) as any as S.Schema; /** Members of the organization, each combining membership details (role, status) with the associated user's identity. */ export type GetOrganizationMembersResponseMembersList = Array; export const GetOrganizationMembersResponseMembersList = /*@__PURE__*/ S.Array( MemberWithUser, ) as any as S.Schema; /** To paginate the response, issue an initial request with `limit` value. Then, add the value returned in the response `.pagination.next` attribute into the request under the `cursor` query parameter to the subsequent request to retrieve next page in pagination. The contents on cursor `next` are opaque, clients are not expected to make any assumptions on the format of the data inside the cursor. */ export interface CursorPagination { /** Cursor for the next page of results. Pass it as the `cursor` query parameter on the next request. Absent on the last page. */ next?: string; /** Field by which the results were sorted, echoing the request's sort_by parameter. */ sort_by?: string; /** Sort order active for this page. Pass back as `sort_order` in the next request to maintain consistent ordering. Valid values are `asc` and `desc`. */ sort_order?: string; } export const CursorPagination = /*@__PURE__*/ S.suspend(() => S.Struct({ next: S.optional(S.String), sort_by: S.optional(S.String), sort_order: S.optional(S.String), }), ).annotate({ identifier: "CursorPagination", }) as any as S.Schema; export interface GetOrganizationMembersResponse { /** Members of the organization, each combining membership details (role, status) with the associated user's identity. */ members: GetOrganizationMembersResponseMembersList; pagination?: CursorPagination; } export const GetOrganizationMembersResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ members: GetOrganizationMembersResponseMembersList, pagination: S.optional(CursorPagination), }), ).annotate({ identifier: "GetOrganizationMembersResponse", }) as any as S.Schema; export interface GetOrganizationSpendingLimitRequest { /** The Neon organization ID */ org_id: string; } export const GetOrganizationSpendingLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/billing/spending_limit", code: 200, }), ), ).annotate({ identifier: "GetOrganizationSpendingLimitRequest", }) as any as S.Schema; export interface SpendingLimitResponse { /** Monthly spending cap in cents. `null` indicates that no limit is currently configured. */ spending_limit_cents: number | null; } export const SpendingLimitResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ spending_limit_cents: S.NullOr(S.Number), }), ).annotate({ identifier: "SpendingLimitResponse", }) as any as S.Schema; export interface GetOrganizationVPCEndpointDetailsRequest { /** The Neon organization ID */ org_id: string; /** The Neon region ID. Azure regions are currently not supported. */ region_id: string; /** The VPC endpoint ID */ vpc_endpoint_id: string; } export const GetOrganizationVPCEndpointDetailsRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ org_id: S.String.pipe(T.Label()), region_id: S.String.pipe(T.Label()), vpc_endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}", code: 200, }), ), ).annotate({ identifier: "GetOrganizationVPCEndpointDetailsRequest", }) as any as S.Schema; /** A list of example projects that are restricted to use this VPC endpoint. There are at most 3 projects in the list, even if more projects are restricted. */ export type VPCEndpointDetailsExampleRestrictedProjectsList = Array; export const VPCEndpointDetailsExampleRestrictedProjectsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface VPCEndpointDetails { /** Cloud provider identifier for the VPC endpoint. */ vpc_endpoint_id: string; /** A descriptive label for the VPC endpoint */ label: string; /** The current state of the VPC endpoint. `new` means the endpoint has just been configured and is pending acceptance by Neon. `accepted` means the VPC connection has been accepted by Neon. */ state: string; /** The number of projects that are restricted to use this VPC endpoint. */ num_restricted_projects: number; /** A list of example projects that are restricted to use this VPC endpoint. There are at most 3 projects in the list, even if more projects are restricted. */ example_restricted_projects: VPCEndpointDetailsExampleRestrictedProjectsList; } export const VPCEndpointDetails = /*@__PURE__*/ S.suspend(() => S.Struct({ vpc_endpoint_id: S.String, label: S.String, state: S.String, num_restricted_projects: S.Number, example_restricted_projects: VPCEndpointDetailsExampleRestrictedProjectsList, }), ).annotate({ identifier: "VPCEndpointDetails", }) as any as S.Schema; export interface GetProjectRequest { /** The Neon project ID */ project_id: string; } export const GetProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/projects/{project_id}", code: 200 })), ).annotate({ identifier: "GetProjectRequest", }) as any as S.Schema; /** Category of an advisor issue */ export type AdvisorCategory = "SECURITY" | "PERFORMANCE"; export const AdvisorCategory = S.String; export type GetProjectAdvisorSecurityIssuesRequestMinSeverity = | "INFO" | "WARN" | "ERROR"; export const GetProjectAdvisorSecurityIssuesRequestMinSeverity = S.String; export interface GetProjectAdvisorSecurityIssuesRequest { /** Neon project ID */ project_id: string; /** Branch ID to analyze. If not specified, the project's default branch is used. */ branch_id?: string; /** Database name to analyze. Required if branch has multiple databases. */ database_name?: string; /** Filter issues by category */ category?: AdvisorCategory | (string & {}); /** Minimum severity level to include. For example, WARN returns WARN and ERROR issues, excluding INFO. */ min_severity?: | GetProjectAdvisorSecurityIssuesRequestMinSeverity | (string & {}); } export const GetProjectAdvisorSecurityIssuesRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.optional(S.String.pipe(T.Query())), database_name: S.optional(S.String.pipe(T.Query())), category: S.optional(AdvisorCategory.pipe(T.Query())), min_severity: S.optional( GetProjectAdvisorSecurityIssuesRequestMinSeverity.pipe(T.Query()), ), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/advisors", code: 200, }), ), ).annotate({ identifier: "GetProjectAdvisorSecurityIssuesRequest", }) as any as S.Schema; /** Whether this issue affects external API exposure or is internal only */ export type AdvisorIssueFacing = "EXTERNAL" | "INTERNAL"; export const AdvisorIssueFacing = S.String; /** Categories this issue belongs to */ export type AdvisorIssueCategoriesList = Array; export const AdvisorIssueCategoriesList = /*@__PURE__*/ S.Array( AdvisorCategory, ) as any as S.Schema; /** Additional context-specific metadata */ export type AdvisorIssueMetadataMap = { [key: string]: unknown | undefined }; export const AdvisorIssueMetadataMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export interface AdvisorIssue { /** Unique identifier for the issue type */ name: string; /** Human-readable title */ title: string; /** Severity level of the issue */ level: string; /** Whether this issue affects external API exposure or is internal only */ facing: AdvisorIssueFacing; /** Categories this issue belongs to */ categories: AdvisorIssueCategoriesList; /** Detailed description of what this check detects */ description: string; /** Specific details about this instance of the issue */ detail: string; /** URL to documentation on how to fix this issue */ remediation: string; /** Additional context-specific metadata */ metadata: AdvisorIssueMetadataMap; /** Unique key for caching this issue result */ cache_key: string; } export const AdvisorIssue = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, title: S.String, level: S.String, facing: AdvisorIssueFacing, categories: AdvisorIssueCategoriesList, description: S.String, detail: S.String, remediation: S.String, metadata: AdvisorIssueMetadataMap, cache_key: S.String, }), ).annotate({ identifier: "AdvisorIssue" }) as any as S.Schema; export type GetProjectAdvisorSecurityIssuesResponseIssuesList = Array; export const GetProjectAdvisorSecurityIssuesResponseIssuesList = /*@__PURE__*/ S.Array( AdvisorIssue, ) as any as S.Schema; export interface GetProjectAdvisorSecurityIssuesResponse { issues: GetProjectAdvisorSecurityIssuesResponseIssuesList; } export const GetProjectAdvisorSecurityIssuesResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ issues: GetProjectAdvisorSecurityIssuesResponseIssuesList, }), ).annotate({ identifier: "GetProjectAdvisorSecurityIssuesResponse", }) as any as S.Schema; export interface GetProjectBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const GetProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchRequest", }) as any as S.Schema; export interface AnnotationObjectData { /** Kind of resource the annotation is attached to, for example "branch" or "endpoint". */ type: string; /** The annotated object's ID. */ id: string; } export const AnnotationObjectData = /*@__PURE__*/ S.suspend(() => S.Struct({ type: S.String, id: S.String, }), ).annotate({ identifier: "AnnotationObjectData", }) as any as S.Schema; export interface AnnotationData { /** Resource that this annotation is attached to. */ object: AnnotationObjectData; value: AnnotationValueData; /** Timestamp when the annotation was created, in RFC 3339 format (UTC). */ created_at?: string; /** Timestamp of the most recent update to the annotation, in RFC 3339 format (UTC). */ updated_at?: string; } export const AnnotationData = /*@__PURE__*/ S.suspend(() => S.Struct({ object: AnnotationObjectData, value: AnnotationValueData, created_at: S.optional(S.String), updated_at: S.optional(S.String), }), ).annotate({ identifier: "AnnotationData" }) as any as S.Schema; export interface GetProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; /** Annotation data associated with the annotated object. */ annotation: AnnotationData; } export const GetProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, annotation: AnnotationData, }), ).annotate({ identifier: "GetProjectBranchResponse", }) as any as S.Schema; export interface GetProjectBranchAiGatewayRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetProjectBranchAiGatewayRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/ai_gateway", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchAiGatewayRequest", }) as any as S.Schema; export interface BranchAiGateway { /** Always `true` in 200 responses. Present for forward compatibility, mirroring BranchStorage.enabled. */ enabled: boolean; /** The AI-gateway endpoint root for this branch — an OpenAI-compatible base URL. No dialect path is included; clients append the route (e.g. `/ai-gateway/openai/v1/responses`) themselves. */ base_url: string; } export const BranchAiGateway = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, base_url: S.String, }), ).annotate({ identifier: "BranchAiGateway", }) as any as S.Schema; export interface GetProjectBranchBucketObjectRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; /** The object key. Keys may contain `/`; the `/` characters of nested keys must be percent-encoded (`%2F`) in the path segment. */ object_key: string; } export const GetProjectBranchBucketObjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), object_key: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}/download", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchBucketObjectRequest", }) as any as S.Schema; export interface GetProjectBranchBucketObjectResponse {} export const GetProjectBranchBucketObjectResponse = /*@__PURE__*/ S.suspend( () => S.Struct({}), ).annotate({ identifier: "GetProjectBranchBucketObjectResponse", }) as any as S.Schema; export interface GetProjectBranchDataAPIRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The database name */ database_name: string; } export const GetProjectBranchDataAPIRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchDataAPIRequest", }) as any as S.Schema; /** List of available database schemas (SubZero only) */ export type DataAPIReponseAvailableSchemasList = Array; export const DataAPIReponseAvailableSchemasList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Neon Data API response */ export interface DataAPIReponse { /** The URL of the Neon Data API */ url: string; /** The status of the Neon Data API deployment */ status: string; /** Configuration settings for the Data API (SubZero only) */ settings?: DataAPISettings | null; /** List of available database schemas (SubZero only) */ available_schemas?: DataAPIReponseAvailableSchemasList | null; } export const DataAPIReponse = /*@__PURE__*/ S.suspend(() => S.Struct({ url: S.String, status: S.String, settings: S.optional(S.NullOr(DataAPISettings)), available_schemas: S.optional(S.NullOr(DataAPIReponseAvailableSchemasList)), }), ).annotate({ identifier: "DataAPIReponse" }) as any as S.Schema; export interface GetProjectBranchDatabaseRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The database name */ database_name: string; } export const GetProjectBranchDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchDatabaseRequest", }) as any as S.Schema; export interface DatabaseResponse { /** Database object returned by the operation. */ database: Database; } export const DatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ database: Database, }), ).annotate({ identifier: "DatabaseResponse", }) as any as S.Schema; export interface GetProjectBranchFunctionRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The function slug */ slug: string; } export const GetProjectBranchFunctionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), slug: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/functions/{slug}", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchFunctionRequest", }) as any as S.Schema; export interface NeonFunction { /** Opaque, stable function identifier. */ id: string; /** Branch-unique, lowercase DNS-label. Forms the invocation URL's host together with the branch id. Immutable. */ slug: string; /** Free-form display name. */ name: string; /** URL at which the function is invoked. The host carries `-` as its first DNS label under a Neon-managed functions domain, and the URL ends with a trailing slash so paths concatenate onto it. Empty string when the function has no servable invoke host (e.g. a deployment without an invocation front-door). */ invocation_url: string; /** The most recent deployment, regardless of build status. It may still be building or it may have failed. Omitted until the first deployment is created. */ current_deployment?: NeonFunctionDeployment; /** The most recent deployment whose build completed successfully. This is the deployment that serves invocations. Omitted until a deployment succeeds. */ active_deployment?: NeonFunctionDeployment; created_at: string; } export const NeonFunction = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, slug: S.String, name: S.String, invocation_url: S.String, current_deployment: S.optional(NeonFunctionDeployment), active_deployment: S.optional(NeonFunctionDeployment), created_at: S.String, }), ).annotate({ identifier: "NeonFunction" }) as any as S.Schema; export interface NeonFunctionResponse { function: NeonFunction; } export const NeonFunctionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ function: NeonFunction, }), ).annotate({ identifier: "NeonFunctionResponse", }) as any as S.Schema; export interface GetProjectBranchRoleRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The role name */ role_name: string; } export const GetProjectBranchRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), role_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchRoleRequest", }) as any as S.Schema; export interface RoleResponse { /** Role details for the requested database role. The `password` field is included in the response when a role is created or its password is reset, and is not returned in subsequent read requests. Store it securely at that time. */ role: Role; } export const RoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ role: Role, }), ).annotate({ identifier: "RoleResponse" }) as any as S.Schema; export interface GetProjectBranchRolePasswordRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The role name */ role_name: string; } export const GetProjectBranchRolePasswordRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), role_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchRolePasswordRequest", }) as any as S.Schema; export interface RolePasswordResponse { /** The role password */ password: string | Redacted.Redacted; } export const RolePasswordResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ password: S.String.pipe(T.SensitiveValue({})), }), ).annotate({ identifier: "RolePasswordResponse", }) as any as S.Schema; export interface GetProjectBranchSchemaRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** Name of the database for which the schema is retrieved */ db_name: string; /** The Log Sequence Number (LSN) for which the schema is retrieved */ lsn?: string; /** The point in time for which the schema is retrieved */ timestamp?: string; /** The format of the schema to retrieve. Possible values: - `sql` (default) - `json` */ format?: string; } export const GetProjectBranchSchemaRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), db_name: S.String.pipe(T.Query()), lsn: S.optional(S.String.pipe(T.Query())), timestamp: S.optional(S.String.pipe(T.Query())), format: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/schema", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchSchemaRequest", }) as any as S.Schema; export interface BranchSchemaJSONTablesItemColumnsItem { /** Name of the column. */ name: string; /** Postgres data type of the column, for example "integer" or "text". */ type: string; /** Whether the column allows NULL values */ nullable?: boolean; /** Whether the column is a generated (computed) column */ generated?: boolean; } export const BranchSchemaJSONTablesItemColumnsItem = /*@__PURE__*/ S.suspend( () => S.Struct({ name: S.String, type: S.String, nullable: S.optional(S.Boolean), generated: S.optional(S.Boolean), }), ).annotate({ identifier: "BranchSchemaJSONTablesItemColumnsItem", }) as any as S.Schema; /** Columns belonging to this table, each describing a column's name and attributes. */ export type BranchSchemaJSONTablesItemColumnsList = Array; export const BranchSchemaJSONTablesItemColumnsList = /*@__PURE__*/ S.Array( BranchSchemaJSONTablesItemColumnsItem, ) as any as S.Schema; /** Column names participating in this constraint */ export type BranchSchemaJSONTablesItemConstraintsItemColumnsList = Array; export const BranchSchemaJSONTablesItemConstraintsItemColumnsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Names of the referenced columns */ export type BranchSchemaJSONTablesItemConstraintsItemReferencedTableColumnsList = Array; export const BranchSchemaJSONTablesItemConstraintsItemReferencedTableColumnsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** For foreign keys - the referenced table information */ export interface BranchSchemaJSONTablesItemConstraintsItemReferencedTable { /** Schema of the referenced table */ schema: string; /** Name of the referenced table */ table: string; /** Names of the referenced columns */ columns: BranchSchemaJSONTablesItemConstraintsItemReferencedTableColumnsList; } export const BranchSchemaJSONTablesItemConstraintsItemReferencedTable = /*@__PURE__*/ S.suspend(() => S.Struct({ schema: S.String, table: S.String, columns: BranchSchemaJSONTablesItemConstraintsItemReferencedTableColumnsList, }), ).annotate({ identifier: "BranchSchemaJSONTablesItemConstraintsItemReferencedTable", }) as any as S.Schema; export interface BranchSchemaJSONTablesItemConstraintsItem { /** Type of constraint. Possible values: `primary_key`, `unique`, `foreign_key` */ type: string; /** Column names participating in this constraint */ columns: BranchSchemaJSONTablesItemConstraintsItemColumnsList; /** Optional name of the constraint */ name?: string; /** For foreign keys - the referenced table information */ referenced_table?: BranchSchemaJSONTablesItemConstraintsItemReferencedTable; } export const BranchSchemaJSONTablesItemConstraintsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: S.String, columns: BranchSchemaJSONTablesItemConstraintsItemColumnsList, name: S.optional(S.String), referenced_table: S.optional( BranchSchemaJSONTablesItemConstraintsItemReferencedTable, ), }), ).annotate({ identifier: "BranchSchemaJSONTablesItemConstraintsItem", }) as any as S.Schema; /** Table constraints defined in the branch schema, such as primary key, foreign key, unique, and check constraints. */ export type BranchSchemaJSONTablesItemConstraintsList = Array; export const BranchSchemaJSONTablesItemConstraintsList = /*@__PURE__*/ S.Array( BranchSchemaJSONTablesItemConstraintsItem, ) as any as S.Schema; export interface BranchSchemaJSONTablesItem { /** Postgres schema (namespace) that contains the table, for example `public`. */ schema: string; /** Name of the table within the schema. */ name: string; /** Columns belonging to this table, each describing a column's name and attributes. */ columns: BranchSchemaJSONTablesItemColumnsList; /** Table constraints defined in the branch schema, such as primary key, foreign key, unique, and check constraints. */ constraints?: BranchSchemaJSONTablesItemConstraintsList; } export const BranchSchemaJSONTablesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ schema: S.String, name: S.String, columns: BranchSchemaJSONTablesItemColumnsList, constraints: S.optional(BranchSchemaJSONTablesItemConstraintsList), }), ).annotate({ identifier: "BranchSchemaJSONTablesItem", }) as any as S.Schema; /** Tables present in the branch schema. */ export type BranchSchemaJSONTablesList = Array; export const BranchSchemaJSONTablesList = /*@__PURE__*/ S.Array( BranchSchemaJSONTablesItem, ) as any as S.Schema; export interface BranchSchemaJSON { /** Tables present in the branch schema. */ tables: BranchSchemaJSONTablesList; } export const BranchSchemaJSON = /*@__PURE__*/ S.suspend(() => S.Struct({ tables: BranchSchemaJSONTablesList, }), ).annotate({ identifier: "BranchSchemaJSON", }) as any as S.Schema; export interface BranchSchemaResponse { /** Branch schema expressed as SQL DDL statements. */ sql?: string; /** Branch schema represented as a structured JSON object, parallel to the SQL DDL in `sql`. */ json?: BranchSchemaJSON; } export const BranchSchemaResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ sql: S.optional(S.String), json: S.optional(BranchSchemaJSON), }), ).annotate({ identifier: "BranchSchemaResponse", }) as any as S.Schema; export interface GetProjectBranchSchemaComparisonRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The branch ID to compare the schema with */ base_branch_id?: string; /** Name of the database for which the schema is retrieved */ db_name: string; /** The Log Sequence Number (LSN) for which the schema is retrieved */ lsn?: string; /** The point in time for which the schema is retrieved */ timestamp?: string; /** The Log Sequence Number (LSN) for the base branch schema */ base_lsn?: string; /** The point in time for the base branch schema */ base_timestamp?: string; } export const GetProjectBranchSchemaComparisonRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), base_branch_id: S.optional(S.String.pipe(T.Query())), db_name: S.String.pipe(T.Query()), lsn: S.optional(S.String.pipe(T.Query())), timestamp: S.optional(S.String.pipe(T.Query())), base_lsn: S.optional(S.String.pipe(T.Query())), base_timestamp: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/compare_schema", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchSchemaComparisonRequest", }) as any as S.Schema; export interface BranchSchemaCompareResponse { /** Unified diff of the SQL schema changes between the compared branches. */ diff?: string; } export const BranchSchemaCompareResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ diff: S.optional(S.String), }), ).annotate({ identifier: "BranchSchemaCompareResponse", }) as any as S.Schema; export interface GetProjectBranchStorageRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const GetProjectBranchStorageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/storage", code: 200, }), ), ).annotate({ identifier: "GetProjectBranchStorageRequest", }) as any as S.Schema; export interface BranchStorage { /** Always `true` in 200 responses. Present for forward compatibility: a future version may add intermediate states; callers should treat `true` as "object storage is usable for this branch right now." */ enabled: boolean; /** The S3-compatible endpoint URL for this branch. */ s3_endpoint: string; /** The AWS region for this branch's object storage. The platform normalizes the us-east-1 convention server-side: a non-empty region string is always returned in 200 responses (e.g. `"us-east-1"` for the S3 default region). */ region: string; /** Whether the S3 client must use path-style addressing (bucket-in-path rather than virtual-hosted subdomain). Always true: the wildcard TLS cert covers one level of subdomain (*.storage.), so the branch ID occupies that label and the bucket name must travel in the request path, not as a further subdomain. Callers must set the S3 SDK's ForcePathStyle (or equivalent) to true. */ force_path_style: boolean; } export const BranchStorage = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, s3_endpoint: S.String, region: S.String, force_path_style: S.Boolean, }), ).annotate({ identifier: "BranchStorage" }) as any as S.Schema; export interface GetProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; } export const GetProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/endpoints/{endpoint_id}", code: 200, }), ), ).annotate({ identifier: "GetProjectEndpointRequest", }) as any as S.Schema; export interface EndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; } export const EndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, }), ).annotate({ identifier: "EndpointResponse", }) as any as S.Schema; export interface GetProjectJWKSRequest { /** The Neon project ID */ project_id: string; } export const GetProjectJWKSRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/jwks", code: 200 }), ), ).annotate({ identifier: "GetProjectJWKSRequest", }) as any as S.Schema; /** JWKS configurations associated with the project. */ export type ProjectJWKSResponseJwksList = Array; export const ProjectJWKSResponseJwksList = /*@__PURE__*/ S.Array( JWKS, ) as any as S.Schema; /** The list of configured JWKS definitions for a project */ export interface ProjectJWKSResponse { /** JWKS configurations associated with the project. */ jwks: ProjectJWKSResponseJwksList; } export const ProjectJWKSResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ jwks: ProjectJWKSResponseJwksList, }), ).annotate({ identifier: "ProjectJWKSResponse", }) as any as S.Schema; export interface GetProjectOperationRequest { /** The Neon project ID */ project_id: string; /** The operation ID */ operation_id: string; } export const GetProjectOperationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), operation_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/operations/{operation_id}", code: 200, }), ), ).annotate({ identifier: "GetProjectOperationRequest", }) as any as S.Schema; export interface OperationResponse { operation: Operation; } export const OperationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ operation: Operation, }), ).annotate({ identifier: "OperationResponse", }) as any as S.Schema; export interface GetSnapshotScheduleRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const GetSnapshotScheduleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/backup_schedule", code: 200, }), ), ).annotate({ identifier: "GetSnapshotScheduleRequest", }) as any as S.Schema; export interface BackupScheduleItem { /** How often to take snapshots. Known values: `daily`, `weekly`, `monthly`. */ frequency: string; /** The hour of the day to take the snapshot (if applicable). */ hour?: number; /** The day of the week or month to take the snapshot (if applicable). */ day?: number; /** The month of the year to take the snapshot (if applicable). */ month?: number; /** How long to keep a scheduled snapshot (in seconds) before it's automatically deleted. The default is 3024000 seconds (35 days), which is also the maximum. Manually created snapshots have no maximum retention: set their `expires_at` instead. */ retention_seconds?: number; } export const BackupScheduleItem = /*@__PURE__*/ S.suspend(() => S.Struct({ frequency: S.String, hour: S.optional(S.Number), day: S.optional(S.Number), month: S.optional(S.Number), retention_seconds: S.optional(S.Number), }), ).annotate({ identifier: "BackupScheduleItem", }) as any as S.Schema; /** List of schedule entries defining the backup frequency. At least one entry is required. */ export type BackupScheduleScheduleList = Array; export const BackupScheduleScheduleList = /*@__PURE__*/ S.Array( BackupScheduleItem, ) as any as S.Schema; export interface BackupSchedule { /** List of schedule entries defining the backup frequency. At least one entry is required. */ schedule: BackupScheduleScheduleList; } export const BackupSchedule = /*@__PURE__*/ S.suspend(() => S.Struct({ schedule: BackupScheduleScheduleList, }), ).annotate({ identifier: "BackupSchedule" }) as any as S.Schema; export interface GrantPermissionToProjectRequest { project_id: string; /** Email address of the user to grant project access to. */ email: string; } export const GrantPermissionToProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), email: S.String, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/permissions", code: 200, }), ), ).annotate({ identifier: "GrantPermissionToProjectRequest", }) as any as S.Schema; export interface ProjectPermission { /** The project permission's ID. */ id: string; /** Email address of the user who has been granted access to the project. */ granted_to_email: string; /** Timestamp when the permission was granted. */ granted_at: string; /** Timestamp when the permission was revoked. Null if the permission is still active. */ revoked_at?: string; } export const ProjectPermission = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, granted_to_email: S.String, granted_at: S.String, revoked_at: S.optional(S.String), }), ).annotate({ identifier: "ProjectPermission", }) as any as S.Schema; export interface ListApiKeysRequest {} export const ListApiKeysRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/api_keys", code: 200 })), ).annotate({ identifier: "ListApiKeysRequest", }) as any as S.Schema; /** The user data of the user that created this API key. */ export interface ApiKeyCreatorData { /** ID of the user who created this API key */ id: string; /** Display name of the user who created the API key. */ name: string; /** The URL to the user's avatar image. */ image: string; } export const ApiKeyCreatorData = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, image: S.String, }), ).annotate({ identifier: "ApiKeyCreatorData", }) as any as S.Schema; export interface ApiKeysListResponseItem { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; created_by: ApiKeyCreatorData; /** A timestamp indicating when the API was last used */ last_used_at?: string | null; /** The IP address from which the API key was last used */ last_used_from_addr: string; } export const ApiKeysListResponseItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, name: S.String, created_at: S.String, created_by: ApiKeyCreatorData, last_used_at: S.optional(S.NullOr(S.String)), last_used_from_addr: S.String, }), ).annotate({ identifier: "ApiKeysListResponseItem", }) as any as S.Schema; export type ListApiKeysResponseBodyList = Array; export const ListApiKeysResponseBodyList = /*@__PURE__*/ S.Array( ApiKeysListResponseItem, ) as any as S.Schema; export type ListApiKeysResponse = ListApiKeysResponseBodyList; export const ListApiKeysResponse = /*@__PURE__*/ S.suspend(() => ListApiKeysResponseBodyList.pipe(T.RawResponseRoot()), ).annotate({ identifier: "ListApiKeysResponse", }) as any as S.Schema; export interface ListBranchNeonAuthOauthProvidersRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const ListBranchNeonAuthOauthProvidersRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/oauth_providers", code: 200, }), ), ).annotate({ identifier: "ListBranchNeonAuthOauthProvidersRequest", }) as any as S.Schema; /** OAuth providers configured for Neon Auth on the project. */ export type ListNeonAuthOauthProvidersResponseProvidersList = Array; export const ListNeonAuthOauthProvidersResponseProvidersList = /*@__PURE__*/ S.Array( NeonAuthOauthProvider, ) as any as S.Schema; export interface ListNeonAuthOauthProvidersResponse { /** OAuth providers configured for Neon Auth on the project. */ providers: ListNeonAuthOauthProvidersResponseProvidersList; } export const ListNeonAuthOauthProvidersResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ providers: ListNeonAuthOauthProvidersResponseProvidersList, }), ).annotate({ identifier: "ListNeonAuthOauthProvidersResponse", }) as any as S.Schema; export interface ListBranchNeonAuthTrustedDomainsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const ListBranchNeonAuthTrustedDomainsRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/auth/domains", code: 200, }), ), ).annotate({ identifier: "ListBranchNeonAuthTrustedDomainsRequest", }) as any as S.Schema; export interface NeonAuthRedirectURIWhitelistDomain { /** Allowed redirect URI domain for the auth provider. */ domain: string; auth_provider: NeonAuthSupportedAuthProvider; } export const NeonAuthRedirectURIWhitelistDomain = /*@__PURE__*/ S.suspend(() => S.Struct({ domain: S.String, auth_provider: NeonAuthSupportedAuthProvider, }), ).annotate({ identifier: "NeonAuthRedirectURIWhitelistDomain", }) as any as S.Schema; /** Domains permitted as redirect URI targets in the whitelist. */ export type NeonAuthRedirectURIWhitelistResponseDomainsList = Array; export const NeonAuthRedirectURIWhitelistResponseDomainsList = /*@__PURE__*/ S.Array( NeonAuthRedirectURIWhitelistDomain, ) as any as S.Schema; export interface NeonAuthRedirectURIWhitelistResponse { /** Domains permitted as redirect URI targets in the whitelist. */ domains: NeonAuthRedirectURIWhitelistResponseDomainsList; } export const NeonAuthRedirectURIWhitelistResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ domains: NeonAuthRedirectURIWhitelistResponseDomainsList, }), ).annotate({ identifier: "NeonAuthRedirectURIWhitelistResponse", }) as any as S.Schema; export interface ListCredentialsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const ListCredentialsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/credentials", code: 200, }), ), ).annotate({ identifier: "ListCredentialsRequest", }) as any as S.Schema; export type CredentialMetaScopesList = Array; export const CredentialMetaScopesList = /*@__PURE__*/ S.Array( GrantedCredentialScope, ) as any as S.Schema; export interface CredentialMeta { /** Opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; token_id_short: string; /** Customer-supplied label; absent when not provided at issuance. */ name?: string; scopes: CredentialMetaScopesList; branch_id?: string; principal_type: string; function_id?: string; created_at: string; last_used_at?: string; revoked_at?: string; /** When the credential expires; absent means never expires. The verifier refuses to authenticate after `expires_at <= now()`. */ expires_at?: string; } export const CredentialMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ token_id: S.String, token_id_short: S.String, name: S.optional(S.String), scopes: CredentialMetaScopesList, branch_id: S.optional(S.String), principal_type: S.String, function_id: S.optional(S.String), created_at: S.String, last_used_at: S.optional(S.String), revoked_at: S.optional(S.String), expires_at: S.optional(S.String), }), ).annotate({ identifier: "CredentialMeta" }) as any as S.Schema; export type ListCredentialsResponseCredentialsList = Array; export const ListCredentialsResponseCredentialsList = /*@__PURE__*/ S.Array( CredentialMeta, ) as any as S.Schema; export interface ListCredentialsResponse { credentials: ListCredentialsResponseCredentialsList; } export const ListCredentialsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ credentials: ListCredentialsResponseCredentialsList, }), ).annotate({ identifier: "ListCredentialsResponse", }) as any as S.Schema; export interface ListOrganizationVPCEndpointsRequest { /** The Neon organization ID */ org_id: string; /** The Neon region ID */ region_id: string; } export const ListOrganizationVPCEndpointsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), region_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints", code: 200, }), ), ).annotate({ identifier: "ListOrganizationVPCEndpointsRequest", }) as any as S.Schema; export interface VPCEndpoint { /** Cloud provider identifier for the VPC endpoint. */ vpc_endpoint_id: string; /** A descriptive label for the VPC endpoint */ label: string; } export const VPCEndpoint = /*@__PURE__*/ S.suspend(() => S.Struct({ vpc_endpoint_id: S.String, label: S.String, }), ).annotate({ identifier: "VPCEndpoint" }) as any as S.Schema; /** List of VPC endpoints returned by the request. */ export type VPCEndpointsResponseEndpointsList = Array; export const VPCEndpointsResponseEndpointsList = /*@__PURE__*/ S.Array( VPCEndpoint, ) as any as S.Schema; export interface VPCEndpointsResponse { /** List of VPC endpoints returned by the request. */ endpoints: VPCEndpointsResponseEndpointsList; } export const VPCEndpointsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoints: VPCEndpointsResponseEndpointsList, }), ).annotate({ identifier: "VPCEndpointsResponse", }) as any as S.Schema; export interface ListOrganizationVPCEndpointsAllRegionsRequest { /** The Neon organization ID */ org_id: string; } export const ListOrganizationVPCEndpointsAllRegionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/vpc/vpc_endpoints", code: 200, }), ), ).annotate({ identifier: "ListOrganizationVPCEndpointsAllRegionsRequest", }) as any as S.Schema; export interface VPCEndpointWithRegion { /** Cloud provider identifier for the VPC endpoint. */ vpc_endpoint_id: string; /** A descriptive label for the VPC endpoint */ label: string; /** The region where the VPC endpoint is located */ region_id: string; } export const VPCEndpointWithRegion = /*@__PURE__*/ S.suspend(() => S.Struct({ vpc_endpoint_id: S.String, label: S.String, region_id: S.String, }), ).annotate({ identifier: "VPCEndpointWithRegion", }) as any as S.Schema; /** VPC endpoints associated with the region. */ export type VPCEndpointsWithRegionResponseEndpointsList = Array; export const VPCEndpointsWithRegionResponseEndpointsList = /*@__PURE__*/ S.Array( VPCEndpointWithRegion, ) as any as S.Schema; export interface VPCEndpointsWithRegionResponse { /** VPC endpoints associated with the region. */ endpoints: VPCEndpointsWithRegionResponseEndpointsList; } export const VPCEndpointsWithRegionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoints: VPCEndpointsWithRegionResponseEndpointsList, }), ).annotate({ identifier: "VPCEndpointsWithRegionResponse", }) as any as S.Schema; export interface ListOrgApiKeysRequest { /** The Neon organization ID */ org_id: string; } export const ListOrgApiKeysRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/organizations/{org_id}/api_keys", code: 200, }), ), ).annotate({ identifier: "ListOrgApiKeysRequest", }) as any as S.Schema; export interface OrgApiKeysListResponseItem { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; created_by: ApiKeyCreatorData; /** A timestamp indicating when the API was last used */ last_used_at?: string | null; /** The IP address from which the API key was last used */ last_used_from_addr: string; /** If set, the API key can access only this project */ project_id?: string; } export const OrgApiKeysListResponseItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, name: S.String, created_at: S.String, created_by: ApiKeyCreatorData, last_used_at: S.optional(S.NullOr(S.String)), last_used_from_addr: S.String, project_id: S.optional(S.String), }), ).annotate({ identifier: "OrgApiKeysListResponseItem", }) as any as S.Schema; export type ListOrgApiKeysResponseBodyList = Array; export const ListOrgApiKeysResponseBodyList = /*@__PURE__*/ S.Array( OrgApiKeysListResponseItem, ) as any as S.Schema; export type ListOrgApiKeysResponse = ListOrgApiKeysResponseBodyList; export const ListOrgApiKeysResponse = /*@__PURE__*/ S.suspend(() => ListOrgApiKeysResponseBodyList.pipe(T.RawResponseRoot()), ).annotate({ identifier: "ListOrgApiKeysResponse", }) as any as S.Schema; export interface ListProjectBranchBucketObjectsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; /** Only list objects whose key starts with this prefix. */ prefix?: string; /** Collapse keys sharing a common prefix up to the first occurrence of this delimiter (typically `/`) into the `folders` array. */ delimiter?: string; /** Opaque pagination cursor returned as `next_cursor` by a previous call. Resume listing after the last item of the previous page. */ cursor?: string; /** Maximum number of items (objects + folders) to return. */ limit?: number; } export const ListProjectBranchBucketObjectsRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), prefix: S.optional(S.String.pipe(T.Query())), delimiter: S.optional(S.String.pipe(T.Query())), cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchBucketObjectsRequest", }) as any as S.Schema; /** Common prefixes (folder names) collapsed under the requested `delimiter`. Empty when no `delimiter` was supplied. */ export type BucketObjectsListResponseFoldersList = Array; export const BucketObjectsListResponseFoldersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface BucketObject { /** The full object key. */ key: string; /** The object size in bytes. */ size: number; /** The time the object was last modified. */ last_modified: string; /** The object's entity tag (content hash). */ etag: string; } export const BucketObject = /*@__PURE__*/ S.suspend(() => S.Struct({ key: S.String, size: S.Number, last_modified: S.String, etag: S.String, }), ).annotate({ identifier: "BucketObject" }) as any as S.Schema; /** Objects whose keys did not collapse into a folder. */ export type BucketObjectsListResponseObjectsList = Array; export const BucketObjectsListResponseObjectsList = /*@__PURE__*/ S.Array( BucketObject, ) as any as S.Schema; export interface BucketObjectsListResponse { /** Common prefixes (folder names) collapsed under the requested `delimiter`. Empty when no `delimiter` was supplied. */ folders: BucketObjectsListResponseFoldersList; /** Objects whose keys did not collapse into a folder. */ objects: BucketObjectsListResponseObjectsList; /** The prefix that was applied to this listing (echoed back). */ prefix: string; /** Pagination cursor to pass as `cursor` on the next request. Empty when the listing is not truncated. */ next_cursor?: string; /** True when more results exist beyond this page. */ is_truncated: boolean; } export const BucketObjectsListResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ folders: BucketObjectsListResponseFoldersList, objects: BucketObjectsListResponseObjectsList, prefix: S.String, next_cursor: S.optional(S.String), is_truncated: S.Boolean, }), ).annotate({ identifier: "BucketObjectsListResponse", }) as any as S.Schema; export interface ListProjectBranchBucketsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const ListProjectBranchBucketsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/buckets", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchBucketsRequest", }) as any as S.Schema; export type BucketsListResponseBucketsList = Array; export const BucketsListResponseBucketsList = /*@__PURE__*/ S.Array( Bucket, ) as any as S.Schema; export interface BucketsListResponse { buckets: BucketsListResponseBucketsList; } export const BucketsListResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ buckets: BucketsListResponseBucketsList, }), ).annotate({ identifier: "BucketsListResponse", }) as any as S.Schema; export interface ListProjectBranchCustomDomainsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list. */ cursor?: string; /** Specify a value from 1 to 1000 to limit number of domains in the response */ limit?: number; } export const ListProjectBranchCustomDomainsRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/custom-domains", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchCustomDomainsRequest", }) as any as S.Schema; export interface CustomDomain { /** The registered custom domain (normalized, lowercase). */ domain: string; /** The kind of branch entity the domain targets. Possible values: `function` (v1 supports only `function`). Not an `enum`: new values may ship in later spec versions — treat any undocumented value as unknown. */ entity_type: string; /** The target entity's identifier within the branch. For `function` this is the function slug. */ entity_id: string; /** The hostname the customer must point their custom domain at with a CNAME record. Empty when the serving region has no custom-domains front door configured. This is the activation input: point DNS here and the domain goes live (see `status`) once a certificate is issued on the first request. */ cname_target: string; /** The domain's current validity, computed by a background check: `pending` (still converging — point your CNAME at `cname_target` and wait), `active` (live: DNS resolves to the edge, the CA is authorized, and routing is published), or `error` (a fixable problem — see `status_reason`). Not an `enum`: treat any undocumented value as unknown. May be absent briefly right after registration. */ status?: string; /** The DNS + CAA portion of the check: `pending` (no records yet), `ok` (resolves to our edge and the CA is authorized), `misconfigured` (your CNAME does not resolve to our edge), or `caa_blocked` (your CAA records forbid Let's Encrypt). Not an `enum`. */ dns_status?: string; /** Whether Neon's internal routing for the domain is published: `pending`, `present`, or `missing`. `missing` is an internal fault surfaced for support. Not an `enum`. */ binding_status?: string; /** A short, stable machine-readable reason for a non-active `status` (e.g. `cname-not-pointing-at-edge`, `caa-blocks-lets-encrypt`, `binding-missing`), suitable for keying an actionable hint. Empty when active or pending. */ status_reason?: string; } export const CustomDomain = /*@__PURE__*/ S.suspend(() => S.Struct({ domain: S.String, entity_type: S.String, entity_id: S.String, cname_target: S.String, status: S.optional(S.String), dns_status: S.optional(S.String), binding_status: S.optional(S.String), status_reason: S.optional(S.String), }), ).annotate({ identifier: "CustomDomain" }) as any as S.Schema; export type ListProjectBranchCustomDomainsResponseCustomDomainsList = Array; export const ListProjectBranchCustomDomainsResponseCustomDomainsList = /*@__PURE__*/ S.Array( CustomDomain, ) as any as S.Schema; export interface ListProjectBranchCustomDomainsResponse { custom_domains: ListProjectBranchCustomDomainsResponseCustomDomainsList; pagination?: CursorPagination; } export const ListProjectBranchCustomDomainsResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ custom_domains: ListProjectBranchCustomDomainsResponseCustomDomainsList, pagination: S.optional(CursorPagination), }), ).annotate({ identifier: "ListProjectBranchCustomDomainsResponse", }) as any as S.Schema; export interface ListProjectBranchDatabasesRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const ListProjectBranchDatabasesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/databases", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchDatabasesRequest", }) as any as S.Schema; /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ export type DatabasesResponseDatabasesList = Array; export const DatabasesResponseDatabasesList = /*@__PURE__*/ S.Array( Database, ) as any as S.Schema; export interface DatabasesResponse { /** Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. */ databases: DatabasesResponseDatabasesList; } export const DatabasesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ databases: DatabasesResponseDatabasesList, }), ).annotate({ identifier: "DatabasesResponse", }) as any as S.Schema; export interface ListProjectBranchEndpointsRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const ListProjectBranchEndpointsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/endpoints", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchEndpointsRequest", }) as any as S.Schema; /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ export type EndpointsResponseEndpointsList = Array; export const EndpointsResponseEndpointsList = /*@__PURE__*/ S.Array( Endpoint, ) as any as S.Schema; export interface EndpointsResponse { /** Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. */ endpoints: EndpointsResponseEndpointsList; } export const EndpointsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoints: EndpointsResponseEndpointsList, }), ).annotate({ identifier: "EndpointsResponse", }) as any as S.Schema; export type ListProjectBranchesRequestSortBy = | "name" | "created_at" | "updated_at"; export const ListProjectBranchesRequestSortBy = S.String; export type ListProjectBranchesRequestSortOrder = "asc" | "desc"; export const ListProjectBranchesRequestSortOrder = S.String; export interface ListProjectBranchesRequest { /** The Neon project ID */ project_id: string; /** Search by branch `name` or `id`. You can specify partial `name` or `id` values to filter results. */ search?: string; /** Sort the branches by sort_field. If not provided, branches will be sorted by updated_at descending order */ sort_by?: ListProjectBranchesRequestSortBy | (string & {}); /** A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list. */ cursor?: string; /** Defines the sorting order of entities. */ sort_order?: ListProjectBranchesRequestSortOrder | (string & {}); /** The maximum number of records to be returned in the response */ limit?: number; /** If true, return recoverable deleted branches too (soft-deleted within the recovery window). If false or not provided, return only active (non-deleted) branches. This parameter is part of the Branch Recovery feature, which is in preview and not available to all users. */ include_deleted?: boolean; } export const ListProjectBranchesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), search: S.optional(S.String.pipe(T.Query())), sort_by: S.optional(ListProjectBranchesRequestSortBy.pipe(T.Query())), cursor: S.optional(S.String.pipe(T.Query())), sort_order: S.optional(ListProjectBranchesRequestSortOrder.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), include_deleted: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchesRequest", }) as any as S.Schema; /** Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`. */ export type ListProjectBranchesResponseBranchesList = Array; export const ListProjectBranchesResponseBranchesList = /*@__PURE__*/ S.Array( Branch, ) as any as S.Schema; /** Map of annotations keyed by resource identifier, where each value contains the annotation data for that resource. */ export type ListProjectBranchesResponseAnnotationsMap = { [key: string]: AnnotationData | undefined; }; export const ListProjectBranchesResponseAnnotationsMap = /*@__PURE__*/ S.Record( S.String, AnnotationData, ) as any as S.Schema; export interface ListProjectBranchesResponse { /** Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`. */ branches: ListProjectBranchesResponseBranchesList; /** Map of annotations keyed by resource identifier, where each value contains the annotation data for that resource. */ annotations: ListProjectBranchesResponseAnnotationsMap; pagination?: CursorPagination; } export const ListProjectBranchesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branches: ListProjectBranchesResponseBranchesList, annotations: ListProjectBranchesResponseAnnotationsMap, pagination: S.optional(CursorPagination), }), ).annotate({ identifier: "ListProjectBranchesResponse", }) as any as S.Schema; export interface ListProjectBranchFunctionsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list. */ cursor?: string; /** Specify a value from 1 to 1000 to limit number of functions in the response */ limit?: number; } export const ListProjectBranchFunctionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/functions", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchFunctionsRequest", }) as any as S.Schema; export type ListProjectBranchFunctionsResponseFunctionsList = Array; export const ListProjectBranchFunctionsResponseFunctionsList = /*@__PURE__*/ S.Array( NeonFunction, ) as any as S.Schema; export interface ListProjectBranchFunctionsResponse { functions: ListProjectBranchFunctionsResponseFunctionsList; pagination?: CursorPagination; } export const ListProjectBranchFunctionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ functions: ListProjectBranchFunctionsResponseFunctionsList, pagination: S.optional(CursorPagination), }), ).annotate({ identifier: "ListProjectBranchFunctionsResponse", }) as any as S.Schema; export interface ListProjectBranchLogFieldsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; } export const ListProjectBranchLogFieldsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/logs/fields", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchLogFieldsRequest", }) as any as S.Schema; /** Log field names observed on this branch, each usable as `field_name` on the log field-values endpoint. Computed per branch rather than fixed by this specification, so clients should not assume a particular set. */ export type ProjectBranchLogFieldsResponseFieldsList = Array; export const ProjectBranchLogFieldsResponseFieldsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ProjectBranchLogFieldsResponse { /** Log field names observed on this branch, each usable as `field_name` on the log field-values endpoint. Computed per branch rather than fixed by this specification, so clients should not assume a particular set. */ fields: ProjectBranchLogFieldsResponseFieldsList; } export const ProjectBranchLogFieldsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ fields: ProjectBranchLogFieldsResponseFieldsList, }), ).annotate({ identifier: "ProjectBranchLogFieldsResponse", }) as any as S.Schema; /** The Neon service that emitted the log record. */ export type ProjectBranchLogSource = "function" | "storage" | "pg_endpoint"; export const ProjectBranchLogSource = S.String; export interface ListProjectBranchLogFieldValuesRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The log field whose distinct values should be returned. Must be one of the names returned by the log fields endpoint for this branch. */ field_name: string; /** Length of the lookup window, ending at `end_time` or at the current time when `end_time` is omitted. Mutually exclusive with `start_time`. Defaults to six hours. */ since?: string; /** Inclusive beginning of the lookup window. Mutually exclusive with `since`. */ start_time?: string; /** Exclusive end of the lookup window. Defaults to the current time. */ end_time?: string; /** Only consider records emitted by this Neon service. */ source?: ProjectBranchLogSource | (string & {}); /** Maximum number of distinct values to return. The response sets `is_truncated` when this bound, or the server's own scan cap, cut the list short. */ limit?: number; } export const ListProjectBranchLogFieldValuesRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), field_name: S.String.pipe(T.Label()), since: S.optional(S.String.pipe(T.Query())), start_time: S.optional(S.String.pipe(T.Query())), end_time: S.optional(S.String.pipe(T.Query())), source: S.optional(ProjectBranchLogSource.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchLogFieldValuesRequest", }) as any as S.Schema; export type ProjectBranchLogFieldValuesResponseValuesList = Array; export const ProjectBranchLogFieldValuesResponseValuesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ProjectBranchLogFieldValuesResponse { values: ProjectBranchLogFieldValuesResponseValuesList; /** True when more distinct values exist than were returned, because either the requested `limit` or the server's own scan cap was reached. A caller that filters on a partial list is choosing from an arbitrary subset, so narrow `since` or `source` and ask again when this is `true`. */ is_truncated: boolean; } export const ProjectBranchLogFieldValuesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ values: ProjectBranchLogFieldValuesResponseValuesList, is_truncated: S.Boolean, }), ).annotate({ identifier: "ProjectBranchLogFieldValuesResponse", }) as any as S.Schema; export interface ListProjectBranchRolesRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const ListProjectBranchRolesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/branches/{branch_id}/roles", code: 200, }), ), ).annotate({ identifier: "ListProjectBranchRolesRequest", }) as any as S.Schema; /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ export type RolesResponseRolesList = Array; export const RolesResponseRolesList = /*@__PURE__*/ S.Array( Role, ) as any as S.Schema; export interface RolesResponse { /** Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. */ roles: RolesResponseRolesList; } export const RolesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ roles: RolesResponseRolesList, }), ).annotate({ identifier: "RolesResponse" }) as any as S.Schema; export interface ListProjectEndpointsRequest { /** The Neon project ID */ project_id: string; } export const ListProjectEndpointsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/endpoints", code: 200, }), ), ).annotate({ identifier: "ListProjectEndpointsRequest", }) as any as S.Schema; export interface ListProjectMembersRequest { project_id: string; /** A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list. */ cursor?: string; /** The maximum number of members to return in the response */ limit?: number; } export const ListProjectMembersRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/members", code: 200 }), ), ).annotate({ identifier: "ListProjectMembersRequest", }) as any as S.Schema; /** Organization-level role used by project member role management. */ export type ProjectMemberOrgRole = | "admin" | "member" | "editor" | "viewer" | "collaborator"; export const ProjectMemberOrgRole = S.String; /** Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`, and `admin` maps to `ADMIN`. */ export type ProjectRole = "viewer" | "editor" | "admin"; export const ProjectRole = S.String; /** How a member's project access is granted. */ export type ProjectMemberGrantSource = | "explicit" | "org_role_default" | "org_admin_override" | "unassigned"; export const ProjectMemberGrantSource = S.String; export interface ProjectMember { /** The organization member ID. */ member_id: string; /** The user ID for the organization member. */ user_id: string; /** Email address of the user who has been granted access to the project. */ email?: string; /** The user's display name. */ name?: string; org_role: ProjectMemberOrgRole; project_role?: ProjectRole; org_default_project_permission?: ProjectPermissionLevel; explicit_project_permission?: ProjectPermissionLevel; effective_project_permission?: ProjectPermissionLevel; grant_source?: ProjectMemberGrantSource; } export const ProjectMember = /*@__PURE__*/ S.suspend(() => S.Struct({ member_id: S.String, user_id: S.String, email: S.optional(S.String), name: S.optional(S.String), org_role: ProjectMemberOrgRole, project_role: S.optional(ProjectRole), org_default_project_permission: S.optional(ProjectPermissionLevel), explicit_project_permission: S.optional(ProjectPermissionLevel), effective_project_permission: S.optional(ProjectPermissionLevel), grant_source: S.optional(ProjectMemberGrantSource), }), ).annotate({ identifier: "ProjectMember" }) as any as S.Schema; export type ProjectMembersProjectMembersList = Array; export const ProjectMembersProjectMembersList = /*@__PURE__*/ S.Array( ProjectMember, ) as any as S.Schema; export interface ProjectMembers { project_members: ProjectMembersProjectMembersList; pagination?: CursorPagination; } export const ProjectMembers = /*@__PURE__*/ S.suspend(() => S.Struct({ project_members: ProjectMembersProjectMembersList, pagination: S.optional(CursorPagination), }), ).annotate({ identifier: "ProjectMembers" }) as any as S.Schema; export interface ListProjectOperationsRequest { /** The Neon project ID */ project_id: string; /** Specify the cursor value from the previous response to get the next batch of operations */ cursor?: string; /** Specify a value from 1 to 1000 to limit number of operations in the response */ limit?: number; } export const ListProjectOperationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/operations", code: 200, }), ), ).annotate({ identifier: "ListProjectOperationsRequest", }) as any as S.Schema; export type ListProjectOperationsResponseOperationsList = Array; export const ListProjectOperationsResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface ListProjectOperationsResponse { operations: ListProjectOperationsResponseOperationsList; pagination?: Pagination; } export const ListProjectOperationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ operations: ListProjectOperationsResponseOperationsList, pagination: S.optional(Pagination), }), ).annotate({ identifier: "ListProjectOperationsResponse", }) as any as S.Schema; export interface ListProjectPermissionsRequest { project_id: string; } export const ListProjectPermissionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/permissions", code: 200, }), ), ).annotate({ identifier: "ListProjectPermissionsRequest", }) as any as S.Schema; export type ProjectPermissionsProjectPermissionsList = Array; export const ProjectPermissionsProjectPermissionsList = /*@__PURE__*/ S.Array( ProjectPermission, ) as any as S.Schema; export interface ProjectPermissions { project_permissions: ProjectPermissionsProjectPermissionsList; } export const ProjectPermissions = /*@__PURE__*/ S.suspend(() => S.Struct({ project_permissions: ProjectPermissionsProjectPermissionsList, }), ).annotate({ identifier: "ProjectPermissions", }) as any as S.Schema; export interface ListProjectsRequest { /** Specify the cursor value from the previous response to retrieve the next batch of projects. */ cursor?: string; /** Specify a value from 1 to 400 to limit number of projects in the response. */ limit?: number; /** Search by project `name` or `id`. You can specify partial `name` or `id` values to filter results. */ search?: string; /** Search for projects by `org_id`. */ org_id?: string; /** Specify an explicit timeout in milliseconds to limit response delay. After timing out, the incomplete list of project data fetched so far will be returned. Projects still being fetched when the timeout occurred are listed in the "unavailable" attribute of the response. If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above */ timeout?: number; /** Show only deleted projects within the recovery window. */ recoverable?: boolean; } export const ListProjectsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), search: S.optional(S.String.pipe(T.Query())), org_id: S.optional(S.String.pipe(T.Query())), timeout: S.optional(S.Number.pipe(T.Query())), recoverable: S.optional(S.Boolean.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/projects", code: 200 })), ).annotate({ identifier: "ListProjectsRequest", }) as any as S.Schema; /** Essential data about the project. Full data is available at `GET /projects/{project_id}`. */ export interface ProjectListItem { /** The Neon project ID. Use as the `project_id` path parameter in other endpoints. */ id: string; /** The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`. */ platform_id: string; /** Cloud region where the project's Postgres compute and storage reside (for example, `aws-us-east-2`). Valid values are returned by `GET /regions`. */ region_id: string; /** The project name */ name: string; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner: string; default_endpoint_settings?: DefaultEndpointSettings; /** Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`. */ settings?: ProjectSettingsData; pg_version: number; /** The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`). */ proxy_host: string; /** The logical size limit for a branch. The value is in MiB. */ branch_logical_size_limit: number; /** The logical size limit for a branch. The value is in B. */ branch_logical_size_limit_bytes: number; /** Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization. */ store_passwords: boolean; /** Control plane observed endpoints of this project being active this amount of wall-clock time. */ active_time: number; /** Deprecated. Use `compute_time_seconds` from `GET /projects/{project_id}` instead. */ cpu_used_sec: number; /** A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time. */ maintenance_starts_at?: string; /** The project creation source */ creation_source: string; /** A timestamp indicating when the project was created */ created_at: string; /** A timestamp indicating when the project was last updated */ updated_at: string; /** The current space occupied by the project in Postgres storage, in bytes. Synthetic Postgres storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project. */ synthetic_storage_size?: number; /** Deprecated. Use `consumption_period_end` from `GET /projects/{project_id}` instead. A timestamp indicating when the project quota resets. */ quota_reset_at?: string; /** ID of the organization that owns the project. */ owner_id: string; /** The most recent time when any endpoint of this project was active. Omitted when observed no activity for endpoints of this project. */ compute_last_active_at?: string; /** ID of the organization that owns the project. Project permissions are granted to organization members as configured by the organization's admins, independent of which member created the project. */ org_id?: string; /** Name of the organization that owns the project. */ org_name?: string; /** The number of seconds to retain the shared history for all branches in this project. */ history_retention_seconds?: number; /** A timestamp indicating when HIPAA was enabled for this project */ hipaa_enabled_at?: string; /** A timestamp indicating when the project was deleted */ deleted_at?: string; /** A timestamp indicating the project will be recoverable until this date and time. */ recoverable_until?: string; effective_project_permission?: ProjectPermissionLevel | null; } export const ProjectListItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, platform_id: S.String, region_id: S.String, name: S.String, provisioner: S.String, default_endpoint_settings: S.optional(DefaultEndpointSettings), settings: S.optional(ProjectSettingsData), pg_version: S.Number, proxy_host: S.String, branch_logical_size_limit: S.Number, branch_logical_size_limit_bytes: S.Number, store_passwords: S.Boolean, active_time: S.Number, cpu_used_sec: S.Number, maintenance_starts_at: S.optional(S.String), creation_source: S.String, created_at: S.String, updated_at: S.String, synthetic_storage_size: S.optional(S.Number), quota_reset_at: S.optional(S.String), owner_id: S.String, compute_last_active_at: S.optional(S.String), org_id: S.optional(S.String), org_name: S.optional(S.String), history_retention_seconds: S.optional(S.Number), hipaa_enabled_at: S.optional(S.String), deleted_at: S.optional(S.String), recoverable_until: S.optional(S.String), effective_project_permission: S.optional(S.NullOr(ProjectPermissionLevel)), }), ).annotate({ identifier: "ProjectListItem", }) as any as S.Schema; /** List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`. */ export type ListProjectsResponseProjectsList = Array; export const ListProjectsResponseProjectsList = /*@__PURE__*/ S.Array( ProjectListItem, ) as any as S.Schema; /** A list of project IDs indicating which projects are known to exist, but whose details could not be fetched within the requested (or implicit) time limit */ export type ListProjectsResponseUnavailableProjectIdsList = Array; export const ListProjectsResponseUnavailableProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Type of application integration */ export type ApplicationType = "vercel" | "github" | "datadog" | "opentelemetry"; export const ApplicationType = S.String; export type ListProjectsResponseApplicationsValueList = Array; export const ListProjectsResponseApplicationsValueList = /*@__PURE__*/ S.Array( ApplicationType, ) as any as S.Schema; /** Map of project IDs to their installed applications. Each key is a project ID; each value is an array of application types (for example, `vercel`, `github`). */ export type ListProjectsResponseApplicationsMap = { [key: string]: ListProjectsResponseApplicationsValueList | undefined; }; export const ListProjectsResponseApplicationsMap = /*@__PURE__*/ S.Record( S.String, ListProjectsResponseApplicationsValueList, ) as any as S.Schema; export type ListProjectsResponseIntegrationsValueList = Array; export const ListProjectsResponseIntegrationsValueList = /*@__PURE__*/ S.Array( ApplicationType, ) as any as S.Schema; /** Map of project IDs to their associated integration details. */ export type ListProjectsResponseIntegrationsMap = { [key: string]: ListProjectsResponseIntegrationsValueList | undefined; }; export const ListProjectsResponseIntegrationsMap = /*@__PURE__*/ S.Record( S.String, ListProjectsResponseIntegrationsValueList, ) as any as S.Schema; export interface ListProjectsResponse { /** List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`. */ projects: ListProjectsResponseProjectsList; /** A list of project IDs indicating which projects are known to exist, but whose details could not be fetched within the requested (or implicit) time limit */ unavailable_project_ids?: ListProjectsResponseUnavailableProjectIdsList; pagination?: Pagination; /** Map of project IDs to their installed applications. Each key is a project ID; each value is an array of application types (for example, `vercel`, `github`). */ applications: ListProjectsResponseApplicationsMap; /** Map of project IDs to their associated integration details. */ integrations: ListProjectsResponseIntegrationsMap; } export const ListProjectsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ projects: ListProjectsResponseProjectsList, unavailable_project_ids: S.optional( ListProjectsResponseUnavailableProjectIdsList, ), pagination: S.optional(Pagination), applications: ListProjectsResponseApplicationsMap, integrations: ListProjectsResponseIntegrationsMap, }), ).annotate({ identifier: "ListProjectsResponse", }) as any as S.Schema; export interface ListProjectVPCEndpointsRequest { /** The Neon project ID */ project_id: string; } export const ListProjectVPCEndpointsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/vpc_endpoints", code: 200, }), ), ).annotate({ identifier: "ListProjectVPCEndpointsRequest", }) as any as S.Schema; export interface ListSharedProjectsRequest { /** Specify the cursor value from the previous response to get the next batch of projects. */ cursor?: string; /** Specify a value from 1 to 400 to limit number of projects in the response. */ limit?: number; /** Search query by name or id. */ search?: string; /** Specify an explicit timeout in milliseconds to limit response delay. After timing out, the incomplete list of project data fetched so far will be returned. Projects still being fetched when the timeout occurred are listed in the "unavailable" attribute of the response. If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above */ timeout?: number; } export const ListSharedProjectsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ cursor: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), search: S.optional(S.String.pipe(T.Query())), timeout: S.optional(S.Number.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/projects/shared", code: 200 })), ).annotate({ identifier: "ListSharedProjectsRequest", }) as any as S.Schema; /** List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`. */ export type ListSharedProjectsResponseProjectsList = Array; export const ListSharedProjectsResponseProjectsList = /*@__PURE__*/ S.Array( ProjectListItem, ) as any as S.Schema; /** A list of project IDs indicating which projects are known to exist, but whose details could not be fetched within the requested (or implicit) time limit */ export type ListSharedProjectsResponseUnavailableProjectIdsList = Array; export const ListSharedProjectsResponseUnavailableProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ListSharedProjectsResponse { /** List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`. */ projects: ListSharedProjectsResponseProjectsList; /** A list of project IDs indicating which projects are known to exist, but whose details could not be fetched within the requested (or implicit) time limit */ unavailable_project_ids?: ListSharedProjectsResponseUnavailableProjectIdsList; pagination?: Pagination; } export const ListSharedProjectsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ projects: ListSharedProjectsResponseProjectsList, unavailable_project_ids: S.optional( ListSharedProjectsResponseUnavailableProjectIdsList, ), pagination: S.optional(Pagination), }), ).annotate({ identifier: "ListSharedProjectsResponse", }) as any as S.Schema; export interface ListSnapshotsRequest { /** The Neon project ID */ project_id: string; } export const ListSnapshotsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/projects/{project_id}/snapshots", code: 200, }), ), ).annotate({ identifier: "ListSnapshotsRequest", }) as any as S.Schema; export type ListSnapshotsResponseSnapshotsList = Array; export const ListSnapshotsResponseSnapshotsList = /*@__PURE__*/ S.Array( Snapshot, ) as any as S.Schema; export interface ListSnapshotsResponse { snapshots: ListSnapshotsResponseSnapshotsList; } export const ListSnapshotsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ snapshots: ListSnapshotsResponseSnapshotsList, }), ).annotate({ identifier: "ListSnapshotsResponse", }) as any as S.Schema; /** The transfer direction. `upload` returns a presigned `PUT` URL; `download` returns a presigned `GET` URL. */ export type PresignProjectBranchBucketObjectRequestOperation = | "upload" | "download"; export const PresignProjectBranchBucketObjectRequestOperation = S.String; export interface PresignProjectBranchBucketObjectRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The bucket name */ bucket_name: string; /** The object key. Keys may contain `/`; the `/` characters of nested keys must be percent-encoded (`%2F`) in the path segment. */ object_key: string; /** The transfer direction. `upload` returns a presigned `PUT` URL; `download` returns a presigned `GET` URL. */ operation: PresignProjectBranchBucketObjectRequestOperation | (string & {}); /** The `Content-Type` to bind into the signed request. Only meaningful for `upload`: when set, the caller MUST send the same `Content-Type` header on the `PUT`, and the value is echoed back in the response `headers`. Ignored for `download`. */ content_type?: string; /** How long the presigned URL stays valid, in seconds. Defaults to 900 (15 minutes); capped at 604800 (7 days). */ expires_in_seconds?: number; } export const PresignProjectBranchBucketObjectRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), bucket_name: S.String.pipe(T.Label()), object_key: S.String.pipe(T.Label()), operation: PresignProjectBranchBucketObjectRequestOperation, content_type: S.optional(S.String), expires_in_seconds: S.optional(S.Number), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}/presign", code: 200, }), ), ).annotate({ identifier: "PresignProjectBranchBucketObjectRequest", }) as any as S.Schema; /** Headers the caller MUST send verbatim on the request (e.g. `Content-Type` when it was signed on an upload). May be empty. */ export type PresignResponseHeadersMap = { [key: string]: string | undefined }; export const PresignResponseHeadersMap = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; export interface PresignResponse { /** The presigned URL. Transfer the object bytes by issuing `method url` with the returned `headers`. */ url: string; /** The HTTP method to use against `url`: `PUT` for an upload, `GET` for a download. */ method: string; /** Headers the caller MUST send verbatim on the request (e.g. `Content-Type` when it was signed on an upload). May be empty. */ headers: PresignResponseHeadersMap; /** When the presigned URL stops being valid. */ expires_at: string; } export const PresignResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ url: S.String, method: S.String, headers: PresignResponseHeadersMap, expires_at: S.String, }), ).annotate({ identifier: "PresignResponse", }) as any as S.Schema; /** Order matching records by timestamp. `desc`, the default, returns the newest records first. */ export type QueryProjectBranchLogsRequestSortOrder = "asc" | "desc"; export const QueryProjectBranchLogsRequestSortOrder = S.String; /** An OpenTelemetry severity level. A minimum severity includes every higher level in this order: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. */ export type ProjectBranchLogSeverity = | "trace" | "debug" | "info" | "warn" | "error" | "fatal"; export const ProjectBranchLogSeverity = S.String; export interface QueryProjectBranchLogsRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Length of the query window, ending at `end_time` or at the current time when `end_time` is omitted. Mutually exclusive with `start_time`. Prefer this over computing absolute bounds when the caller only means "the last hour". */ since?: string; /** Inclusive beginning of the query window. Mutually exclusive with `since`. Defaults to one hour before `end_time`, or one hour before the current time when both bounds are omitted. */ start_time?: string; /** Exclusive end of the query window. Defaults to the current time. */ end_time?: string; /** Maximum number of log records to return per page. */ limit?: number; /** Opaque pagination cursor returned as `next_cursor` by a previous call. Resume the query after the last record of the previous page, repeating the time range and every filter unchanged. */ cursor?: string; /** Order matching records by timestamp. `desc`, the default, returns the newest records first. */ sort_order?: QueryProjectBranchLogsRequestSortOrder | (string & {}); source?: ProjectBranchLogSource | (string & {}); /** Match the OpenTelemetry `service.name` resource attribute exactly. */ service_name?: string; /** Match the OpenTelemetry instrumentation scope name exactly. */ scope_name?: string; minimum_severity?: ProjectBranchLogSeverity | (string & {}); /** Match the OpenTelemetry severity text exactly. */ severity_text?: string; /** Match records whose rendered `message` contains this case-sensitive substring. Records with a structured body are matched against their JSON rendering, so the substring meets JSON syntax rather than prose: a bare key name such as `operation` matches every record carrying that key, and `http_status: 200` matches none, because the rendering contains `"http_status":200` with no space. */ body_contains?: string; /** Match records associated with this OpenTelemetry trace ID. W3C Trace Context defines a trace ID as 32 lowercase hex digits, and that is what is stored, so an uppercase value is rejected rather than silently matching nothing. */ trace_id?: string; /** Escape hatch for selections the structured filters cannot express: a raw LogQL expression, evaluated against this branch's log stream. Only stream selectors and line filters are accepted — no aggregations and no parser stages. Supplying this alongside any structured filter is rejected with `conflicting_filters` rather than silently ignoring one of them. `limit`, `sort_order`, and the time window still apply. This field passes the underlying query language through to the caller, so unlike the rest of this contract it may change as that backend changes. Prefer the structured filters where they suffice. */ logql?: string; } export const QueryProjectBranchLogsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), since: S.optional(S.String), start_time: S.optional(S.String), end_time: S.optional(S.String), limit: S.optional(S.Number), cursor: S.optional(S.String), sort_order: S.optional(QueryProjectBranchLogsRequestSortOrder), source: S.optional(ProjectBranchLogSource), service_name: S.optional(S.String), scope_name: S.optional(S.String), minimum_severity: S.optional(ProjectBranchLogSeverity), severity_text: S.optional(S.String), body_contains: S.optional(S.String), trace_id: S.optional(S.String), logql: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/logs/query", code: 200, }), ), ).annotate({ identifier: "QueryProjectBranchLogsRequest", }) as any as S.Schema; /** Customer-defined OpenTelemetry log and resource attributes. */ export type ProjectBranchLogRecordAttributesMap = { [key: string]: unknown | undefined; }; export const ProjectBranchLogRecordAttributesMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export interface ProjectBranchLogRecord { /** The OpenTelemetry record timestamp in UTC. */ timestamp: string; /** The OpenTelemetry log body rendered as text. A body that is already a string is returned verbatim. Any other OpenTelemetry `AnyValue` body — notably the structured key/value body that `storage` records always carry — is rendered as compact JSON with its keys sorted alphabetically, for example `{"bytes":1024,"operation":"GET","object_key":"a/b.png"}`. */ message: string; source?: ProjectBranchLogSource; /** The Neon identifier of the service instance that emitted the record. */ entity_id?: string; /** The OpenTelemetry `service.name` resource attribute. */ service_name?: string; /** The OpenTelemetry instrumentation scope name. */ scope_name?: string; /** The numeric OpenTelemetry severity. */ severity_number?: number; /** The original OpenTelemetry severity text. */ severity_text?: string; /** The OpenTelemetry trace ID, when the record belongs to a trace. */ trace_id?: string; /** The OpenTelemetry span ID, when the record belongs to a span. */ span_id?: string; /** Customer-defined OpenTelemetry log and resource attributes. */ attributes: ProjectBranchLogRecordAttributesMap; } export const ProjectBranchLogRecord = /*@__PURE__*/ S.suspend(() => S.Struct({ timestamp: S.String, message: S.String, source: S.optional(ProjectBranchLogSource), entity_id: S.optional(S.String), service_name: S.optional(S.String), scope_name: S.optional(S.String), severity_number: S.optional(S.Number), severity_text: S.optional(S.String), trace_id: S.optional(S.String), span_id: S.optional(S.String), attributes: ProjectBranchLogRecordAttributesMap, }), ).annotate({ identifier: "ProjectBranchLogRecord", }) as any as S.Schema; export type ProjectBranchLogsQueryResponseLogsList = Array; export const ProjectBranchLogsQueryResponseLogsList = /*@__PURE__*/ S.Array( ProjectBranchLogRecord, ) as any as S.Schema; export interface ProjectBranchLogsQueryResponse { logs: ProjectBranchLogsQueryResponseLogsList; /** Pagination cursor to pass as `cursor` on the next request. Empty when the response is not truncated. */ next_cursor?: string; /** True when more records matched than were returned. */ is_truncated: boolean; } export const ProjectBranchLogsQueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ logs: ProjectBranchLogsQueryResponseLogsList, next_cursor: S.optional(S.String), is_truncated: S.Boolean, }), ).annotate({ identifier: "ProjectBranchLogsQueryResponse", }) as any as S.Schema; export interface RecoverProjectRequest { /** The Neon project ID */ project_id: string; } export const RecoverProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/recover", code: 200, }), ), ).annotate({ identifier: "RecoverProjectRequest", }) as any as S.Schema; /** Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`. */ export type RecoverProjectResponseBranchesList = Array; export const RecoverProjectResponseBranchesList = /*@__PURE__*/ S.Array( Branch, ) as any as S.Schema; export interface RecoverProjectResponse { /** Full details of the project, including configuration, consumption metrics, and ownership. */ project: Project; /** Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`. */ branches: RecoverProjectResponseBranchesList; } export const RecoverProjectResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project: Project, branches: RecoverProjectResponseBranchesList, }), ).annotate({ identifier: "RecoverProjectResponse", }) as any as S.Schema; export interface RegisterProjectBranchCustomDomainRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The custom domain to register (for example `dashboard.acme.com`). Case-insensitive; normalized to lowercase (a trailing root dot is stripped, so the 254-char bound admits a fully-qualified name whose normalized form is 253 chars). Neon-managed and internal hostnames are rejected. */ domain: string; /** The kind of branch entity to point the domain at. v1 supports only `function`; any other value is rejected with `invalid_entity_type`. */ entity_type: string; /** The target entity's identifier within the branch. For `function` this is the function slug (which must already exist on the branch). */ entity_id: string; } export const RegisterProjectBranchCustomDomainRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), domain: S.String, entity_type: S.String, entity_id: S.String, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/custom-domains", code: 200, }), ), ).annotate({ identifier: "RegisterProjectBranchCustomDomainRequest", }) as any as S.Schema; export interface RemoveOrganizationMemberRequest { /** The Neon organization ID */ org_id: string; /** The Neon organization member ID */ member_id: string; } export const RemoveOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), member_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/organizations/{org_id}/members/{member_id}", code: 200, }), ), ).annotate({ identifier: "RemoveOrganizationMemberRequest", }) as any as S.Schema; export type RemoveOrganizationMemberResponse = unknown; export const RemoveOrganizationMemberResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "RemoveOrganizationMemberResponse", }) as any as S.Schema; export interface RemoveProjectMemberRoleRequest { project_id: string; member_id: string; confirm_self_lockout?: boolean; } export const RemoveProjectMemberRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), member_id: S.String.pipe(T.Label()), confirm_self_lockout: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/members/{member_id}/role", code: 200, }), ), ).annotate({ identifier: "RemoveProjectMemberRoleRequest", }) as any as S.Schema; export interface ProjectMemberRoleResponse { project_id: string; member_id: string; user_id: string; /** Email address of the user who has been granted access to the project. */ email?: string; /** The user's display name. */ name?: string; org_role: ProjectMemberOrgRole; /** The resulting effective project role after applying org-admin default access, explicit grants, and creator fallback. Null only when the member has no remaining effective project access. */ project_role?: ProjectRole; org_default_project_permission?: ProjectPermissionLevel; explicit_project_permission?: ProjectPermissionLevel; effective_project_permission?: ProjectPermissionLevel; /** Hint that database credentials may need rotation after the role change. */ credential_rotation_recommended?: boolean; /** Hint that project-scoped org API keys created by the target user may need rotation. */ org_api_key_rotation_recommended?: boolean; } export const ProjectMemberRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String, member_id: S.String, user_id: S.String, email: S.optional(S.String), name: S.optional(S.String), org_role: ProjectMemberOrgRole, project_role: S.optional(ProjectRole), org_default_project_permission: S.optional(ProjectPermissionLevel), explicit_project_permission: S.optional(ProjectPermissionLevel), effective_project_permission: S.optional(ProjectPermissionLevel), credential_rotation_recommended: S.optional(S.Boolean), org_api_key_rotation_recommended: S.optional(S.Boolean), }), ).annotate({ identifier: "ProjectMemberRoleResponse", }) as any as S.Schema; export interface ResetProjectBranchRolePasswordRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The role name */ role_name: string; } export const ResetProjectBranchRolePasswordRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), role_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password", code: 200, }), ), ).annotate({ identifier: "ResetProjectBranchRolePasswordRequest", }) as any as S.Schema; export type ResetProjectBranchRolePasswordResponseOperationsList = Array; export const ResetProjectBranchRolePasswordResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface ResetProjectBranchRolePasswordResponse { /** Role details for the requested database role. The `password` field is included in the response when a role is created or its password is reset, and is not returned in subsequent read requests. Store it securely at that time. */ role: Role; operations: ResetProjectBranchRolePasswordResponseOperationsList; } export const ResetProjectBranchRolePasswordResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ role: Role, operations: ResetProjectBranchRolePasswordResponseOperationsList, }), ).annotate({ identifier: "ResetProjectBranchRolePasswordResponse", }) as any as S.Schema; export interface RestartProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; } export const RestartProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/endpoints/{endpoint_id}/restart", code: 200, }), ), ).annotate({ identifier: "RestartProjectEndpointRequest", }) as any as S.Schema; export type RestartProjectEndpointResponseOperationsList = Array; export const RestartProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface RestartProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: RestartProjectEndpointResponseOperationsList; } export const RestartProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: RestartProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "RestartProjectEndpointResponse", }) as any as S.Schema; export interface RestoreProjectBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The `branch_id` of the restore source branch. If `source_timestamp` and `source_lsn` are omitted, the branch will be restored to head. If `source_branch_id` is equal to the branch's id, `source_timestamp` or `source_lsn` is required. */ source_branch_id: string; /** A Postgres LSN (for example, `0/1A2B3C4`) on the source branch to restore from. Mutually exclusive with `source_timestamp`. Omit both to restore to head. */ source_lsn?: string; /** A point in time on the source branch to restore from, in RFC 3339 format. When omitted alongside `source_lsn`, the branch is restored to the latest available state of the source branch. */ source_timestamp?: string; /** Name under which to save the current branch state before restoring. Required when the branch has children or when `source_branch_id` equals the branch being restored; in those cases all existing child branches are moved to the newly created branch. If omitted and not required, the previous state is not preserved. */ preserve_under_name?: string; } export const RestoreProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), source_branch_id: S.String, source_lsn: S.optional(S.String), source_timestamp: S.optional(S.String), preserve_under_name: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/restore", code: 200, }), ), ).annotate({ identifier: "RestoreProjectBranchRequest", }) as any as S.Schema; export type RestoreProjectBranchResponseOperationsList = Array; export const RestoreProjectBranchResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface RestoreProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; operations: RestoreProjectBranchResponseOperationsList; } export const RestoreProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, operations: RestoreProjectBranchResponseOperationsList, }), ).annotate({ identifier: "RestoreProjectBranchResponse", }) as any as S.Schema; export interface RestoreSnapshotRequest { /** The Neon project ID */ project_id: string; /** The snapshot ID */ snapshot_id: string; /** Deprecated. Use the `name` field in the request body instead. Removal scheduled for November 29, 2025. A name for the newly restored branch. If omitted, a default name will be generated. */ name?: string; /** ID of the branch to restore the snapshot into. Defaults to the snapshot's source branch (`snapshot.source_branch_id`); fails if that cannot be determined. */ target_branch_id?: string; /** Set to `true` to finalize the restore operation immediately. This will complete the restore and move any associated computes to the new branch, similar to the `finalizeRestoreBranch` operation. Defaults to `false` to allow previewing the restored snapshot data first. */ finalize_restore?: boolean; } export const RestoreSnapshotRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), snapshot_id: S.String.pipe(T.Label()), name: S.optional(S.String.pipe(T.Query())), target_branch_id: S.optional(S.String), finalize_restore: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/snapshots/{snapshot_id}/restore", code: 200, }), ), ).annotate({ identifier: "RestoreSnapshotRequest", }) as any as S.Schema; /** Compute endpoints associated with the project. */ export type RestoreSnapshotResponseEndpointsList = Array; export const RestoreSnapshotResponseEndpointsList = /*@__PURE__*/ S.Array( Endpoint, ) as any as S.Schema; export type RestoreSnapshotResponseOperationsList = Array; export const RestoreSnapshotResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface RestoreSnapshotResponse { /** Branch returned by the request. */ branch: Branch; /** Compute endpoints associated with the project. */ endpoints?: RestoreSnapshotResponseEndpointsList; operations: RestoreSnapshotResponseOperationsList; } export const RestoreSnapshotResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, endpoints: S.optional(RestoreSnapshotResponseEndpointsList), operations: RestoreSnapshotResponseOperationsList, }), ).annotate({ identifier: "RestoreSnapshotResponse", }) as any as S.Schema; export interface RevealCredentialRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; } export const RevealCredentialRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), token_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/credentials/{token_id}/reveal", code: 200, }), ), ).annotate({ identifier: "RevealCredentialRequest", }) as any as S.Schema; /** The live secrets of an existing credential, recovered on demand by the reveal endpoint. `api_token` and `s3_secret_access_key` are the same values handed back once at issuance. The field set is deliberately narrower than `CreateCredentialResponse`: it carries only what reveal can actually recover. `token_id_short`, `scopes`, `principal_type`, `created_at` and `expires_at` are metadata, not secrets — read them from the list endpoint instead. No `branch_id` is returned. Reveal is scoped by `(project_id, token_id)`, so the branch in the request path authorizes the call but is not proven to be the branch the credential was issued on. Echoing it back would assert an anchor this endpoint never verified. For a credential's true anchor branch, read `branch_id` from the list endpoint, which is branch-exact. */ export interface CredentialSecret { /** Opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; /** Bearer token. */ api_token: string | Redacted.Redacted; /** nsk_live_<64 hex>; the AWS_SECRET_ACCESS_KEY. */ s3_secret_access_key: string; } export const CredentialSecret = /*@__PURE__*/ S.suspend(() => S.Struct({ token_id: S.String, api_token: S.String.pipe(T.SensitiveValue({})), s3_secret_access_key: S.String, }), ).annotate({ identifier: "CredentialSecret", }) as any as S.Schema; export interface RevokeApiKeyRequest { /** The API key ID */ key_id: number; } export const RevokeApiKeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ key_id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "DELETE", uri: "/api_keys/{key_id}", code: 200 })), ).annotate({ identifier: "RevokeApiKeyRequest", }) as any as S.Schema; export interface ApiKeyRevokeResponse { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; /** ID of the user who created this API key */ created_by: string; /** A timestamp indicating when the API was last used */ last_used_at?: string | null; /** The IP address from which the API key was last used */ last_used_from_addr: string; /** A `true` or `false` value indicating whether the API key is revoked */ revoked: boolean; } export const ApiKeyRevokeResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, name: S.String, created_at: S.String, created_by: S.String, last_used_at: S.optional(S.NullOr(S.String)), last_used_from_addr: S.String, revoked: S.Boolean, }), ).annotate({ identifier: "ApiKeyRevokeResponse", }) as any as S.Schema; export interface RevokeCredentialRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; } export const RevokeCredentialRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), token_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/branches/{branch_id}/credentials/{token_id}", code: 200, }), ), ).annotate({ identifier: "RevokeCredentialRequest", }) as any as S.Schema; export interface RevokeCredentialResponse {} export const RevokeCredentialResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "RevokeCredentialResponse", }) as any as S.Schema; export interface RevokeOrgApiKeyRequest { /** The Neon organization ID */ org_id: string; /** The API key ID */ key_id: number; } export const RevokeOrgApiKeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), key_id: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/organizations/{org_id}/api_keys/{key_id}", code: 200, }), ), ).annotate({ identifier: "RevokeOrgApiKeyRequest", }) as any as S.Schema; export interface RevokeOrgApiKeyResponse { /** The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** The user-specified API key name */ name: string; /** A timestamp indicating when the API key was created */ created_at: string; /** ID of the user who created this API key */ created_by: string; /** A timestamp indicating when the API was last used */ last_used_at?: string | null; /** The IP address from which the API key was last used */ last_used_from_addr: string; /** A `true` or `false` value indicating whether the API key is revoked */ revoked: boolean; /** If set, the API key can access only this project */ project_id?: string; } export const RevokeOrgApiKeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, name: S.String, created_at: S.String, created_by: S.String, last_used_at: S.optional(S.NullOr(S.String)), last_used_from_addr: S.String, revoked: S.Boolean, project_id: S.optional(S.String), }), ).annotate({ identifier: "RevokeOrgApiKeyResponse", }) as any as S.Schema; export interface RevokePermissionFromProjectRequest { project_id: string; permission_id: string; } export const RevokePermissionFromProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), permission_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/projects/{project_id}/permissions/{permission_id}", code: 200, }), ), ).annotate({ identifier: "RevokePermissionFromProjectRequest", }) as any as S.Schema; export interface RotateCredentialRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The opaque credential id (e.g. nak_live_<32hex>). */ token_id: string; } export const RotateCredentialRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), token_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/credentials/{token_id}/rotate", code: 200, }), ), ).annotate({ identifier: "RotateCredentialRequest", }) as any as S.Schema; export type RotateCredentialResponseScopesList = Array; export const RotateCredentialResponseScopesList = /*@__PURE__*/ S.Array( GrantedCredentialScope, ) as any as S.Schema; /** Always `user`: only customer-managed credentials are rotatable through this endpoint. */ export type RotateCredentialResponsePrincipalType = "user"; export const RotateCredentialResponsePrincipalType = S.String; /** The replacement secret material for an existing credential, returned exactly once. `token_id`, `scopes`, `branch_id` and `created_at` are unchanged by the rotation — only `api_token` and `s3_secret_access_key` are new. */ export interface RotateCredentialResponse { /** Opaque credential id (e.g. nak_live_<32hex>), unchanged by the rotation. Doubles as the `AWS_ACCESS_KEY_ID` for SigV4. */ token_id: string; /** First 12 hex chars of token_id; safe to log. */ token_id_short: string; /** Customer-supplied label carried on the credential. Absent when none was set at issuance. */ name?: string; /** The new Bearer token; returned exactly once. */ api_token: string | Redacted.Redacted; /** The new nsk_live_<64 hex> AWS_SECRET_ACCESS_KEY; returned exactly once. */ s3_secret_access_key: string; scopes: RotateCredentialResponseScopesList; branch_id: string; /** Always `user`: only customer-managed credentials are rotatable through this endpoint. */ principal_type: RotateCredentialResponsePrincipalType; /** When the credential was originally issued. Rotation replaces the secrets in place and does not reset this. */ created_at: string; /** When the credential expires; absent means never expires. Rotation does not extend it. */ expires_at?: string; } export const RotateCredentialResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ token_id: S.String, token_id_short: S.String, name: S.optional(S.String), api_token: S.String.pipe(T.SensitiveValue({})), s3_secret_access_key: S.String, scopes: RotateCredentialResponseScopesList, branch_id: S.String, principal_type: RotateCredentialResponsePrincipalType, created_at: S.String, expires_at: S.optional(S.String), }), ).annotate({ identifier: "RotateCredentialResponse", }) as any as S.Schema; export interface SendNeonAuthEmailProviderTestRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The email address to send the test email to. */ recipient_email: string; } export const SendNeonAuthEmailProviderTestRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), recipient_email: S.String, }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/auth/email_provider/test", code: 200, }), ), ).annotate({ identifier: "SendNeonAuthEmailProviderTestRequest", }) as any as S.Schema; export interface SendNeonAuthTestEmailResponse { /** Whether the test email was sent successfully. */ success: boolean; /** The error message from the email server. */ error_message?: string; } export const SendNeonAuthTestEmailResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ success: S.Boolean, error_message: S.optional(S.String), }), ).annotate({ identifier: "SendNeonAuthTestEmailResponse", }) as any as S.Schema; export interface SetDefaultProjectBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const SetDefaultProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/set_as_default", code: 200, }), ), ).annotate({ identifier: "SetDefaultProjectBranchRequest", }) as any as S.Schema; export type SetDefaultProjectBranchResponseOperationsList = Array; export const SetDefaultProjectBranchResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface SetDefaultProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; operations: SetDefaultProjectBranchResponseOperationsList; } export const SetDefaultProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, operations: SetDefaultProjectBranchResponseOperationsList, }), ).annotate({ identifier: "SetDefaultProjectBranchResponse", }) as any as S.Schema; export interface SetOrganizationSpendingLimitRequest { /** The Neon organization ID */ org_id: string; /** Monthly spending cap in cents. Must be positive. To remove a previously configured limit, send a DELETE request to the spending_limit endpoint — `0` and `null` are rejected here. The cap is alert-only: notifications fire at 80% and 100%, but computes are not suspended. Setting a cap below the period's already-accrued spend is permitted and will trigger the over-limit notification on the next worker run. */ spending_limit_cents: number; } export const SetOrganizationSpendingLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), spending_limit_cents: S.Number, }).pipe( T.Http({ method: "PUT", uri: "/organizations/{org_id}/billing/spending_limit", code: 200, }), ), ).annotate({ identifier: "SetOrganizationSpendingLimitRequest", }) as any as S.Schema; export interface SetProjectMemberRoleRequest { project_id: string; member_id: string; confirm_self_demotion?: boolean; role: ProjectRole | (string & {}); } export const SetProjectMemberRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), member_id: S.String.pipe(T.Label()), confirm_self_demotion: S.optional(S.Boolean.pipe(T.Query())), role: ProjectRole, }).pipe( T.Http({ method: "PUT", uri: "/projects/{project_id}/members/{member_id}/role", code: 200, }), ), ).annotate({ identifier: "SetProjectMemberRoleRequest", }) as any as S.Schema; /** List of schedule entries defining the backup frequency. At least one entry is required. */ export type SetSnapshotScheduleRequestScheduleList = Array; export const SetSnapshotScheduleRequestScheduleList = /*@__PURE__*/ S.Array( BackupScheduleItem, ) as any as S.Schema; export interface SetSnapshotScheduleRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** List of schedule entries defining the backup frequency. At least one entry is required. */ schedule: SetSnapshotScheduleRequestScheduleList; } export const SetSnapshotScheduleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), schedule: SetSnapshotScheduleRequestScheduleList, }).pipe( T.Http({ method: "PUT", uri: "/projects/{project_id}/branches/{branch_id}/backup_schedule", code: 200, }), ), ).annotate({ identifier: "SetSnapshotScheduleRequest", }) as any as S.Schema; export type SetSnapshotScheduleResponse = unknown; export const SetSnapshotScheduleResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "SetSnapshotScheduleResponse", }) as any as S.Schema; export interface StartAnonymizationRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; } export const StartAnonymizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/branches/{branch_id}/anonymize", code: 200, }), ), ).annotate({ identifier: "StartAnonymizationRequest", }) as any as S.Schema; export interface StartProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; } export const StartProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/endpoints/{endpoint_id}/start", code: 200, }), ), ).annotate({ identifier: "StartProjectEndpointRequest", }) as any as S.Schema; export type StartProjectEndpointResponseOperationsList = Array; export const StartProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface StartProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: StartProjectEndpointResponseOperationsList; } export const StartProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: StartProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "StartProjectEndpointResponse", }) as any as S.Schema; export interface SuspendProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; } export const SuspendProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/projects/{project_id}/endpoints/{endpoint_id}/suspend", code: 200, }), ), ).annotate({ identifier: "SuspendProjectEndpointRequest", }) as any as S.Schema; export type SuspendProjectEndpointResponseOperationsList = Array; export const SuspendProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface SuspendProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: SuspendProjectEndpointResponseOperationsList; } export const SuspendProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: SuspendProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "SuspendProjectEndpointResponse", }) as any as S.Schema; export interface TransferNeonAuthProviderProjectRequest { /** The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; auth_provider: NeonAuthSupportedAuthProvider | (string & {}); } export const TransferNeonAuthProviderProjectRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String, auth_provider: NeonAuthSupportedAuthProvider, }).pipe( T.Http({ method: "POST", uri: "/projects/auth/transfer_ownership", code: 200, }), ), ).annotate({ identifier: "TransferNeonAuthProviderProjectRequest", }) as any as S.Schema; export interface NeonAuthTransferAuthProviderProjectResponse { /** URL for completing the process of ownership transfer */ url: string; } export const NeonAuthTransferAuthProviderProjectResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ url: S.String, }), ).annotate({ identifier: "NeonAuthTransferAuthProviderProjectResponse", }) as any as S.Schema; /** The list of projects ids to transfer. Maximum of 400 project ids */ export type TransferProjectsFromOrgToOrgRequestProjectIdsList = Array; export const TransferProjectsFromOrgToOrgRequestProjectIdsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface TransferProjectsFromOrgToOrgRequest { /** The Neon organization ID (source org, which currently owns the project) */ source_org_id: string; /** The destination organization identifier */ destination_org_id: string; /** The list of projects ids to transfer. Maximum of 400 project ids */ project_ids: TransferProjectsFromOrgToOrgRequestProjectIdsList; } export const TransferProjectsFromOrgToOrgRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ source_org_id: S.String.pipe(T.Label()), destination_org_id: S.String, project_ids: TransferProjectsFromOrgToOrgRequestProjectIdsList, }).pipe( T.Http({ method: "POST", uri: "/organizations/{source_org_id}/projects/transfer", code: 200, }), ), ).annotate({ identifier: "TransferProjectsFromOrgToOrgRequest", }) as any as S.Schema; export type TransferProjectsFromOrgToOrgResponse = unknown; export const TransferProjectsFromOrgToOrgResponse = /*@__PURE__*/ S.suspend( () => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "TransferProjectsFromOrgToOrgResponse", }) as any as S.Schema; export type UpdateBranchNeonAuthOauthProviderRequestOauthProviderId = | "google" | "github" | "microsoft" | "vercel"; export const UpdateBranchNeonAuthOauthProviderRequestOauthProviderId = S.String; export interface UpdateBranchNeonAuthOauthProviderRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The OAuth provider ID */ oauth_provider_id: | UpdateBranchNeonAuthOauthProviderRequestOauthProviderId | (string & {}); /** The OAuth client ID registered with the provider. Omit to keep the currently configured value. */ client_id?: string; /** OAuth client secret for the provider. Omit to leave the existing secret unchanged. */ client_secret?: string | Redacted.Redacted; /** The tenant ID scoping the Microsoft OAuth provider. Supply this field when the provider type is microsoft; it has no effect for other provider types. */ microsoft_tenant_id?: string; } export const UpdateBranchNeonAuthOauthProviderRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), oauth_provider_id: UpdateBranchNeonAuthOauthProviderRequestOauthProviderId.pipe(T.Label()), client_id: S.optional(S.String), client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), microsoft_tenant_id: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}", code: 200, }), ), ).annotate({ identifier: "UpdateBranchNeonAuthOauthProviderRequest", }) as any as S.Schema; /** List of masking rules to apply to the branch. This will replace all existing masking rules for the branch. */ export type UpdateMaskingRulesRequestMaskingRulesList = Array; export const UpdateMaskingRulesRequestMaskingRulesList = /*@__PURE__*/ S.Array( MaskingRule, ) as any as S.Schema; export interface UpdateMaskingRulesRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** List of masking rules to apply to the branch. This will replace all existing masking rules for the branch. */ masking_rules: UpdateMaskingRulesRequestMaskingRulesList; } export const UpdateMaskingRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), masking_rules: UpdateMaskingRulesRequestMaskingRulesList, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/masking_rules", code: 200, }), ), ).annotate({ identifier: "UpdateMaskingRulesRequest", }) as any as S.Schema; export interface UpdateNeonAuthAllowLocalhostRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Whether to allow localhost connections */ allow_localhost: boolean; } export const UpdateNeonAuthAllowLocalhostRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), allow_localhost: S.Boolean, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/allow_localhost", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthAllowLocalhostRequest", }) as any as S.Schema; export interface UpdateNeonAuthConfigRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The application name used in auth emails and communications. */ name: string; } export const UpdateNeonAuthConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), name: S.String, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/config", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthConfigRequest", }) as any as S.Schema; export interface NeonAuthConfigResponse { /** The application name used in auth emails and communications. */ name: string; } export const NeonAuthConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, }), ).annotate({ identifier: "NeonAuthConfigResponse", }) as any as S.Schema; export interface UpdateNeonAuthEmailAndPasswordConfigRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Controls whether email and password authentication is enabled for this project. When omitted from an update request, the current value is unchanged. */ enabled?: boolean; /** Email verification method. `link`: sends a verification link. `otp`: sends a one-time password. */ email_verification_method?: NeonAuthEmailVerificationMethod | (string & {}); /** When true, users must verify their email address before they can sign in. Omitting this field from an update request leaves the current value unchanged. */ require_email_verification?: boolean; /** Whether users are automatically signed in after verifying their email */ auto_sign_in_after_verification?: boolean; /** Whether to send a verification email when users sign up. */ send_verification_email_on_sign_up?: boolean; /** Whether to send a verification email when a user with an unverified email signs in. */ send_verification_email_on_sign_in?: boolean; /** Whether to disable new user sign ups. When omitted, the current setting is not changed. */ disable_sign_up?: boolean; } export const UpdateNeonAuthEmailAndPasswordConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), enabled: S.optional(S.Boolean), email_verification_method: S.optional(NeonAuthEmailVerificationMethod), require_email_verification: S.optional(S.Boolean), auto_sign_in_after_verification: S.optional(S.Boolean), send_verification_email_on_sign_up: S.optional(S.Boolean), send_verification_email_on_sign_in: S.optional(S.Boolean), disable_sign_up: S.optional(S.Boolean), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/email_and_password", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthEmailAndPasswordConfigRequest", }) as any as S.Schema; export interface StandardEmailServer { /** Hostname of the email server. */ host?: string; /** TCP port of the SMTP server. Common values: 25 (SMTP), 465 (SMTPS), 587 (submission). */ port?: number; /** Username for authenticating with the SMTP server. */ username?: string; /** Password for authenticating with the SMTP server. */ password?: string | Redacted.Redacted; /** Email address used as the From address on outgoing auth emails. */ sender_email?: string; /** Display name shown as the sender in outgoing emails. */ sender_name?: string; } export const StandardEmailServer = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional(S.String), port: S.optional(S.Number), username: S.optional(S.String), password: S.optional(S.String.pipe(T.SensitiveValue({}))), sender_email: S.optional(S.String), sender_name: S.optional(S.String), }), ).annotate({ identifier: "StandardEmailServer", }) as any as S.Schema; export type NeonAuthEmailServerConfig = StandardEmailServer | SharedEmailServer; export const NeonAuthEmailServerConfig = S.Unknown as any as S.Schema; export interface UpdateNeonAuthEmailProviderRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; body: NeonAuthEmailServerConfig; } export const UpdateNeonAuthEmailProviderRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), body: NeonAuthEmailServerConfig.pipe(T.HttpBody()), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/email_provider", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthEmailProviderRequest", }) as any as S.Schema; export type UpdateNeonAuthEmailProviderResponse = NeonAuthEmailServerConfigResponse; export const UpdateNeonAuthEmailProviderResponse = /*@__PURE__*/ S.suspend(() => NeonAuthEmailServerConfigResponse.pipe(T.RawResponseRoot()), ).annotate({ identifier: "UpdateNeonAuthEmailProviderResponse", }) as any as S.Schema; export interface UpdateNeonAuthMagicLinkPluginRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Whether to enable the magic link plugin. */ enabled?: boolean; /** Minutes until the magic link expires. */ expires_in?: number; /** When true, sign-up via magic link is disabled. */ disable_sign_up?: boolean; } export const UpdateNeonAuthMagicLinkPluginRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), enabled: S.optional(S.Boolean), expires_in: S.optional(S.Number), disable_sign_up: S.optional(S.Boolean), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/plugins/magic-link", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthMagicLinkPluginRequest", }) as any as S.Schema; /** Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ export type UpdateNeonAuthOrganizationPluginRequestCreatorRole = | "admin" | "owner"; export const UpdateNeonAuthOrganizationPluginRequestCreatorRole = S.String; export interface UpdateNeonAuthOrganizationPluginRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Controls whether the organization plugin is active for the organization. */ enabled?: boolean; /** Maximum organizations a user can belong to (created or joined). At the limit, the user cannot create or join more. */ organization_limit?: number; /** Maximum members per organization. */ membership_limit?: number; /** Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ creator_role?: | UpdateNeonAuthOrganizationPluginRequestCreatorRole | (string & {}); /** When true, invited users receive an email containing an accept link. Requires that the invited user has a verified email address. */ send_invitation_email?: boolean; } export const UpdateNeonAuthOrganizationPluginRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), enabled: S.optional(S.Boolean), organization_limit: S.optional(S.Number), membership_limit: S.optional(S.Number), creator_role: S.optional( UpdateNeonAuthOrganizationPluginRequestCreatorRole, ), send_invitation_email: S.optional(S.Boolean), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/plugins/organization", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthOrganizationPluginRequest", }) as any as S.Schema; export interface UpdateNeonAuthPhoneNumberPluginRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Whether the phone number plugin is enabled. */ enabled?: boolean; /** Time in seconds before the OTP expires */ otp_expires_in?: number; } export const UpdateNeonAuthPhoneNumberPluginRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), enabled: S.optional(S.Boolean), otp_expires_in: S.optional(S.Number), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/auth/plugins/phone-number", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthPhoneNumberPluginRequest", }) as any as S.Schema; /** Roles to assign to the user in the Neon Auth (Better Auth) directory. `user` and `admin` are the built-in roles; custom role strings are also supported. */ export type UpdateNeonAuthUserRoleRequestRolesList = Array; export const UpdateNeonAuthUserRoleRequestRolesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface UpdateNeonAuthUserRoleRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The Neon user ID */ auth_user_id: string; /** Roles to assign to the user in the Neon Auth (Better Auth) directory. `user` and `admin` are the built-in roles; custom role strings are also supported. */ roles: UpdateNeonAuthUserRoleRequestRolesList; } export const UpdateNeonAuthUserRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), auth_user_id: S.String.pipe(T.Label()), roles: UpdateNeonAuthUserRoleRequestRolesList, }).pipe( T.Http({ method: "PUT", uri: "/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}/role", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthUserRoleRequest", }) as any as S.Schema; export interface UpdateNeonAuthUserRoleResponse { /** ID of the updated user */ id: string; } export const UpdateNeonAuthUserRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, }), ).annotate({ identifier: "UpdateNeonAuthUserRoleResponse", }) as any as S.Schema; export type UpdateNeonAuthWebhookConfigRequestEnabledEventsItem = | "user.before_create" | "user.created" | "send.otp" | "send.magic_link" | "organization.invitation.created" | "organization.invitation.accepted" | "phone_number.verified"; export const UpdateNeonAuthWebhookConfigRequestEnabledEventsItem = S.String; /** Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values. */ export type UpdateNeonAuthWebhookConfigRequestEnabledEventsList = Array< UpdateNeonAuthWebhookConfigRequestEnabledEventsItem | (string & {}) >; export const UpdateNeonAuthWebhookConfigRequestEnabledEventsList = /*@__PURE__*/ S.Array( UpdateNeonAuthWebhookConfigRequestEnabledEventsItem, ) as any as S.Schema; export interface UpdateNeonAuthWebhookConfigRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** Whether the webhook is active. */ enabled: boolean; /** Destination URL that receives webhook event payloads. */ webhook_url?: string; /** Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values. */ enabled_events?: UpdateNeonAuthWebhookConfigRequestEnabledEventsList; /** Maximum time, in seconds, to wait for a response from the webhook endpoint. */ timeout_seconds?: number; } export const UpdateNeonAuthWebhookConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), enabled: S.Boolean, webhook_url: S.optional(S.String), enabled_events: S.optional( UpdateNeonAuthWebhookConfigRequestEnabledEventsList, ), timeout_seconds: S.optional(S.Number), }).pipe( T.Http({ method: "PUT", uri: "/projects/{project_id}/branches/{branch_id}/auth/webhooks", code: 200, }), ), ).annotate({ identifier: "UpdateNeonAuthWebhookConfigRequest", }) as any as S.Schema; export interface UpdateOrganizationMemberRequest { /** The Neon organization ID */ org_id: string; /** The Neon organization member ID */ member_id: string; role: MemberRole | (string & {}); } export const UpdateOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ org_id: S.String.pipe(T.Label()), member_id: S.String.pipe(T.Label()), role: MemberRole, }).pipe( T.Http({ method: "PATCH", uri: "/organizations/{org_id}/members/{member_id}", code: 200, }), ), ).annotate({ identifier: "UpdateOrganizationMemberRequest", }) as any as S.Schema; export interface UpdateProjectRequestProject { /** Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`. */ settings?: ProjectSettingsData; /** The project name */ name?: string; default_endpoint_settings?: DefaultEndpointSettings; /** History window (point-in-time restore range) for all branches, in seconds. `0` disables it. Default 1 day (Free: 6 hours). Maximum depends on plan: Free 6 hours (21600), Launch 7 days (604800), Scale 30 days (2592000). */ history_retention_seconds?: number; } export const UpdateProjectRequestProject = /*@__PURE__*/ S.suspend(() => S.Struct({ settings: S.optional(ProjectSettingsData), name: S.optional(S.String), default_endpoint_settings: S.optional(DefaultEndpointSettings), history_retention_seconds: S.optional(S.Number), }), ).annotate({ identifier: "UpdateProjectRequestProject", }) as any as S.Schema; export interface UpdateProjectRequest { /** The Neon project ID */ project_id: string; project: UpdateProjectRequestProject; } export const UpdateProjectRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), project: UpdateProjectRequestProject, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}", code: 200 }), ), ).annotate({ identifier: "UpdateProjectRequest", }) as any as S.Schema; export type UpdateProjectResponseOperationsList = Array; export const UpdateProjectResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface UpdateProjectResponse { /** Full details of the project, including configuration, consumption metrics, and ownership. */ project: Project; operations: UpdateProjectResponseOperationsList; } export const UpdateProjectResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ project: Project, operations: UpdateProjectResponseOperationsList, }), ).annotate({ identifier: "UpdateProjectResponse", }) as any as S.Schema; /** Branch attributes to update. Supply only the fields you want to change, for example `name` or `protected`. */ export interface UpdateProjectBranchRequestBranch { /** New display name for the branch. */ name?: string; /** Whether the branch is protected. Protected branches (and their computes) cannot be deleted, archived, or reset, and block deletion of the project. Can be gated by `protected_branches_only` in the IP allowlist. Paid plans only. */ protected?: boolean; /** The timestamp when the branch is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time. If this field is set to null, the expiration timestamp is removed. Access to this feature is currently limited to participants in the Early Access Program. */ expires_at?: string | null; } export const UpdateProjectBranchRequestBranch = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), protected: S.optional(S.Boolean), expires_at: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "UpdateProjectBranchRequestBranch", }) as any as S.Schema; export interface UpdateProjectBranchRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** Branch attributes to update. Supply only the fields you want to change, for example `name` or `protected`. */ branch: UpdateProjectBranchRequestBranch; } export const UpdateProjectBranchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), branch: UpdateProjectBranchRequestBranch, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}", code: 200, }), ), ).annotate({ identifier: "UpdateProjectBranchRequest", }) as any as S.Schema; export type UpdateProjectBranchResponseOperationsList = Array; export const UpdateProjectBranchResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface UpdateProjectBranchResponse { /** Branch returned by the request. */ branch: Branch; operations: UpdateProjectBranchResponseOperationsList; } export const UpdateProjectBranchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ branch: Branch, operations: UpdateProjectBranchResponseOperationsList, }), ).annotate({ identifier: "UpdateProjectBranchResponse", }) as any as S.Schema; export interface UpdateProjectBranchDataAPIRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The database name */ database_name: string; /** Configuration settings for the Neon Data API. */ settings?: DataAPISettings; } export const UpdateProjectBranchDataAPIRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), settings: S.optional(DataAPISettings), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}", code: 200, }), ), ).annotate({ identifier: "UpdateProjectBranchDataAPIRequest", }) as any as S.Schema; export type UpdateProjectBranchDataAPIResponse = unknown; export const UpdateProjectBranchDataAPIResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot()), ).annotate({ identifier: "UpdateProjectBranchDataAPIResponse", }) as any as S.Schema; /** Properties to update on the database. */ export interface UpdateProjectBranchDatabaseRequestDatabase { /** Name of the database to update. */ name?: string; /** The name of the role that owns the database */ owner_name?: string; } export const UpdateProjectBranchDatabaseRequestDatabase = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), owner_name: S.optional(S.String), }), ).annotate({ identifier: "UpdateProjectBranchDatabaseRequestDatabase", }) as any as S.Schema; export interface UpdateProjectBranchDatabaseRequest { /** The Neon project ID */ project_id: string; /** The branch ID */ branch_id: string; /** The database name */ database_name: string; /** Properties to update on the database. */ database: UpdateProjectBranchDatabaseRequestDatabase; } export const UpdateProjectBranchDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), database_name: S.String.pipe(T.Label()), database: UpdateProjectBranchDatabaseRequestDatabase, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}", code: 200, }), ), ).annotate({ identifier: "UpdateProjectBranchDatabaseRequest", }) as any as S.Schema; export type UpdateProjectBranchDatabaseResponseOperationsList = Array; export const UpdateProjectBranchDatabaseResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface UpdateProjectBranchDatabaseResponse { /** Database object returned by the operation. */ database: Database; operations: UpdateProjectBranchDatabaseResponseOperationsList; } export const UpdateProjectBranchDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ database: Database, operations: UpdateProjectBranchDatabaseResponseOperationsList, }), ).annotate({ identifier: "UpdateProjectBranchDatabaseResponse", }) as any as S.Schema; export interface UpdateProjectBranchFunctionRequest { /** The Neon project ID */ project_id: string; /** The Neon branch ID */ branch_id: string; /** The function slug */ slug: string; /** New display name for the function. `null` clears the display name; the function's `name` then falls back to its slug. Leading and trailing whitespace is trimmed; a whitespace-only name is rejected. */ name: string | null; } export const UpdateProjectBranchFunctionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), branch_id: S.String.pipe(T.Label()), slug: S.String.pipe(T.Label()), name: S.NullOr(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/branches/{branch_id}/functions/{slug}", code: 200, }), ), ).annotate({ identifier: "UpdateProjectBranchFunctionRequest", }) as any as S.Schema; /** Parameters for the compute endpoint update. */ export interface UpdateProjectEndpointRequestEndpoint { /** Deprecated. The destination branch ID; must not have an existing read-write endpoint. */ branch_id?: string; /** The minimum number of Compute Units. The minimum value is `0.25`. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_min_cu?: number; /** The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration) for more information. */ autoscaling_limit_max_cu?: number; /** Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`. */ provisioner?: string; settings?: EndpointSettingsData; /** Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string. See [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling) */ pooler_enabled?: boolean; /** Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026. */ pooler_mode?: EndpointPoolerMode | (string & {}); /** Whether to restrict connections to the compute endpoint. Enabling this option schedules a suspend compute operation. A disabled compute endpoint cannot be enabled by a connection or console action. However, the compute endpoint is periodically enabled by check_availability operations. */ disabled?: boolean; /** NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint. */ passwordless_access?: boolean; /** Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` uses the plan default; `-1` disables scale-to-zero (never suspends). Minimum is plan-dependent (Scale: 60); maximum 604800 (one week). Free cannot change it; Launch can only enable or disable; Scale can set any value. */ suspend_timeout_seconds?: number; /** Optional name of the compute endpoint */ name?: string; } export const UpdateProjectEndpointRequestEndpoint = /*@__PURE__*/ S.suspend( () => S.Struct({ branch_id: S.optional(S.String), autoscaling_limit_min_cu: S.optional(S.Number), autoscaling_limit_max_cu: S.optional(S.Number), provisioner: S.optional(S.String), settings: S.optional(EndpointSettingsData), pooler_enabled: S.optional(S.Boolean), pooler_mode: S.optional(EndpointPoolerMode), disabled: S.optional(S.Boolean), passwordless_access: S.optional(S.Boolean), suspend_timeout_seconds: S.optional(S.Number), name: S.optional(S.String), }), ).annotate({ identifier: "UpdateProjectEndpointRequestEndpoint", }) as any as S.Schema; export interface UpdateProjectEndpointRequest { /** The Neon project ID */ project_id: string; /** The endpoint ID */ endpoint_id: string; /** Parameters for the compute endpoint update. */ endpoint: UpdateProjectEndpointRequestEndpoint; } export const UpdateProjectEndpointRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), endpoint_id: S.String.pipe(T.Label()), endpoint: UpdateProjectEndpointRequestEndpoint, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/endpoints/{endpoint_id}", code: 200, }), ), ).annotate({ identifier: "UpdateProjectEndpointRequest", }) as any as S.Schema; export type UpdateProjectEndpointResponseOperationsList = Array; export const UpdateProjectEndpointResponseOperationsList = /*@__PURE__*/ S.Array( Operation, ) as any as S.Schema; export interface UpdateProjectEndpointResponse { /** Compute endpoint created or retrieved, including its current lifecycle state. */ endpoint: Endpoint; operations: UpdateProjectEndpointResponseOperationsList; } export const UpdateProjectEndpointResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ endpoint: Endpoint, operations: UpdateProjectEndpointResponseOperationsList, }), ).annotate({ identifier: "UpdateProjectEndpointResponse", }) as any as S.Schema; /** Fields to update on the snapshot. Updatable fields include `name` and `expires_at`. */ export interface UpdateSnapshotRequestSnapshot { /** Human-readable label for the snapshot. */ name?: string; /** The date and time when the snapshot will expire. Omit to leave the current expiration unchanged. Send `null` to clear the expiration so the snapshot never expires. A future timestamp sets the absolute expiration. */ expires_at?: string | null; } export const UpdateSnapshotRequestSnapshot = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), expires_at: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "UpdateSnapshotRequestSnapshot", }) as any as S.Schema; export interface UpdateSnapshotRequest { /** The Neon project ID */ project_id: string; /** The snapshot ID */ snapshot_id: string; /** Fields to update on the snapshot. Updatable fields include `name` and `expires_at`. */ snapshot: UpdateSnapshotRequestSnapshot; } export const UpdateSnapshotRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ project_id: S.String.pipe(T.Label()), snapshot_id: S.String.pipe(T.Label()), snapshot: UpdateSnapshotRequestSnapshot, }).pipe( T.Http({ method: "PATCH", uri: "/projects/{project_id}/snapshots/{snapshot_id}", code: 200, }), ), ).annotate({ identifier: "UpdateSnapshotRequest", }) as any as S.Schema; export interface UpdateSnapshotResponse { snapshot: Snapshot; } export const UpdateSnapshotResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ snapshot: Snapshot, }), ).annotate({ identifier: "UpdateSnapshotResponse", }) as any as S.Schema; export type AcceptProjectTransferRequestError = NeonOpError; /** Accept a project transfer request Accepts a transfer request for the specified project, transferring it to the specified organization or user. If org_id is not passed, the project will be transferred to the current user or organization account. */ export const acceptProjectTransferRequest: API.OperationMethod< AcceptProjectTransferRequestRequest, AcceptProjectTransferRequestResponse, AcceptProjectTransferRequestError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AcceptProjectTransferRequestRequest, output: AcceptProjectTransferRequestResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type AddBranchNeonAuthOauthProviderError = NeonOpError; /** Add an OAuth provider Adds an OAuth provider configuration to the specified branch's Neon Auth integration. After adding, users can authenticate using the configured provider. */ export const addBranchNeonAuthOauthProvider: API.OperationMethod< AddBranchNeonAuthOauthProviderRequest, NeonAuthOauthProvider, AddBranchNeonAuthOauthProviderError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AddBranchNeonAuthOauthProviderRequest, output: NeonAuthOauthProvider, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type AddBranchNeonAuthTrustedDomainError = NeonOpError; /** Add domain to redirect_uri whitelist Adds a domain to the redirect URI whitelist for the specified branch. Only domains in this list are permitted as redirect targets after authentication. */ export const addBranchNeonAuthTrustedDomain: API.OperationMethod< AddBranchNeonAuthTrustedDomainRequest, AddBranchNeonAuthTrustedDomainResponse, AddBranchNeonAuthTrustedDomainError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AddBranchNeonAuthTrustedDomainRequest, output: AddBranchNeonAuthTrustedDomainResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type AddProjectJWKSError = NeonOpError; /** Add JWKS URL Adds a JWKS URL to the specified project for verifying JWTs used as the authentication mechanism. The URL must be a valid HTTPS URL that returns a JSON Web Key Set. The `provider_name` field allows you to specify which authentication provider you're using (e.g., Clerk, Auth0, AWS Cognito). The `branch_id` scopes the JWKS URL to specific branches; if not specified, it applies to all branches. The `role_names` scopes the URL to specific roles; if not specified, default roles are used (`authenticator`, `authenticated`, `anonymous`). The `jwt_audience` specifies which `aud` values are accepted in JWTs. */ export const addProjectJWKS: API.OperationMethod< AddProjectJWKSRequest, AddProjectJWKSResponse, AddProjectJWKSError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AddProjectJWKSRequest, output: AddProjectJWKSResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type AssignOrganizationVPCEndpointError = NeonOpError; /** Assign or update VPC endpoint Assigns a VPC endpoint to a Neon organization or updates its existing assignment. */ export const assignOrganizationVPCEndpoint: API.OperationMethod< AssignOrganizationVPCEndpointRequest, AssignOrganizationVPCEndpointResponse, AssignOrganizationVPCEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AssignOrganizationVPCEndpointRequest, output: AssignOrganizationVPCEndpointResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type AssignProjectVPCEndpointError = NeonOpError; /** Set VPC endpoint restriction Sets or updates a VPC endpoint restriction for a Neon project. When a VPC endpoint restriction is set, the project only accepts connections from the specified VPC. A VPC endpoint can be set as a restriction only after it is assigned to the parent organization of the Neon project. */ export const assignProjectVPCEndpoint: API.OperationMethod< AssignProjectVPCEndpointRequest, AssignProjectVPCEndpointResponse, AssignProjectVPCEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: AssignProjectVPCEndpointRequest, output: AssignProjectVPCEndpointResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CountProjectBranchesError = NotFound | NeonOpError; /** Retrieve number of branches Retrieves the total number of branches in the specified project. Supports an optional `search` parameter to count branches matching a name filter. */ export const countProjectBranches: API.OperationMethod< CountProjectBranchesRequest, CountProjectBranchesResponse, CountProjectBranchesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CountProjectBranchesRequest, output: CountProjectBranchesResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateApiKeyError = NeonOpError; /** Create API key Creates an API key. The `key_name` is a user-specified name for the key. Returns an `id` and `key`; the `key` is a randomly generated, 64-bit token required to access the Neon API. Store the key securely — it is only returned once. API keys can also be managed in the Neon Console. See [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const createApiKey: API.OperationMethod< CreateApiKeyRequest, ApiKeyCreateResponse, CreateApiKeyError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateApiKeyRequest, output: ApiKeyCreateResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateBranchNeonAuthNewUserError = NeonOpError; /** Create new auth user Creates a new user in the Neon Auth user directory for the specified branch. The user is created in the `neon_auth.users_sync` table and can immediately authenticate using the branch's configured auth providers. */ export const createBranchNeonAuthNewUser: API.OperationMethod< CreateBranchNeonAuthNewUserRequest, NeonAuthCreateNewUserResponse, CreateBranchNeonAuthNewUserError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateBranchNeonAuthNewUserRequest, output: NeonAuthCreateNewUserResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateCredentialError = NeonOpError; /** Issue a scoped credential on the branch Issues a new scoped service credential anchored to the specified branch. The response carries `api_token` and `s3_secret_access_key` exactly once — they are not stored server-side. **Note**: This endpoint is currently in Beta. */ export const createCredential: API.OperationMethod< CreateCredentialRequest, CreateCredentialResponse, CreateCredentialError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateCredentialRequest, output: CreateCredentialResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateNeonAuthError = NeonOpError; /** Enable Neon Auth for the branch Enables Neon Auth for the specified branch by connecting it to an authentication provider. Creating the integration provisions the `neon_auth` schema in the branch database, which stores user identity data synchronized from the provider. */ export const createNeonAuth: API.OperationMethod< CreateNeonAuthRequest, NeonAuthCreateIntegrationResponse, CreateNeonAuthError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateNeonAuthRequest, output: NeonAuthCreateIntegrationResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateNeonAuthProviderSDKKeysError = NeonOpError; /** Create Auth Provider SDK keys Generates SDK or API Keys for the auth provider. These might be called different things depending on the auth provider you're using, but are generally used for setting up the frontend and backend SDKs. */ export const createNeonAuthProviderSDKKeys: API.OperationMethod< CreateNeonAuthProviderSDKKeysRequest, NeonAuthCreateIntegrationResponse, CreateNeonAuthProviderSDKKeysError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateNeonAuthProviderSDKKeysRequest, output: NeonAuthCreateIntegrationResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateOrganizationInvitationsError = NeonOpError; /** Create organization invitations Creates invitations for a specific organization. If the invited user has an existing account, they automatically join as a member. If they don't yet have an account, they are invited to create one, after which they become a member. Each invited user receives an email notification. */ export const createOrganizationInvitations: API.OperationMethod< CreateOrganizationInvitationsRequest, OrganizationInvitationsResponse, CreateOrganizationInvitationsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateOrganizationInvitationsRequest, output: OrganizationInvitationsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateOrgApiKeyError = NeonOpError; /** Create organization API key Creates an API key for the specified organization. The `key_name` is a user-specified name for the key. Returns an `id` and `key`; the `key` is a randomly generated, 64-bit token required to access the Neon API. Store the key securely — it is only returned once. API keys can also be managed in the Neon Console. See [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const createOrgApiKey: API.OperationMethod< CreateOrgApiKeyRequest, CreateOrgApiKeyResponse, CreateOrgApiKeyError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateOrgApiKeyRequest, output: CreateOrgApiKeyResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectError = NeonOpError; /** Create project Creates a Neon project within an organization. If using a personal API key, include the `org_id` parameter to specify which organization to create the project in. If using an org API key, `org_id` is automatically inferred from the key. Plan limits define how many projects you can create. For more information, see [Manage projects](https://neon.com/docs/manage/projects/). You can specify a region and Postgres version in the request body. Neon supports Postgres 14 through 18, with 19 rolling out to enabled regions. For supported regions and `region_id` values, see [Regions](https://neon.com/docs/introduction/regions/). */ export const createProject: API.OperationMethod< CreateProjectRequest, CreateProjectResponse, CreateProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectRequest, output: CreateProjectResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchError = NeonOpError; /** Create branch Creates a branch in the specified project. No request body is required, but you can specify one to create a compute endpoint or select a non-default parent branch. By default, the branch is created from the project's default branch with no compute endpoint, and the branch name is auto-generated. To access the branch, add a `read_write` endpoint. Each branch supports one read-write endpoint and multiple read-only endpoints. For related information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const createProjectBranch: API.OperationMethod< CreateProjectBranchRequest, CreateProjectBranchResponse, CreateProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchRequest, output: CreateProjectBranchResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchAnonymizedError = NeonOpError; /** Create anonymized branch Creates a new branch with anonymized data using PostgreSQL Anonymizer for static masking. This allows developers to work with masked production data. Optionally, provide `masking_rules` to set initial masking rules for the branch and `start_anonymization` to automatically start anonymization after creation. This combines functionality of updating masking rules and starting anonymization into the branch creation request. **Note**: This endpoint is currently in Beta. */ export const createProjectBranchAnonymized: API.OperationMethod< CreateProjectBranchAnonymizedRequest, CreateProjectBranchAnonymizedResponse, CreateProjectBranchAnonymizedError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchAnonymizedRequest, output: CreateProjectBranchAnonymizedResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchBucketError = NeonOpError; /** Create a bucket on the branch Creates a new branchable object storage bucket on the specified branch. Buckets are managed by the Neon Platform branchable object storage service. **Note**: This endpoint is currently in Beta. */ export const createProjectBranchBucket: API.OperationMethod< CreateProjectBranchBucketRequest, BucketResponse, CreateProjectBranchBucketError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchBucketRequest, output: BucketResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchDataAPIError = NeonOpError; /** Create Neon Data API Creates a new instance of Neon Data API in the specified branch. The Data API exposes a REST interface over the branch database. The `database_name` path parameter determines which database the API serves. */ export const createProjectBranchDataAPI: API.OperationMethod< CreateProjectBranchDataAPIRequest, DataAPICreateResponse, CreateProjectBranchDataAPIError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchDataAPIRequest, output: DataAPICreateResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchDatabaseError = | BadRequest | NotFound | Conflict | UnprocessableEntity | NeonOpError; /** Create database Creates a database in the specified branch. A branch can have multiple databases. For related information, see [Manage databases](https://neon.com/docs/manage/databases/). */ export const createProjectBranchDatabase: API.OperationMethod< CreateProjectBranchDatabaseRequest, CreateProjectBranchDatabaseResponse, CreateProjectBranchDatabaseError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchDatabaseRequest, output: CreateProjectBranchDatabaseResponse, errors: [ BadRequest, NotFound, Conflict, UnprocessableEntity, UnknownNeonError, ], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchFunctionDeploymentError = NeonOpError; /** Deploy code to a function Creates a deployment for the function. Supply any subset of zip, environment, and runtime; omitted fields inherit the function's latest version. At least one field must be supplied. The first deployment of a function must include zip. The newest deployment becomes active. **Note**: This endpoint is currently in Beta. */ export const createProjectBranchFunctionDeployment: API.OperationMethod< CreateProjectBranchFunctionDeploymentRequest, NeonFunctionDeploymentResponse, CreateProjectBranchFunctionDeploymentError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchFunctionDeploymentRequest, output: NeonFunctionDeploymentResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectBranchRoleError = NotFound | Conflict | NeonOpError; /** Create role Creates a Postgres role in the specified branch. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). Connections established to the active compute endpoint will be dropped. If the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward. */ export const createProjectBranchRole: API.OperationMethod< CreateProjectBranchRoleRequest, CreateProjectBranchRoleResponse, CreateProjectBranchRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectBranchRoleRequest, output: CreateProjectBranchRoleResponse, errors: [NotFound, Conflict, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectEndpointError = NotFound | Conflict | NeonOpError; /** Create compute endpoint Creates a compute endpoint for the specified branch. A compute endpoint is a Neon compute instance. There is a maximum of one read-write compute endpoint per branch. If the specified branch already has a read-write compute endpoint, the operation fails. A branch can have multiple read-only compute endpoints. For more information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const createProjectEndpoint: API.OperationMethod< CreateProjectEndpointRequest, CreateProjectEndpointResponse, CreateProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectEndpointRequest, output: CreateProjectEndpointResponse, errors: [NotFound, Conflict, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateProjectTransferRequestError = NeonOpError; /** Create a project transfer request Creates a transfer request for the specified project. The request expires after a set period. To accept the request, the recipient calls `PUT /projects/{project_id}/transfer_requests/{request_id}` or uses the Neon Console claim link. The optional `ru` parameter redirects the recipient after acceptance. */ export const createProjectTransferRequest: API.OperationMethod< CreateProjectTransferRequestRequest, ProjectTransferRequestResponse, CreateProjectTransferRequestError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateProjectTransferRequestRequest, output: ProjectTransferRequestResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type CreateSnapshotError = NeonOpError; /** Create snapshot Creates a snapshot from the specified branch. This operation may initiate an asynchronous process. */ export const createSnapshot: API.OperationMethod< CreateSnapshotRequest, CreateSnapshotResponse, CreateSnapshotError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateSnapshotRequest, output: CreateSnapshotResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteBranchNeonAuthOauthProviderError = NeonOpError; /** Delete OAuth provider Deletes an OAuth provider from the specified project. */ export const deleteBranchNeonAuthOauthProvider: API.OperationMethod< DeleteBranchNeonAuthOauthProviderRequest, DeleteBranchNeonAuthOauthProviderResponse, DeleteBranchNeonAuthOauthProviderError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteBranchNeonAuthOauthProviderRequest, output: DeleteBranchNeonAuthOauthProviderResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteBranchNeonAuthTrustedDomainError = NeonOpError; /** Delete domain from redirect_uri whitelist Removes a domain from the redirect URI whitelist for the specified branch. After removal, the domain can no longer be used as a redirect target after authentication. */ export const deleteBranchNeonAuthTrustedDomain: API.OperationMethod< DeleteBranchNeonAuthTrustedDomainRequest, DeleteBranchNeonAuthTrustedDomainResponse, DeleteBranchNeonAuthTrustedDomainError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteBranchNeonAuthTrustedDomainRequest, output: DeleteBranchNeonAuthTrustedDomainResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteBranchNeonAuthUserError = NeonOpError; /** Delete auth user Deletes the specified user from the Neon Auth user directory for the specified branch. Removes the user record from `neon_auth.users_sync`. This action cannot be undone. */ export const deleteBranchNeonAuthUser: API.OperationMethod< DeleteBranchNeonAuthUserRequest, DeleteBranchNeonAuthUserResponse, DeleteBranchNeonAuthUserError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteBranchNeonAuthUserRequest, output: DeleteBranchNeonAuthUserResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteOrganizationSpendingLimitError = NeonOpError; /** Remove organization spending limit Removes the configured monthly spending limit for the specified organization. Idempotent — removing an already-unset limit still succeeds. Available to organization admins on Launch and Scale plans only. */ export const deleteOrganizationSpendingLimit: API.OperationMethod< DeleteOrganizationSpendingLimitRequest, DeleteOrganizationSpendingLimitResponse, DeleteOrganizationSpendingLimitError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteOrganizationSpendingLimitRequest, output: DeleteOrganizationSpendingLimitResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteOrganizationVPCEndpointError = NeonOpError; /** Delete VPC endpoint Deletes the VPC endpoint from the specified Neon organization. If you delete a VPC endpoint from a Neon organization, that VPC endpoint cannot be added back to the Neon organization. */ export const deleteOrganizationVPCEndpoint: API.OperationMethod< DeleteOrganizationVPCEndpointRequest, DeleteOrganizationVPCEndpointResponse, DeleteOrganizationVPCEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteOrganizationVPCEndpointRequest, output: DeleteOrganizationVPCEndpointResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectError = NotFound | NeonOpError; /** Delete project Deletes the specified project and all its endpoints, branches, databases, and users. Deleted projects can be recovered within 7 days using `POST /projects/{project_id}/recover`. To list recoverable projects, use `GET /projects?recoverable=true`. */ export const deleteProject: API.OperationMethod< DeleteProjectRequest, ProjectResponse, DeleteProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectRequest, output: ProjectResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchError = | NotFound | UnprocessableEntity | NeonOpError; /** Delete branch Deletes the specified branch from a project and places all compute endpoints into an idle state, breaking existing client connections. The deletion completes after all operations finish. You cannot delete a project's root or default branch, or a branch that has a child branch. A project must have at least one branch. By default, deleted branches can be recovered within a 7-day grace period. Use the `hard_delete` parameter to permanently delete the branch immediately. For related information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const deleteProjectBranch: API.OperationMethod< DeleteProjectBranchRequest, DeleteProjectBranchResponse, DeleteProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchRequest, output: DeleteProjectBranchResponse, errors: [NotFound, UnprocessableEntity, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchBucketError = NotFound | NeonOpError; /** Delete a bucket on the branch Deletes the named bucket from the specified branch. **Note**: This endpoint is currently in Beta. */ export const deleteProjectBranchBucket: API.OperationMethod< DeleteProjectBranchBucketRequest, DeleteProjectBranchBucketResponse, DeleteProjectBranchBucketError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchBucketRequest, output: DeleteProjectBranchBucketResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchBucketObjectError = NotFound | NeonOpError; /** Delete an object in a bucket Deletes the named object from the bucket on the specified branch. Served by the user's session (no customer S3 credentials required). **Note**: This endpoint is currently in Beta. */ export const deleteProjectBranchBucketObject: API.OperationMethod< DeleteProjectBranchBucketObjectRequest, DeleteProjectBranchBucketObjectResponse, DeleteProjectBranchBucketObjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchBucketObjectRequest, output: DeleteProjectBranchBucketObjectResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchBucketObjectsByPrefixError = | NotFound | NeonOpError; /** Delete every object under a key prefix (folder) in a bucket Soft-deletes every object on the specified branch whose key starts with `prefix`, in a single call. Intended to back a "delete folder" action in an object browser: a `prefix` of `app/avatars/` removes every object beneath that folder. Served by the user's session (no customer S3 credentials required). `prefix` must be non-empty, end with `/`, be at most 1024 bytes, and contain no control characters - a partial-segment prefix cannot accidentally delete sibling keys. Returns the number of objects soft-deleted (`deleted`), which may be 0 when no live object matched the prefix on this branch. Only objects physically present on this branch are tombstoned; objects inherited from an ancestor branch via copy-on-write (not materialized on this branch) are out of scope. **Note**: This endpoint is currently in Beta. */ export const deleteProjectBranchBucketObjectsByPrefix: API.OperationMethod< DeleteProjectBranchBucketObjectsByPrefixRequest, BucketObjectsDeletePrefixResponse, DeleteProjectBranchBucketObjectsByPrefixError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchBucketObjectsByPrefixRequest, output: BucketObjectsDeletePrefixResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchCustomDomainError = NeonOpError; /** Delete a custom domain from a branch Removes a custom domain registered on the branch and stops routing it. **Note**: This endpoint is currently in Beta. */ export const deleteProjectBranchCustomDomain: API.OperationMethod< DeleteProjectBranchCustomDomainRequest, DeleteProjectBranchCustomDomainResponse, DeleteProjectBranchCustomDomainError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchCustomDomainRequest, output: DeleteProjectBranchCustomDomainResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchDataAPIError = NeonOpError; /** Delete Neon Data API Deletes the Neon Data API for the specified branch. Existing connections using the Data API endpoint will fail after deletion. */ export const deleteProjectBranchDataAPI: API.OperationMethod< DeleteProjectBranchDataAPIRequest, DeleteProjectBranchDataAPIResponse, DeleteProjectBranchDataAPIError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchDataAPIRequest, output: DeleteProjectBranchDataAPIResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchDatabaseError = NotFound | NeonOpError; /** Delete database Deletes the specified database from the branch. For related information, see [Manage databases](https://neon.com/docs/manage/databases/). */ export const deleteProjectBranchDatabase: API.OperationMethod< DeleteProjectBranchDatabaseRequest, DeleteProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchDatabaseRequest, output: DeleteProjectBranchDatabaseResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchFunctionError = NeonOpError; /** Delete a function on the branch Deletes the function identified by its slug. **Note**: This endpoint is currently in Beta. */ export const deleteProjectBranchFunction: API.OperationMethod< DeleteProjectBranchFunctionRequest, DeleteProjectBranchFunctionResponse, DeleteProjectBranchFunctionError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchFunctionRequest, output: DeleteProjectBranchFunctionResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectBranchRoleError = | NotFound | UnprocessableEntity | NeonOpError; /** Delete role Deletes the specified Postgres role from the branch. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). */ export const deleteProjectBranchRole: API.OperationMethod< DeleteProjectBranchRoleRequest, DeleteProjectBranchRoleResponse, DeleteProjectBranchRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectBranchRoleRequest, output: DeleteProjectBranchRoleResponse, errors: [NotFound, UnprocessableEntity, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectEndpointError = NotFound | NeonOpError; /** Delete compute endpoint Deletes the specified compute endpoint. A compute endpoint is a Neon compute instance. Deleting a compute endpoint drops existing network connections to the compute endpoint. The deletion is completed when the last operation in the chain finishes successfully. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const deleteProjectEndpoint: API.OperationMethod< DeleteProjectEndpointRequest, DeleteProjectEndpointResponse, DeleteProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectEndpointRequest, output: DeleteProjectEndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectJWKSError = NeonOpError; /** Delete JWKS URL Removes the specified JWKS URL from the project. JWTs signed by keys from the removed URL can no longer authenticate to the project's endpoints. */ export const deleteProjectJWKS: API.OperationMethod< DeleteProjectJWKSRequest, JWKS, DeleteProjectJWKSError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectJWKSRequest, output: JWKS, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteProjectVPCEndpointError = NeonOpError; /** Delete VPC endpoint restriction Removes the specified VPC endpoint restriction from a Neon project. */ export const deleteProjectVPCEndpoint: API.OperationMethod< DeleteProjectVPCEndpointRequest, DeleteProjectVPCEndpointResponse, DeleteProjectVPCEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteProjectVPCEndpointRequest, output: DeleteProjectVPCEndpointResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DeleteSnapshotError = NeonOpError; /** Delete snapshot Deletes the specified snapshot. */ export const deleteSnapshot: API.OperationMethod< DeleteSnapshotRequest, DeleteSnapshotResponse, DeleteSnapshotError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteSnapshotRequest, output: DeleteSnapshotResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type DisableNeonAuthError = NeonOpError; /** Disable Neon Auth for the branch Disables the Neon Auth integration for the specified branch, removing the connection to the authentication provider. If `delete_data` is `true`, also deletes the `neon_auth` schema and all associated tables from the branch database. The integration can be re-enabled by calling `POST /projects/{project_id}/branches/{branch_id}/auth`. */ export const disableNeonAuth: API.OperationMethod< DisableNeonAuthRequest, DisableNeonAuthResponse, DisableNeonAuthError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: DisableNeonAuthRequest, output: DisableNeonAuthResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type FinalizeRestoreBranchError = NeonOpError; /** Finalize branch restore from snapshot Finalize the restore operation for a branch created from a snapshot. This operation updates the branch so it functions as the original branch it replaced. This includes: - Reassigning any computes from the original branch to the restored branch (this will restart the computes) - Renaming the restored branch to the original branch's name - Renaming the original branch so it no longer uses the original name This operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`. */ export const finalizeRestoreBranch: API.OperationMethod< FinalizeRestoreBranchRequest, OperationsResponse, FinalizeRestoreBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: FinalizeRestoreBranchRequest, output: OperationsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetActiveRegionsError = NeonOpError; /** List supported regions Lists supported Neon regions. **Note:** Not all regions are available to all organizations. Pass the `org_id` parameter to get an accurate list of regions available to your organization. */ export const getActiveRegions: API.OperationMethod< GetActiveRegionsRequest, ActiveRegionsResponse, GetActiveRegionsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetActiveRegionsRequest, output: ActiveRegionsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetAnonymizedBranchStatusError = NeonOpError; /** Retrieve anonymized branch status Retrieves the current status of an anonymized branch, including its state and progress information. This endpoint allows you to monitor the anonymization process from initialization through completion. Only anonymized branches will have status information available. **Note**: This endpoint is currently in Beta. */ export const getAnonymizedBranchStatus: API.OperationMethod< GetAnonymizedBranchStatusRequest, AnonymizedBranchStatusResponse, GetAnonymizedBranchStatusError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAnonymizedBranchStatusRequest, output: AnonymizedBranchStatusResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetAuthDetailsError = NeonOpError; /** Retrieve request authentication details Returns authentication details for the credentials used in the request, including the credential type (API key, Bearer token, or OAuth session) and the associated identity. */ export const getAuthDetails: API.OperationMethod< GetAuthDetailsRequest, AuthDetailsResponse, GetAuthDetailsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAuthDetailsRequest, output: AuthDetailsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetAvailablePreloadLibrariesError = NeonOpError; /** List available shared preload libraries Returns the shared preload libraries available for the specified project's Postgres version. Shared preload libraries are Postgres extensions that require the `shared_preload_libraries` setting and a compute restart to activate. Use this list to determine which libraries can be enabled in the project's `settings.preload_libraries` configuration. */ export const getAvailablePreloadLibraries: API.OperationMethod< GetAvailablePreloadLibrariesRequest, AvailablePreloadLibraries, GetAvailablePreloadLibrariesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAvailablePreloadLibrariesRequest, output: AvailablePreloadLibraries, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetConnectionURIError = NotFound | NeonOpError; /** Retrieve connection URI Retrieves a connection URI for the specified database. The URI uses the standard PostgreSQL connection string format. Set `pooled=true` to include the `-pooler` suffix for a connection pooler URI. */ export const getConnectionURI: API.OperationMethod< GetConnectionURIRequest, ConnectionURIResponse, GetConnectionURIError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetConnectionURIRequest, output: ConnectionURIResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetConsumptionHistoryPerBranchV2Error = | Forbidden | NotFound | NeonOpError; /** Retrieve branch consumption metrics Returns consumption metrics for each branch across one or more projects listed in `project_ids` (1 to 100 projects). Available for accounts on paid usage-based Launch, Scale, Agent, and Enterprise plans. History starts when the account first ingests branch-level consumption data. The `metrics` query parameter is required. Only these six values are supported on this endpoint: `compute_unit_seconds`, `root_branch_bytes_month`, `child_branch_bytes_month`, `instant_restore_bytes_month`, `public_network_transfer_bytes`, `private_network_transfer_bytes`. This endpoint does not support `extra_branches_month` or `snapshot_storage_bytes_month`. Use `GET /consumption_history/v2/projects` for those. Consumption metrics within each branch are returned in ascending time order (oldest first). This request does not wake project computes. */ export const getConsumptionHistoryPerBranchV2: API.PaginatedOperationMethod< GetConsumptionHistoryPerBranchV2Request, GetConsumptionHistoryPerBranchV2Response, GetConsumptionHistoryPerBranchV2Error, NeonOpContext, ConsumptionHistoryPerBranchV2 > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetConsumptionHistoryPerBranchV2Request, output: GetConsumptionHistoryPerBranchV2Response, errors: [Forbidden, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "branches", } as const, }), paginateCursor, ) as any; export type GetConsumptionHistoryPerProjectError = | Forbidden | NotFound | NeonOpError; /** Retrieve project consumption metrics (legacy plans) Retrieves consumption metrics for Scale, Business, and Enterprise plan projects. History begins at the time of upgrade. Results are ordered by time in ascending order (oldest to newest). Issuing a call to this API does not wake a project's compute endpoint. */ export const getConsumptionHistoryPerProject: API.PaginatedOperationMethod< GetConsumptionHistoryPerProjectRequest, GetConsumptionHistoryPerProjectResponse, GetConsumptionHistoryPerProjectError, NeonOpContext, ConsumptionHistoryPerProject > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetConsumptionHistoryPerProjectRequest, output: GetConsumptionHistoryPerProjectResponse, errors: [Forbidden, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "projects", } as const, }), paginateCursor, ) as any; export type GetConsumptionHistoryPerProjectV2Error = | Forbidden | NotFound | NeonOpError; /** Retrieve project consumption metrics Returns consumption metrics for up to `limit` projects per page. If `project_ids` is omitted, projects in the organization are included across pages (use `cursor`). If `project_ids` is provided, the response is limited to those projects (up to 100). Available for accounts on Launch, Scale, Agent, Business, and Enterprise plans. History starts when the account upgrades to an eligible plan. The `metrics` query parameter is required. Supported values: `compute_unit_seconds`, `root_branch_bytes_month`, `child_branch_bytes_month`, `instant_restore_bytes_month`, `public_network_transfer_bytes`, `private_network_transfer_bytes`, `extra_branches_month`, `snapshot_storage_bytes_month`. Consumption metrics within each project are returned in ascending time order (oldest first). This request does not wake project computes. */ export const getConsumptionHistoryPerProjectV2: API.PaginatedOperationMethod< GetConsumptionHistoryPerProjectV2Request, GetConsumptionHistoryPerProjectV2Response, GetConsumptionHistoryPerProjectV2Error, NeonOpContext, ConsumptionHistoryPerProjectV2 > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetConsumptionHistoryPerProjectV2Request, output: GetConsumptionHistoryPerProjectV2Response, errors: [Forbidden, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "projects", } as const, }), paginateCursor, ) as any; export type GetCurrentUserInfoError = NeonOpError; /** Retrieve current user details Retrieves information about the currently authenticated Neon user, including account identifiers, plan details, and linked auth accounts. */ export const getCurrentUserInfo: API.OperationMethod< GetCurrentUserInfoRequest, CurrentUserInfoResponse, GetCurrentUserInfoError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetCurrentUserInfoRequest, output: CurrentUserInfoResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetCurrentUserOrganizationsError = NeonOpError; /** List organizations for the current user Retrieves the organizations that the currently authenticated user belongs to. When called with an organization- or project-scoped API key (which is not tied to a user), this returns the single organization that owns the key. */ export const getCurrentUserOrganizations: API.OperationMethod< GetCurrentUserOrganizationsRequest, OrganizationsResponse, GetCurrentUserOrganizationsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetCurrentUserOrganizationsRequest, output: OrganizationsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetMaskingRulesError = NeonOpError; /** Retrieve masking rules Retrieves the masking rules for the specified anonymized branch. Masking rules define how sensitive data should be anonymized using PostgreSQL Anonymizer. **Note**: This endpoint is currently in Beta. */ export const getMaskingRules: API.OperationMethod< GetMaskingRulesRequest, MaskingRulesResponse, GetMaskingRulesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMaskingRulesRequest, output: MaskingRulesResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthError = NeonOpError; /** Retrieve Neon Auth details for the branch Retrieves the Neon Auth integration details for the specified branch, including the auth provider type and integration status. */ export const getNeonAuth: API.OperationMethod< GetNeonAuthRequest, NeonAuthIntegration, GetNeonAuthError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthRequest, output: NeonAuthIntegration, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthAllowLocalhostError = NeonOpError; /** Retrieve localhost allow setting Retrieves the localhost allow setting for the specified branch's Neon Auth integration. When enabled, authentication flows work from `localhost` without adding it to the redirect URI whitelist. */ export const getNeonAuthAllowLocalhost: API.OperationMethod< GetNeonAuthAllowLocalhostRequest, NeonAuthAllowLocalhostResponse, GetNeonAuthAllowLocalhostError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthAllowLocalhostRequest, output: NeonAuthAllowLocalhostResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthEmailAndPasswordConfigError = NeonOpError; /** Retrieve email and password configuration Retrieves the email and password authentication configuration for the specified branch's Neon Auth integration, including whether it is enabled and the email verification method. */ export const getNeonAuthEmailAndPasswordConfig: API.OperationMethod< GetNeonAuthEmailAndPasswordConfigRequest, NeonAuthEmailAndPasswordConfig, GetNeonAuthEmailAndPasswordConfigError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthEmailAndPasswordConfigRequest, output: NeonAuthEmailAndPasswordConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthEmailProviderError = NeonOpError; /** Retrieve email provider configuration Retrieves the email provider configuration for the specified branch's Neon Auth integration, including the provider type and server settings. */ export const getNeonAuthEmailProvider: API.OperationMethod< GetNeonAuthEmailProviderRequest, GetNeonAuthEmailProviderResponse, GetNeonAuthEmailProviderError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthEmailProviderRequest, output: GetNeonAuthEmailProviderResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthPhoneNumberPluginError = NeonOpError; /** Retrieve phone number plugin configuration Returns the phone number plugin configuration for Neon Auth. The phone number plugin enables phone-based OTP authentication. */ export const getNeonAuthPhoneNumberPlugin: API.OperationMethod< GetNeonAuthPhoneNumberPluginRequest, NeonAuthPhoneNumberConfig, GetNeonAuthPhoneNumberPluginError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthPhoneNumberPluginRequest, output: NeonAuthPhoneNumberConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthPluginConfigsError = NeonOpError; /** Retrieve Neon Auth plugin configurations Returns all plugin configurations for Neon Auth in a single response. This endpoint aggregates organization, email provider, email and password, OAuth providers, and localhost settings. */ export const getNeonAuthPluginConfigs: API.OperationMethod< GetNeonAuthPluginConfigsRequest, NeonAuthPluginConfigs, GetNeonAuthPluginConfigsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthPluginConfigsRequest, output: NeonAuthPluginConfigs, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetNeonAuthWebhookConfigError = NeonOpError; /** Retrieve Neon Auth webhook configuration Returns the webhook configuration for the specified branch's Neon Auth integration, including the endpoint URL and the events that trigger it. */ export const getNeonAuthWebhookConfig: API.OperationMethod< GetNeonAuthWebhookConfigRequest, NeonAuthWebhookConfig, GetNeonAuthWebhookConfigError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNeonAuthWebhookConfigRequest, output: NeonAuthWebhookConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetOrganizationError = NeonOpError; /** Retrieve organization details Retrieves details for the specified organization, including its name, plan, and configuration. */ export const getOrganization: API.OperationMethod< GetOrganizationRequest, Organization, GetOrganizationError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationRequest, output: Organization, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetOrganizationInvitationsError = NeonOpError; /** List organization invitations Retrieves pending and accepted invitations for the specified organization. */ export const getOrganizationInvitations: API.OperationMethod< GetOrganizationInvitationsRequest, OrganizationInvitationsResponse, GetOrganizationInvitationsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationInvitationsRequest, output: OrganizationInvitationsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetOrganizationMemberError = NeonOpError; /** Retrieve organization member details Retrieves information about the specified organization member. */ export const getOrganizationMember: API.OperationMethod< GetOrganizationMemberRequest, Member, GetOrganizationMemberError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationMemberRequest, output: Member, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetOrganizationMembersError = NeonOpError; /** List organization members Retrieves a paginated list of members for the specified organization. */ export const getOrganizationMembers: API.PaginatedOperationMethod< GetOrganizationMembersRequest, GetOrganizationMembersResponse, GetOrganizationMembersError, NeonOpContext, MemberWithUser > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetOrganizationMembersRequest, output: GetOrganizationMembersResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.next", items: "members", } as const, }), paginateCursor, ) as any; export type GetOrganizationSpendingLimitError = NeonOpError; /** Retrieve organization spending limit Returns the configured monthly spending limit for the specified organization. `spending_limit_cents: null` indicates that no limit is currently set. Available to organization members with read access on Launch and Scale plans only. */ export const getOrganizationSpendingLimit: API.OperationMethod< GetOrganizationSpendingLimitRequest, SpendingLimitResponse, GetOrganizationSpendingLimitError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationSpendingLimitRequest, output: SpendingLimitResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetOrganizationVPCEndpointDetailsError = NeonOpError; /** Retrieve VPC endpoint details Retrieves the current state and configuration details of a specified VPC endpoint. */ export const getOrganizationVPCEndpointDetails: API.OperationMethod< GetOrganizationVPCEndpointDetailsRequest, VPCEndpointDetails, GetOrganizationVPCEndpointDetailsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationVPCEndpointDetailsRequest, output: VPCEndpointDetails, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectError = BadRequest | NotFound | NeonOpError; /** Retrieve project details Retrieves information about the specified project. Returned details include the project settings, compute configuration, history retention, owner information, and current usage metrics. */ export const getProject: API.OperationMethod< GetProjectRequest, ProjectResponse, GetProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectRequest, output: ProjectResponse, errors: [BadRequest, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectAdvisorSecurityIssuesError = NeonOpError; /** Get advisor issues Analyzes the database for security and performance issues. Returns a list of issues categorized by severity (ERROR, WARN, INFO). Requires read access to the project and Data API enabled. */ export const getProjectAdvisorSecurityIssues: API.OperationMethod< GetProjectAdvisorSecurityIssuesRequest, GetProjectAdvisorSecurityIssuesResponse, GetProjectAdvisorSecurityIssuesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectAdvisorSecurityIssuesRequest, output: GetProjectAdvisorSecurityIssuesResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchError = NotFound | NeonOpError; /** Retrieve branch details Retrieves information about the specified branch. A `branch_id` value has a `br-` prefix. Each Neon project is initially created with a root and default branch named `main`. A project can contain one or more branches. A parent branch is identified by a `parent_id` value, which is the `id` of the parent branch. For related information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const getProjectBranch: API.OperationMethod< GetProjectBranchRequest, GetProjectBranchResponse, GetProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchRequest, output: GetProjectBranchResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchAiGatewayError = NotFound | NeonOpError; /** Get branch AI Gateway endpoint Returns the AI Gateway endpoint host for the specified branch, used to render code-snippet base URLs. A 200 response means the branch is registered and this region serves the AI gateway. A 404 response includes a `reason` field indicating why the gateway is unavailable. **Note**: This endpoint is currently in Beta. */ export const getProjectBranchAiGateway: API.OperationMethod< GetProjectBranchAiGatewayRequest, BranchAiGateway, GetProjectBranchAiGatewayError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchAiGatewayRequest, output: BranchAiGateway, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchBucketObjectError = NotFound | NeonOpError; /** Download an object's bytes Streams the raw bytes of the named object from the bucket on the specified branch, including objects inherited from ancestor branches. Served by the user's session (no customer S3 credentials required). The body is returned as `application/octet-stream` so a browser treats it as a download; the `Content-Length` and `ETag` response headers echo the stored object metadata. BINARY-STREAM EXCEPTION TO THE BUILD-GENERATED-TYPES RULE (#7029): the successful 200 body is the raw object stream, proxied verbatim from the platform object storage admin endpoint. It is modeled as an `application/octet-stream` binary body (not a JSON response schema) and is streamed without buffering the whole object in memory. Error responses still use the generated `GeneralError` shape. **Note**: This endpoint is currently in Beta. */ export const getProjectBranchBucketObject: API.OperationMethod< GetProjectBranchBucketObjectRequest, GetProjectBranchBucketObjectResponse, GetProjectBranchBucketObjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchBucketObjectRequest, output: GetProjectBranchBucketObjectResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchDataAPIError = NeonOpError; /** Retrieve Neon Data API configuration Retrieves the Neon Data API configuration for the specified branch, including endpoint URL, enabled state, and database settings. */ export const getProjectBranchDataAPI: API.OperationMethod< GetProjectBranchDataAPIRequest, DataAPIReponse, GetProjectBranchDataAPIError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchDataAPIRequest, output: DataAPIReponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchDatabaseError = NotFound | NeonOpError; /** Retrieve database details Retrieves information about the specified database. For related information, see [Manage databases](https://neon.com/docs/manage/databases/). */ export const getProjectBranchDatabase: API.OperationMethod< GetProjectBranchDatabaseRequest, DatabaseResponse, GetProjectBranchDatabaseError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchDatabaseRequest, output: DatabaseResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchFunctionError = NeonOpError; /** Get function details Returns the function identified by its slug. **Note**: This endpoint is currently in Beta. */ export const getProjectBranchFunction: API.OperationMethod< GetProjectBranchFunctionRequest, NeonFunctionResponse, GetProjectBranchFunctionError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchFunctionRequest, output: NeonFunctionResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchRoleError = NotFound | NeonOpError; /** Retrieve role details Retrieves details about the specified role. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). */ export const getProjectBranchRole: API.OperationMethod< GetProjectBranchRoleRequest, RoleResponse, GetProjectBranchRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchRoleRequest, output: RoleResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchRolePasswordError = NotFound | NeonOpError; /** Retrieve role password Retrieves the password for the specified Postgres role, if possible. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). */ export const getProjectBranchRolePassword: API.OperationMethod< GetProjectBranchRolePasswordRequest, RolePasswordResponse, GetProjectBranchRolePasswordError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchRolePasswordRequest, output: RolePasswordResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchSchemaError = NotFound | NeonOpError; /** Retrieve database schema Retrieves the database schema. Specify `lsn` or `timestamp` (not both) to read at a point in time; omit both to read from the database's head. */ export const getProjectBranchSchema: API.OperationMethod< GetProjectBranchSchemaRequest, BranchSchemaResponse, GetProjectBranchSchemaError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchSchemaRequest, output: BranchSchemaResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchSchemaComparisonError = NotFound | NeonOpError; /** Compare database schema Compares the schema from the specified database with another branch's schema. */ export const getProjectBranchSchemaComparison: API.OperationMethod< GetProjectBranchSchemaComparisonRequest, BranchSchemaCompareResponse, GetProjectBranchSchemaComparisonError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchSchemaComparisonRequest, output: BranchSchemaCompareResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectBranchStorageError = NotFound | NeonOpError; /** Get branch object storage state Returns whether branchable object storage is usable for the specified branch. A 200 response means the branch is registered in the object storage service and the S3 data plane will accept requests for it. A 404 response includes a `reason` field indicating why object storage is unavailable. **Note**: This endpoint is currently in Beta. */ export const getProjectBranchStorage: API.OperationMethod< GetProjectBranchStorageRequest, BranchStorage, GetProjectBranchStorageError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectBranchStorageRequest, output: BranchStorage, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectEndpointError = NotFound | NeonOpError; /** Retrieve compute endpoint details Retrieves information about the specified compute endpoint. A compute endpoint is a Neon compute instance. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const getProjectEndpoint: API.OperationMethod< GetProjectEndpointRequest, EndpointResponse, GetProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectEndpointRequest, output: EndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectJWKSError = NeonOpError; /** List JWKS URLs Returns the JWKS URLs available for verifying JWTs used as the authentication mechanism for the specified project. */ export const getProjectJWKS: API.OperationMethod< GetProjectJWKSRequest, ProjectJWKSResponse, GetProjectJWKSError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectJWKSRequest, output: ProjectJWKSResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetProjectOperationError = NotFound | NeonOpError; /** Retrieve operation details Retrieves details for the specified operation. An operation is an action performed on a Neon project resource. */ export const getProjectOperation: API.OperationMethod< GetProjectOperationRequest, OperationResponse, GetProjectOperationError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetProjectOperationRequest, output: OperationResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GetSnapshotScheduleError = NeonOpError; /** Retrieve backup schedule Returns the backup schedule for the specified branch, including the configured snapshot frequencies. */ export const getSnapshotSchedule: API.OperationMethod< GetSnapshotScheduleRequest, BackupSchedule, GetSnapshotScheduleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetSnapshotScheduleRequest, output: BackupSchedule, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type GrantPermissionToProjectError = NeonOpError; /** Grant project access Grants project access to the account associated with the specified email address. */ export const grantPermissionToProject: API.OperationMethod< GrantPermissionToProjectRequest, ProjectPermission, GrantPermissionToProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: GrantPermissionToProjectRequest, output: ProjectPermission, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListApiKeysError = NeonOpError; /** List API keys Retrieves the API keys for your Neon account. The response does not include API key tokens. A token is only provided when creating an API key. API keys can also be managed in the Neon Console. For more information, see [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const listApiKeys: API.OperationMethod< ListApiKeysRequest, ListApiKeysResponse, ListApiKeysError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListApiKeysRequest, output: ListApiKeysResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListBranchNeonAuthOauthProvidersError = NeonOpError; /** List OAuth providers for the branch Lists the OAuth providers configured for the specified branch's Neon Auth integration. */ export const listBranchNeonAuthOauthProviders: API.OperationMethod< ListBranchNeonAuthOauthProvidersRequest, ListNeonAuthOauthProvidersResponse, ListBranchNeonAuthOauthProvidersError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListBranchNeonAuthOauthProvidersRequest, output: ListNeonAuthOauthProvidersResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListBranchNeonAuthTrustedDomainsError = NeonOpError; /** List domains in redirect_uri whitelist Lists the trusted domains in the redirect URI whitelist for the specified branch. Only domains in this list are permitted as redirect targets after authentication. */ export const listBranchNeonAuthTrustedDomains: API.OperationMethod< ListBranchNeonAuthTrustedDomainsRequest, NeonAuthRedirectURIWhitelistResponse, ListBranchNeonAuthTrustedDomainsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListBranchNeonAuthTrustedDomainsRequest, output: NeonAuthRedirectURIWhitelistResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListCredentialsError = NeonOpError; /** List credentials on the branch Returns metadata for customer-issued credentials on the branch. Secrets are never included. **Note**: This endpoint is currently in Beta. */ export const listCredentials: API.OperationMethod< ListCredentialsRequest, ListCredentialsResponse, ListCredentialsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListCredentialsRequest, output: ListCredentialsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListOrganizationVPCEndpointsError = NeonOpError; /** List VPC endpoints Retrieves the list of VPC endpoints for the specified Neon organization. */ export const listOrganizationVPCEndpoints: API.OperationMethod< ListOrganizationVPCEndpointsRequest, VPCEndpointsResponse, ListOrganizationVPCEndpointsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListOrganizationVPCEndpointsRequest, output: VPCEndpointsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListOrganizationVPCEndpointsAllRegionsError = NeonOpError; /** List VPC endpoints across all regions Retrieves the list of VPC endpoints for the specified Neon organization across all regions. */ export const listOrganizationVPCEndpointsAllRegions: API.OperationMethod< ListOrganizationVPCEndpointsAllRegionsRequest, VPCEndpointsWithRegionResponse, ListOrganizationVPCEndpointsAllRegionsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListOrganizationVPCEndpointsAllRegionsRequest, output: VPCEndpointsWithRegionResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListOrgApiKeysError = NeonOpError; /** List organization API keys Retrieves the API keys for the specified organization. The response does not include API key tokens. A token is only provided when creating an API key. API keys can also be managed in the Neon Console. For more information, see [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const listOrgApiKeys: API.OperationMethod< ListOrgApiKeysRequest, ListOrgApiKeysResponse, ListOrgApiKeysError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListOrgApiKeysRequest, output: ListOrgApiKeysResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchBucketObjectsError = NeonOpError; /** List objects in a bucket Lists objects visible in the named bucket on the specified branch, including those inherited from ancestor branches. Listing is served by the user's session (no customer S3 credentials required). When `delimiter` is supplied (typically `/`), keys are collapsed into common prefixes (`folders`) so callers can render a folder-style browser; keys that do not contain the delimiter after `prefix` are returned as `objects`. **Note**: This endpoint is currently in Beta. */ export const listProjectBranchBucketObjects: API.OperationMethod< ListProjectBranchBucketObjectsRequest, BucketObjectsListResponse, ListProjectBranchBucketObjectsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchBucketObjectsRequest, output: BucketObjectsListResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchBucketsError = NeonOpError; /** List buckets on the branch Lists branchable object storage buckets visible on the specified branch, including those inherited from ancestor branches. **Note**: This endpoint is currently in Beta. */ export const listProjectBranchBuckets: API.OperationMethod< ListProjectBranchBucketsRequest, BucketsListResponse, ListProjectBranchBucketsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchBucketsRequest, output: BucketsListResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchCustomDomainsError = NeonOpError; /** List the custom domains on a branch Lists all custom domains registered on the branch, across every target entity. **Note**: This endpoint is currently in Beta. */ export const listProjectBranchCustomDomains: API.PaginatedOperationMethod< ListProjectBranchCustomDomainsRequest, ListProjectBranchCustomDomainsResponse, ListProjectBranchCustomDomainsError, NeonOpContext, CustomDomain > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectBranchCustomDomainsRequest, output: ListProjectBranchCustomDomainsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.next", items: "custom_domains", } as const, }), paginateCursor, ) as any; export type ListProjectBranchDatabasesError = NotFound | NeonOpError; /** List databases Retrieves a list of databases for the specified branch. A branch can have multiple databases. For related information, see [Manage databases](https://neon.com/docs/manage/databases/). */ export const listProjectBranchDatabases: API.OperationMethod< ListProjectBranchDatabasesRequest, DatabasesResponse, ListProjectBranchDatabasesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchDatabasesRequest, output: DatabasesResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchEndpointsError = NotFound | NeonOpError; /** List branch endpoints Retrieves a list of compute endpoints for the specified branch. Neon permits only one read-write compute endpoint per branch. A branch can have multiple read-only compute endpoints. */ export const listProjectBranchEndpoints: API.OperationMethod< ListProjectBranchEndpointsRequest, EndpointsResponse, ListProjectBranchEndpointsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchEndpointsRequest, output: EndpointsResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchesError = NotFound | NeonOpError; /** List branches Retrieves a list of branches for the specified project. Each Neon project has a root branch named `main`. A `branch_id` value has a `br-` prefix. A project may contain child branches that were branched from `main` or from another branch. A parent branch is identified by the `parent_id` value, which is the `id` of the parent branch. For related information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const listProjectBranches: API.PaginatedOperationMethod< ListProjectBranchesRequest, ListProjectBranchesResponse, ListProjectBranchesError, NeonOpContext, Branch > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectBranchesRequest, output: ListProjectBranchesResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.next", items: "branches", } as const, }), paginateCursor, ) as any; export type ListProjectBranchFunctionsError = NeonOpError; /** List functions on the branch Lists functions on the specified branch. **Note**: This endpoint is currently in Beta. */ export const listProjectBranchFunctions: API.PaginatedOperationMethod< ListProjectBranchFunctionsRequest, ListProjectBranchFunctionsResponse, ListProjectBranchFunctionsError, NeonOpContext, NeonFunction > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectBranchFunctionsRequest, output: ListProjectBranchFunctionsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.next", items: "functions", } as const, }), paginateCursor, ) as any; export type ListProjectBranchLogFieldsError = NotFound | NeonOpError; /** List branch log fields Lists the low-cardinality log fields observed on this branch whose distinct values can be discovered with the log field-values endpoint. The set is computed per branch and grows as new fields are observed, so treat it as data rather than a fixed list: discover a field here, then pass it as `field_name` to the field-values endpoint. **Note**: This endpoint is currently in Private Beta. */ export const listProjectBranchLogFields: API.OperationMethod< ListProjectBranchLogFieldsRequest, ProjectBranchLogFieldsResponse, ListProjectBranchLogFieldsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchLogFieldsRequest, output: ProjectBranchLogFieldsResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchLogFieldValuesError = | BadRequest | NotFound | NeonOpError; /** List branch log field values Lists the distinct values observed for a low-cardinality log field in the requested time range. Call the log fields endpoint first to learn which `field_name` values this branch supports; a field that branch has never emitted is rejected with `unknown_field`. Give the window either as `since` or as an explicit `start_time`; supplying both is rejected. If neither is given, the previous six hours are used. The maximum supported time range is seven days. **Note**: This endpoint is currently in Private Beta. */ export const listProjectBranchLogFieldValues: API.OperationMethod< ListProjectBranchLogFieldValuesRequest, ProjectBranchLogFieldValuesResponse, ListProjectBranchLogFieldValuesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchLogFieldValuesRequest, output: ProjectBranchLogFieldValuesResponse, errors: [BadRequest, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectBranchRolesError = NotFound | NeonOpError; /** List roles Retrieves a list of Postgres roles from the specified branch. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). */ export const listProjectBranchRoles: API.OperationMethod< ListProjectBranchRolesRequest, RolesResponse, ListProjectBranchRolesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectBranchRolesRequest, output: RolesResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectEndpointsError = NotFound | NeonOpError; /** List compute endpoints Retrieves a list of compute endpoints for the specified project. A compute endpoint is a Neon compute instance. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const listProjectEndpoints: API.OperationMethod< ListProjectEndpointsRequest, EndpointsResponse, ListProjectEndpointsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectEndpointsRequest, output: EndpointsResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectMembersError = NeonOpError; /** List org members and their project roles Lists organization members and their per-project roles for an org-owned project. Returns 404 when the project is not org-owned, per-project role management is disabled, or the caller has no access. Callers with VIEWER or EDITOR see members with effective project access. Callers with ADMIN also see unassigned org members. */ export const listProjectMembers: API.PaginatedOperationMethod< ListProjectMembersRequest, ProjectMembers, ListProjectMembersError, NeonOpContext, ProjectMember > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectMembersRequest, output: ProjectMembers, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.next", items: "project_members", } as const, }), paginateCursor, ) as any; export type ListProjectOperationsError = NotFound | NeonOpError; /** List operations Retrieves a list of operations for the specified Neon project. The number of operations returned can be large. To paginate the response, issue an initial request with a `limit` value. Then, add the `cursor` value that was returned in the response to the next request. Operations older than 6 months may be deleted from our systems. If you need more history than that, you should store your own history. */ export const listProjectOperations: API.PaginatedOperationMethod< ListProjectOperationsRequest, ListProjectOperationsResponse, ListProjectOperationsError, NeonOpContext, Operation > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectOperationsRequest, output: ListProjectOperationsResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "operations", } as const, }), paginateCursor, ) as any; export type ListProjectPermissionsError = NotFound | NeonOpError; /** List project access Retrieves details about users who have access to the project, including the permission `id`, the granted-to email address, and the date project access was granted. */ export const listProjectPermissions: API.OperationMethod< ListProjectPermissionsRequest, ProjectPermissions, ListProjectPermissionsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectPermissionsRequest, output: ProjectPermissions, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListProjectsError = NeonOpError; /** List projects Retrieves a list of projects for the specified organization. If using a personal API key, include the `org_id` parameter to specify which organization to work with. If using an org API key, `org_id` is automatically inferred from the key. For more information, see [Manage organizations using the Neon API](https://neon.com/docs/manage/orgs-api) and [Manage projects](https://neon.com/docs/manage/projects/). */ export const listProjects: API.PaginatedOperationMethod< ListProjectsRequest, ListProjectsResponse, ListProjectsError, NeonOpContext, ProjectListItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListProjectsRequest, output: ListProjectsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "projects", } as const, }), paginateCursor, ) as any; export type ListProjectVPCEndpointsError = NeonOpError; /** List VPC endpoint restrictions Lists VPC endpoint restrictions for the specified Neon project. */ export const listProjectVPCEndpoints: API.OperationMethod< ListProjectVPCEndpointsRequest, VPCEndpointsResponse, ListProjectVPCEndpointsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListProjectVPCEndpointsRequest, output: VPCEndpointsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ListSharedProjectsError = NeonOpError; /** List shared projects Retrieves a list of projects shared with your Neon account. For more information, see [Manage projects](https://neon.com/docs/manage/projects/). */ export const listSharedProjects: API.PaginatedOperationMethod< ListSharedProjectsRequest, ListSharedProjectsResponse, ListSharedProjectsError, NeonOpContext, ProjectListItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListSharedProjectsRequest, output: ListSharedProjectsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "pagination.cursor", items: "projects", } as const, }), paginateCursor, ) as any; export type ListSnapshotsError = NeonOpError; /** List project snapshots Lists the snapshots for the specified project. Each snapshot represents a point-in-time backup of the project data. */ export const listSnapshots: API.OperationMethod< ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListSnapshotsRequest, output: ListSnapshotsResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type PresignProjectBranchBucketObjectError = NotFound | NeonOpError; /** Presign an upload or download for an object in a bucket Returns a presigned URL that transfers bytes directly to or from the object's bucket on the specified branch, without the caller ever handling S3 credentials. The `operation` field selects the direction: - `upload` returns a presigned `PUT` URL (the caller `PUT`s the file bytes straight to `url` with the returned `headers`). Authorized with project write access. - `download` returns a presigned `GET` URL (the caller `GET`s the bytes straight from `url`). Authorized with project read access. The platform mints a short-lived credential and builds the SigV4-signed URL against the branch's S3 data-plane host, returning it together with the HTTP method, any headers the caller must echo, and the URL's expiry. Served by the user's session (no customer S3 credentials required). **Note**: This endpoint is currently in Beta. */ export const presignProjectBranchBucketObject: API.OperationMethod< PresignProjectBranchBucketObjectRequest, PresignResponse, PresignProjectBranchBucketObjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: PresignProjectBranchBucketObjectRequest, output: PresignResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type QueryProjectBranchLogsError = BadRequest | NotFound | NeonOpError; /** Query branch logs Returns logs emitted by services running on the specified branch, ordered by timestamp according to `sort_order`. All supplied filters are combined with `AND`: a record is returned only when it matches every filter. `minimum_severity` and `severity_text` are independent filters, so setting both requires a record to clear the severity floor *and* match the exact severity text. Supply `logql` instead of the structured filters to run a raw LogQL expression. Combining it with any structured filter is rejected rather than silently ignored; `limit`, `sort_order`, and the time window still apply, because those bound the query rather than form part of the expression. Give the window either as `since` — a duration ending at `end_time`, or at the current time when `end_time` is omitted — or as an explicit `start_time`. Supplying both is rejected. A single response holds at most 1,000 records. When `is_truncated` is `true`, pass the returned `next_cursor` back as `cursor` to fetch the next page, repeating the time range and every filter unchanged. If no time range is supplied, the query covers the previous hour. The maximum supported time range is seven days. `end_time` is exclusive. **Note**: This endpoint is currently in Private Beta. */ export const queryProjectBranchLogs: API.OperationMethod< QueryProjectBranchLogsRequest, ProjectBranchLogsQueryResponse, QueryProjectBranchLogsError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: QueryProjectBranchLogsRequest, output: ProjectBranchLogsQueryResponse, errors: [BadRequest, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RecoverProjectError = NeonOpError; /** Recover a deleted project Recovers a deleted project within the 7-day deletion recovery period. Restores branches, endpoints, settings, and connection strings. Some integrations require manual reconfiguration after recovery. To list recoverable projects, use `GET /projects?recoverable=true`. */ export const recoverProject: API.OperationMethod< RecoverProjectRequest, RecoverProjectResponse, RecoverProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RecoverProjectRequest, output: RecoverProjectResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RegisterProjectBranchCustomDomainError = NeonOpError; /** Register a custom domain on a branch Registers a customer-owned domain (for example `dashboard.acme.com`) on the branch and points it at a target entity, chosen by `entity_type` + `entity_id`. In v1 only `entity_type: function` is supported (an unsupported type is rejected with `400`), where `entity_id` is the function slug and the function must already exist on the branch (else `404`). The response includes the `cname_target` the customer must point their domain at with a CNAME record; the domain goes live only once that DNS resolves and a certificate is issued on the first request. A domain already registered to another resource is rejected with `409` and no detail about the owner. Re-registering the same domain for the same entity is idempotent. **Note**: This endpoint is currently in Beta. */ export const registerProjectBranchCustomDomain: API.OperationMethod< RegisterProjectBranchCustomDomainRequest, CustomDomain, RegisterProjectBranchCustomDomainError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RegisterProjectBranchCustomDomainRequest, output: CustomDomain, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RemoveOrganizationMemberError = NeonOpError; /** Remove organization member Removes the specified member from the organization. Only organization admins can perform this action. The last admin in an organization cannot be removed. */ export const removeOrganizationMember: API.OperationMethod< RemoveOrganizationMemberRequest, RemoveOrganizationMemberResponse, RemoveOrganizationMemberError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RemoveOrganizationMemberRequest, output: RemoveOrganizationMemberResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RemoveProjectMemberRoleError = NeonOpError; /** Remove an org member's role on a project Idempotently removes the explicit project grant. The member's organization-role default project permission still applies. Self-DELETE requires `confirm_self_lockout=true` when effective manage access would be lost. */ export const removeProjectMemberRole: API.OperationMethod< RemoveProjectMemberRoleRequest, ProjectMemberRoleResponse, RemoveProjectMemberRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RemoveProjectMemberRoleRequest, output: ProjectMemberRoleResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type ResetProjectBranchRolePasswordError = NotFound | NeonOpError; /** Reset role password Resets the password for the specified Postgres role. Returns a new password and operations. The new password is ready to use when the last operation finishes. The old password remains valid until last operation finishes. Connections to the compute endpoint are dropped. If idle, the compute endpoint becomes active for a short period of time. For related information, see [Manage roles](https://neon.com/docs/manage/roles/). */ export const resetProjectBranchRolePassword: API.OperationMethod< ResetProjectBranchRolePasswordRequest, ResetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: ResetProjectBranchRolePasswordRequest, output: ResetProjectBranchRolePasswordResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RestartProjectEndpointError = NotFound | NeonOpError; /** Restart compute endpoint Restarts the specified compute endpoint by immediately suspending it and then starting it again. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const restartProjectEndpoint: API.OperationMethod< RestartProjectEndpointRequest, RestartProjectEndpointResponse, RestartProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RestartProjectEndpointRequest, output: RestartProjectEndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RestoreProjectBranchError = NotFound | NeonOpError; /** Restore branch to a historical state Restores a branch to an earlier state in its own or another branch's history by specifying an LSN or timestamp. Creates a new branch from the historical state. */ export const restoreProjectBranch: API.OperationMethod< RestoreProjectBranchRequest, RestoreProjectBranchResponse, RestoreProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RestoreProjectBranchRequest, output: RestoreProjectBranchResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RestoreSnapshotError = NeonOpError; /** Restore snapshot Restores the specified snapshot to a new branch, and optionally finalizes the restore operation to replace the original branch. */ export const restoreSnapshot: API.OperationMethod< RestoreSnapshotRequest, RestoreSnapshotResponse, RestoreSnapshotError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RestoreSnapshotRequest, output: RestoreSnapshotResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RevealCredentialError = NotFound | Conflict | NeonOpError; /** Reveal a credential's secrets Returns the live `api_token` and `s3_secret_access_key` of an existing credential, so a credential whose issuance response was lost can be recovered without minting a new one. This is a POST with an explicit `/reveal` verb so the secrets never ride a GET, where they would land in access logs, browser history and proxy caches. Revoked and expired credentials return 404, as does a `token_id` that does not belong to this project. A credential issued before secret retrieval was supported has no recoverable secret and returns 409 — rotate it to obtain one. **Note**: This endpoint is currently in Beta. */ export const revealCredential: API.OperationMethod< RevealCredentialRequest, CredentialSecret, RevealCredentialError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RevealCredentialRequest, output: CredentialSecret, errors: [NotFound, Conflict, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RevokeApiKeyError = NotFound | NeonOpError; /** Revoke API key Revokes the specified API key. An API key that is no longer needed can be revoked. This action cannot be reversed. API keys can also be managed in the Neon Console. See [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const revokeApiKey: API.OperationMethod< RevokeApiKeyRequest, ApiKeyRevokeResponse, RevokeApiKeyError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RevokeApiKeyRequest, output: ApiKeyRevokeResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RevokeCredentialError = NotFound | NeonOpError; /** Revoke a credential Soft-deletes the credential. Idempotent. **Note**: This endpoint is currently in Beta. */ export const revokeCredential: API.OperationMethod< RevokeCredentialRequest, RevokeCredentialResponse, RevokeCredentialError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RevokeCredentialRequest, output: RevokeCredentialResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RevokeOrgApiKeyError = NeonOpError; /** Revoke organization API key Revokes the specified organization API key. An API key that is no longer needed can be revoked. This action cannot be reversed. API keys can also be managed in the Neon Console. See [Manage API keys](https://neon.com/docs/manage/api-keys/). */ export const revokeOrgApiKey: API.OperationMethod< RevokeOrgApiKeyRequest, RevokeOrgApiKeyResponse, RevokeOrgApiKeyError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RevokeOrgApiKeyRequest, output: RevokeOrgApiKeyResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RevokePermissionFromProjectError = NeonOpError; /** Revoke project access Revokes project access from the user associated with the specified permission `id`. You can retrieve a user's permission `id` by listing project access. */ export const revokePermissionFromProject: API.OperationMethod< RevokePermissionFromProjectRequest, ProjectPermission, RevokePermissionFromProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RevokePermissionFromProjectRequest, output: ProjectPermission, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type RotateCredentialError = NeonOpError; /** Rotate a credential's secrets Replaces the secret material on an existing scoped credential in place. `token_id` is preserved — it is the `AWS_ACCESS_KEY_ID` for S3-compatible clients, so the access key id your application already holds keeps working and only the secret changes. This is the analog of resetting a Postgres password, not of issuing a second credential. The response carries the new `api_token` and `s3_secret_access_key` exactly once. Rotation is **not** idempotent: retrying after an ambiguous timeout mints another secret and supersedes the previous replacement, so a retry does not recover a lost response — it only invalidates the secret you did not receive. If you lose the response, issue a replacement credential and revoke this one. The old secret stops authenticating as soon as the rotation commits. Where a region caches credentials on its data-plane verifiers, a replica may briefly keep accepting the old secret — and rejecting the new one — until its cache entry expires; where it does not, the cutover is immediate apart from requests already in flight. Either way the changeover is not atomic across replicas, so retry an unexpected authentication failure right after rotating rather than treating the new secret as bad. `last_used_at` continues to report the logical credential's prior usage and says nothing about whether the new secret has been used yet. Only a live, unexpired, unrevoked customer-managed (`user`) credential on a live project and live branch is eligible. Anything else — including the platform-internal `function` and `system` credentials — is reported as not found, indistinguishable from an unknown `token_id`. **Note**: This endpoint is currently in Beta. */ export const rotateCredential: API.OperationMethod< RotateCredentialRequest, RotateCredentialResponse, RotateCredentialError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: RotateCredentialRequest, output: RotateCredentialResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SendNeonAuthEmailProviderTestError = NeonOpError; /** Send test email using the saved email provider Sends a test email using the branch's already-saved custom SMTP configuration. Only the `recipient_email` is provided — the stored SMTP settings and password are used server-side, so the caller does not need to re-supply (or be able to read) the password. This avoids the GET response's masked password being sent back, which would fail SMTP authentication. Requires a configured custom SMTP provider on a Better Auth integration. A shared provider, a missing configuration, or a non-Better-Auth integration is rejected. */ export const sendNeonAuthEmailProviderTest: API.OperationMethod< SendNeonAuthEmailProviderTestRequest, SendNeonAuthTestEmailResponse, SendNeonAuthEmailProviderTestError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SendNeonAuthEmailProviderTestRequest, output: SendNeonAuthTestEmailResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SetDefaultProjectBranchError = NotFound | NeonOpError; /** Set branch as default Sets the specified branch as the project's default branch. The default designation is automatically removed from the previous default branch. For more information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const setDefaultProjectBranch: API.OperationMethod< SetDefaultProjectBranchRequest, SetDefaultProjectBranchResponse, SetDefaultProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SetDefaultProjectBranchRequest, output: SetDefaultProjectBranchResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SetOrganizationSpendingLimitError = NeonOpError; /** Set organization spending limit Sets the monthly spending limit for the specified organization. To remove a previously configured limit, send a DELETE request to this endpoint. When a limit is configured, email notifications are sent at 80% and 100% of the limit. Computes are not suspended when the limit is reached. Available to organization admins on Launch and Scale plans only. */ export const setOrganizationSpendingLimit: API.OperationMethod< SetOrganizationSpendingLimitRequest, SpendingLimitResponse, SetOrganizationSpendingLimitError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SetOrganizationSpendingLimitRequest, output: SpendingLimitResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SetProjectMemberRoleError = NeonOpError; /** Set an org member's role on a project Idempotently sets or updates the explicit project grant of the specified org member. Self-demotion requires `confirm_self_demotion=true`. */ export const setProjectMemberRole: API.OperationMethod< SetProjectMemberRoleRequest, ProjectMemberRoleResponse, SetProjectMemberRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SetProjectMemberRoleRequest, output: ProjectMemberRoleResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SetSnapshotScheduleError = NeonOpError; /** Update backup schedule Updates the backup schedule for the specified branch. The schedule defines how often automatic snapshots are created (for example, `daily` or `weekly`). Requires a paid plan. */ export const setSnapshotSchedule: API.OperationMethod< SetSnapshotScheduleRequest, SetSnapshotScheduleResponse, SetSnapshotScheduleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SetSnapshotScheduleRequest, output: SetSnapshotScheduleResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type StartAnonymizationError = NeonOpError; /** Start anonymization Starts the anonymization process for an anonymized branch that is in the initialized, error, or anonymized state. This will apply all defined masking rules to anonymize sensitive data in the branch databases. The branch must be an anonymized branch to start anonymization. **Note**: This endpoint is currently in Beta. */ export const startAnonymization: API.OperationMethod< StartAnonymizationRequest, AnonymizedBranchStatusResponse, StartAnonymizationError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: StartAnonymizationRequest, output: AnonymizedBranchStatusResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type StartProjectEndpointError = NotFound | NeonOpError; /** Start compute endpoint Starts a compute endpoint. The compute endpoint is ready to use after the last operation in the chain finishes successfully. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const startProjectEndpoint: API.OperationMethod< StartProjectEndpointRequest, StartProjectEndpointResponse, StartProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: StartProjectEndpointRequest, output: StartProjectEndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type SuspendProjectEndpointError = NotFound | NeonOpError; /** Suspend compute endpoint Suspends the specified compute endpoint. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). */ export const suspendProjectEndpoint: API.OperationMethod< SuspendProjectEndpointRequest, SuspendProjectEndpointResponse, SuspendProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: SuspendProjectEndpointRequest, output: SuspendProjectEndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type TransferNeonAuthProviderProjectError = NeonOpError; /** Transfer Neon-managed auth project to your own account Transfers ownership of your Neon-managed auth project to your own auth provider account. */ export const transferNeonAuthProviderProject: API.OperationMethod< TransferNeonAuthProviderProjectRequest, NeonAuthTransferAuthProviderProjectResponse, TransferNeonAuthProviderProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: TransferNeonAuthProviderProjectRequest, output: NeonAuthTransferAuthProviderProjectResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type TransferProjectsFromOrgToOrgError = | UnprocessableEntity | NeonOpError; /** Transfer projects between organizations Transfers selected projects, identified by their IDs, from your organization to another specified organization. */ export const transferProjectsFromOrgToOrg: API.OperationMethod< TransferProjectsFromOrgToOrgRequest, TransferProjectsFromOrgToOrgResponse, TransferProjectsFromOrgToOrgError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: TransferProjectsFromOrgToOrgRequest, output: TransferProjectsFromOrgToOrgResponse, errors: [UnprocessableEntity, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateBranchNeonAuthOauthProviderError = NeonOpError; /** Update OAuth provider Updates an OAuth provider for the specified project. */ export const updateBranchNeonAuthOauthProvider: API.OperationMethod< UpdateBranchNeonAuthOauthProviderRequest, NeonAuthOauthProvider, UpdateBranchNeonAuthOauthProviderError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateBranchNeonAuthOauthProviderRequest, output: NeonAuthOauthProvider, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateMaskingRulesError = NeonOpError; /** Update masking rules Updates the masking rules for the specified anonymized branch. Masking rules define how sensitive data should be anonymized using PostgreSQL Anonymizer. **Note**: This endpoint is currently in Beta. */ export const updateMaskingRules: API.OperationMethod< UpdateMaskingRulesRequest, MaskingRulesResponse, UpdateMaskingRulesError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateMaskingRulesRequest, output: MaskingRulesResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthAllowLocalhostError = NeonOpError; /** Update localhost allow setting Updates the localhost allow setting for the specified branch's Neon Auth integration. When enabled, authentication flows work from `localhost` without adding it to the redirect URI whitelist. */ export const updateNeonAuthAllowLocalhost: API.OperationMethod< UpdateNeonAuthAllowLocalhostRequest, NeonAuthAllowLocalhostResponse, UpdateNeonAuthAllowLocalhostError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthAllowLocalhostRequest, output: NeonAuthAllowLocalhostResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthConfigError = NeonOpError; /** Update auth configuration Updates the auth configuration for the branch. Currently supports updating the application name used in auth emails. */ export const updateNeonAuthConfig: API.OperationMethod< UpdateNeonAuthConfigRequest, NeonAuthConfigResponse, UpdateNeonAuthConfigError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthConfigRequest, output: NeonAuthConfigResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthEmailAndPasswordConfigError = NeonOpError; /** Update email and password configuration Updates the email and password authentication configuration for the specified branch's Neon Auth integration. Only the fields provided in the request body are updated. */ export const updateNeonAuthEmailAndPasswordConfig: API.OperationMethod< UpdateNeonAuthEmailAndPasswordConfigRequest, NeonAuthEmailAndPasswordConfig, UpdateNeonAuthEmailAndPasswordConfigError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthEmailAndPasswordConfigRequest, output: NeonAuthEmailAndPasswordConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthEmailProviderError = NeonOpError; /** Update email provider configuration Updates the email provider configuration for the specified branch's Neon Auth integration. The email provider handles transactional messages such as verification emails and password reset links. Partial `standard` updates — omitting fields to keep their stored values — are supported only for Better Auth integrations, which merge omitted fields server-side. Legacy Stack Auth integrations do not merge and require all six `standard` fields (`host`, `port`, `username`, `password`, `sender_email`, `sender_name`) on every update; a partial `standard` body is rejected with 400. */ export const updateNeonAuthEmailProvider: API.OperationMethod< UpdateNeonAuthEmailProviderRequest, UpdateNeonAuthEmailProviderResponse, UpdateNeonAuthEmailProviderError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthEmailProviderRequest, output: UpdateNeonAuthEmailProviderResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthMagicLinkPluginError = NeonOpError; /** Update magic link plugin configuration Updates the magic link plugin configuration for Neon Auth. The magic link plugin enables passwordless authentication via email magic links. */ export const updateNeonAuthMagicLinkPlugin: API.OperationMethod< UpdateNeonAuthMagicLinkPluginRequest, NeonAuthMagicLinkConfig, UpdateNeonAuthMagicLinkPluginError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthMagicLinkPluginRequest, output: NeonAuthMagicLinkConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthOrganizationPluginError = NeonOpError; /** Update organization plugin configuration Updates the organization plugin configuration for Neon Auth. The organization plugin enables multi-tenant organization support. */ export const updateNeonAuthOrganizationPlugin: API.OperationMethod< UpdateNeonAuthOrganizationPluginRequest, NeonAuthOrganizationConfig, UpdateNeonAuthOrganizationPluginError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthOrganizationPluginRequest, output: NeonAuthOrganizationConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthPhoneNumberPluginError = NeonOpError; /** Update phone number plugin configuration Updates the phone number plugin configuration for Neon Auth. Only the fields provided in the request body are updated; omitted fields retain their current values. The phone number plugin enables phone-based OTP authentication. OTP codes are delivered via the `send.otp` webhook event with `delivery_preference: "sms"`. A webhook must be configured with the `send.otp` event enabled for SMS delivery to work. */ export const updateNeonAuthPhoneNumberPlugin: API.OperationMethod< UpdateNeonAuthPhoneNumberPluginRequest, NeonAuthPhoneNumberConfig, UpdateNeonAuthPhoneNumberPluginError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthPhoneNumberPluginRequest, output: NeonAuthPhoneNumberConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthUserRoleError = NeonOpError; /** Update auth user role Updates the role of a user in the Neon Auth user directory for the specified branch. The role controls the user's level of access within the Neon Auth integration. */ export const updateNeonAuthUserRole: API.OperationMethod< UpdateNeonAuthUserRoleRequest, UpdateNeonAuthUserRoleResponse, UpdateNeonAuthUserRoleError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthUserRoleRequest, output: UpdateNeonAuthUserRoleResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateNeonAuthWebhookConfigError = NeonOpError; /** Update Neon Auth webhook configuration Updates the webhook configuration for the specified branch's Neon Auth integration. Webhooks notify an external endpoint when auth events occur, such as user creation or sign-in. */ export const updateNeonAuthWebhookConfig: API.OperationMethod< UpdateNeonAuthWebhookConfigRequest, NeonAuthWebhookConfig, UpdateNeonAuthWebhookConfigError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNeonAuthWebhookConfigRequest, output: NeonAuthWebhookConfig, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateOrganizationMemberError = NeonOpError; /** Update role for organization member Updates the role of an existing member in the specified organization. The requested role must be valid for the organization. Only organization admins can call this endpoint. */ export const updateOrganizationMember: API.OperationMethod< UpdateOrganizationMemberRequest, Member, UpdateOrganizationMemberError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateOrganizationMemberRequest, output: Member, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectError = BadRequest | NotFound | NeonOpError; /** Update project Updates the specified project. Configurable properties include the project name, default compute settings, history retention period, and IP allowlist. */ export const updateProject: API.OperationMethod< UpdateProjectRequest, UpdateProjectResponse, UpdateProjectError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectRequest, output: UpdateProjectResponse, errors: [BadRequest, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectBranchError = BadRequest | NotFound | NeonOpError; /** Update branch Updates the specified branch. For more information, see [Manage branches](https://neon.com/docs/manage/branches/). */ export const updateProjectBranch: API.OperationMethod< UpdateProjectBranchRequest, UpdateProjectBranchResponse, UpdateProjectBranchError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectBranchRequest, output: UpdateProjectBranchResponse, errors: [BadRequest, NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectBranchDataAPIError = NeonOpError; /** Update Neon Data API Updates the Neon Data API configuration for the specified branch. You can optionally provide settings to update the Data API configuration. The schema cache is always refreshed as part of this operation. */ export const updateProjectBranchDataAPI: API.OperationMethod< UpdateProjectBranchDataAPIRequest, UpdateProjectBranchDataAPIResponse, UpdateProjectBranchDataAPIError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectBranchDataAPIRequest, output: UpdateProjectBranchDataAPIResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectBranchDatabaseError = NotFound | NeonOpError; /** Update database Updates the specified database in the branch. For related information, see [Manage databases](https://neon.com/docs/manage/databases/). */ export const updateProjectBranchDatabase: API.OperationMethod< UpdateProjectBranchDatabaseRequest, UpdateProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectBranchDatabaseRequest, output: UpdateProjectBranchDatabaseResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectBranchFunctionError = NeonOpError; /** Update a function Updates the function's mutable metadata — currently only the display `name`. A string sets the display name; `null` clears it, after which the function's `name` falls back to its slug. Leading and trailing whitespace is trimmed; a whitespace-only name is rejected. Acts only on a function owned by the branch: a slug that is only inherited from an ancestor branch returns 404 — rename it on the branch that owns it. Like every other change on a branch, a rename is isolated per branch: a branch forked before the rename keeps the name it had at fork time. **Note**: This endpoint is currently in Beta. */ export const updateProjectBranchFunction: API.OperationMethod< UpdateProjectBranchFunctionRequest, NeonFunctionResponse, UpdateProjectBranchFunctionError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectBranchFunctionRequest, output: NeonFunctionResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateProjectEndpointError = NotFound | NeonOpError; /** Update compute endpoint Updates the specified compute endpoint. An `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix. For more information about compute endpoints, see [Manage computes](https://neon.com/docs/manage/endpoints/). If the returned list of operations is not empty, the compute endpoint is not ready to use. The client must wait for the last operation to finish before using the compute endpoint. If the compute endpoint was idle before the update, it becomes active for a short period of time, and the control plane suspends it again after the update. */ export const updateProjectEndpoint: API.OperationMethod< UpdateProjectEndpointRequest, UpdateProjectEndpointResponse, UpdateProjectEndpointError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateProjectEndpointRequest, output: UpdateProjectEndpointResponse, errors: [NotFound, UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, })); export type UpdateSnapshotError = NeonOpError; /** Update snapshot Updates the specified snapshot. */ export const updateSnapshot: API.OperationMethod< UpdateSnapshotRequest, UpdateSnapshotResponse, UpdateSnapshotError, NeonOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateSnapshotRequest, output: UpdateSnapshotResponse, errors: [UnknownNeonError], protocol: NeonProtocol, retry: Retry.Retry, }));