diff --git a/.changeset/olive-pears-remain.md b/.changeset/olive-pears-remain.md new file mode 100644 index 00000000..c7c60a6b --- /dev/null +++ b/.changeset/olive-pears-remain.md @@ -0,0 +1,19 @@ +--- +"@neon/sdk": major +--- + +**Breaking:** `neon.branches.recover` is removed. Neon stopped publishing `POST /projects/{project_id}/branches/{branch_id}/recover` in its OpenAPI spec, so the generated client no longer carries the operation. The endpoint still answers in production, so reach it through the low-level client until it returns to the spec and the wrapper with it: + +```ts +import type { BranchRecoverResponse } from "@neon/sdk"; + +const { data } = await neon.client.post<{ 200: BranchRecoverResponse }>({ + url: "/projects/{project_id}/branches/{branch_id}/recover", + path: { project_id: projectId, branch_id: branchId }, +}); +const branch = data?.branch; +``` + +That envelope carries the API's own error body rather than a `NeonError`, and the `{ 200: … }` wrapper is required — passing `BranchRecoverResponse` directly resolves to a union of its members. `neon.projects.recover` is a different endpoint and is unaffected. + +The same spec refresh adds two namespaces: `neon.projects.members` (`list`, `setRole`, `removeRole`) for the per-project roles of organization members, and `neon.logs` (`query`, `fields`, `fieldValues`) for branch logs. diff --git a/.changeset/quiet-moons-repeat.md b/.changeset/quiet-moons-repeat.md new file mode 100644 index 00000000..f80d5f93 --- /dev/null +++ b/.changeset/quiet-moons-repeat.md @@ -0,0 +1,5 @@ +--- +"neon": patch +--- + +Refreshed `--help` text for project, branch, endpoint, and database flags from the current Neon OpenAPI spec. Several descriptions that rendered as empty now have text, and the scale-to-zero, history-retention, and provisioner flags describe their plan limits. diff --git a/packages/cli/src/parameters.gen.ts b/packages/cli/src/parameters.gen.ts index 5dd2e6f4..b8646fb6 100644 --- a/packages/cli/src/parameters.gen.ts +++ b/packages/cli/src/parameters.gen.ts @@ -68,23 +68,23 @@ export const projectCreateRequest = { }, 'project.settings.audit_log_level': { type: "string", - description: undefined, + description: "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`.", demandOption: false, choices: ["base","extended","full"], }, 'project.settings.hipaa': { type: "boolean", - description: undefined, + description: "Enables HIPAA compliance mode for the project, including audit logging.", demandOption: false, }, 'project.settings.preload_libraries.use_defaults': { type: "boolean", - description: undefined, + description: "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`.", demandOption: false, }, 'project.settings.preload_libraries.enabled_libraries': { type: "array", - description: undefined, + description: "Names of shared preload libraries to enable for the project.", demandOption: false, }, 'project.name': { @@ -109,7 +109,7 @@ export const projectCreateRequest = { }, 'project.provisioner': { type: "string", - description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n", + description: "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`.", demandOption: false, }, 'project.region_id': { @@ -119,12 +119,12 @@ export const projectCreateRequest = { }, 'project.default_endpoint_settings.suspend_timeout_seconds': { type: "number", - description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n", + description: "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.", demandOption: false, }, 'project.pg_version': { type: "number", - description: "The major Postgres version number. Generally available versions are `14`, `15`, `16`, `17`, and `18`. `19` is being rolled out and is only accepted in regions where it has been enabled; requesting it in a region where it is not yet available returns an error.", + description: "The major Postgres version number. Supported versions are `14`, `15`, `16`, `17`, and `18`. `19` is rolling out and is accepted only in regions where it is enabled; requesting it elsewhere returns an error.", demandOption: false, }, 'project.store_passwords': { @@ -134,12 +134,12 @@ export const projectCreateRequest = { }, 'project.history_retention_seconds': { type: "number", - description: "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (86400 seconds).\n", + description: "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).\n", demandOption: false, }, 'project.org_id': { type: "string", - description: "Organization id in case the project created belongs to an organization.\nIf not present, project is owned by a user and not by org.\n", + description: "ID of the organization that will own the project. If omitted when using an organization API key, it is inferred from the key.\n", demandOption: false, }, } as const; @@ -212,23 +212,23 @@ export const projectUpdateRequest = { }, 'project.settings.audit_log_level': { type: "string", - description: undefined, + description: "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`.", demandOption: false, choices: ["base","extended","full"], }, 'project.settings.hipaa': { type: "boolean", - description: undefined, + description: "Enables HIPAA compliance mode for the project, including audit logging.", demandOption: false, }, 'project.settings.preload_libraries.use_defaults': { type: "boolean", - description: undefined, + description: "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`.", demandOption: false, }, 'project.settings.preload_libraries.enabled_libraries': { type: "array", - description: undefined, + description: "Names of shared preload libraries to enable for the project.", demandOption: false, }, 'project.name': { @@ -238,12 +238,12 @@ export const projectUpdateRequest = { }, 'project.default_endpoint_settings.suspend_timeout_seconds': { type: "number", - description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n", + description: "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.", demandOption: false, }, 'project.history_retention_seconds': { type: "number", - description: "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (604800 seconds).\n", + description: "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).\n", demandOption: false, }, } as const; @@ -251,7 +251,7 @@ export const projectUpdateRequest = { export const branchCreateRequest = { 'endpoints': { type: "array", - description: undefined, + description: "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.", demandOption: false, }, 'branch.parent_id': { @@ -271,22 +271,22 @@ export const branchCreateRequest = { }, 'branch.parent_timestamp': { type: "string", - description: "A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time.\nThe timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.\n", + description: "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.\n", demandOption: false, }, 'branch.protected': { type: "boolean", - description: "Whether the branch is protected\n", + description: "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.\n", demandOption: false, }, 'branch.archived': { type: "boolean", - description: "Whether to create the branch as archived\n", + description: "Whether to create the branch in the archived state. When omitted, the branch is created as a normal (non-archived) branch.\n", demandOption: false, }, 'branch.init_source': { type: "string", - description: "The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).\n * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.\n * `parent-data` - creates the branch with both schema and data from the parent.\n", + description: "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.", demandOption: false, }, 'branch.expires_at': { @@ -299,28 +299,28 @@ export const branchCreateRequest = { export const branchCreateRequestEndpointOptions = { 'type': { type: "string", - description: "The compute endpoint type. Either `read_write` or `read_only`.\n", + description: "Compute endpoint type. `read_write`: the primary read-write endpoint (one per branch). `read_only`: a read replica endpoint (multiple allowed per branch).", demandOption: true, choices: ["read_only","read_write"], }, 'settings.preload_libraries.use_defaults': { type: "boolean", - description: undefined, + description: "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`.", demandOption: false, }, 'settings.preload_libraries.enabled_libraries': { type: "array", - description: undefined, + description: "Names of shared preload libraries to enable for the project.", demandOption: false, }, 'provisioner': { type: "string", - description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n", + description: "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`.", demandOption: false, }, 'suspend_timeout_seconds': { type: "number", - description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n", + description: "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.", demandOption: false, }, } as const; @@ -328,12 +328,12 @@ export const branchCreateRequestEndpointOptions = { export const branchUpdateRequest = { 'branch.name': { type: "string", - description: undefined, + description: "New display name for the branch.", demandOption: false, }, 'branch.protected': { type: "boolean", - description: undefined, + description: "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.\n", demandOption: false, }, 'branch.expires_at': { @@ -356,33 +356,33 @@ export const endpointCreateRequest = { }, 'endpoint.type': { type: "string", - description: "The compute endpoint type. Either `read_write` or `read_only`.\n", + description: "Compute endpoint type. `read_write`: the primary read-write endpoint (one per branch). `read_only`: a read replica endpoint (multiple allowed per branch).", demandOption: true, choices: ["read_only","read_write"], }, 'endpoint.settings.preload_libraries.use_defaults': { type: "boolean", - description: undefined, + description: "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`.", demandOption: false, }, 'endpoint.settings.preload_libraries.enabled_libraries': { type: "array", - description: undefined, + description: "Names of shared preload libraries to enable for the project.", demandOption: false, }, 'endpoint.provisioner': { type: "string", - description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n", + description: "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`.", demandOption: false, }, 'endpoint.pooler_enabled': { type: "boolean", - description: "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", + description: "Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", demandOption: false, }, 'endpoint.pooler_mode': { type: "string", - description: "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n", + description: "Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026.\n", demandOption: false, choices: ["transaction"], }, @@ -398,7 +398,7 @@ export const endpointCreateRequest = { }, 'endpoint.suspend_timeout_seconds': { type: "number", - description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n", + description: "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.", demandOption: false, }, 'endpoint.name': { @@ -411,32 +411,32 @@ export const endpointCreateRequest = { export const endpointUpdateRequest = { 'endpoint.branch_id': { type: "string", - description: "DEPRECATED: This field will be removed in a future release.\nThe destination branch ID. The destination branch must not have an existing read-write endpoint.\n", + description: "Deprecated. The destination branch ID; must not have an existing read-write endpoint.\n", demandOption: false, }, 'endpoint.provisioner': { type: "string", - description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n", + description: "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`.", demandOption: false, }, 'endpoint.settings.preload_libraries.use_defaults': { type: "boolean", - description: undefined, + description: "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`.", demandOption: false, }, 'endpoint.settings.preload_libraries.enabled_libraries': { type: "array", - description: undefined, + description: "Names of shared preload libraries to enable for the project.", demandOption: false, }, 'endpoint.pooler_enabled': { type: "boolean", - description: "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", + description: "Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", demandOption: false, }, 'endpoint.pooler_mode': { type: "string", - description: "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n", + description: "Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026.\n", demandOption: false, choices: ["transaction"], }, @@ -452,7 +452,7 @@ export const endpointUpdateRequest = { }, 'endpoint.suspend_timeout_seconds': { type: "number", - description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n", + description: "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.", demandOption: false, }, 'endpoint.name': { @@ -465,7 +465,7 @@ export const endpointUpdateRequest = { export const databaseCreateRequest = { 'database.name': { type: "string", - description: "The name of the database\n", + description: "Name of the database to create.\n", demandOption: true, }, 'database.owner_name': { diff --git a/packages/sdk/README.md b/packages/sdk/README.md index a046b644..12b48f1b 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -48,7 +48,7 @@ const { project, connectionString } = data; | `baseUrl` | `string` | `https://console.neon.tech/api/v2` | Override the API base URL. | | `fetch` | `typeof fetch` | global `fetch` | Custom fetch implementation (proxies, tests, non-global runtimes). | -Every option except `apiKey` is also accepted **per call** via the last `options` argument (`{ throwOnError?, waitForReadiness?, requestTimeoutMs?, signal? }`), overriding the client default. Paginated `list()` methods take it too, after their query. +Every option except `apiKey` is also accepted **per call** via the last `options` argument (`{ throwOnError?, waitForReadiness?, requestTimeoutMs?, signal? }`), overriding the client default. Paginated methods take it too, after their query. ## The result model @@ -96,14 +96,20 @@ if (error?.kind === "not_found") { /* … */ } Branch on `kind` rather than `name` or `message`. `name` is a stable string literal on every class, so it survives bundling, but `message` is not a contract. +`kind` tells you what happened. To reach a subclass's **own** fields — `NeonNetworkError.reason`, +`NeonApiError.body` — narrow with `instanceof`: the result envelope types `error` as the base +`NeonError`, so a `kind` check alone does not make those properties visible. + `NeonNetworkError.reason` carries the most specific reason the platform gave — an `errno` code such as `ECONNRESET` when one is available, otherwise the innermost non-empty message. It is also interpolated into `message`, so transport faults are distinguishable in logs and error trackers instead of collapsing onto one string: ```ts +import { NeonNetworkError } from "@neon/sdk"; + const { error } = await neon.projects.get(id); -if (error?.kind === "network") { +if (error instanceof NeonNetworkError) { error.reason; // "ECONNRESET" error.message; // 'Network error: no response received from the Neon API (ECONNRESET).' } @@ -232,9 +238,22 @@ await neon.projects.transfer({ | `createWithCompute(projectId, input, { pooled? })` | **[W]** `{ branch, endpoint, connectionString }` | `input`: `{ name?, parentId?, compute?: { minCu?, maxCu?, suspendTimeoutSeconds? } }` | | `getDefault(projectId)` | `Branch` | resolves the default branch by the `default` flag | | `setDefault(projectId, branchId)` | `Branch` | | -| `recover(projectId, branchId)` | `Branch` | beta — recover a soft-deleted branch within the 7-day window | | `finalizeRestore(projectId, branchId, { name? }?)` | **→void** | commits a restore previewed with `snapshots.restore({ finalize: false })` | +**There is no `recover`.** Neon stopped publishing `POST /projects/{project_id}/branches/{branch_id}/recover` in its OpenAPI spec, so the wrapper is gone until it returns. The endpoint still answers, so a soft-deleted branch can still be recovered through the low-level client — note that this envelope carries the API's own error body rather than a `NeonError`: + +```ts +import type { BranchRecoverResponse } from "@neon/sdk"; + +const { data } = await neon.client.post<{ 200: BranchRecoverResponse }>({ + url: "/projects/{project_id}/branches/{branch_id}/recover", + path: { project_id: projectId, branch_id: branchId }, +}); +const branch = data?.branch; +``` + +`neon.projects.recover` is a different endpoint — it recovers a deleted **project**, not a branch. + ```ts // Resolve the project's default ("production") branch const { data: prod } = await neon.branches.getDefault(projectId); @@ -392,6 +411,110 @@ Branch-scoped AI Gateway endpoint metadata (beta). | --- | --- | --- | | `get(projectId, branchId)` | `BranchAiGateway` | 404 when AI Gateway is not enabled on the branch | +### `neon.logs` + +Branch-scoped logs from the services running on a branch — Neon Functions, object +storage, and Postgres computes (private beta). + +Being private beta shows, and all three calls behave the same way on a given branch: + +| Branch state | Response | +| --- | --- | +| Telemetry not available in the branch's region | `404`, `reason: "telemetry_not_enabled"` | +| Project or branch missing, or no access to it | `404`, `reason: "branch_not_found"` | +| Telemetry available, nothing recorded in the window | `200` with an empty `logs` / `values` array | +| Telemetry available, backend down | `503`, which the client retries on by default | + +**The two 404s need different handling, and only `reason` tells them apart.** Telemetry is +region-gated and the region is fixed at project creation, so `telemetry_not_enabled` is a +permanent property of the branch and an ordinary outcome to design around. +`branch_not_found` is a real error — a wrong id or a key without access — and should not +be absorbed into the same path. Both arrive as `NeonNotFoundError`, and `reason` is not +lifted onto the error, so it has to be read off the API's body, which the SDK keeps as +`unknown`: + +```ts +import { NeonNotFoundError } from "@neon/sdk"; + +function logsUnavailableReason(error: unknown): string | undefined { + if (!(error instanceof NeonNotFoundError)) return undefined; + const body = error.body; + if (typeof body !== "object" || body === null || !("reason" in body)) return undefined; + return typeof body.reason === "string" ? body.reason : undefined; +} + +const { error } = await neon.logs.fields(projectId, branchId); +if (error) { + if (logsUnavailableReason(error) === "telemetry_not_enabled") { + // no logs on this branch, ever — carry on + } else throw error; +} +``` + +Two more limits worth knowing, because the spec is wider than the backend. `source` is a +three-value enum, but only `function` and `storage` were observed emitting; no branch +produced a `pg_endpoint` record. And `minimum_severity` can be rejected outright with a +`400` (`NeonApiError`, `kind: "api"`) reading +`"minimum_severity is not supported by this branch's log backend"` — so filter on +`severity_text` if you need it to work everywhere. + +| Method | Returns | Notes | +| --- | --- | --- | +| `query(projectId, branchId, input?)` | **[P]** `ProjectBranchLogRecord` | `input`: `{ since?, start_time?, end_time?, limit?, sort_order?, source?, service_name?, scope_name?, minimum_severity?, severity_text?, body_contains?, trace_id?, logql? }` — filters combine with `AND` | +| `fields(projectId, branchId)` | `string[]` | field names this branch has emitted, usable as `fieldName` below | +| `fieldValues(projectId, branchId, fieldName, query?)` | `ProjectBranchLogFieldValuesResponse` | `query`: `{ since?, start_time?, end_time?, source?, limit? }` — check `is_truncated` | + +Give the window as **either** `since` (`"30m"`, `"6h"`, `"7d"`) **or** `start_time`; +supplying both is rejected with `conflicting_time_range`. `logql` replaces the seven +content filters rather than adding to them — combining them is rejected with +`conflicting_filters` — while `limit`, `sort_order`, and the time window still apply +alongside it. Seven days is the widest range served. **The default window differs +between the two calls:** `query` covers the last hour, `fieldValues` the last six, so a +value discovered by one is not guaranteed to appear in the other. + +`query` pages for you, replaying the filters unchanged as the endpoint requires. If a +page reports more records than it returned but no cursor to reach them, the walk fails +with a `client`-kind `NeonError` rather than handing back a partial result as if it +were complete. + +```ts +// Errors from a function over the last 6 hours, newest first +const { data: errors } = await neon.logs + .query(projectId, branchId, { + since: "6h", + source: "function", + // some branches' log backends reject minimum_severity; severity_text always works + minimum_severity: "error", + }) + .all(); + +// Paging replays the filters for you — the endpoint returns wrong results otherwise +for await (const line of neon.logs.query(projectId, branchId, { since: "1h" })) { + console.log(line.timestamp, line.message); +} + +// Discover what you can enumerate, then read one field's values +const { data: fields } = await neon.logs.fields(projectId, branchId); +// e.g. ["service_name", "severity_text", "scope_name", "entity_type"] + +const { data: services } = await neon.logs.fieldValues( + projectId, branchId, "service_name", { since: "24h" }, +); +console.log(services?.values); +if (services?.is_truncated) { + // an arbitrary subset — narrow `since` or `source` before filtering on it +} +``` + +**`fieldName` must be a name `fields` returned.** The enumerable set and the filterable +set overlap rather than nest: `source` is a filter — on `query` and on `fieldValues`' own +query — but is not enumerable, so `fieldValues(…, "source")` answers `400` with +`reason: "unknown_field"`; `entity_type` is enumerable but is not a filter on `query`. + +`fields` returns a bare `string[]` because its response carries nothing else. +`fieldValues` returns the whole response, because `is_truncated` is what decides whether +the values can be trusted and unwrapping would hide it. + ### `neon.snapshots` | Method | Returns | Notes | @@ -483,6 +606,74 @@ for await (const project of neon.consumption.perProject({ | `user.me()` | `CurrentUserInfoResponse` | | `user.organizations()` | `Organization[]` | +### `neon.auth` + +Branch-scoped Neon Auth (the legacy project-scoped endpoints are deprecated and stay raw-only). + +| Method | Returns | Notes | +| --- | --- | --- | +| `get(projectId, branchId)` | `NeonAuthIntegration` | | +| `create(projectId, branchId, input)` | `NeonAuthCreateIntegrationResponse` | enable the integration | +| `disable(projectId, branchId, { deleteData? }?)` | **→void** | | +| `updateConfig(projectId, branchId, input)` | `NeonAuthConfigResponse` | | +| `oauthProviders.list / add / update / delete` | `NeonAuthOauthProvider`(`[]`) / **→void** | | +| `trustedDomains.list / add / delete` | `NeonAuthRedirectUriWhitelistDomain[]` / **→void** | redirect-URI whitelist | +| `users.create / delete / updateRole` | `NeonAuthCreateNewUserResponse` / **→void** / role | | + +### `neon.projects.permissions` + +| Method | Returns | +| --- | --- | +| `list(projectId)` | `ProjectPermission[]` | +| `grant(projectId, email)` | `ProjectPermission` | +| `revoke(projectId, permissionId)` | `ProjectPermission` | + +For an **org-owned** project, roles for existing organization members live on +`neon.projects.members` below instead. + +### `neon.projects.members` + +Per-project roles for members of the **owning organization**. Distinct from +`neon.projects.permissions`, which shares a project with an individual by email: these +act on existing org members by member id, and clearing a grant leaves the member's +organization-role default in force rather than removing their access. Org-owned projects +only — a personal project answers 404. + +| Method | Returns | Notes | +| --- | --- | --- | +| `list(projectId, query?)` | **[P]** `ProjectMember` | `query`: `{ limit? }` | +| `setRole(projectId, memberId, role, { confirmSelfDemotion? }?)` | `ProjectMemberRoleResponse` | `role`: `"viewer" \| "editor" \| "admin"`; idempotent | +| `removeRole(projectId, memberId, { confirmSelfLockout? }?)` | `ProjectMemberRoleResponse` | clears the explicit grant; idempotent | + +A `ProjectMember` carries several role-ish fields, and they are not interchangeable. +**Read `effective_project_permission`** for "what can this member actually do" — `VIEWER` +/ `EDITOR` / `ADMIN`, uppercase. `org_default_project_permission` and +`explicit_project_permission` are the two inputs it was resolved from, and `grant_source` +says which one won (`explicit`, `org_role_default`, `org_admin_override`, `unassigned`). + +The two lowercase fields are a different axis: `project_role` is the explicit grant you +set with `setRole` and shares its `"viewer" | "editor" | "admin"` type, and `org_role` is +the member's organization role. Reading back `project_role` after a `setRole` tells you +the grant landed — it does **not** tell you the member's effective access, which the +org-role default can still exceed. + +The two confirmations are **off by default** so a call cannot silently cost you access to +your own project. Pass one only when you mean to lower your own role +(`confirmSelfDemotion`) or to drop your own grant when that removes your management +access (`confirmSelfLockout`); without it the API rejects the call. + +```ts +const { data: grant } = await neon.projects.members.setRole( + projectId, memberId, "editor", +); +// A downgrade can leave credentials the member still holds +if (grant?.credential_rotation_recommended) { /* rotate database credentials */ } +if (grant?.org_api_key_rotation_recommended) { /* rotate project-scoped org keys */ } +``` + +Also on `neon.projects`: `recover(id)` (beta — recover a soft-deleted project), and on +`neon.postgres.endpoints`: `listByBranch(projectId, branchId)` → `Endpoint[]`. + --- ## Raw layer (every endpoint, 1:1) @@ -519,31 +710,6 @@ underlying configured Fetch client; `raw.*` are the wrapped generated functions, request/response/error **types** are re-exported flat from `@neon/sdk` for `import type { Project, Branch, … }`. -### `neon.auth` - -Branch-scoped Neon Auth (the legacy project-scoped endpoints are deprecated and stay raw-only). - -| Method | Returns | Notes | -| --- | --- | --- | -| `get(projectId, branchId)` | `NeonAuthIntegration` | | -| `create(projectId, branchId, input)` | `NeonAuthCreateIntegrationResponse` | enable the integration | -| `disable(projectId, branchId, { deleteData? }?)` | **→void** | | -| `updateConfig(projectId, branchId, input)` | `NeonAuthConfigResponse` | | -| `oauthProviders.list / add / update / delete` | `NeonAuthOauthProvider`(`[]`) / **→void** | | -| `trustedDomains.list / add / delete` | `NeonAuthRedirectUriWhitelistDomain[]` / **→void** | redirect-URI whitelist | -| `users.create / delete / updateRole` | `NeonAuthCreateNewUserResponse` / **→void** / role | | - -### `neon.projects.permissions` - -| Method | Returns | -| --- | --- | -| `list(projectId)` | `ProjectPermission[]` | -| `grant(projectId, email)` | `ProjectPermission` | -| `revoke(projectId, permissionId)` | `ProjectPermission` | - -Also on `neon.projects`: `recover(id)` (beta — recover a soft-deleted project), and on -`neon.postgres.endpoints`: `listByBranch(projectId, branchId)` → `Endpoint[]`. - ## Regenerating the client The client is generated from a vendored, pinned copy of the spec in [`spec/neon-openapi.json`](./spec/neon-openapi.json) using [`@hey-api/openapi-ts`](https://heyapi.dev). diff --git a/packages/sdk/spec/neon-openapi.json b/packages/sdk/spec/neon-openapi.json index af44d6de..6b4c27c9 100644 --- a/packages/sdk/spec/neon-openapi.json +++ b/packages/sdk/spec/neon-openapi.json @@ -7,7 +7,7 @@ ], "info": { "title": "Neon API", - "description": "The Neon API allows you to access and manage Neon programmatically. You can use the Neon API to manage API keys, projects, branches, compute endpoints, databases, roles, and operations. For information about these features, refer to the [Neon documentation](https://neon.com/docs/manage/overview/).\n\nYou can run Neon API requests from this API reference using the **Try It** feature. Enter your API key as a **Bearer** token in the **Authorization** section of the page.\n\nYou can create and manage API keys in the Neon Console. See [Manage API keys](https://neon.com/docs/manage/api-keys/) for instructions.", + "description": "The Neon API is the management API for Neon. Use it to provision, configure, and manage resources such as projects, branches, databases, roles, functions, and object storage.\n\nSee the [Neon API reference](https://neon.com/docs/reference/api) for details, and [Manage API keys](https://neon.com/docs/manage/api-keys/) to create and use API keys.", "version": "v2", "contact": { "email": "help@databricks.com" @@ -87,11 +87,11 @@ }, { "name": "Storage", - "description": "These methods allow you to inspect branchable object-storage state for Neon branches." + "description": "These methods allow you to inspect branchable object storage state for Neon branches." }, { "name": "Buckets", - "description": "These methods allow you to create and manage branchable object-storage buckets and their objects." + "description": "These methods allow you to create and manage branchable object storage buckets and their objects." }, { "name": "Functions", @@ -101,6 +101,10 @@ "name": "AI Gateway", "description": "These methods allow you to inspect the AI Gateway endpoint for your Neon branches." }, + { + "name": "Logs", + "description": "These methods allow you to query logs emitted by services running on your Neon branches." + }, { "name": "Credentials", "description": "These methods allow you to issue and manage scoped credentials on your Neon branches." @@ -547,7 +551,7 @@ }, "post": { "summary": "Create project", - "description": "Creates a Neon project within an organization.\nIf using a personal API key, include the `org_id` parameter to specify which organization to create the project in.\nIf using an org API key, `org_id` is automatically inferred from the key.\nPlan limits define how many projects you can create.\nFor more information, see [Manage projects](https://neon.com/docs/manage/projects/).\n\nYou can specify a region and Postgres version in the request body.\nNeon currently supports PostgreSQL 14, 15, 16, 17, and 18.\nFor supported regions and `region_id` values, see [Regions](https://neon.com/docs/introduction/regions/).\n", + "description": "Creates a Neon project within an organization.\nIf using a personal API key, include the `org_id` parameter to specify which organization to create the project in.\nIf using an org API key, `org_id` is automatically inferred from the key.\nPlan limits define how many projects you can create.\nFor more information, see [Manage projects](https://neon.com/docs/manage/projects/).\n\nYou can specify a region and Postgres version in the request body.\nNeon supports Postgres 14 through 18, with 19 rolling out to enabled regions.\nFor supported regions and `region_id` values, see [Regions](https://neon.com/docs/introduction/regions/).\n", "tags": [ "Project" ], @@ -1072,6 +1076,155 @@ } } }, + "/projects/{project_id}/members": { + "parameters": [ + { + "name": "project_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + } + ], + "get": { + "summary": "List org members and their project roles", + "description": "Lists organization members and their per-project roles for an org-owned project.\nReturns 404 when the project is not org-owned, per-project role management is disabled,\nor the caller has no access. Callers with VIEWER or EDITOR see members with\neffective project access. Callers with ADMIN also see unassigned org members.\n", + "tags": [ + "Project" + ], + "operationId": "listProjectMembers", + "parameters": [ + { + "$ref": "#/components/parameters/CursorParam" + }, + { + "name": "limit", + "description": "The maximum number of members to return in the response", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 500 + } + } + ], + "responses": { + "200": { + "description": "Returned the org members and their project roles", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMembers" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + } + }, + "/projects/{project_id}/members/{member_id}/role": { + "parameters": [ + { + "name": "project_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "member_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "put": { + "summary": "Set an org member's role on a project", + "description": "Idempotently sets or updates the explicit project grant of the specified org member.\nSelf-demotion requires `confirm_self_demotion=true`.\n", + "tags": [ + "Project" + ], + "operationId": "setProjectMemberRole", + "parameters": [ + { + "name": "confirm_self_demotion", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetProjectMemberRoleRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Role set or updated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberRoleResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + }, + "delete": { + "summary": "Remove an org member's role on a project", + "description": "Idempotently removes the explicit project grant. The member's organization-role\ndefault project permission still applies. Self-DELETE requires\n`confirm_self_lockout=true` when effective manage access would be lost.\n", + "tags": [ + "Project" + ], + "operationId": "removeProjectMemberRole", + "parameters": [ + { + "name": "confirm_self_lockout", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Role removed, or no-op if no explicit row existed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectMemberRoleResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + } + }, "/projects/{project_id}/permissions/{permission_id}": { "parameters": [ { @@ -1181,7 +1334,8 @@ "ttl_seconds": { "type": "integer", "format": "int64", - "description": "Specifies the validity duration of the transfer request in seconds. If not provided,\nthe request will expire after 24 hours (86,400 seconds).\n" + "description": "Number of seconds the transfer request stays valid before it expires. Defaults to 86400 (24 hours).\n", + "default": 86400 } } } @@ -1243,6 +1397,7 @@ "properties": { "org_id": { "description": "The Neon organization ID to transfer the project to. If not provided, the project will be\ntransferred to the current user or organization account.\n", + "example": "org-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" } @@ -1533,7 +1688,7 @@ "/projects/auth/create": { "post": { "summary": "Create Neon Auth integration", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth` instead. Creates a project on a third-party authentication provider's platform for use with Neon Auth.\nUse this endpoint if the frontend integration flow can't be used.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth` instead. Removal scheduled for March 1, 2026.\nUse this endpoint if the frontend integration flow can't be used.\n", "tags": [ "Auth (legacy)" ], @@ -1697,7 +1852,7 @@ ], "get": { "summary": "List trusted redirect URI domains", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Lists the domains in the redirect_uri whitelist for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -1722,7 +1877,7 @@ }, "post": { "summary": "Add trusted redirect URI domain", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Adds a domain to the redirect_uri whitelist for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -1750,7 +1905,7 @@ }, "delete": { "summary": "Delete trusted redirect URI domain", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Deletes a domain from the redirect_uri whitelist for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -1917,7 +2072,7 @@ "/projects/auth/user": { "post": { "summary": "Create new auth user", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/users` instead. Creates a new user in Neon Auth.\nThe user will be created in your neon_auth.users_sync table and automatically propagated to your auth project, whether Neon-managed or provider-owned.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/users` instead. Removal scheduled for March 1, 2026.\nThe user will be created in your neon_auth.users_sync table and automatically propagated to your auth project, whether Neon-managed or provider-owned.\n", "tags": [ "Auth (legacy)" ], @@ -2128,7 +2283,7 @@ "/projects/{project_id}/auth/users/{auth_user_id}": { "delete": { "summary": "Delete auth user", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}` instead. Deletes the auth user for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2204,7 +2359,7 @@ "/projects/{project_id}/auth/integrations": { "get": { "summary": "List active integrations with auth providers", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth` instead.", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth` instead. Removal scheduled for March 1, 2026.", "tags": [ "Auth (legacy)" ], @@ -2255,7 +2410,7 @@ ], "get": { "summary": "List OAuth providers", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Lists the OAuth providers for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2280,7 +2435,7 @@ }, "post": { "summary": "Add an OAuth provider", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead.\nAdds an OAuth provider to the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2420,7 +2575,7 @@ ], "patch": { "summary": "Update OAuth provider", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}` instead. Updates a OAuth provider for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2455,7 +2610,7 @@ }, "delete": { "summary": "Delete OAuth provider", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}` instead. Deletes a OAuth provider from the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2506,7 +2661,7 @@ ], "patch": { "summary": "Update OAuth provider", - "description": "Updates a OAuth provider for the specified project.\n", + "description": "Updates an OAuth provider for the specified project.\n", "tags": [ "Auth" ], @@ -2540,7 +2695,7 @@ }, "delete": { "summary": "Delete OAuth provider", - "description": "Deletes a OAuth provider from the specified project.\n", + "description": "Deletes an OAuth provider from the specified project.\n", "tags": [ "Auth" ], @@ -2571,7 +2726,7 @@ ], "get": { "summary": "Retrieve email server configuration", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Gets the email server configuration for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2596,7 +2751,7 @@ }, "patch": { "summary": "Update email server configuration", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Updates the email server configuration for the specified project.\n", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Removal scheduled for March 1, 2026.\n", "tags": [ "Auth (legacy)" ], @@ -2851,7 +3006,7 @@ "/projects/{project_id}/auth/integration/{auth_provider}": { "delete": { "summary": "Delete integration with auth provider", - "description": "DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth` instead.", + "description": "Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth` instead. Removal scheduled for March 1, 2026.", "tags": [ "Auth (legacy)" ], @@ -4063,7 +4218,7 @@ "Branch" ], "summary": "Retrieve database schema", - "description": "Retrieves the schema from the specified database. The `lsn` and `timestamp` values cannot be specified at the same time. If both are omitted, the database schema is retrieved from database's head.", + "description": "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.", "operationId": "getProjectBranchSchema", "parameters": [ { @@ -4485,54 +4640,6 @@ } } }, - "/projects/{project_id}/branches/{branch_id}/recover": { - "parameters": [ - { - "name": "project_id", - "in": "path", - "description": "The Neon project ID", - "required": true, - "schema": { - "type": "string", - "pattern": "^[a-z0-9-]{1,60}$" - } - }, - { - "name": "branch_id", - "in": "path", - "description": "The branch ID", - "required": true, - "schema": { - "type": "string", - "pattern": "^[a-z0-9-]{1,60}$" - } - } - ], - "post": { - "summary": "Recover a deleted branch", - "description": "Recovers a deleted branch within the 7-day deletion recovery period.\nThe branch must have been soft deleted and not yet permanently deleted.\nRecovery restores the branch and its endpoints to an idle state.\nConnection strings remain valid after recovery.\nTTL branches become non-TTL branches after recovery.\n\nTo list deleted branches available for recovery, use `GET /projects/{project_id}/branches?include_deleted=true`.\n", - "tags": [ - "Branch" - ], - "operationId": "recoverProjectBranch", - "x-stability-level": "beta", - "responses": { - "200": { - "description": "Recovered the specified branch", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BranchRecoverResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/GeneralError" - } - } - } - }, "/projects/{project_id}/branches/{branch_id}/finalize_restore": { "parameters": [ { @@ -4558,7 +4665,7 @@ ], "post": { "summary": "Finalize branch restore from snapshot", - "description": "Finalize the restore operation for a branch created from a snapshot.\nThis operation updates the branch so it functions as the original branch it replaced.\nThis includes:\n - Reassigning any computes from the original branch to the restored branch (this will restart the computes)\n - Renaming the restored branch to the original branch's name\n - Renaming the original branch so it no longer uses the original name\n\nThis operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Finalize the restore operation for a branch created from a snapshot.\nThis operation updates the branch so it functions as the original branch it replaced.\nThis includes:\n - Reassigning any computes from the original branch to the restored branch (this will restart the computes)\n - Renaming the restored branch to the original branch's name\n - Renaming the original branch so it no longer uses the original name\n\nThis operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`.\n", "tags": [ "Branch" ], @@ -4572,7 +4679,7 @@ "properties": { "name": { "type": "string", - "description": "used to rename the existing branch when it is replaced. if omitted, a default name is generated and used" + "description": "Name for the replaced branch. If omitted, a unique name is generated." } } } @@ -7326,7 +7433,7 @@ "id": "db8faf32-b07f-4b0f-94c8-5c288909f5d3", "email": "invited1@email.com", "org_id": "my-organization-morning-bread-81040908", - "invited_by": "some@email.com", + "invited_by": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "role": "admin", "invited_at": "2024-02-23T17:42:25Z" }, @@ -7334,7 +7441,7 @@ "id": "c52f0d22-ebd9-4708-ae44-2872cae49a83", "email": "invited2@email.com", "org_id": "my-organization-morning-bread-81040908", - "invited_by": "some@email.com", + "invited_by": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "role": "member", "invited_at": "2024-02-23T12:42:25Z" } @@ -7432,7 +7539,7 @@ } }, "406": { - "description": "Transfer failed - the target organization has too many projects or its plan is incompatible with the source organization. Reduce projects or upgrade the organization.", + "description": "Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization.", "content": { "application/json": { "schema": { @@ -7442,7 +7549,7 @@ } }, "422": { - "description": "One or more of the provided project IDs have GitHub or Vercel integrations installed. Transferring integration projects is currently not supported", + "description": "Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred.", "content": { "application/json": { "schema": { @@ -7730,7 +7837,7 @@ "deprecated": true, "x-sunset": "2026-07-01", "summary": "Transfer projects from personal account to organization", - "description": "DEPRECATED. Personal accounts have been migrated to organizations, making this operation no longer applicable.\n", + "description": "Deprecated. Personal accounts have been migrated to organizations, so this operation no longer applies. Removal scheduled for July 1, 2026.\n", "requestBody": { "required": true, "content": { @@ -7757,7 +7864,7 @@ } }, "406": { - "description": "Transfer failed - the target organization has too many projects or its plan is incompatible with the source account. Reduce the number of projects or upgrade the target organization to increase its capacity.", + "description": "Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization.", "content": { "application/json": { "schema": { @@ -7767,7 +7874,7 @@ } }, "422": { - "description": "One or more of the provided project IDs have GitHub or Vercel integrations installed. Transferring integration projects is currently not supported", + "description": "Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred.", "content": { "application/json": { "schema": { @@ -7832,7 +7939,7 @@ ], "post": { "summary": "Create snapshot", - "description": "Creates a snapshot from the specified branch.\nThis operation may initiate an asynchronous process.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Creates a snapshot from the specified branch.\nThis operation may initiate an asynchronous process.\n", "tags": [ "Snapshot" ], @@ -7850,10 +7957,11 @@ { "name": "timestamp", "in": "query", - "description": "The target timestamp for the snapshot. Must fall within the restore window.\nUse ISO 8601 format (e.g. 2025-08-05T22:00:00Z). Cannot be used with `lsn`.\n", + "description": "The target timestamp for the snapshot. Must fall within the restore window. RFC 3339 format. Cannot be used with `lsn`.\n", "required": false, "schema": { - "type": "string" + "type": "string", + "example": "2025-08-05T22:00:00Z" } }, { @@ -7868,10 +7976,11 @@ { "name": "expires_at", "in": "query", - "description": "The time at which the snapshot will be automatically deleted.\nUse ISO 8601 format (e.g. 2025-08-05T22:00:00Z).\n", + "description": "The time at which the snapshot will be automatically deleted. RFC 3339 format.\n", "required": false, "schema": { - "type": "string" + "type": "string", + "example": "2025-08-05T22:00:00Z" } } ], @@ -7922,7 +8031,7 @@ ], "get": { "summary": "List project snapshots", - "description": "Lists the snapshots for the specified project.\nEach snapshot represents a point-in-time backup of the project data.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Lists the snapshots for the specified project.\nEach snapshot represents a point-in-time backup of the project data.\n", "tags": [ "Snapshot" ], @@ -7980,7 +8089,7 @@ ], "delete": { "summary": "Delete snapshot", - "description": "Deletes the specified snapshot.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Deletes the specified snapshot.\n", "tags": [ "Snapshot" ], @@ -8003,7 +8112,7 @@ }, "patch": { "summary": "Update snapshot", - "description": "Updates the specified snapshot.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Updates the specified snapshot.\n", "tags": [ "Snapshot" ], @@ -8069,12 +8178,12 @@ "post": { "x-stability-level": "beta", "summary": "Restore snapshot", - "description": "Restores the specified snapshot to a new branch,\nand optionally finalizes the restore operation to replace the original branch.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Restores the specified snapshot to a new branch,\nand optionally finalizes the restore operation to replace the original branch.\n", "parameters": [ { "name": "name", "in": "query", - "description": "DEPRECATED. Use the `name` field in the request body instead.\nA name for the newly restored branch. If omitted, a default name will be generated.\n", + "description": "Deprecated. Use the `name` field in the request body instead. Removal scheduled for November 29, 2025.\nA name for the newly restored branch. If omitted, a default name will be generated.\n", "required": false, "deprecated": true, "x-sunset": "2025-11-29", @@ -8091,11 +8200,11 @@ "type": "object", "properties": { "name": { - "description": "A name for the newly restored branch.\nIf omitted, a default name will be generated.\n", + "description": "A name for the newly restored branch. If not provided, the server generates a unique name for the branch automatically.\n", "type": "string" }, "target_branch_id": { - "description": "The ID of the branch to restore the snapshot into.\nIf not specified, the branch from which the snapshot was originally\ncreated (`snapshot.source_branch_id`) will be used.\n", + "description": "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.\n", "type": "string" }, "finalize_restore": { @@ -8147,7 +8256,7 @@ ], "get": { "summary": "Retrieve backup schedule", - "description": "Returns the backup schedule for the specified branch, including the configured snapshot frequencies.\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Returns the backup schedule for the specified branch, including the configured snapshot frequencies.\n", "tags": [ "Snapshot" ], @@ -8163,7 +8272,7 @@ }, "put": { "summary": "Update backup schedule", - "description": "Updates the backup schedule for the specified branch.\nThe schedule defines how often automatic snapshots are created (e.g., `daily`, `weekly`).\n\n**Note**: This endpoint is currently in Beta.\n", + "description": "Updates the backup schedule for the specified branch.\nThe schedule defines how often automatic snapshots are created (for example, `daily` or `weekly`). Requires a paid plan.\n", "tags": [ "Snapshot" ], @@ -8213,7 +8322,7 @@ ], "post": { "summary": "Create a bucket on the branch", - "description": "Creates a new branchable object-storage bucket on the specified branch.\nBuckets are managed by the Neon Platform branchable-storage service.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Creates a new branchable object storage bucket on the specified branch.\nBuckets are managed by the Neon Platform branchable object storage service.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8257,7 +8366,7 @@ }, "get": { "summary": "List buckets on the branch", - "description": "Lists branchable object-storage buckets visible on the specified branch,\nincluding those inherited from ancestor branches.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Lists branchable object storage buckets visible on the specified branch,\nincluding those inherited from ancestor branches.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8316,7 +8425,7 @@ ], "delete": { "summary": "Delete a bucket on the branch", - "description": "Deletes the named bucket from the specified branch.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Deletes the named bucket from the specified branch.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8366,8 +8475,8 @@ } ], "get": { - "summary": "Get branch storage state", - "description": "Returns whether branchable object-storage is usable for the specified\nbranch. A 200 response means the branch is registered in the storage\nservice and the S3 data plane will accept requests for it. A 404\nresponse includes a `reason` field indicating why storage is unavailable.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "summary": "Get branch object storage state", + "description": "Returns whether branchable object storage is usable for the specified\nbranch. A 200 response means the branch is registered in the object storage\nservice and the S3 data plane will accept requests for it. A 404\nresponse includes a `reason` field indicating why object storage is unavailable.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Storage" ], @@ -8375,7 +8484,7 @@ "operationId": "getProjectBranchStorage", "responses": { "200": { - "description": "Storage is enabled for this branch", + "description": "Object storage is enabled for this branch", "content": { "application/json": { "schema": { @@ -8385,7 +8494,7 @@ } }, "404": { - "description": "Storage is not enabled for this branch, or the project/branch was not\nfound. The body is always `BranchStorageNotEnabled` \u2014 see `reason` for\nthe exact cause.\n", + "description": "Object storage is not enabled for this branch, or the project/branch was not\nfound. The body is always `BranchStorageNotEnabled` \u2014 see `reason` for\nthe exact cause.\n", "content": { "application/json": { "schema": { @@ -8425,7 +8534,7 @@ ], "get": { "summary": "Get branch AI Gateway endpoint", - "description": "Returns the AI Gateway endpoint host for the specified branch, used to\nrender code-snippet base URLs. A 200 response means the branch is\nregistered and this region serves the AI gateway. A 404 response\nincludes a `reason` field indicating why the gateway is unavailable.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Returns the AI Gateway endpoint host for the specified branch, used to\nrender code-snippet base URLs. A 200 response means the branch is\nregistered and this region serves the AI gateway. A 404 response\nincludes a `reason` field indicating why the gateway is unavailable.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "AI Gateway" ], @@ -8458,7 +8567,7 @@ } } }, - "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects": { + "/projects/{project_id}/branches/{branch_id}/logs/query": { "parameters": [ { "name": "project_id", @@ -8479,76 +8588,337 @@ "type": "string", "pattern": "^[a-z0-9-]{1,60}$" } - }, - { - "name": "bucket_name", - "in": "path", - "description": "The bucket name", - "required": true, - "schema": { - "type": "string", - "minLength": 1, - "maxLength": 255 - } } ], - "get": { - "summary": "List objects in a bucket", - "description": "Lists objects visible in the named bucket on the specified branch,\nincluding those inherited from ancestor branches. Listing is served by\nthe user's session (no customer S3 credentials required).\n\nWhen `delimiter` is supplied (typically `/`), keys are collapsed into\ncommon prefixes (`folders`) so callers can render a folder-style\nbrowser; keys that do not contain the delimiter after `prefix` are\nreturned as `objects`.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "post": { + "summary": "Query branch logs", + "description": "Returns logs emitted by services running on the specified branch,\nordered by timestamp according to `sort_order`.\n\nAll supplied filters are combined with `AND`: a record is returned only\nwhen it matches every filter. `minimum_severity` and `severity_text` are\nindependent filters, so setting both requires a record to clear the\nseverity floor *and* match the exact severity text.\n\nSupply `logql` instead of the structured filters to run a raw LogQL\nexpression. Combining it with any structured filter is rejected rather\nthan silently ignored; `limit`, `sort_order`, and the time window still\napply, because those bound the query rather than form part of the\nexpression.\n\nGive the window either as `since` \u2014 a duration ending at `end_time`, or\nat the current time when `end_time` is omitted \u2014 or as an explicit\n`start_time`. Supplying both is rejected.\n\nA single response holds at most 1,000 records. When `is_truncated` is\n`true`, pass the returned `next_cursor` back as `cursor` to fetch the\nnext page, repeating the time range and every filter unchanged.\n\nIf no time range is supplied, the query covers the previous hour. The\nmaximum supported time range is seven days. `end_time` is exclusive.\n\n**Note**: This endpoint is currently in Private Beta.\n", "tags": [ - "Buckets" + "Logs" ], "x-stability-level": "beta", - "operationId": "listProjectBranchBucketObjects", - "parameters": [ - { - "name": "prefix", - "in": "query", - "description": "Only list objects whose key starts with this prefix.", - "required": false, - "schema": { - "type": "string" + "operationId": "queryProjectBranchLogs", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsQueryRequest" + } } - }, - { - "name": "delimiter", - "in": "query", - "description": "Collapse keys sharing a common prefix up to the first occurrence of\nthis delimiter (typically `/`) into the `folders` array.\n", - "required": false, - "schema": { - "type": "string" + } + }, + "responses": { + "200": { + "description": "Logs matching the supplied filters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsQueryResponse" + } + } } }, - { - "name": "cursor", - "in": "query", - "description": "Opaque pagination cursor returned as `next_cursor` by a previous\ncall. Resume listing after the last item of the previous page.\n", - "required": false, - "schema": { - "type": "string" + "400": { + "description": "The query could not be served as written. The body is always\n`ProjectBranchLogsInvalidQuery` \u2014 see `reason` for the exact cause.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsInvalidQuery" + } + } } }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of items (objects + folders) to return.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000, - "default": 1000 - } - } - ], - "responses": { - "200": { - "description": "The list of objects and folders", + "404": { + "description": "Logs are not available for this branch, or the project/branch was\nnot found. The body is always `ProjectBranchLogsNotAvailable` \u2014 see\n`reason` for the exact cause.\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BucketObjectsListResponse" + "$ref": "#/components/schemas/ProjectBranchLogsNotAvailable" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + } + }, + "/projects/{project_id}/branches/{branch_id}/logs/fields": { + "parameters": [ + { + "name": "project_id", + "in": "path", + "description": "The Neon project ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "branch_id", + "in": "path", + "description": "The Neon branch ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + } + ], + "get": { + "summary": "List branch log fields", + "description": "Lists the low-cardinality log fields observed on this branch whose\ndistinct values can be discovered with the log field-values endpoint.\n\nThe set is computed per branch and grows as new fields are observed, so\ntreat it as data rather than a fixed list: discover a field here, then\npass it as `field_name` to the field-values endpoint.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "tags": [ + "Logs" + ], + "x-stability-level": "beta", + "operationId": "listProjectBranchLogFields", + "responses": { + "200": { + "description": "Log fields available for value discovery on this branch", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogFieldsResponse" + } + } + } + }, + "404": { + "description": "Logs are not available for this branch, or the project/branch was\nnot found. The body is always `ProjectBranchLogsNotAvailable` \u2014 see\n`reason` for the exact cause.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsNotAvailable" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + } + }, + "/projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values": { + "parameters": [ + { + "name": "project_id", + "in": "path", + "description": "The Neon project ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "branch_id", + "in": "path", + "description": "The Neon branch ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "field_name", + "in": "path", + "description": "The log field whose distinct values should be returned. Must be one of\nthe names returned by the log fields endpoint for this branch.\n", + "required": true, + "schema": { + "type": "string", + "minLength": 1 + } + } + ], + "get": { + "summary": "List branch log field values", + "description": "Lists the distinct values observed for a low-cardinality log field in\nthe requested time range. Call the log fields endpoint first to learn\nwhich `field_name` values this branch supports; a field that branch has\nnever emitted is rejected with `unknown_field`.\n\nGive the window either as `since` or as an explicit `start_time`;\nsupplying both is rejected. If neither is given, the previous six hours\nare used. The maximum supported time range is seven days.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "tags": [ + "Logs" + ], + "x-stability-level": "beta", + "operationId": "listProjectBranchLogFieldValues", + "parameters": [ + { + "name": "since", + "description": "Length of the lookup window, ending at `end_time` or at the current\ntime when `end_time` is omitted. Mutually exclusive with\n`start_time`. Defaults to six hours.\n", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogDuration" + } + }, + { + "name": "start_time", + "description": "Inclusive beginning of the lookup window. Mutually exclusive with\n`since`.\n", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_time", + "description": "Exclusive end of the lookup window. Defaults to the current time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "source", + "description": "Only consider records emitted by this Neon service.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogSource" + } + }, + { + "name": "limit", + "description": "Maximum number of distinct values to return. The response sets\n`is_truncated` when this bound, or the server's own scan cap, cut the\nlist short.\n", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + } + ], + "responses": { + "200": { + "description": "Distinct values for the requested log field", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogFieldValuesResponse" + } + } + } + }, + "400": { + "description": "The lookup could not be served as written. The body is always\n`ProjectBranchLogsInvalidQuery` \u2014 see `reason` for the exact cause.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsInvalidQuery" + } + } + } + }, + "404": { + "description": "Logs are not available for this branch, or the project/branch was\nnot found. The body is always `ProjectBranchLogsNotAvailable` \u2014 see\n`reason` for the exact cause.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectBranchLogsNotAvailable" + } + } + } + }, + "default": { + "$ref": "#/components/responses/GeneralError" + } + } + } + }, + "/projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects": { + "parameters": [ + { + "name": "project_id", + "in": "path", + "description": "The Neon project ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "branch_id", + "in": "path", + "description": "The Neon branch ID", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + } + }, + { + "name": "bucket_name", + "in": "path", + "description": "The bucket name", + "required": true, + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 255 + } + } + ], + "get": { + "summary": "List objects in a bucket", + "description": "Lists objects visible in the named bucket on the specified branch,\nincluding those inherited from ancestor branches. Listing is served by\nthe user's session (no customer S3 credentials required).\n\nWhen `delimiter` is supplied (typically `/`), keys are collapsed into\ncommon prefixes (`folders`) so callers can render a folder-style\nbrowser; keys that do not contain the delimiter after `prefix` are\nreturned as `objects`.\n\n**Note**: This endpoint is currently in Beta.\n", + "tags": [ + "Buckets" + ], + "x-stability-level": "beta", + "operationId": "listProjectBranchBucketObjects", + "parameters": [ + { + "name": "prefix", + "in": "query", + "description": "Only list objects whose key starts with this prefix.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "delimiter", + "in": "query", + "description": "Collapse keys sharing a common prefix up to the first occurrence of\nthis delimiter (typically `/`) into the `folders` array.\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "cursor", + "in": "query", + "description": "Opaque pagination cursor returned as `next_cursor` by a previous\ncall. Resume listing after the last item of the previous page.\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items (objects + folders) to return.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000, + "default": 1000 + } + } + ], + "responses": { + "200": { + "description": "The list of objects and folders", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BucketObjectsListResponse" } } } @@ -8606,7 +8976,7 @@ ], "delete": { "summary": "Delete an object in a bucket", - "description": "Deletes the named object from the bucket on the specified branch.\nServed by the user's session (no customer S3 credentials required).\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Deletes the named object from the bucket on the specified branch.\nServed by the user's session (no customer S3 credentials required).\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8679,7 +9049,7 @@ ], "get": { "summary": "Download an object's bytes", - "description": "Streams the raw bytes of the named object from the bucket on the\nspecified branch, including objects inherited from ancestor branches.\nServed by the user's session (no customer S3 credentials required).\n\nThe body is returned as `application/octet-stream` so a browser treats\nit as a download; the `Content-Length` and `ETag` response headers echo\nthe stored object metadata.\n\nBINARY-STREAM EXCEPTION TO THE BUILD-GENERATED-TYPES RULE (#7029): the\nsuccessful 200 body is the raw object stream, proxied verbatim from the\nplatform storage admin endpoint. It is modeled as an\n`application/octet-stream` binary body (not a JSON response schema) and\nis streamed without buffering the whole object in memory. Error\nresponses still use the generated `GeneralError` shape.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Streams the raw bytes of the named object from the bucket on the\nspecified branch, including objects inherited from ancestor branches.\nServed by the user's session (no customer S3 credentials required).\n\nThe body is returned as `application/octet-stream` so a browser treats\nit as a download; the `Content-Length` and `ETag` response headers echo\nthe stored object metadata.\n\nBINARY-STREAM EXCEPTION TO THE BUILD-GENERATED-TYPES RULE (#7029): the\nsuccessful 200 body is the raw object stream, proxied verbatim from the\nplatform object storage admin endpoint. It is modeled as an\n`application/octet-stream` binary body (not a JSON response schema) and\nis streamed without buffering the whole object in memory. Error\nresponses still use the generated `GeneralError` shape.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8776,7 +9146,7 @@ ], "delete": { "summary": "Delete every object under a key prefix (folder) in a bucket", - "description": "Soft-deletes every object on the specified branch whose key starts with\n`prefix`, in a single call. Intended to back a \"delete folder\" action in\nan object browser: a `prefix` of `app/avatars/` removes every object\nbeneath that folder. Served by the user's session (no customer S3\ncredentials required).\n\n`prefix` must be non-empty, end with `/`, be at most 1024 bytes, and\ncontain no control characters - a partial-segment prefix cannot\naccidentally delete sibling keys. Returns the number of objects\nsoft-deleted (`deleted`), which may be 0 when no live object matched the\nprefix on this branch.\n\nOnly objects physically present on this branch are tombstoned; objects\ninherited from an ancestor branch via copy-on-write (not materialized on\nthis branch) are out of scope.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Soft-deletes every object on the specified branch whose key starts with\n`prefix`, in a single call. Intended to back a \"delete folder\" action in\nan object browser: a `prefix` of `app/avatars/` removes every object\nbeneath that folder. Served by the user's session (no customer S3\ncredentials required).\n\n`prefix` must be non-empty, end with `/`, be at most 1024 bytes, and\ncontain no control characters - a partial-segment prefix cannot\naccidentally delete sibling keys. Returns the number of objects\nsoft-deleted (`deleted`), which may be 0 when no live object matched the\nprefix on this branch.\n\nOnly objects physically present on this branch are tombstoned; objects\ninherited from an ancestor branch via copy-on-write (not materialized on\nthis branch) are out of scope.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8869,7 +9239,7 @@ ], "post": { "summary": "Presign an upload or download for an object in a bucket", - "description": "Returns a presigned URL that transfers bytes directly to or from the\nobject's bucket on the specified branch, without the caller ever\nhandling S3 credentials. The `operation` field selects the direction:\n\n- `upload` returns a presigned `PUT` URL (the caller `PUT`s the file\n bytes straight to `url` with the returned `headers`). Authorized with\n project write access.\n- `download` returns a presigned `GET` URL (the caller `GET`s the\n bytes straight from `url`). Authorized with project read access.\n\nThe platform mints a short-lived credential and builds the SigV4-signed\nURL against the branch's S3 data-plane host, returning it together with\nthe HTTP method, any headers the caller must echo, and the URL's expiry.\n\nServed by the user's session (no customer S3 credentials required).\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Returns a presigned URL that transfers bytes directly to or from the\nobject's bucket on the specified branch, without the caller ever\nhandling S3 credentials. The `operation` field selects the direction:\n\n- `upload` returns a presigned `PUT` URL (the caller `PUT`s the file\n bytes straight to `url` with the returned `headers`). Authorized with\n project write access.\n- `download` returns a presigned `GET` URL (the caller `GET`s the\n bytes straight from `url`). Authorized with project read access.\n\nThe platform mints a short-lived credential and builds the SigV4-signed\nURL against the branch's S3 data-plane host, returning it together with\nthe HTTP method, any headers the caller must echo, and the URL's expiry.\n\nServed by the user's session (no customer S3 credentials required).\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Buckets" ], @@ -8937,7 +9307,7 @@ ], "post": { "summary": "Issue a scoped credential on the branch", - "description": "Issues a new scoped service credential anchored to the specified\nbranch. The response carries `api_token` and `s3_secret_access_key`\nexactly once \u2014 they are not stored server-side.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Issues a new scoped service credential anchored to the specified\nbranch. The response carries `api_token` and `s3_secret_access_key`\nexactly once \u2014 they are not stored server-side.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Credentials" ], @@ -8971,7 +9341,7 @@ }, "get": { "summary": "List credentials on the branch", - "description": "Returns metadata for customer-issued credentials on the branch.\nSecrets are never included.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Returns metadata for customer-issued credentials on the branch.\nSecrets are never included.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Credentials" ], @@ -9028,7 +9398,7 @@ ], "delete": { "summary": "Revoke a credential", - "description": "Soft-deletes the credential. Idempotent.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Soft-deletes the credential. Idempotent.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Credentials" ], @@ -9079,7 +9449,7 @@ ], "get": { "summary": "List functions on the branch", - "description": "Lists functions on the specified branch.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Lists functions on the specified branch.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Functions" ], @@ -9159,7 +9529,7 @@ ], "get": { "summary": "Get function details", - "description": "Returns the function identified by its slug.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Returns the function identified by its slug.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Functions" ], @@ -9183,7 +9553,7 @@ }, "patch": { "summary": "Update a function", - "description": "Updates the function's mutable metadata \u2014 currently only the display\n`name`. A string sets the display name; `null` clears it, after which\nthe function's `name` falls back to its slug. Leading and trailing\nwhitespace is trimmed; a whitespace-only name is rejected. Acts only\non a function owned by the branch: a slug that is only inherited from\nan ancestor branch returns 404 \u2014 rename it on the branch that owns\nit. Like every other change on a branch, a rename is isolated per\nbranch: a branch forked before the rename keeps the name it had at\nfork time.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Updates the function's mutable metadata \u2014 currently only the display\n`name`. A string sets the display name; `null` clears it, after which\nthe function's `name` falls back to its slug. Leading and trailing\nwhitespace is trimmed; a whitespace-only name is rejected. Acts only\non a function owned by the branch: a slug that is only inherited from\nan ancestor branch returns 404 \u2014 rename it on the branch that owns\nit. Like every other change on a branch, a rename is isolated per\nbranch: a branch forked before the rename keeps the name it had at\nfork time.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Functions" ], @@ -9217,7 +9587,7 @@ }, "delete": { "summary": "Delete a function on the branch", - "description": "Deletes the function identified by its slug.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Deletes the function identified by its slug.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Functions" ], @@ -9268,7 +9638,7 @@ ], "post": { "summary": "Deploy code to a function", - "description": "Creates a deployment for the function. Supply any subset of zip,\nenvironment, and runtime; omitted fields inherit the\nfunction's latest version. At least one field must be supplied. The\nfirst deployment of a function must include zip. The newest deployment\nbecomes active.\n\n**Note**: This endpoint is currently in Private Beta.\n", + "description": "Creates a deployment for the function. Supply any subset of zip,\nenvironment, and runtime; omitted fields inherit the\nfunction's latest version. At least one field must be supplied. The\nfirst deployment of a function must include zip. The newest deployment\nbecomes active.\n\n**Note**: This endpoint is currently in Beta.\n", "tags": [ "Functions" ], @@ -9457,7 +9827,8 @@ }, "Provisioner": { "type": "string", - "description": "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n" + "description": "", + "example": "k8s-neonvm" }, "PaginationResponse": { "type": "object", @@ -9468,7 +9839,7 @@ } }, "Pagination": { - "description": "Cursor based pagination is used. The user must pass the cursor as is to the backend.\nFor more information about cursor based pagination, see\nhttps://learn.microsoft.com/en-us/ef/core/querying/pagination#keyset-pagination\n", + "description": "Cursor-based pagination. The `cursor` value reflects the endpoint's sort field (for example, an ID or timestamp), so pass it back unchanged.", "type": "object", "required": [ "cursor" @@ -9476,7 +9847,8 @@ "properties": { "cursor": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Cursor marking the last item in this response. Pass it unchanged as the `cursor` query parameter to fetch the next page." } }, "example": { @@ -9495,10 +9867,12 @@ ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "Plan name, for example `free`, `launch`, or `scale`." }, "version": { - "$ref": "#/components/schemas/PlanVersion" + "$ref": "#/components/schemas/PlanVersion", + "description": "Version of the plan, expressed as `major` and `minor` components." } } }, @@ -9526,7 +9900,7 @@ ], "properties": { "jwks_url": { - "description": "The URL that lists the JWKS", + "description": "URL of the provider's JWKS endpoint used to verify JWTs.", "type": "string" }, "provider_name": { @@ -9534,17 +9908,17 @@ "type": "string" }, "branch_id": { - "description": "Branch ID", + "description": "The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "jwt_audience": { - "description": "The name of the required JWT Audience to be used", + "description": "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.", "type": "string" }, "role_names": { "type": "array", - "description": "DEPRECATED. This field should only be used when using Neon RLS. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated` and `anonymous` roles.", + "description": "Deprecated. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated`, and `anonymous` roles.", "deprecated": true, "minItems": 0, "maxItems": 10, @@ -9554,7 +9928,7 @@ }, "skip_role_creation": { "type": "boolean", - "description": "DEPRECATED. This field should only be used when using Neon RLS. If true, the role creation will be skipped.", + "description": "Deprecated. Only used with Neon RLS. If true, role creation is skipped.", "default": false } } @@ -9571,21 +9945,21 @@ ], "properties": { "id": { - "description": "JWKS ID", + "description": "The JWKS configuration's ID.", "type": "string" }, "project_id": { - "description": "Project ID", + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { - "description": "Branch ID", + "description": "The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "jwks_url": { - "description": "The URL that lists the JWKS", + "description": "URL of the provider's JWKS endpoint used to verify JWTs.", "type": "string" }, "provider_name": { @@ -9603,14 +9977,15 @@ "format": "date-time" }, "jwt_audience": { - "description": "The name of the required JWT Audience to be used", + "description": "Expected JWT `aud` claim value configured for this JWKS.", "type": "string" }, "role_names": { "type": "array", "items": { "type": "string" - } + }, + "description": "Database role names that are permitted to authenticate using this JWKS configuration." } } }, @@ -9625,7 +10000,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/JWKS" - } + }, + "description": "JWKS configurations associated with the project." } } }, @@ -9756,7 +10132,7 @@ ], "properties": { "id": { - "description": "The API key ID", + "description": "The API key's unique numeric ID. Distinct from the API key token (`key`).", "type": "integer", "format": "int64" }, @@ -9809,7 +10185,7 @@ ], "properties": { "id": { - "description": "The API key ID", + "description": "The API key's unique numeric ID. Distinct from the API key token (`key`).", "type": "integer", "format": "int64" }, @@ -9871,7 +10247,7 @@ ], "properties": { "id": { - "description": "The API key ID", + "description": "The API key's unique numeric ID. Distinct from the API key token (`key`).", "type": "integer", "format": "int64" }, @@ -9932,7 +10308,7 @@ }, "name": { "type": "string", - "description": "The name of the user." + "description": "Display name of the user who created the API key." }, "image": { "type": "string", @@ -9942,6 +10318,7 @@ }, "Operation": { "type": "object", + "description": "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.", "required": [ "id", "project_id", @@ -9959,17 +10336,17 @@ "format": "uuid" }, "project_id": { - "description": "The Neon project ID", + "description": "The ID of the project this operation ran on.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { - "description": "The branch ID", + "description": "The ID of the branch this operation ran on.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "endpoint_id": { - "description": "The endpoint ID", + "description": "The ID of the compute endpoint this operation ran on.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -9977,10 +10354,11 @@ "$ref": "#/components/schemas/OperationAction" }, "status": { - "$ref": "#/components/schemas/OperationStatus" + "$ref": "#/components/schemas/OperationStatus", + "description": "Current lifecycle state of the operation. On `failed`, see `failures_count` and `retry_at` for retry detail." }, "error": { - "description": "The error that occurred", + "description": "Human-readable message describing why the operation failed.", "type": "string" }, "failures_count": { @@ -10090,7 +10468,7 @@ ] }, "OperationStatus": { - "description": "The status of the operation", + "description": "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.", "type": "string", "enum": [ "scheduling", @@ -10104,7 +10482,7 @@ ] }, "ProjectListItem": { - "description": "Essential data about the project. Full data is available at the getProject endpoint.\n", + "description": "Essential data about the project. Full data is available at `GET /projects/{project_id}`.\n", "type": "object", "required": [ "active_time", @@ -10126,7 +10504,7 @@ ], "properties": { "id": { - "description": "The project ID", + "description": "The Neon project ID. Use as the `project_id` path parameter in other endpoints.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10135,21 +10513,24 @@ "type": "string" }, "region_id": { - "description": "The region identifier\n", - "type": "string" + "description": "Cloud region where the project's Postgres compute and storage reside (for example, `aws-us-east-2`). Valid values are returned by `GET /regions`.\n", + "type": "string", + "example": "aws-us-east-2" }, "name": { "description": "The project name\n", "type": "string" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "default_endpoint_settings": { "$ref": "#/components/schemas/DefaultEndpointSettings" }, "settings": { - "$ref": "#/components/schemas/ProjectSettingsData" + "$ref": "#/components/schemas/ProjectSettingsData", + "description": "Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`." }, "pg_version": { "$ref": "#/components/schemas/PgVersion" @@ -10180,7 +10561,7 @@ }, "cpu_used_sec": { "deprecated": true, - "description": "DEPRECATED. Use data from the getProject endpoint instead.\n", + "description": "Deprecated. Use `compute_time_seconds` from `GET /projects/{project_id}` instead.\n", "type": "integer", "format": "int64" }, @@ -10204,18 +10585,19 @@ "format": "date-time" }, "synthetic_storage_size": { - "description": "The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.\n", + "description": "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.\n", "type": "integer", "format": "int64" }, "quota_reset_at": { "deprecated": true, - "description": "DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.\nA timestamp indicating when the project quota resets\n", + "description": "Deprecated. Use `consumption_period_end` from `GET /projects/{project_id}` instead. A timestamp indicating when the project quota resets.\n", "type": "string", "format": "date-time" }, "owner_id": { - "type": "string" + "type": "string", + "description": "ID of the organization that owns the project." }, "compute_last_active_at": { "description": "The most recent time when any endpoint of this project was active.\n\nOmitted when observed no activity for endpoints of this project.\n", @@ -10223,13 +10605,13 @@ "format": "date-time" }, "org_id": { - "description": "Organization id if the project belongs to an organization.\nPermissions for the project will be given to organization members as defined by the organization admins.\nThe permissions of the project do not depend on the user that created the project if a project belongs to an organization.\n", + "description": "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.\n", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "org_name": { "type": "string", - "description": "Organization name if the project belongs to an organization.\n" + "description": "Name of the organization that owns the project.\n" }, "history_retention_seconds": { "description": "The number of seconds to retain the shared history for all branches in this project.\n", @@ -10309,7 +10691,7 @@ ], "properties": { "data_storage_bytes_hour": { - "description": "Bytes-Hour. Project consumed that much storage hourly during the billing period. The value has some lag.\nThe value is reset at the beginning of each billing period.\n", + "description": "Bytes-Hour. Project consumed that much Postgres storage hourly during the billing period. The value has some lag.\nThe value is reset at the beginning of each billing period.\n", "type": "integer", "format": "int64", "minimum": 0 @@ -10321,7 +10703,7 @@ "minimum": 0 }, "written_data_bytes": { - "description": "Bytes. Amount of WAL that travelled through storage for given project across all branches.\nThe value has some lag. The value is reset at the beginning of each billing period.\n", + "description": "Bytes. Amount of WAL that travelled through Postgres storage for given project across all branches.\nThe value has some lag. The value is reset at the beginning of each billing period.\n", "type": "integer", "format": "int64", "minimum": 0 @@ -10339,13 +10721,13 @@ "minimum": 0 }, "cpu_used_sec": { - "description": "DEPRECATED, use compute_time instead.\n", + "description": "Deprecated. Use `compute_time_seconds` instead.\n", "type": "integer", "format": "int64", "deprecated": true }, "id": { - "description": "The project ID", + "description": "The Neon project ID. Use as the `project_id` path parameter in other endpoints.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10354,21 +10736,24 @@ "type": "string" }, "region_id": { - "description": "The region identifier\n", - "type": "string" + "description": "Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`.\n", + "type": "string", + "example": "aws-us-east-1" }, "name": { "description": "The project name\n", "type": "string" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "default_endpoint_settings": { "$ref": "#/components/schemas/DefaultEndpointSettings" }, "settings": { - "$ref": "#/components/schemas/ProjectSettingsData" + "$ref": "#/components/schemas/ProjectSettingsData", + "description": "Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`." }, "pg_version": { "$ref": "#/components/schemas/PgVersion" @@ -10416,7 +10801,7 @@ "format": "date-time" }, "synthetic_storage_size": { - "description": "The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.\n", + "description": "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.\n", "type": "integer", "format": "int64" }, @@ -10432,15 +10817,18 @@ }, "quota_reset_at": { "deprecated": true, - "description": "DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.\nA timestamp indicating when the project quota resets.\n", + "description": "Deprecated. Use the `consumption_period_end` field instead. A timestamp indicating when the project quota resets.\n", "type": "string", "format": "date-time" }, "owner_id": { - "type": "string" + "type": "string", + "description": "ID of the organization that owns the project.", + "example": "org-cool-darkness-12345678" }, "owner": { - "$ref": "#/components/schemas/ProjectOwnerData" + "$ref": "#/components/schemas/ProjectOwnerData", + "description": "Ownership details for the project, including the owner's name and email." }, "compute_last_active_at": { "description": "The most recent time when any endpoint of this project was active.\n\nOmitted when observed no activity for endpoints of this project.\n", @@ -10448,6 +10836,8 @@ "format": "date-time" }, "org_id": { + "description": "The Neon organization ID. Returned as `id` from `GET /users/me/organizations`.", + "example": "org-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10512,9 +10902,11 @@ "properties": { "project": { "type": "object", + "description": "Configuration for the new project, including name, region, and Postgres compute and storage settings.", "properties": { "settings": { - "$ref": "#/components/schemas/ProjectSettingsData" + "$ref": "#/components/schemas/ProjectSettingsData", + "description": "Project-level settings applied at creation." }, "name": { "description": "The project name. If not specified, the name will be identical to the generated project ID", @@ -10524,6 +10916,7 @@ }, "branch": { "type": "object", + "description": "Configuration for the initial branch created with the project.", "properties": { "name": { "description": "The default branch name. If not specified, the default branch name, `main`, will be used.\n", @@ -10540,23 +10933,24 @@ "type": "string" }, "annotations": { - "description": "The annotations for the branch.\n", + "description": "Arbitrary key-value metadata to attach to the branch.\n", "$ref": "#/components/schemas/AnnotationValueData" } } }, "autoscaling_limit_min_cu": { "deprecated": true, - "description": "DEPRECATED, use default_endpoint_settings.autoscaling_limit_min_cu instead.\n\nThe minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", + "description": "Deprecated. Use `default_endpoint_settings.autoscaling_limit_min_cu` instead.\n\nThe minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", "$ref": "#/components/schemas/ComputeUnit" }, "autoscaling_limit_max_cu": { "deprecated": true, - "description": "DEPRECATED, use default_endpoint_settings.autoscaling_limit_max_cu instead.\n\nThe maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", + "description": "Deprecated. Use `default_endpoint_settings.autoscaling_limit_max_cu` instead.\n\nThe maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", "$ref": "#/components/schemas/ComputeUnit" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "region_id": { "description": "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`\n", @@ -10573,14 +10967,14 @@ "type": "boolean" }, "history_retention_seconds": { - "description": "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (86400 seconds).\n", + "description": "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).\n", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2592000 }, "org_id": { - "description": "Organization id in case the project created belongs to an organization.\nIf not present, project is owned by a user and not by org.\n", + "description": "ID of the organization that will own the project. If omitted when using an organization API key, it is inferred from the key.\n", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" } @@ -10598,7 +10992,8 @@ "type": "object", "properties": { "settings": { - "$ref": "#/components/schemas/ProjectSettingsData" + "$ref": "#/components/schemas/ProjectSettingsData", + "description": "Project-level settings, for example `quota`, `allowed_ips`, `enable_logical_replication`, and `maintenance_window`." }, "name": { "description": "The project name", @@ -10610,7 +11005,7 @@ "$ref": "#/components/schemas/DefaultEndpointSettings" }, "history_retention_seconds": { - "description": "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (604800 seconds).\n", + "description": "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).\n", "type": "integer", "format": "int32", "minimum": 0, @@ -10675,7 +11070,8 @@ "description": "A short code identifying the reason" } } - } + }, + "description": "List of reasons why the target account's plan cannot satisfy the transfer requirements. Each item contains a `code` identifying the constraint and a `message` with a human-readable explanation." } } }, @@ -10704,10 +11100,12 @@ "type": "boolean" }, "audit_log_level": { - "$ref": "#/components/schemas/ProjectAuditLogLevel" + "$ref": "#/components/schemas/ProjectAuditLogLevel", + "description": "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`." }, "hipaa": { - "type": "boolean" + "type": "boolean", + "description": "Enables HIPAA compliance mode for the project, including audit logging." }, "preload_libraries": { "$ref": "#/components/schemas/PreloadLibraries" @@ -10721,7 +11119,8 @@ ], "properties": { "project": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/Project", + "description": "Full details of the project, including configuration, consumption metrics, and ownership." } } }, @@ -10745,7 +11144,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ProjectListItem" - } + }, + "description": "List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`." }, "unavailable_project_ids": { "description": "A list of project IDs indicating which projects are known to exist, but whose details could not\nbe fetched within the requested (or implicit) time limit\n", @@ -10769,21 +11169,25 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "description": "The project permission's ID." }, "granted_to_email": { "type": "string", "format": "email", "minLength": 1, - "maxLength": 256 + "maxLength": 256, + "description": "Email address of the user who has been granted access to the project." }, "granted_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp when the permission was granted." }, "revoked_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp when the permission was revoked. Null if the permission is still active." } } }, @@ -10811,6 +11215,7 @@ ], "properties": { "email": { + "description": "Email address of the user to grant project access to.", "type": "string", "format": "email", "minLength": 1, @@ -10818,6 +11223,15 @@ } } }, + "ProjectRole": { + "type": "string", + "enum": [ + "viewer", + "editor", + "admin" + ], + "description": "Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`,\nand `admin` maps to `ADMIN`.\n" + }, "ProjectPermissionLevel": { "type": "string", "enum": [ @@ -10827,6 +11241,170 @@ ], "description": "The caller's effective permission for a project when\nper-project permissions are enabled. `VIEWER` grants read access,\n`EDITOR` adds update access, and `ADMIN` grants full management.\nOmitted for personal projects, flag-off organizations, and non-user\nsubjects.\n" }, + "ProjectMemberGrantSource": { + "type": "string", + "enum": [ + "explicit", + "org_role_default", + "org_admin_override", + "unassigned" + ], + "description": "How a member's project access is granted.\n" + }, + "ProjectMemberOrgRole": { + "type": "string", + "enum": [ + "admin", + "member", + "editor", + "viewer", + "collaborator" + ], + "description": "Organization-level role used by project member role management.\n" + }, + "ProjectMember": { + "type": "object", + "required": [ + "member_id", + "user_id", + "org_role" + ], + "x-sensitive": [ + "email", + "name" + ], + "properties": { + "member_id": { + "type": "string", + "format": "uuid", + "description": "The organization member ID." + }, + "user_id": { + "type": "string", + "format": "uuid", + "description": "The user ID for the organization member." + }, + "email": { + "type": "string", + "format": "email", + "minLength": 1, + "maxLength": 256, + "description": "Email address of the user who has been granted access to the project." + }, + "name": { + "type": "string", + "description": "The user's display name." + }, + "org_role": { + "$ref": "#/components/schemas/ProjectMemberOrgRole" + }, + "project_role": { + "$ref": "#/components/schemas/ProjectRole" + }, + "org_default_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "explicit_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "effective_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "grant_source": { + "$ref": "#/components/schemas/ProjectMemberGrantSource" + } + } + }, + "ProjectMembers": { + "type": "object", + "required": [ + "project_members" + ], + "properties": { + "project_members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProjectMember" + } + }, + "pagination": { + "$ref": "#/components/schemas/CursorPagination" + } + } + }, + "SetProjectMemberRoleRequest": { + "type": "object", + "required": [ + "role" + ], + "properties": { + "role": { + "$ref": "#/components/schemas/ProjectRole" + } + } + }, + "ProjectMemberRoleResponse": { + "type": "object", + "required": [ + "project_id", + "member_id", + "user_id", + "org_role" + ], + "x-sensitive": [ + "email", + "name" + ], + "properties": { + "project_id": { + "type": "string", + "pattern": "^[a-z0-9-]{1,60}$" + }, + "member_id": { + "type": "string", + "format": "uuid" + }, + "user_id": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email", + "minLength": 1, + "maxLength": 256, + "description": "Email address of the user who has been granted access to the project." + }, + "name": { + "type": "string", + "description": "The user's display name." + }, + "org_role": { + "$ref": "#/components/schemas/ProjectMemberOrgRole" + }, + "project_role": { + "$ref": "#/components/schemas/ProjectRole", + "description": "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." + }, + "org_default_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "explicit_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "effective_project_permission": { + "$ref": "#/components/schemas/ProjectPermissionLevel" + }, + "credential_rotation_recommended": { + "type": "boolean", + "description": "Hint that database credentials may need rotation after the role change.\n" + }, + "org_api_key_rotation_recommended": { + "type": "boolean", + "description": "Hint that project-scoped org API keys created by the target user may need rotation.\n" + } + } + }, "ConsumptionHistoryPerProjectResponse": { "type": "object", "properties": { @@ -10834,7 +11412,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerProject" - } + }, + "description": "Per-project consumption history records included in the response." } }, "required": [ @@ -10848,7 +11427,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerProjectV2" - } + }, + "description": "Per-project consumption history entries for the requested time range." } }, "required": [ @@ -10859,7 +11439,7 @@ "type": "object", "properties": { "project_id": { - "description": "The project ID", + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10867,7 +11447,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerPeriod" - } + }, + "description": "Consumption periods for the project, each covering a discrete billing interval." } }, "required": [ @@ -10879,7 +11460,7 @@ "type": "object", "properties": { "project_id": { - "description": "The project ID", + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10887,7 +11468,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerPeriodV2" - } + }, + "description": "Consumption periods recorded for this project." } }, "required": [ @@ -10902,7 +11484,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerBranchV2" - } + }, + "description": "Per-branch consumption history records returned for the requested time range." } }, "required": [ @@ -10913,12 +11496,13 @@ "type": "object", "properties": { "project_id": { - "description": "The project that owns the branch", + "description": "The ID of the project that owns this branch.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { - "description": "The branch ID", + "description": "The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.", + "example": "br-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -10926,7 +11510,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerPeriodV2" - } + }, + "description": "Consumption history records for the branch, grouped by billing period." } }, "required": [ @@ -10961,7 +11546,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerTimeframe" - } + }, + "description": "Consumption metric records for the billing period." } }, "required": [ @@ -11020,7 +11606,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionHistoryPerTimeframeV2" - } + }, + "description": "Consumption metric records for the billing period." } }, "required": [ @@ -11084,12 +11671,12 @@ "format": "uint64" }, "synthetic_storage_size_bytes": { - "description": "Bytes. The space occupied in storage. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches.\n", + "description": "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.\n", "type": "integer", "format": "uint64" }, "data_storage_bytes_hour": { - "description": "Bytes-Hour. The amount of storage consumed hourly.\n", + "description": "Bytes-Hour. The amount of Postgres storage consumed hourly.\n", "type": "integer", "format": "uint64" }, @@ -11130,7 +11717,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConsumptionMetricValue" - } + }, + "description": "Consumption metric values recorded for the timeframe." } } }, @@ -11138,10 +11726,12 @@ "type": "object", "properties": { "metric_name": { - "type": "string" + "type": "string", + "description": "Name of the consumption metric, such as compute_time or data_storage_bytes_hour." }, "value": { - "type": "integer" + "type": "integer", + "description": "Measured quantity for the metric named by `metric_name`." } }, "required": [ @@ -11182,19 +11772,24 @@ ], "properties": { "library_name": { - "type": "string" + "type": "string", + "description": "Name of the Postgres shared preload library as it appears in the `shared_preload_libraries` parameter (for example, `pg_stat_statements`)." }, "description": { - "type": "string" + "type": "string", + "description": "Human-readable explanation of the library's purpose and behavior." }, "is_default": { - "type": "boolean" + "type": "boolean", + "description": "Whether this library is loaded by default in the `shared_preload_libraries` configuration for new compute endpoints." }, "is_experimental": { - "type": "boolean" + "type": "boolean", + "description": "Marks the library as experimental. Experimental libraries may be unstable, subject to breaking changes, or not recommended for production use." }, "version": { - "type": "string" + "type": "string", + "description": "Version of the preload library." } } }, @@ -11205,7 +11800,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/AvailablePreloadLibrary" - } + }, + "description": "Preload libraries available for the project's Postgres version. Each entry includes `library_name`, `description`, `is_default`, `is_experimental`, and `version`." } } }, @@ -11235,7 +11831,7 @@ "pattern": "^[a-z0-9-]{1,60}$" }, "project_id": { - "description": "The ID of the project to which the branch belongs\n", + "description": "The ID of the project this branch belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -11279,7 +11875,7 @@ }, "primary": { "deprecated": true, - "description": "DEPRECATED. Use `default` field.\nWhether the branch is the project's primary branch\n", + "description": "Deprecated. Use the `default` field. Whether the branch is the project's primary branch.\n", "type": "boolean" }, "default": { @@ -11287,30 +11883,34 @@ "type": "boolean" }, "protected": { - "description": "Whether the branch is protected\n", + "description": "Whether the branch is protected. Protected branches (and their computes) cannot be deleted, archived, or reset, and block deletion of the project.\n", "type": "boolean" }, "cpu_used_sec": { "deprecated": true, - "description": "CPU seconds used by all of the branch's compute endpoints, including deleted ones.\nThis value is reset at the beginning of each billing period.\nExamples:\n1. A branch that uses 1 CPU for 1 second is equal to `cpu_used_sec=1`.\n2. A branch that uses 2 CPUs simultaneously for 1 second is equal to `cpu_used_sec=2`.\n", + "description": "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.\n", "type": "integer", "format": "int64" }, "compute_time_seconds": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "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." }, "active_time_seconds": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "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." }, "written_data_bytes": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Data written by this branch during the current billing period, in bytes." }, "data_transfer_bytes": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Total data transferred out of the branch, in bytes. Used as a consumption metric." }, "created_at": { "description": "A timestamp indicating when the branch was created\n", @@ -11344,7 +11944,7 @@ "properties": { "name": { "type": "string", - "description": "The name of the user." + "description": "Display name of the user who created the branch." }, "image": { "type": "string", @@ -11353,8 +11953,9 @@ } }, "init_source": { - "description": "The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).\n * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point\u2014they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.\n * `parent-data` - creates the branch with both schema and data from the parent.\n", - "type": "string" + "description": "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.\n", + "type": "string", + "example": "parent-data" }, "restore_status": { "$ref": "#/components/schemas/BranchRestoreStatus" @@ -11400,7 +12001,7 @@ } }, "BranchState": { - "description": "The branch\u2019s state, indicating if it is initializing, ready for use, or archived.\n * 'init' - the branch is being created but is not available for querying.\n * 'resetting' - the branch is being reset to a specific point in time or LSN and is not yet available for querying.\n * 'ready' - the branch is fully operational and ready for querying. Expect normal query response times.\n * 'archived' - the branch is stored in cost-effective archival storage. Expect slow query response times.\n", + "description": "The branch\u2019s state, indicating if it is initializing, ready for use, or archived.\n * 'init' - the branch is being created but is not available for querying.\n * 'resetting' - the branch is being reset to a specific point in time or LSN and is not yet available for querying.\n * 'ready' - the branch is fully operational and ready for querying. Expect normal query response times.\n * 'archived' - the branch is stored in cost-effective archival Postgres storage. Expect slow query response times.\n", "type": "string" }, "BranchRestoreStatus": { @@ -11416,8 +12017,9 @@ ], "properties": { "name": { - "description": "The name of a restricted action. Possible values include `restore`, `delete-rw-endpoint`.\n", - "type": "string" + "description": "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.\n", + "type": "string", + "example": "restore" }, "reason": { "description": "A human-readable explanation of why the action is restricted.\n", @@ -11464,21 +12066,24 @@ "$ref": "#/components/schemas/EndpointType" }, "settings": { - "$ref": "#/components/schemas/EndpointSettingsData" + "$ref": "#/components/schemas/EndpointSettingsData", + "description": "Compute endpoint settings: `pg_settings` (Postgres parameter overrides such as `work_mem`, `max_connections`) and `preload_libraries`." }, "autoscaling_limit_min_cu": { - "description": "The minimum number of Compute Units. The minimum value is `0.25`.\n See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\n for more information.\n", + "description": "Minimum number of Compute Units the endpoint can scale down to. Minimum 0.25.\n", "$ref": "#/components/schemas/ComputeUnit" }, "autoscaling_limit_max_cu": { - "description": "The maximum number of Compute Units.\n See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\n for more information.\n", + "description": "Maximum number of Compute Units the endpoint can scale up to. Minimum 0.25.\n", "$ref": "#/components/schemas/ComputeUnit" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "suspend_timeout_seconds": { - "$ref": "#/components/schemas/SuspendTimeoutSeconds" + "$ref": "#/components/schemas/SuspendTimeoutSeconds", + "description": "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." } } }, @@ -11502,7 +12107,8 @@ }, "start_anonymization": { "description": "If true, automatically start anonymization after the branch is created.\nDefaults to false.\n", - "type": "boolean" + "type": "boolean", + "default": false } } } @@ -11515,10 +12121,12 @@ "type": "array", "items": { "$ref": "#/components/schemas/BranchCreateRequestEndpointOptions" - } + }, + "description": "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." }, "branch": { "type": "object", + "description": "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`.", "properties": { "parent_id": { "description": "The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's default branch.\n", @@ -11536,20 +12144,23 @@ "type": "string" }, "parent_timestamp": { - "description": "A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time.\nThe timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.\n", + "description": "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.\n", "type": "string", - "format": "date-time" + "format": "date-time", + "example": "2024-02-26T12:00:00Z" }, "protected": { - "description": "Whether the branch is protected\n", - "type": "boolean" + "description": "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.\n", + "type": "boolean", + "default": false }, "archived": { - "description": "Whether to create the branch as archived\n", + "description": "Whether to create the branch in the archived state. When omitted, the branch is created as a normal (non-archived) branch.\n", "type": "boolean" }, "init_source": { - "description": "The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).\n * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point\u2014they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.\n * `parent-data` - creates the branch with both schema and data from the parent.\n", + "example": "parent-data", + "description": "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.", "type": "string" }, "expires_at": { @@ -11570,14 +12181,17 @@ "properties": { "branch": { "type": "object", + "description": "Branch attributes to update. Supply only the fields you want to change, for example `name` or `protected`.", "properties": { "name": { "type": "string", "minLength": 1, - "maxLength": 256 + "maxLength": 256, + "description": "New display name for the branch." }, "protected": { - "type": "boolean" + "type": "boolean", + "description": "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.\n" }, "expires_at": { "description": "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.\n\nAccess to this feature is currently limited to participants in the Early Access Program.\n", @@ -11602,16 +12216,17 @@ "pattern": "^[a-z0-9-]{1,60}$" }, "source_lsn": { - "description": "A Log Sequence Number (LSN) on the source branch. The branch will be restored with data from this LSN.\n", + "description": "A Postgres LSN (for example, `0/1A2B3C4`) on the source branch to restore from.\nMutually exclusive with `source_timestamp`. Omit both to restore to head.\n", "type": "string" }, "source_timestamp": { - "description": "A timestamp identifying a point in time on the source branch. The branch will be restored with data starting from this point in time.\nThe timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.\n", + "description": "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.\n", "type": "string", - "format": "date-time" + "format": "date-time", + "example": "2024-02-26T12:00:00Z" }, "preserve_under_name": { - "description": "If not empty, the previous state of the branch will be saved to a branch with this name.\nIf the branch has children or the `source_branch_id` is equal to the branch id, this field is required. All existing child branches will be moved to the newly created branch under the name `preserve_under_name`.\n", + "description": "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.\n", "type": "string" } } @@ -11623,7 +12238,8 @@ ], "properties": { "branch": { - "$ref": "#/components/schemas/Branch" + "$ref": "#/components/schemas/Branch", + "description": "Branch returned by the request." } } }, @@ -11631,10 +12247,12 @@ "type": "object", "properties": { "sql": { - "type": "string" + "type": "string", + "description": "Branch schema expressed as SQL DDL statements." }, "json": { - "$ref": "#/components/schemas/BranchSchemaJSON" + "$ref": "#/components/schemas/BranchSchemaJSON", + "description": "Branch schema represented as a structured JSON object, parallel to the SQL DDL in `sql`." } } }, @@ -11642,7 +12260,8 @@ "type": "object", "properties": { "diff": { - "type": "string" + "type": "string", + "description": "Unified diff of the SQL schema changes between the compared branches." } } }, @@ -11656,7 +12275,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Branch" - } + }, + "description": "Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`." } } }, @@ -11668,7 +12288,8 @@ "properties": { "count": { "type": "integer", - "format": "int" + "format": "int", + "description": "Total number of branches in the project." } } }, @@ -11766,18 +12387,19 @@ ], "properties": { "project_id": { - "description": "The ID of the project\n", + "description": "The ID of the project this branch belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { - "description": "The ID of the anonymized branch\n", + "description": "The ID of the anonymized branch.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "state": { - "description": "The current state of the anonymized branch. Possible values: created, initialized, initialization_error, anonymizing, anonymized, error\n", - "type": "string" + "description": "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.\n", + "type": "string", + "example": "created" }, "status_message": { "description": "A descriptive message about the current status or any errors\n", @@ -11863,23 +12485,23 @@ ], "properties": { "database": { - "description": "Database name\n", + "description": "Name of the Postgres database used in the connection URI.\n", "type": "string" }, "password": { - "description": "Password for the role\n", + "description": "Authentication password for the role, used in the connection URI.\n", "type": "string" }, "role": { - "description": "Role name\n", + "description": "Postgres role used to authenticate the database connection.\n", "type": "string" }, "host": { - "description": "Hostname\n", + "description": "Hostname of the compute endpoint. Use `pooler_host` for the pooled connection hostname.\n", "type": "string" }, "pooler_host": { - "description": "Pooler hostname\n", + "description": "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.\n", "type": "string" } } @@ -11899,7 +12521,8 @@ "type": "string" }, "connection_parameters": { - "$ref": "#/components/schemas/ConnectionParameters" + "$ref": "#/components/schemas/ConnectionParameters", + "description": "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." } } }, @@ -11957,12 +12580,12 @@ "description": "Optional name of the compute endpoint\n" }, "project_id": { - "description": "The ID of the project to which the compute endpoint belongs\n", + "description": "The ID of the project this compute endpoint belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { - "description": "The ID of the branch that the compute endpoint is associated with\n", + "description": "The ID of the branch this compute endpoint belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -11976,7 +12599,8 @@ }, "region_id": { "type": "string", - "description": "The region identifier\n" + "description": "Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`.\n", + "example": "aws-us-east-1" }, "type": { "$ref": "#/components/schemas/EndpointType" @@ -11985,20 +12609,21 @@ "$ref": "#/components/schemas/EndpointState" }, "pending_state": { - "$ref": "#/components/schemas/EndpointState" + "$ref": "#/components/schemas/EndpointState", + "description": "Target state the compute endpoint is transitioning to. Omitted when no transition is in progress." }, "settings": { "$ref": "#/components/schemas/EndpointSettingsData" }, "pooler_enabled": { "deprecated": true, - "description": "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", + "description": "Deprecated. To use connection pooling, append `-pooler` to the endpoint ID in the connection string.\n", "type": "boolean" }, "pooler_mode": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026.\n", "$ref": "#/components/schemas/EndpointPoolerMode" }, "disabled": { @@ -12039,14 +12664,16 @@ "description": "A timestamp indicating when the compute endpoint was last suspended\n" }, "proxy_host": { - "description": "DEPRECATED. Use the \"host\" property instead.\n", + "description": "Deprecated. Use the `host` property instead.\n", "type": "string" }, "suspend_timeout_seconds": { - "$ref": "#/components/schemas/SuspendTimeoutSeconds" + "$ref": "#/components/schemas/SuspendTimeoutSeconds", + "description": "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)." }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "compute_release_version": { "description": "Attached compute's release version number.\n", @@ -12081,7 +12708,7 @@ } }, "EndpointState": { - "description": "The state of the compute endpoint\n", + "description": "Lifecycle state of the compute endpoint. `init`: being initialized. `active`: running and accepting connections. `idle`: suspended (scaled to zero).", "type": "string", "enum": [ "init", @@ -12090,7 +12717,7 @@ ] }, "EndpointType": { - "description": "The compute endpoint type. Either `read_write` or `read_only`.\n", + "description": "Compute endpoint type. `read_write`: the primary read-write endpoint (one per branch). `read_only`: a read replica endpoint (multiple allowed per branch).", "type": "string", "enum": [ "read_only", @@ -12100,7 +12727,7 @@ "EndpointPoolerMode": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. The connection pooler mode. Neon supports PgBouncer in `transaction` mode only. This schema is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. The connection pooler mode. Neon supports PgBouncer in `transaction` mode only. Removal scheduled for June 20, 2026.\n", "type": "string", "enum": [ "transaction" @@ -12161,13 +12788,15 @@ "type": "object", "properties": { "use_defaults": { - "type": "boolean" + "type": "boolean", + "description": "When true, the project's preload libraries include the platform default set in addition to any libraries listed in `enabled_libraries`." }, "enabled_libraries": { "type": "array", "items": { "type": "string" - } + }, + "description": "Names of shared preload libraries to enable for the project." } } }, @@ -12179,6 +12808,7 @@ "properties": { "endpoint": { "type": "object", + "description": "Configuration for the compute endpoint to create.", "required": [ "branch_id", "type" @@ -12208,17 +12838,18 @@ "$ref": "#/components/schemas/ComputeUnit" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "pooler_enabled": { "deprecated": true, - "description": "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", + "description": "Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", "type": "boolean" }, "pooler_mode": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026.\n", "$ref": "#/components/schemas/EndpointPoolerMode" }, "disabled": { @@ -12230,7 +12861,8 @@ "description": "NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.\n" }, "suspend_timeout_seconds": { - "$ref": "#/components/schemas/SuspendTimeoutSeconds" + "$ref": "#/components/schemas/SuspendTimeoutSeconds", + "description": "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." }, "name": { "type": "string", @@ -12250,10 +12882,11 @@ "properties": { "endpoint": { "type": "object", + "description": "Parameters for the compute endpoint update.", "properties": { "branch_id": { "deprecated": true, - "description": "DEPRECATED: This field will be removed in a future release.\nThe destination branch ID. The destination branch must not have an existing read-write endpoint.\n", + "description": "Deprecated. The destination branch ID; must not have an existing read-write endpoint.\n", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -12266,20 +12899,21 @@ "$ref": "#/components/schemas/ComputeUnit" }, "provisioner": { - "$ref": "#/components/schemas/Provisioner" + "$ref": "#/components/schemas/Provisioner", + "description": "Compute provisioner. `k8s-neonvm` (default) supports Autoscaling; `k8s-pod` is fixed-size compute. Also `docker` and `serverless-platform`." }, "settings": { "$ref": "#/components/schemas/EndpointSettingsData" }, "pooler_enabled": { "deprecated": true, - "description": "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", + "description": "Deprecated. To enable connection pooling, append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n", "type": "boolean" }, "pooler_mode": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. The connection pooler mode. Removal scheduled for June 20, 2026.\n", "$ref": "#/components/schemas/EndpointPoolerMode" }, "disabled": { @@ -12291,7 +12925,8 @@ "type": "boolean" }, "suspend_timeout_seconds": { - "$ref": "#/components/schemas/SuspendTimeoutSeconds" + "$ref": "#/components/schemas/SuspendTimeoutSeconds", + "description": "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." }, "name": { "type": "string", @@ -12310,7 +12945,8 @@ ], "properties": { "endpoint": { - "$ref": "#/components/schemas/Endpoint" + "$ref": "#/components/schemas/Endpoint", + "description": "Compute endpoint created or retrieved, including its current lifecycle state." } } }, @@ -12327,7 +12963,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConnectionDetails" - } + }, + "description": "Connection URIs for the project. Each entry contains credentials and should be treated as sensitive." } } }, @@ -12338,7 +12975,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/ConnectionDetails" - } + }, + "description": "Connection URIs for the compute endpoint, including credentials." } } }, @@ -12352,7 +12990,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/VPCEndpoint" - } + }, + "description": "List of VPC endpoints returned by the request." } } }, @@ -12366,7 +13005,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/VPCEndpointWithRegion" - } + }, + "description": "VPC endpoints associated with the region." } } }, @@ -12378,7 +13018,7 @@ ], "properties": { "vpc_endpoint_id": { - "description": "The VPC endpoint ID", + "description": "Cloud provider identifier for the VPC endpoint.", "type": "string" }, "label": { @@ -12420,7 +13060,7 @@ ], "properties": { "vpc_endpoint_id": { - "description": "The VPC endpoint ID", + "description": "Cloud provider identifier for the VPC endpoint.", "type": "string" }, "label": { @@ -12428,8 +13068,9 @@ "type": "string" }, "state": { - "description": "The current state of the VPC endpoint. Possible values are\n`new` (just configured, pending acceptance) or `accepted`\n(VPC connection was accepted by Neon).\n", - "type": "string" + "description": "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.\n", + "type": "string", + "example": "new" }, "num_restricted_projects": { "description": "The number of projects that are restricted to use this VPC endpoint.\n", @@ -12451,7 +13092,8 @@ ], "properties": { "label": { - "type": "string" + "type": "string", + "description": "Human-readable name for the VPC endpoint assignment, used to identify it within the organization." } } }, @@ -12465,7 +13107,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Endpoint" - } + }, + "description": "Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`." } } }, @@ -12476,7 +13119,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Endpoint" - } + }, + "description": "Compute endpoints associated with the project." } } }, @@ -12493,12 +13137,12 @@ ], "properties": { "branch_id": { - "description": "The ID of the branch to which the role belongs\n", + "description": "The ID of the branch this role belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "name": { - "description": "The role name\n", + "description": "Postgres role name within the branch.\n", "type": "string" }, "password": { @@ -12510,8 +13154,9 @@ "type": "boolean" }, "authentication_method": { - "description": "Authentication method configured for this role. Valid options: `password`, `oauth`, `no_login`\n", - "type": "string" + "description": "Authentication method configured for this role: `password`, `oauth`, or `no_login`.\n", + "type": "string", + "example": "password" }, "created_at": { "description": "A timestamp indicating when the role was created\n", @@ -12540,6 +13185,7 @@ "properties": { "role": { "type": "object", + "description": "Properties of the role to create.", "required": [ "name" ], @@ -12563,7 +13209,8 @@ ], "properties": { "role": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/Role", + "description": "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." } } }, @@ -12574,7 +13221,8 @@ ], "properties": { "jwks": { - "$ref": "#/components/schemas/JWKS" + "$ref": "#/components/schemas/JWKS", + "description": "JWKS configuration associated with the project." } } }, @@ -12591,7 +13239,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Role" - } + }, + "description": "Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`.\n" } } }, @@ -12622,7 +13271,7 @@ }, "brand": { "type": "string", - "description": "Brand of credit card.\n", + "description": "Card network reported by the payment processor. Set to `unknown` when the network cannot be determined.\n", "enum": [ "amex", "diners", @@ -12657,7 +13306,8 @@ "description": "Type of payment source. E.g. \"card\".\n" }, "card": { - "$ref": "#/components/schemas/PaymentSourceBankCard" + "$ref": "#/components/schemas/PaymentSourceBankCard", + "description": "Bank card details for this payment source." } } }, @@ -12692,10 +13342,12 @@ ], "properties": { "state": { - "$ref": "#/components/schemas/BillingAccountState" + "$ref": "#/components/schemas/BillingAccountState", + "description": "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.\n" }, "payment_source": { - "$ref": "#/components/schemas/PaymentSource" + "$ref": "#/components/schemas/PaymentSource", + "description": "Payment source attached to the billing account, such as a credit card on file." }, "subscription_type": { "$ref": "#/components/schemas/BillingSubscriptionType" @@ -12704,7 +13356,7 @@ "$ref": "#/components/schemas/BillingPaymentMethod" }, "quota_reset_at_last": { - "description": "The last time the quota was reset. Defaults to the date-time the account is created.\n", + "description": "Timestamp of the last quota reset. Set to the account creation time when the account is first created.\n", "type": "string", "format": "date-time" }, @@ -12760,7 +13412,8 @@ "type": "string" }, "plan_details": { - "$ref": "#/components/schemas/PlanDetails" + "$ref": "#/components/schemas/PlanDetails", + "description": "Details of the subscription plan associated with the billing account." }, "spending_limit_cents": { "description": "Monthly spending cap in cents for V3 paid plans. When set,\nnotifications are sent at 80% and 100% of this limit. `null`\nmeans no limit is configured.\n", @@ -12861,7 +13514,7 @@ "format": "int64" }, "branch_id": { - "description": "The ID of the branch to which the database belongs\n", + "description": "The ID of the branch this database belongs to.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -12904,13 +13557,14 @@ "properties": { "database": { "type": "object", + "description": "Configuration for the new Postgres database.", "required": [ "name", "owner_name" ], "properties": { "name": { - "description": "The name of the database\n", + "description": "Name of the database to create.\n", "type": "string" }, "owner_name": { @@ -12932,9 +13586,10 @@ "properties": { "database": { "type": "object", + "description": "Properties to update on the database.", "properties": { "name": { - "description": "The name of the database\n", + "description": "Name of the database to update.\n", "type": "string" }, "owner_name": { @@ -12955,7 +13610,8 @@ ], "properties": { "database": { - "$ref": "#/components/schemas/Database" + "$ref": "#/components/schemas/Database", + "description": "Database object returned by the operation." } } }, @@ -12969,7 +13625,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Database" - } + }, + "description": "Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`." } } }, @@ -12989,7 +13646,8 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The invitation ID." }, "email": { "description": "Email of the invited user", @@ -13019,7 +13677,7 @@ } }, "MemberRole": { - "description": "The role of the organization member. Some role values may not be\navailable for all organizations.\n", + "description": "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.", "type": "string", "enum": [ "admin", @@ -13040,13 +13698,17 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The organization member's ID." }, "user_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The Neon user ID." }, "org_id": { + "description": "The Neon organization ID. Returned as `id` from `GET /users/me/organizations`.", + "example": "org-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -13055,7 +13717,8 @@ }, "joined_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp when the user joined the organization." } } }, @@ -13069,6 +13732,7 @@ ], "properties": { "email": { + "description": "Email address of the organization member's user account.", "type": "string", "format": "email", "minLength": 1, @@ -13093,10 +13757,12 @@ ], "properties": { "member": { - "$ref": "#/components/schemas/Member" + "$ref": "#/components/schemas/Member", + "description": "Membership record for the user in the organization." }, "user": { - "$ref": "#/components/schemas/MemberUserInfo" + "$ref": "#/components/schemas/MemberUserInfo", + "description": "Profile information for the organization member." } } }, @@ -13113,17 +13779,21 @@ ], "properties": { "id": { + "description": "The Neon organization ID. Use as the `org_id` path parameter in other endpoints.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "name": { - "type": "string" + "type": "string", + "description": "Human-readable display name of the organization." }, "handle": { - "type": "string" + "type": "string", + "description": "URL-safe identifier for the organization, used in API paths. Distinct from the display name." }, "plan": { - "type": "string" + "type": "string", + "description": "Billing plan for the organization, for example `free`, `launch`, or `scale`." }, "created_at": { "description": "A timestamp indicting when the organization was created\n", @@ -13159,7 +13829,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Organization" - } + }, + "description": "Organizations returned by the request. Each includes `id`, `name`, `handle`, and `plan`." } } }, @@ -13173,7 +13844,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/Invitation" - } + }, + "description": "List of pending invitations for the organization." } } }, @@ -13188,6 +13860,7 @@ ], "properties": { "email": { + "description": "Email address of the person to invite to the organization.", "type": "string", "format": "email", "minLength": 1, @@ -13208,7 +13881,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/OrganizationInviteCreateRequest" - } + }, + "description": "Invitations to create for the organization." } } }, @@ -13233,7 +13907,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/MemberWithUser" - } + }, + "description": "Members of the organization, each combining membership details (role, status) with the associated user's identity." } } }, @@ -13264,7 +13939,8 @@ "properties": { "region_id": { "type": "string", - "description": "The region ID as used in other API endpoints" + "description": "Cloud region where the resource's Postgres compute and storage reside (for example, `aws-us-east-1`). Valid values are returned by `GET /regions`.", + "example": "aws-us-east-1" }, "name": { "type": "string", @@ -13272,7 +13948,7 @@ }, "default": { "type": "boolean", - "description": "Whether this region is used by default in new projects." + "description": "True if this region is selected by default when no region is specified during project creation." }, "geo_lat": { "type": "string", @@ -13300,21 +13976,24 @@ ], "properties": { "email": { + "description": "Email address associated with this auth account.", "type": "string", "format": "email", "minLength": 1, "maxLength": 256 }, "image": { - "type": "string" + "type": "string", + "description": "URL of the user's profile picture as provided by the identity provider." }, "login": { "type": "string", "deprecated": true, - "description": "DEPRECATED. Use `email` field.\n" + "description": "Deprecated. Use the `email` field.\n" }, "name": { - "type": "string" + "type": "string", + "description": "Display name of the account as provided by the identity provider." }, "provider": { "$ref": "#/components/schemas/IdentityProviderId" @@ -13350,44 +14029,53 @@ "format": "int64" }, "billing_account": { - "$ref": "#/components/schemas/BillingAccount" + "$ref": "#/components/schemas/BillingAccount", + "description": "Billing account associated with the current user, including plan and subscription details." }, "auth_accounts": { "type": "array", "items": { "$ref": "#/components/schemas/CurrentUserAuthAccount" - } + }, + "description": "Authentication provider accounts linked to the current user." }, "email": { + "description": "Email address of the authenticated user.", "type": "string", "format": "email", "minLength": 1, "maxLength": 256 }, "id": { - "type": "string" + "type": "string", + "description": "The Neon user ID." }, "image": { - "type": "string" + "type": "string", + "description": "URL of the user's profile avatar image." }, "login": { "type": "string", "deprecated": true, - "description": "DEPRECATED. Use `email` field.\n" + "description": "Deprecated. Use the `email` field.\n" }, "name": { - "type": "string" + "type": "string", + "description": "First name of the current user." }, "last_name": { - "type": "string" + "type": "string", + "description": "Last name of the current user." }, "projects_limit": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Maximum number of projects the account is allowed to create under the current plan." }, "branches_limit": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Maximum number of branches allowed for the account under the current plan." }, "max_autoscaling_limit": { "type": "number", @@ -13396,10 +14084,12 @@ }, "compute_seconds_limit": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Maximum Postgres compute time, in seconds, allowed under the account's current plan." }, "plan": { - "type": "string" + "type": "string", + "description": "Current billing plan for the user's account." } } }, @@ -13411,7 +14101,8 @@ ], "properties": { "account_id": { - "type": "string" + "type": "string", + "description": "The ID of the account associated with this authentication record." }, "auth_method": { "type": "string", @@ -13421,7 +14112,8 @@ "api_key_user", "api_key_org", "oauth" - ] + ], + "description": "Authentication method used for the request:\n- `keycloak`: Keycloak identity provider authentication.\n- `session_cookie`: Browser session cookie authentication.\n- `api_key_user`: API key scoped to a user account.\n- `api_key_org`: API key scoped to an organization.\n- `oauth`: OAuth-based authentication.\n" }, "auth_data": { "type": "string" @@ -13475,7 +14167,7 @@ "pgbouncer_settings": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. PgBouncer settings for the compute endpoint. This field is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. PgBouncer settings for the compute endpoint. Removal scheduled for June 20, 2026.\n", "$ref": "#/components/schemas/PgbouncerSettingsData" }, "preload_libraries": { @@ -13529,19 +14221,20 @@ "pgbouncer_settings": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. PgBouncer settings for the compute endpoint. This field is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. Use the endpoint-level connection pooler configuration instead. Removal scheduled for June 20, 2026.\n", "$ref": "#/components/schemas/PgbouncerSettingsData" }, "autoscaling_limit_min_cu": { - "description": "The minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", + "description": "Minimum number of Compute Units for this endpoint. At least 0.25 and no greater than `autoscaling_limit_max_cu`.\n", "$ref": "#/components/schemas/ComputeUnit" }, "autoscaling_limit_max_cu": { - "description": "The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.com/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n", + "description": "Default maximum number of Compute Units for endpoints created under this account. At least 0.25.\n", "$ref": "#/components/schemas/ComputeUnit" }, "suspend_timeout_seconds": { - "$ref": "#/components/schemas/SuspendTimeoutSeconds" + "$ref": "#/components/schemas/SuspendTimeoutSeconds", + "description": "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." } } }, @@ -13555,18 +14248,19 @@ "PgbouncerSettingsData": { "deprecated": true, "x-sunset": "2026-06-20", - "description": "DEPRECATED. A raw representation of PgBouncer settings. This schema is deprecated and will be removed after 2026-06-20.\n", + "description": "Deprecated. A raw representation of PgBouncer settings. Removal scheduled for June 20, 2026.\n", "type": "object", "additionalProperties": { "type": "string" } }, "PgVersion": { - "description": "The major Postgres version number. Generally available versions are `14`, `15`, `16`, `17`, and `18`. `19` is being rolled out and is only accepted in regions where it has been enabled; requesting it in a region where it is not yet available returns an error.", + "description": "The major Postgres version number. Supported versions are `14`, `15`, `16`, `17`, and `18`. `19` is rolling out and is accepted only in regions where it is enabled; requesting it elsewhere returns an error.", "type": "integer", "minimum": 14, "maximum": 19, - "default": 17 + "default": 18, + "example": 18 }, "ProjectOwnerData": { "type": "object", @@ -13582,16 +14276,19 @@ ], "properties": { "email": { + "description": "Email address of the project owner.", "type": "string", "format": "email", "minLength": 1, "maxLength": 256 }, "name": { - "type": "string" + "type": "string", + "description": "Display name of the project owner." }, "branches_limit": { - "type": "integer" + "type": "integer", + "description": "Maximum number of branches the owner is allowed to create across their projects." }, "subscription_type": { "$ref": "#/components/schemas/BillingSubscriptionType" @@ -13619,13 +14316,16 @@ "description": "Identifier of the unsatisfied limit. Possible values are:\n- subscription_type\n- projects_count\n- project_region\n" }, "expected": { - "type": "string" + "type": "string", + "description": "Required value for the limit named by `name`. Compare with `actual` to determine the shortfall." }, "actual": { - "type": "string" + "type": "string", + "description": "Current value of the named limit, which does not satisfy the required `expected` value." } } - } + }, + "description": "Plan limits that were not satisfied by the request." } }, "example": { @@ -13659,14 +14359,17 @@ ], "properties": { "id": { + "description": "The Neon project ID. Use as the `project_id` path parameter in other endpoints.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "integration": { - "type": "string" + "type": "string", + "description": "Name of the external integration associated with the project." } } - } + }, + "description": "Projects that have the requested integration, each including the project details and associated integration metadata." } }, "example": { @@ -13705,7 +14408,7 @@ }, "db_max_rows": { "type": "integer", - "description": "Maximum number of rows that can be returned in a single request" + "description": "Hard limit on the number of rows returned in a single Data API response. No limit when unset." }, "db_schemas": { "type": "array", @@ -13721,7 +14424,7 @@ }, "jwt_cache_max_lifetime": { "type": "integer", - "description": "Maximum lifetime for JWT cache in seconds" + "description": "Maximum lifetime of the Data API's JWT cache, in seconds." }, "openapi_mode": { "type": "string", @@ -13734,7 +14437,7 @@ }, "server_timing_enabled": { "type": "boolean", - "description": "Enable server timing headers" + "description": "When enabled, the Data API adds `Server-Timing` headers to each response showing database execution and internal processing time. Default: disabled." } } }, @@ -13747,23 +14450,23 @@ "properties": { "auth_provider": { "type": "string", - "description": "The authentication provider to use for the Neon Data API", + "description": "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).", "enum": [ "neon_auth", "external" ] }, "jwks_url": { - "description": "The URL that lists the JWKS", + "description": "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.", "type": "string", "format": "uri" }, "provider_name": { - "description": "The name of the authentication provider (e.g., Clerk, Stytch, Auth0)", + "description": "Display name for the authentication provider. Accepted values include \"Clerk\", \"Stytch\", and \"Auth0\", but any non-empty string is valid. Optional field.", "type": "string" }, "jwt_audience": { - "description": "WARNING - using this setting will only reject tokens with a\ndifferent audience claim. Tokens without audience claim will still\nbe accepted.\n", + "description": "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.\n", "type": "string" }, "add_default_grants": { @@ -13778,7 +14481,7 @@ }, "settings": { "$ref": "#/components/schemas/DataAPISettings", - "description": "Configuration settings for the Data API" + "description": "Auth and schema configuration for the Data API." } } }, @@ -13794,7 +14497,8 @@ "properties": { "url": { "type": "string", - "format": "uri" + "format": "uri", + "description": "URL of the created Data API endpoint." } } }, @@ -13847,11 +14551,12 @@ "properties": { "settings": { "$ref": "#/components/schemas/DataAPISettings", - "description": "Configuration settings for the Data API" + "description": "Configuration settings for the Neon Data API." } } }, "NeonAuthSupportedAuthProvider": { + "description": "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.", "type": "string", "enum": [ "mock", @@ -13881,7 +14586,8 @@ ], "properties": { "domain": { - "type": "string" + "type": "string", + "description": "Allowed redirect URI domain for the auth provider." }, "auth_provider": { "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" @@ -13898,7 +14604,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/NeonAuthRedirectURIWhitelistDomain" - } + }, + "description": "Domains permitted as redirect URI targets in the whitelist." } } }, @@ -13911,7 +14618,8 @@ "properties": { "domain": { "type": "string", - "format": "uri" + "format": "uri", + "description": "URI to add to the redirect URI allowlist for the auth provider." }, "auth_provider": { "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" @@ -13932,7 +14640,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/NeonAuthDeleteDomainFromRedirectURIWhitelistItem" - } + }, + "description": "Domain names to remove from the redirect URI whitelist for the specified auth provider." } } }, @@ -13944,7 +14653,8 @@ "properties": { "domain": { "type": "string", - "format": "uri" + "format": "uri", + "description": "URI to remove from the redirect URI whitelist." } } }, @@ -13963,19 +14673,25 @@ "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" }, "project_id": { + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", + "example": "wispy-forest-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "branch_id": { + "description": "The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.", + "example": "br-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "database_name": { - "type": "string" + "type": "string", + "description": "Name of the database to associate with the Neon Auth integration. When omitted, the integration uses the project's default database." }, "role_name": { "type": "string", - "deprecated": true + "deprecated": true, + "description": "Deprecated. The database role for the auth integration. Omit this field; it is ignored." } } }, @@ -13992,7 +14708,8 @@ "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" }, "database_name": { - "type": "string" + "type": "string", + "description": "Name of the database to enable Neon Auth on. When omitted, the integration uses the project's default database." } } }, @@ -14016,25 +14733,32 @@ "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" }, "auth_provider_project_id": { - "type": "string" + "type": "string", + "description": "Project ID assigned by the auth provider for this integration." }, "pub_client_key": { - "type": "string" + "type": "string", + "description": "Publishable SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth." }, "secret_server_key": { - "type": "string" + "type": "string", + "description": "Secret server-side SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. Treat as a credential." }, "jwks_url": { - "type": "string" + "type": "string", + "description": "URL of the provider's JWKS endpoint used to verify JWTs." }, "schema_name": { - "type": "string" + "type": "string", + "description": "Postgres schema containing the auth integration tables. Defaults to `neon_auth`." }, "table_name": { - "type": "string" + "type": "string", + "description": "Postgres table in the integration schema where synced user records are stored." }, "base_url": { - "type": "string" + "type": "string", + "description": "Base URL of the Neon Auth service for this integration. Set as the NEON_AUTH_BASE_URL environment variable in your application." } } }, @@ -14046,6 +14770,8 @@ ], "properties": { "project_id": { + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", + "example": "wispy-forest-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -14067,6 +14793,7 @@ ], "properties": { "project_id": { + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -14074,6 +14801,7 @@ "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" }, "email": { + "description": "Email address of the new user.", "type": "string", "format": "email", "minLength": 1, @@ -14082,7 +14810,8 @@ "name": { "type": "string", "minLength": 1, - "maxLength": 255 + "maxLength": 255, + "description": "Display name for the new user. When omitted, the created user has no display name." } } }, @@ -14097,6 +14826,7 @@ ], "properties": { "email": { + "description": "Email address of the new Neon Auth user to create.", "type": "string", "format": "email", "minLength": 1, @@ -14105,7 +14835,8 @@ "name": { "type": "string", "minLength": 1, - "maxLength": 255 + "maxLength": 255, + "description": "Display name for the new user. Optional. Pair with the required email field when creating a new user." } } }, @@ -14129,7 +14860,7 @@ "properties": { "roles": { "type": "array", - "description": "Array of roles to assign to the user", + "description": "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.", "items": { "type": "string" }, @@ -14188,7 +14919,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the organization plugin is enabled", + "description": "Whether the organization plugin is enabled.", "default": true }, "organization_limit": { @@ -14196,18 +14927,18 @@ "format": "int32", "minimum": 1, "default": 10, - "description": "Maximum number of organizations a user can create" + "description": "Maximum organizations a user can belong to (created or joined). At the limit, the user cannot create or join more." }, "membership_limit": { "type": "integer", "format": "int32", "minimum": 1, "default": 100, - "description": "Maximum number of members per organization" + "description": "Maximum number of members per organization." }, "creator_role": { "type": "string", - "description": "The role assigned to the user who creates an organization", + "description": "Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only.", "default": "owner", "enum": [ "admin", @@ -14216,7 +14947,7 @@ }, "send_invitation_email": { "type": "boolean", - "description": "Whether to send invitation emails when inviting members to an organization", + "description": "Whether to send invitation emails when inviting members to an organization.", "default": false } } @@ -14226,23 +14957,23 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the organization plugin is enabled" + "description": "Controls whether the organization plugin is active for the organization." }, "organization_limit": { "type": "integer", "format": "int32", "minimum": 1, - "description": "Maximum number of organizations a user can create" + "description": "Maximum organizations a user can belong to (created or joined). At the limit, the user cannot create or join more." }, "membership_limit": { "type": "integer", "format": "int32", "minimum": 1, - "description": "Maximum number of members per organization" + "description": "Maximum members per organization." }, "creator_role": { "type": "string", - "description": "The role assigned to the user who creates an organization", + "description": "Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only.", "enum": [ "admin", "owner" @@ -14250,7 +14981,7 @@ }, "send_invitation_email": { "type": "boolean", - "description": "Whether to send invitation emails when inviting members to an organization" + "description": "When true, invited users receive an email containing an accept link. Requires that the invited user has a verified email address." } } }, @@ -14264,7 +14995,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the magic link plugin is enabled", + "description": "Whether the magic link plugin is enabled.", "default": false }, "expires_in": { @@ -14273,12 +15004,12 @@ "minimum": 5, "maximum": 1440, "default": 5, - "description": "Time in minutes before the magic link expires" + "description": "Minutes until the magic link expires." }, "disable_sign_up": { "type": "boolean", "default": false, - "description": "Whether to disable sign-up via magic link" + "description": "Whether to disable sign-up via magic link." } } }, @@ -14287,18 +15018,18 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the magic link plugin is enabled" + "description": "Whether to enable the magic link plugin." }, "expires_in": { "type": "integer", "format": "int32", "minimum": 5, "maximum": 1440, - "description": "Time in minutes before the magic link expires" + "description": "Minutes until the magic link expires." }, "disable_sign_up": { "type": "boolean", - "description": "Whether to disable sign-up via magic link" + "description": "When true, sign-up via magic link is disabled." } } }, @@ -14310,7 +15041,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the phone number plugin is enabled", + "description": "Whether the phone number plugin is enabled.", "default": false }, "otp_expires_in": { @@ -14327,7 +15058,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether the phone number plugin is enabled" + "description": "Whether the phone number plugin is enabled." }, "otp_expires_in": { "type": "integer", @@ -14345,6 +15076,7 @@ ], "properties": { "project_id": { + "description": "The Neon project ID. Returned as `id` from `GET /projects`.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, @@ -14375,7 +15107,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/NeonAuthIntegration" - } + }, + "description": "Neon Auth integrations configured for the project." } } }, @@ -14389,7 +15122,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/NeonAuthOauthProvider" - } + }, + "description": "OAuth providers configured for Neon Auth on the project." } } }, @@ -14398,28 +15132,35 @@ "description": "Aggregated plugin configurations for Neon Auth", "properties": { "organization": { - "$ref": "#/components/schemas/NeonAuthOrganizationConfig" + "$ref": "#/components/schemas/NeonAuthOrganizationConfig", + "description": "Configuration for the Neon Auth organization plugin, which enables user organizations within the authentication system. This is distinct from a Neon platform organization." }, "magic_link": { - "$ref": "#/components/schemas/NeonAuthMagicLinkConfig" + "$ref": "#/components/schemas/NeonAuthMagicLinkConfig", + "description": "Configuration for passwordless magic-link email authentication." }, "phone_number": { - "$ref": "#/components/schemas/NeonAuthPhoneNumberConfig" + "$ref": "#/components/schemas/NeonAuthPhoneNumberConfig", + "description": "Configuration for the phone number authentication plugin." }, "email_provider": { - "$ref": "#/components/schemas/NeonAuthEmailServerConfig" + "$ref": "#/components/schemas/NeonAuthEmailServerConfig", + "description": "Email server configuration used to send authentication emails." }, "email_and_password": { - "$ref": "#/components/schemas/NeonAuthEmailAndPasswordConfig" + "$ref": "#/components/schemas/NeonAuthEmailAndPasswordConfig", + "description": "Configuration for email and password authentication." }, "oauth_providers": { "type": "array", "items": { "$ref": "#/components/schemas/NeonAuthOauthProvider" - } + }, + "description": "OAuth provider configurations enabled for this auth setup." }, "allow_localhost": { - "type": "boolean" + "type": "boolean", + "description": "Permits authentication requests from localhost origins when true. Intended for local development; disable in production environments." } } }, @@ -14430,10 +15171,12 @@ ], "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether the webhook is active." }, "webhook_url": { - "type": "string" + "type": "string", + "description": "Destination URL that receives webhook event payloads." }, "enabled_events": { "type": "array", @@ -14448,13 +15191,15 @@ "organization.invitation.accepted", "phone_number.verified" ] - } + }, + "description": "Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values." }, "timeout_seconds": { "type": "integer", "default": 5, "minimum": 1, - "maximum": 10 + "maximum": 10, + "description": "Maximum time, in seconds, to wait for a response from the webhook endpoint." } } }, @@ -14464,18 +15209,25 @@ "id", "type" ], + "x-sensitive": [ + "client_secret" + ], "properties": { "id": { - "$ref": "#/components/schemas/NeonAuthOauthProviderId" + "$ref": "#/components/schemas/NeonAuthOauthProviderId", + "description": "The OAuth provider's ID." }, "type": { - "$ref": "#/components/schemas/NeonAuthOauthProviderType" + "$ref": "#/components/schemas/NeonAuthOauthProviderType", + "description": "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." }, "client_id": { - "type": "string" + "type": "string", + "description": "Public identifier for the OAuth application, issued by the provider when the application is registered." }, "client_secret": { - "type": "string" + "type": "string", + "description": "OAuth client secret for the provider." } } }, @@ -14500,32 +15252,45 @@ "required": [ "id" ], + "x-sensitive": [ + "client_secret" + ], "properties": { "id": { - "$ref": "#/components/schemas/NeonAuthOauthProviderId" + "$ref": "#/components/schemas/NeonAuthOauthProviderId", + "description": "OAuth provider to configure for Neon Auth. Known values: `google`, `github`, `microsoft`, `vercel`.\n" }, "client_id": { - "type": "string" + "type": "string", + "description": "The client ID issued by the OAuth provider for your application. Used to identify the application during the OAuth flow." }, "client_secret": { - "type": "string" + "type": "string", + "description": "OAuth client secret for the provider." }, "microsoft_tenant_id": { - "type": "string" + "type": "string", + "description": "Tenant ID for the Microsoft OAuth provider. Only relevant when the OAuth provider is Microsoft; omit or leave blank for other providers." } } }, "NeonAuthUpdateOAuthProviderRequest": { "type": "object", + "x-sensitive": [ + "client_secret" + ], "properties": { "client_id": { - "type": "string" + "type": "string", + "description": "The OAuth client ID registered with the provider. Omit to keep the currently configured value." }, "client_secret": { - "type": "string" + "type": "string", + "description": "OAuth client secret for the provider. Omit to leave the existing secret unchanged." }, "microsoft_tenant_id": { - "type": "string" + "type": "string", + "description": "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." } } }, @@ -14533,10 +15298,12 @@ "type": "object", "properties": { "sender_email": { - "type": "string" + "type": "string", + "description": "Email address used as the sender for outgoing messages from this shared email server." }, "sender_name": { - "type": "string" + "type": "string", + "description": "Display name shown as the sender in outgoing emails." } } }, @@ -14557,22 +15324,28 @@ ], "properties": { "host": { - "type": "string" + "type": "string", + "description": "Hostname of the email server." }, "port": { - "type": "integer" + "type": "integer", + "description": "TCP port of the SMTP server. Common values: 25 (SMTP), 465 (SMTPS), 587 (submission)." }, "username": { - "type": "string" + "type": "string", + "description": "Username for authenticating with the SMTP server." }, "password": { - "type": "string" + "type": "string", + "description": "Password for authenticating with the SMTP server." }, "sender_email": { - "type": "string" + "type": "string", + "description": "Email address used as the From address on outgoing auth emails." }, "sender_name": { - "type": "string" + "type": "string", + "description": "Display name shown as the sender in outgoing emails." } } }, @@ -14659,7 +15432,7 @@ }, "email_verification_method": { "$ref": "#/components/schemas/NeonAuthEmailVerificationMethod", - "description": "The email verification method to use" + "description": "Controls how email addresses are verified during sign-up or sign-in.\n- `link`: sends a verification link to the user's email address\n- `otp`: sends a one-time password to the user's email address\n" }, "require_email_verification": { "type": "boolean", @@ -14688,15 +15461,15 @@ "properties": { "enabled": { "type": "boolean", - "description": "Whether email and password authentication is enabled" + "description": "Controls whether email and password authentication is enabled for this project. When omitted from an update request, the current value is unchanged." }, "email_verification_method": { "$ref": "#/components/schemas/NeonAuthEmailVerificationMethod", - "description": "The email verification method to use" + "description": "Email verification method. `link`: sends a verification link. `otp`: sends a one-time password.\n" }, "require_email_verification": { "type": "boolean", - "description": "Whether email verification is required before users can sign in" + "description": "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." }, "auto_sign_in_after_verification": { "type": "boolean", @@ -14704,15 +15477,15 @@ }, "send_verification_email_on_sign_up": { "type": "boolean", - "description": "Whether to send a verification email when users sign up" + "description": "Whether to send a verification email when users sign up." }, "send_verification_email_on_sign_in": { "type": "boolean", - "description": "Whether to send a verification email when users sign in" + "description": "Whether to send a verification email when a user with an unverified email signs in." }, "disable_sign_up": { "type": "boolean", - "description": "Whether to disable new user sign ups" + "description": "Whether to disable new user sign ups. When omitted, the current setting is not changed." } } }, @@ -14735,34 +15508,44 @@ "$ref": "#/components/schemas/NeonAuthSupportedAuthProvider" }, "auth_provider_project_id": { - "type": "string" + "type": "string", + "description": "Project identifier assigned by the auth provider for this integration." }, "branch_id": { + "description": "The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.", + "example": "br-cool-darkness-12345678", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "db_name": { - "type": "string" + "type": "string", + "description": "Name of the database used by the Neon Auth integration." }, "created_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp when the Neon Auth integration was created, in RFC 3339 format (UTC).", + "example": "2025-01-15T10:30:00Z" }, "owned_by": { - "$ref": "#/components/schemas/NeonAuthProviderProjectOwnedBy" + "$ref": "#/components/schemas/NeonAuthProviderProjectOwnedBy", + "description": "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." }, "transfer_status": { - "$ref": "#/components/schemas/NeonAuthProviderProjectTransferStatus" + "$ref": "#/components/schemas/NeonAuthProviderProjectTransferStatus", + "description": "Ownership transfer state for the auth provider project. `initiated` means a transfer was requested but not completed. `finished` means it completed successfully." }, "jwks_url": { - "type": "string" + "type": "string", + "description": "URL of the provider's JWKS endpoint used to verify JWTs." }, "base_url": { - "type": "string" + "type": "string", + "description": "Base URL of the Neon Auth service endpoint for this integration. Injected into the project environment as `NEON_AUTH_BASE_URL`." }, "name": { "type": "string", - "description": "The application name used in auth emails and communications. Defaults to the Neon project name.", + "description": "Application name shown in auth emails and communications. Defaults to the project name.", "minLength": 1, "maxLength": 256 } @@ -14806,7 +15589,8 @@ "description": "Unique identifier for the request, useful for debugging.\nYou can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.\n" }, "code": { - "$ref": "#/components/schemas/ErrorCode" + "$ref": "#/components/schemas/ErrorCode", + "description": "Machine-readable code classifying the error type. See `message` for a human-readable explanation." }, "message": { "description": "Error message", @@ -14889,24 +15673,29 @@ ], "properties": { "object": { - "$ref": "#/components/schemas/AnnotationObjectData" + "$ref": "#/components/schemas/AnnotationObjectData", + "description": "Resource that this annotation is attached to." }, "value": { "$ref": "#/components/schemas/AnnotationValueData" }, "created_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp when the annotation was created, in RFC 3339 format (UTC).", + "example": "2025-01-15T10:30:00Z" }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "Timestamp of the most recent update to the annotation, in RFC 3339 format (UTC).", + "example": "2025-01-15T10:30:00Z" } } }, "AnnotationValueData": { "type": "object", - "description": "Annotation properties.", + "description": "A free-form map of string key-value pairs for attaching metadata to a resource (for example, a git commit reference). Maximum 50 entries.", "x-tags": [ "Branch" ], @@ -14929,10 +15718,12 @@ ], "properties": { "type": { - "type": "string" + "type": "string", + "description": "Kind of resource the annotation is attached to, for example \"branch\" or \"endpoint\"." }, "id": { - "type": "string" + "type": "string", + "description": "The annotated object's ID." } } }, @@ -14957,7 +15748,8 @@ ], "properties": { "annotation": { - "$ref": "#/components/schemas/AnnotationData" + "$ref": "#/components/schemas/AnnotationData", + "description": "Annotation data associated with the annotated object." } } }, @@ -14974,7 +15766,8 @@ "type": "object", "additionalProperties": { "$ref": "#/components/schemas/AnnotationData" - } + }, + "description": "Map of annotations keyed by resource identifier, where each value contains the annotation data for that resource." } } }, @@ -15006,7 +15799,8 @@ "type": "string", "$ref": "#/components/schemas/ApplicationType" } - } + }, + "description": "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`)." } }, "example": { @@ -15037,7 +15831,8 @@ "items": { "$ref": "#/components/schemas/ApplicationType" } - } + }, + "description": "Map of project IDs to their associated integration details." } }, "example": { @@ -15064,13 +15859,16 @@ "description": "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.", "properties": { "next": { - "type": "string" + "type": "string", + "description": "Cursor for the next page of results. Pass it as the `cursor` query parameter on the next request. Absent on the last page." }, "sort_by": { - "type": "string" + "type": "string", + "description": "Field by which the results were sorted, echoing the request's sort_by parameter." }, "sort_order": { - "type": "string" + "type": "string", + "description": "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`." } } }, @@ -15083,30 +15881,39 @@ ], "properties": { "id": { + "description": "The snapshot ID.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "name": { - "type": "string" + "type": "string", + "description": "Human-readable label for the snapshot." }, "lsn": { - "type": "string" + "type": "string", + "description": "WAL position (Log Sequence Number) at which the snapshot was captured, in Postgres LSN format (for example, `0/3000000`)." }, "timestamp": { - "type": "string" + "type": "string", + "description": "Point in time captured by the snapshot, in RFC 3339 format (UTC)." }, "source_branch_id": { + "description": "Branch from which this snapshot was created.", "type": "string", "pattern": "^[a-z0-9-]{1,60}$" }, "created_at": { - "type": "string" + "type": "string", + "description": "Timestamp when the snapshot was created, in RFC 3339 format (UTC).", + "example": "2025-01-15T10:30:00Z" }, "expires_at": { - "type": "string" + "type": "string", + "description": "RFC 3339 timestamp when the snapshot expires and is eligible for deletion. Null if the snapshot does not have an expiry." }, "manual": { - "type": "boolean" + "type": "boolean", + "description": "True if the snapshot was created manually rather than by a schedule." }, "full_size": { "description": "Full logical size of the snapshot in bytes at the time it was taken.\n\nWhen absent, the logical size has not been calculated yet and the snapshot is not being charged.\n\nWhen present, a value of 0 means the snapshot is not being charged.\n", @@ -15114,7 +15921,7 @@ "format": "int64" }, "diff_size": { - "description": "Incremental storage size in bytes since the previous scheduled snapshot, when the snapshot is billed on incremental (diff) usage.\n\nWhen 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).\n", + "description": "Incremental Postgres storage size in bytes since the previous scheduled snapshot, when the snapshot is billed on incremental (diff) usage.\n\nWhen 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).\n", "type": "integer", "format": "int64" } @@ -15128,9 +15935,11 @@ "properties": { "snapshot": { "type": "object", + "description": "Fields to update on the snapshot. Updatable fields include `name` and `expires_at`.", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Human-readable label for the snapshot." }, "expires_at": { "description": "The date and time when the snapshot will expire.\n\nOmit to leave the current expiration unchanged. Send `null` to\nclear the expiration so the snapshot never expires. A future\ntimestamp sets the absolute expiration.\n", @@ -15151,7 +15960,8 @@ "properties": { "frequency": { "type": "string", - "description": "How often to take snapshots. Must be one of the following values:\n - `daily`\n - `weekly`\n - `monthly`\n" + "description": "How often to take snapshots. Known values: `daily`, `weekly`, `monthly`.\n", + "example": "daily" }, "hour": { "type": "integer", @@ -15174,7 +15984,9 @@ "retention_seconds": { "type": "integer", "minimum": 3600, - "description": "How long to keep a snapshot (in seconds) before it's automatically deleted.\nIf not set, the snapshot is kept indefinitely.\n" + "maximum": 3024000, + "default": 3024000, + "description": "How long to keep a scheduled snapshot (in seconds) before it's automatically deleted.\nThe default is 3024000 seconds (35 days), which is also the maximum.\nManually created snapshots have no maximum retention: set their `expires_at` instead.\n" } } }, @@ -15188,7 +16000,8 @@ "type": "array", "items": { "$ref": "#/components/schemas/BackupScheduleItem" - } + }, + "description": "List of schedule entries defining the backup frequency. At least one entry is required." } } }, @@ -15209,10 +16022,12 @@ ], "properties": { "schema": { - "type": "string" + "type": "string", + "description": "Postgres schema (namespace) that contains the table, for example `public`." }, "name": { - "type": "string" + "type": "string", + "description": "Name of the table within the schema." }, "columns": { "type": "array", @@ -15224,10 +16039,12 @@ ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "Name of the column." }, "type": { - "type": "string" + "type": "string", + "description": "Postgres data type of the column, for example \"integer\" or \"text\"." }, "nullable": { "type": "boolean", @@ -15238,7 +16055,8 @@ "description": "Whether the column is a generated (computed) column" } } - } + }, + "description": "Columns belonging to this table, each describing a column's name and attributes." }, "constraints": { "type": "array", @@ -15292,10 +16110,12 @@ "description": "For foreign keys - the referenced table information" } } - } + }, + "description": "Table constraints defined in the branch schema, such as primary key, foreign key, unique, and check constraints." } } - } + }, + "description": "Tables present in the branch schema." } } }, @@ -15388,7 +16208,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Always `true` in 200 responses. Present for forward compatibility: a\nfuture version may add intermediate states; callers should treat `true`\nas \"storage is usable for this branch right now.\"\n" + "description": "Always `true` in 200 responses. Present for forward compatibility: a\nfuture version may add intermediate states; callers should treat `true`\nas \"object storage is usable for this branch right now.\"\n" }, "s3_endpoint": { "type": "string", @@ -15398,7 +16218,7 @@ }, "region": { "type": "string", - "description": "The AWS region for this branch's storage. The platform normalizes\nthe us-east-1 convention server-side: a non-empty region string is\nalways returned in 200 responses (e.g. `\"us-east-1\"` for the S3\ndefault region).\n", + "description": "The AWS region for this branch's object storage. The platform normalizes\nthe us-east-1 convention server-side: a non-empty region string is\nalways returned in 200 responses (e.g. `\"us-east-1\"` for the S3\ndefault region).\n", "example": "us-east-2" }, "force_path_style": { @@ -15431,7 +16251,292 @@ "branch_directory_missing", "branch_not_found" ], - "description": "Machine-readable reason why storage is unavailable:\n- `org_not_entitled`: the org's `PlatformBranchableStorage` feature flag is off.\n- `region_unavailable`: the project's region has no storage admin service wired.\n- `branch_directory_missing`: the branch is not registered in the storage service.\n- `branch_not_found`: the project or branch does not exist, or the caller does not\n have access to it.\n" + "description": "Machine-readable reason why object storage is unavailable:\n- `org_not_entitled`: the org's `PlatformBranchableStorage` feature flag is off.\n- `region_unavailable`: the project's region has no object storage admin service wired.\n- `branch_directory_missing`: the branch is not registered in the object storage service.\n- `branch_not_found`: the project or branch does not exist, or the caller does not\n have access to it.\n" + } + } + }, + "ProjectBranchLogSource": { + "type": "string", + "description": "The Neon service that emitted the log record.", + "enum": [ + "function", + "storage", + "pg_endpoint" + ] + }, + "ProjectBranchLogSeverity": { + "type": "string", + "description": "An OpenTelemetry severity level. A minimum severity includes every\nhigher level in this order: `trace`, `debug`, `info`, `warn`, `error`,\n`fatal`.\n", + "enum": [ + "trace", + "debug", + "info", + "warn", + "error", + "fatal" + ] + }, + "ProjectBranchLogDuration": { + "type": "string", + "pattern": "^[0-9]{1,6}(ms|s|m|h|d)$", + "description": "A length of time as a count and a unit, for example `30m`, `6h`, or\n`7d`. Valid units are `ms`, `s`, `m`, `h`, and `d`.\n", + "example": "1h" + }, + "ProjectBranchLogsNotAvailable": { + "type": "object", + "required": [ + "code", + "message", + "reason" + ], + "properties": { + "code": { + "type": "string", + "example": "LOGS_NOT_AVAILABLE" + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string", + "enum": [ + "branch_not_found", + "telemetry_not_enabled" + ], + "description": "Machine-readable reason why logs cannot be read:\n- `branch_not_found`: the project or branch does not exist, or the caller does not\n have access to it.\n- `telemetry_not_enabled`: the branch exists but is not collecting telemetry, so it\n has no logs to serve.\n" + } + } + }, + "ProjectBranchLogsInvalidQuery": { + "type": "object", + "required": [ + "code", + "message", + "reason" + ], + "properties": { + "code": { + "type": "string", + "example": "LOGS_INVALID_QUERY" + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string", + "enum": [ + "time_range_too_large", + "invalid_time_range", + "conflicting_time_range", + "invalid_cursor", + "unknown_field", + "invalid_logql", + "conflicting_filters" + ], + "description": "Machine-readable reason why the request was rejected:\n- `time_range_too_large`: the requested window spans more than seven days.\n- `invalid_time_range`: `end_time` is not after `start_time`.\n- `conflicting_time_range`: both `since` and `start_time` were supplied.\n- `invalid_cursor`: the supplied `cursor` is malformed, expired, or was issued for a\n different query.\n- `unknown_field`: the requested `field_name` is not one of the fields the log fields\n endpoint reports for this branch.\n- `invalid_logql`: the supplied `logql` expression does not parse, or uses a\n construct this endpoint does not accept.\n- `conflicting_filters`: `logql` was supplied alongside one or more structured\n filters. Use one or the other.\n" + } + } + }, + "ProjectBranchLogsQueryRequest": { + "type": "object", + "x-sensitive": [ + "body_contains", + "logql", + "cursor" + ], + "properties": { + "since": { + "allOf": [ + { + "$ref": "#/components/schemas/ProjectBranchLogDuration" + } + ], + "description": "Length of the query window, ending at `end_time` or at the current\ntime when `end_time` is omitted. Mutually exclusive with\n`start_time`. Prefer this over computing absolute bounds when the\ncaller only means \"the last hour\".\n" + }, + "start_time": { + "type": "string", + "format": "date-time", + "description": "Inclusive beginning of the query window. Mutually exclusive with\n`since`. Defaults to one hour before `end_time`, or one hour before\nthe current time when both bounds are omitted.\n" + }, + "end_time": { + "type": "string", + "format": "date-time", + "description": "Exclusive end of the query window. Defaults to the current time." + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100, + "description": "Maximum number of log records to return per page." + }, + "cursor": { + "type": "string", + "description": "Opaque pagination cursor returned as `next_cursor` by a previous\ncall. Resume the query after the last record of the previous page,\nrepeating the time range and every filter unchanged.\n" + }, + "sort_order": { + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "description": "Order matching records by timestamp. `desc`, the default, returns\nthe newest records first.\n" + }, + "source": { + "$ref": "#/components/schemas/ProjectBranchLogSource" + }, + "service_name": { + "type": "string", + "minLength": 1, + "description": "Match the OpenTelemetry `service.name` resource attribute exactly." + }, + "scope_name": { + "type": "string", + "minLength": 1, + "description": "Match the OpenTelemetry instrumentation scope name exactly." + }, + "minimum_severity": { + "$ref": "#/components/schemas/ProjectBranchLogSeverity" + }, + "severity_text": { + "type": "string", + "minLength": 1, + "description": "Match the OpenTelemetry severity text exactly." + }, + "body_contains": { + "type": "string", + "minLength": 1, + "description": "Match records whose rendered `message` contains this case-sensitive\nsubstring.\n\nRecords with a structured body are matched against their JSON\nrendering, so the substring meets JSON syntax rather than prose: a\nbare key name such as `operation` matches every record carrying that\nkey, and `http_status: 200` matches none, because the rendering\ncontains `\"http_status\":200` with no space.\n" + }, + "trace_id": { + "type": "string", + "pattern": "^[0-9a-f]{32}$", + "description": "Match records associated with this OpenTelemetry trace ID. W3C Trace\nContext defines a trace ID as 32 lowercase hex digits, and that is\nwhat is stored, so an uppercase value is rejected rather than\nsilently matching nothing.\n" + }, + "logql": { + "type": "string", + "minLength": 1, + "description": "Escape hatch for selections the structured filters cannot express: a\nraw LogQL expression, evaluated against this branch's log stream.\n\nOnly stream selectors and line filters are accepted \u2014 no\naggregations and no parser stages. Supplying this alongside any\nstructured filter is rejected with `conflicting_filters` rather than\nsilently ignoring one of them. `limit`, `sort_order`, and the time\nwindow still apply.\n\nThis field passes the underlying query language through to the\ncaller, so unlike the rest of this contract it may change as that\nbackend changes. Prefer the structured filters where they suffice.\n", + "example": "{entity_type=\"function\"} |~ \"(?i)timeout\"" + } + } + }, + "ProjectBranchLogRecord": { + "type": "object", + "required": [ + "timestamp", + "message", + "attributes" + ], + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The OpenTelemetry record timestamp in UTC." + }, + "message": { + "type": "string", + "description": "The OpenTelemetry log body rendered as text. A body that is already a\nstring is returned verbatim. Any other OpenTelemetry `AnyValue` body\n\u2014 notably the structured key/value body that `storage` records always\ncarry \u2014 is rendered as compact JSON with its keys sorted\nalphabetically, for example\n`{\"bytes\":1024,\"operation\":\"GET\",\"object_key\":\"a/b.png\"}`.\n" + }, + "source": { + "$ref": "#/components/schemas/ProjectBranchLogSource" + }, + "entity_id": { + "type": "string", + "description": "The Neon identifier of the service instance that emitted the record." + }, + "service_name": { + "type": "string", + "description": "The OpenTelemetry `service.name` resource attribute." + }, + "scope_name": { + "type": "string", + "description": "The OpenTelemetry instrumentation scope name." + }, + "severity_number": { + "type": "integer", + "minimum": 0, + "maximum": 24, + "description": "The numeric OpenTelemetry severity." + }, + "severity_text": { + "type": "string", + "description": "The original OpenTelemetry severity text." + }, + "trace_id": { + "type": "string", + "description": "The OpenTelemetry trace ID, when the record belongs to a trace." + }, + "span_id": { + "type": "string", + "description": "The OpenTelemetry span ID, when the record belongs to a span." + }, + "attributes": { + "type": "object", + "additionalProperties": true, + "description": "Customer-defined OpenTelemetry log and resource attributes." + } + } + }, + "ProjectBranchLogsQueryResponse": { + "type": "object", + "x-sensitive": [ + "logs", + "next_cursor" + ], + "required": [ + "logs", + "is_truncated" + ], + "properties": { + "logs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProjectBranchLogRecord" + } + }, + "next_cursor": { + "type": "string", + "description": "Pagination cursor to pass as `cursor` on the next request. Empty\nwhen the response is not truncated.\n" + }, + "is_truncated": { + "type": "boolean", + "description": "True when more records matched than were returned." + } + } + }, + "ProjectBranchLogFieldsResponse": { + "type": "object", + "required": [ + "fields" + ], + "properties": { + "fields": { + "type": "array", + "description": "Log field names observed on this branch, each usable as `field_name`\non the log field-values endpoint. Computed per branch rather than\nfixed by this specification, so clients should not assume a\nparticular set.\n", + "items": { + "type": "string" + } + } + } + }, + "ProjectBranchLogFieldValuesResponse": { + "type": "object", + "required": [ + "values", + "is_truncated" + ], + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_truncated": { + "type": "boolean", + "description": "True when more distinct values exist than were returned, because\neither the requested `limit` or the server's own scan cap was\nreached. A caller that filters on a partial list is choosing from an\narbitrary subset, so narrow `since` or `source` and ask again when\nthis is `true`.\n" } } }, diff --git a/packages/sdk/src/client/index.ts b/packages/sdk/src/client/index.ts index ea91d0e3..94cf75a6 100644 --- a/packages/sdk/src/client/index.ts +++ b/packages/sdk/src/client/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export { acceptProjectTransferRequest, addBranchNeonAuthOauthProvider, addBranchNeonAuthTrustedDomain, addNeonAuthDomainToRedirectUriWhitelist, addNeonAuthOauthProvider, addProjectJwks, assignOrganizationVpcEndpoint, assignProjectVpcEndpoint, countProjectBranches, createApiKey, createBranchNeonAuthNewUser, createCredential, createNeonAuth, createNeonAuthIntegration, createNeonAuthNewUser, createNeonAuthProviderSdkKeys, createOrganizationInvitations, createOrgApiKey, createProject, createProjectBranch, createProjectBranchAnonymized, createProjectBranchBucket, createProjectBranchDataApi, createProjectBranchDatabase, createProjectBranchFunctionDeployment, createProjectBranchRole, createProjectEndpoint, createProjectTransferRequest, createSnapshot, deleteBranchNeonAuthOauthProvider, deleteBranchNeonAuthTrustedDomain, deleteBranchNeonAuthUser, deleteNeonAuthDomainFromRedirectUriWhitelist, deleteNeonAuthIntegration, deleteNeonAuthOauthProvider, deleteNeonAuthUser, deleteOrganizationSpendingLimit, deleteOrganizationVpcEndpoint, deleteProject, deleteProjectBranch, deleteProjectBranchBucket, deleteProjectBranchBucketObject, deleteProjectBranchBucketObjectsByPrefix, deleteProjectBranchDataApi, deleteProjectBranchDatabase, deleteProjectBranchFunction, deleteProjectBranchRole, deleteProjectEndpoint, deleteProjectJwks, deleteProjectVpcEndpoint, deleteSnapshot, disableNeonAuth, finalizeRestoreBranch, getActiveRegions, getAnonymizedBranchStatus, getAuthDetails, getAvailablePreloadLibraries, getConnectionUri, getConsumptionHistoryPerBranchV2, getConsumptionHistoryPerProject, getConsumptionHistoryPerProjectV2, getCurrentUserInfo, getCurrentUserOrganizations, getMaskingRules, getNeonAuth, getNeonAuthAllowLocalhost, getNeonAuthEmailAndPasswordConfig, getNeonAuthEmailProvider, getNeonAuthEmailServer, getNeonAuthPhoneNumberPlugin, getNeonAuthPluginConfigs, getNeonAuthWebhookConfig, getOrganization, getOrganizationInvitations, getOrganizationMember, getOrganizationMembers, getOrganizationSpendingLimit, getOrganizationVpcEndpointDetails, getProject, getProjectAdvisorSecurityIssues, getProjectBranch, getProjectBranchAiGateway, getProjectBranchBucketObject, getProjectBranchDataApi, getProjectBranchDatabase, getProjectBranchFunction, getProjectBranchRole, getProjectBranchRolePassword, getProjectBranchSchema, getProjectBranchSchemaComparison, getProjectBranchStorage, getProjectEndpoint, getProjectJwks, getProjectOperation, getSnapshotSchedule, grantPermissionToProject, listApiKeys, listBranchNeonAuthOauthProviders, listBranchNeonAuthTrustedDomains, listCredentials, listNeonAuthIntegrations, listNeonAuthOauthProviders, listNeonAuthRedirectUriWhitelistDomains, listOrganizationVpcEndpoints, listOrganizationVpcEndpointsAllRegions, listOrgApiKeys, listProjectBranchBucketObjects, listProjectBranchBuckets, listProjectBranchDatabases, listProjectBranchEndpoints, listProjectBranches, listProjectBranchFunctions, listProjectBranchRoles, listProjectEndpoints, listProjectOperations, listProjectPermissions, listProjects, listProjectVpcEndpoints, listSharedProjects, listSnapshots, type Options, presignProjectBranchBucketObject, recoverProject, recoverProjectBranch, removeOrganizationMember, resetProjectBranchRolePassword, restartProjectEndpoint, restoreProjectBranch, restoreSnapshot, revokeApiKey, revokeCredential, revokeOrgApiKey, revokePermissionFromProject, sendNeonAuthTestEmail, setDefaultProjectBranch, setOrganizationSpendingLimit, setSnapshotSchedule, startAnonymization, startProjectEndpoint, suspendProjectEndpoint, transferNeonAuthProviderProject, transferProjectsFromOrgToOrg, transferProjectsFromUserToOrg, updateBranchNeonAuthOauthProvider, updateMaskingRules, updateNeonAuthAllowLocalhost, updateNeonAuthConfig, updateNeonAuthEmailAndPasswordConfig, updateNeonAuthEmailProvider, updateNeonAuthEmailServer, updateNeonAuthMagicLinkPlugin, updateNeonAuthOauthProvider, updateNeonAuthOrganizationPlugin, updateNeonAuthPhoneNumberPlugin, updateNeonAuthUserRole, updateNeonAuthWebhookConfig, updateOrganizationMember, updateProject, updateProjectBranch, updateProjectBranchDataApi, updateProjectBranchDatabase, updateProjectBranchFunction, updateProjectEndpoint, updateSnapshot } from './sdk.gen.js'; -export type { AcceptProjectTransferRequestData, AcceptProjectTransferRequestError, AcceptProjectTransferRequestErrors, AcceptProjectTransferRequestResponse, AcceptProjectTransferRequestResponses, AcceptProjectTransferRequestSatisfiesPlanError, ActiveRegionsResponse, AddBranchNeonAuthOauthProviderData, AddBranchNeonAuthOauthProviderError, AddBranchNeonAuthOauthProviderErrors, AddBranchNeonAuthOauthProviderResponse, AddBranchNeonAuthOauthProviderResponses, AddBranchNeonAuthTrustedDomainData, AddBranchNeonAuthTrustedDomainError, AddBranchNeonAuthTrustedDomainErrors, AddBranchNeonAuthTrustedDomainResponses, AddNeonAuthDomainToRedirectUriWhitelistData, AddNeonAuthDomainToRedirectUriWhitelistError, AddNeonAuthDomainToRedirectUriWhitelistErrors, AddNeonAuthDomainToRedirectUriWhitelistResponses, AddNeonAuthOauthProviderData, AddNeonAuthOauthProviderError, AddNeonAuthOauthProviderErrors, AddNeonAuthOauthProviderResponse, AddNeonAuthOauthProviderResponses, AddProjectJwksData, AddProjectJwksError, AddProjectJwksErrors, AddProjectJwksRequest, AddProjectJwksResponse, AddProjectJwksResponses, AdvisorCategory, AdvisorIssue, AllowedIps, AnnotationCreateValueRequest, AnnotationData, AnnotationObjectData, AnnotationResponse, AnnotationsMapResponse, AnnotationValueData, AnonymizationRunMetadata, AnonymizedBranchStatusResponse, ApiKeyCreateRequest, ApiKeyCreateResponse, ApiKeyCreatorData, ApiKeyRevokeResponse, ApiKeysListResponseItem, ApplicationType, AssignOrganizationVpcEndpointData, AssignOrganizationVpcEndpointError, AssignOrganizationVpcEndpointErrors, AssignOrganizationVpcEndpointResponses, AssignProjectVpcEndpointData, AssignProjectVpcEndpointError, AssignProjectVpcEndpointErrors, AssignProjectVpcEndpointResponses, AuthDetailsResponse, AvailablePreloadLibraries, AvailablePreloadLibrary, BackupSchedule, BackupScheduleItem, BillingAccount, BillingAccountState, BillingPaymentMethod, BillingSubscriptionType, Branch, BranchAiGateway, BranchAiGatewayNotEnabled, BranchAnonymizedCreateRequest, BranchCreateRequest, BranchCreateRequestEndpointOptions, BranchesCountResponse, BranchesResponse, BranchOperations, BranchRecoverResponse, BranchRecoveryInfo, BranchResponse, BranchRestoreRequest, BranchRestoreStatus, BranchRestrictedAction, BranchSchemaCompareResponse, BranchSchemaJson, BranchSchemaResponse, BranchState, BranchStorage, BranchStorageNotEnabled, BranchUpdateRequest, Bucket, BucketAccessLevel, BucketCreateRequest, BucketObject, BucketObjectsDeletePrefixResponse, BucketObjectsListResponse, BucketResponse, BucketsListResponse, ClientOptions, ComputeUnit, ConnectionDetails, ConnectionParameters, ConnectionUriResponse, ConnectionUrisOptionalResponse, ConnectionUrisResponse, ConsumptionHistoryGranularity, ConsumptionHistoryPerBranchV2, ConsumptionHistoryPerBranchV2Response, ConsumptionHistoryPerPeriod, ConsumptionHistoryPerPeriodV2, ConsumptionHistoryPerProject, ConsumptionHistoryPerProjectResponse, ConsumptionHistoryPerProjectV2, ConsumptionHistoryPerProjectV2Response, ConsumptionHistoryPerTimeframe, ConsumptionHistoryPerTimeframeV2, ConsumptionHistoryQueryMetrics, ConsumptionMetricValue, CountProjectBranchesData, CountProjectBranchesError, CountProjectBranchesErrors, CountProjectBranchesResponse, CountProjectBranchesResponses, CreateApiKeyData, CreateApiKeyError, CreateApiKeyErrors, CreateApiKeyResponse, CreateApiKeyResponses, CreateBranchNeonAuthNewUserData, CreateBranchNeonAuthNewUserError, CreateBranchNeonAuthNewUserErrors, CreateBranchNeonAuthNewUserRequest, CreateBranchNeonAuthNewUserResponse, CreateBranchNeonAuthNewUserResponses, CreateCredentialData, CreateCredentialError, CreateCredentialErrors, CreateCredentialRequest, CreateCredentialResponse, CreateCredentialResponse2, CreateCredentialResponses, CreateNeonAuthData, CreateNeonAuthError, CreateNeonAuthErrors, CreateNeonAuthIntegrationData, CreateNeonAuthIntegrationError, CreateNeonAuthIntegrationErrors, CreateNeonAuthIntegrationResponse, CreateNeonAuthIntegrationResponses, CreateNeonAuthNewUserData, CreateNeonAuthNewUserError, CreateNeonAuthNewUserErrors, CreateNeonAuthNewUserResponse, CreateNeonAuthNewUserResponses, CreateNeonAuthProviderSdkKeysData, CreateNeonAuthProviderSdkKeysError, CreateNeonAuthProviderSdkKeysErrors, CreateNeonAuthProviderSdkKeysResponse, CreateNeonAuthProviderSdkKeysResponses, CreateNeonAuthResponse, CreateNeonAuthResponses, CreateOrganizationInvitationsData, CreateOrganizationInvitationsError, CreateOrganizationInvitationsErrors, CreateOrganizationInvitationsResponse, CreateOrganizationInvitationsResponses, CreateOrgApiKeyData, CreateOrgApiKeyError, CreateOrgApiKeyErrors, CreateOrgApiKeyResponse, CreateOrgApiKeyResponses, CreateProjectBranchAnonymizedData, CreateProjectBranchAnonymizedError, CreateProjectBranchAnonymizedErrors, CreateProjectBranchAnonymizedResponse, CreateProjectBranchAnonymizedResponses, CreateProjectBranchBucketData, CreateProjectBranchBucketError, CreateProjectBranchBucketErrors, CreateProjectBranchBucketResponse, CreateProjectBranchBucketResponses, CreateProjectBranchData, CreateProjectBranchDataApiData, CreateProjectBranchDataApiError, CreateProjectBranchDataApiErrors, CreateProjectBranchDataApiResponse, CreateProjectBranchDataApiResponses, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseError, CreateProjectBranchDatabaseErrors, CreateProjectBranchDatabaseResponse, CreateProjectBranchDatabaseResponses, CreateProjectBranchError, CreateProjectBranchErrors, CreateProjectBranchFunctionDeploymentData, CreateProjectBranchFunctionDeploymentError, CreateProjectBranchFunctionDeploymentErrors, CreateProjectBranchFunctionDeploymentResponse, CreateProjectBranchFunctionDeploymentResponses, CreateProjectBranchResponse, CreateProjectBranchResponses, CreateProjectBranchRoleData, CreateProjectBranchRoleError, CreateProjectBranchRoleErrors, CreateProjectBranchRoleResponse, CreateProjectBranchRoleResponses, CreateProjectData, CreateProjectEndpointData, CreateProjectEndpointError, CreateProjectEndpointErrors, CreateProjectEndpointResponse, CreateProjectEndpointResponses, CreateProjectError, CreateProjectErrors, CreateProjectResponse, CreateProjectResponses, CreateProjectTransferRequestData, CreateProjectTransferRequestError, CreateProjectTransferRequestErrors, CreateProjectTransferRequestResponse, CreateProjectTransferRequestResponses, CreateSnapshotData, CreateSnapshotError, CreateSnapshotErrors, CreateSnapshotResponse, CreateSnapshotResponses, CredentialMeta, CredentialScope, CurrentUserAuthAccount, CurrentUserInfoResponse, CursorPagination, CursorPaginationResponse, CursorParam, DataApiCreateRequest, DataApiCreateResponse, DataApiReponse, DataApiSettings, DataApiUpdateRequest, Database, DatabaseCreateRequest, DatabaseOperations, DatabaseResponse, DatabasesResponse, DatabaseUpdateRequest, DefaultEndpointSettings, DeleteBranchNeonAuthOauthProviderData, DeleteBranchNeonAuthOauthProviderError, DeleteBranchNeonAuthOauthProviderErrors, DeleteBranchNeonAuthOauthProviderResponses, DeleteBranchNeonAuthTrustedDomainData, DeleteBranchNeonAuthTrustedDomainError, DeleteBranchNeonAuthTrustedDomainErrors, DeleteBranchNeonAuthTrustedDomainResponses, DeleteBranchNeonAuthUserData, DeleteBranchNeonAuthUserError, DeleteBranchNeonAuthUserErrors, DeleteBranchNeonAuthUserResponse, DeleteBranchNeonAuthUserResponses, DeleteNeonAuthDomainFromRedirectUriWhitelistData, DeleteNeonAuthDomainFromRedirectUriWhitelistError, DeleteNeonAuthDomainFromRedirectUriWhitelistErrors, DeleteNeonAuthDomainFromRedirectUriWhitelistResponses, DeleteNeonAuthIntegrationData, DeleteNeonAuthIntegrationError, DeleteNeonAuthIntegrationErrors, DeleteNeonAuthIntegrationResponses, DeleteNeonAuthOauthProviderData, DeleteNeonAuthOauthProviderError, DeleteNeonAuthOauthProviderErrors, DeleteNeonAuthOauthProviderResponses, DeleteNeonAuthUserData, DeleteNeonAuthUserError, DeleteNeonAuthUserErrors, DeleteNeonAuthUserResponse, DeleteNeonAuthUserResponses, DeleteOrganizationSpendingLimitData, DeleteOrganizationSpendingLimitError, DeleteOrganizationSpendingLimitErrors, DeleteOrganizationSpendingLimitResponse, DeleteOrganizationSpendingLimitResponses, DeleteOrganizationVpcEndpointData, DeleteOrganizationVpcEndpointError, DeleteOrganizationVpcEndpointErrors, DeleteOrganizationVpcEndpointResponses, DeleteProjectBranchBucketData, DeleteProjectBranchBucketError, DeleteProjectBranchBucketErrors, DeleteProjectBranchBucketObjectData, DeleteProjectBranchBucketObjectError, DeleteProjectBranchBucketObjectErrors, DeleteProjectBranchBucketObjectResponse, DeleteProjectBranchBucketObjectResponses, DeleteProjectBranchBucketObjectsByPrefixData, DeleteProjectBranchBucketObjectsByPrefixError, DeleteProjectBranchBucketObjectsByPrefixErrors, DeleteProjectBranchBucketObjectsByPrefixResponse, DeleteProjectBranchBucketObjectsByPrefixResponses, DeleteProjectBranchBucketResponse, DeleteProjectBranchBucketResponses, DeleteProjectBranchData, DeleteProjectBranchDataApiData, DeleteProjectBranchDataApiError, DeleteProjectBranchDataApiErrors, DeleteProjectBranchDataApiResponse, DeleteProjectBranchDataApiResponses, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseError, DeleteProjectBranchDatabaseErrors, DeleteProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseResponses, DeleteProjectBranchError, DeleteProjectBranchErrors, DeleteProjectBranchFunctionData, DeleteProjectBranchFunctionError, DeleteProjectBranchFunctionErrors, DeleteProjectBranchFunctionResponse, DeleteProjectBranchFunctionResponses, DeleteProjectBranchResponse, DeleteProjectBranchResponses, DeleteProjectBranchRoleData, DeleteProjectBranchRoleError, DeleteProjectBranchRoleErrors, DeleteProjectBranchRoleResponse, DeleteProjectBranchRoleResponses, DeleteProjectData, DeleteProjectEndpointData, DeleteProjectEndpointError, DeleteProjectEndpointErrors, DeleteProjectEndpointResponse, DeleteProjectEndpointResponses, DeleteProjectError, DeleteProjectErrors, DeleteProjectJwksData, DeleteProjectJwksError, DeleteProjectJwksErrors, DeleteProjectJwksResponse, DeleteProjectJwksResponses, DeleteProjectResponse, DeleteProjectResponses, DeleteProjectVpcEndpointData, DeleteProjectVpcEndpointError, DeleteProjectVpcEndpointErrors, DeleteProjectVpcEndpointResponses, DeleteSnapshotData, DeleteSnapshotError, DeleteSnapshotErrors, DeleteSnapshotResponse, DeleteSnapshotResponses, DisableNeonAuthData, DisableNeonAuthError, DisableNeonAuthErrors, DisableNeonAuthResponses, EmptyResponse, EnableNeonAuthIntegrationRequest, Endpoint, EndpointCreateRequest, EndpointOperations, EndpointPoolerMode, EndpointResponse, EndpointSettingsData, EndpointsOptionalResponse, EndpointsResponse, EndpointState, EndpointType, EndpointUpdateRequest, ErrorCode, FinalizeRestoreBranchData, FinalizeRestoreBranchError, FinalizeRestoreBranchErrors, FinalizeRestoreBranchResponse, FinalizeRestoreBranchResponses, FunctionDeployRequest, GeneralError, GetActiveRegionsData, GetActiveRegionsError, GetActiveRegionsErrors, GetActiveRegionsResponse, GetActiveRegionsResponses, GetAnonymizedBranchStatusData, GetAnonymizedBranchStatusError, GetAnonymizedBranchStatusErrors, GetAnonymizedBranchStatusResponse, GetAnonymizedBranchStatusResponses, GetAuthDetailsData, GetAuthDetailsError, GetAuthDetailsErrors, GetAuthDetailsResponse, GetAuthDetailsResponses, GetAvailablePreloadLibrariesData, GetAvailablePreloadLibrariesError, GetAvailablePreloadLibrariesErrors, GetAvailablePreloadLibrariesResponse, GetAvailablePreloadLibrariesResponses, GetConnectionUriData, GetConnectionUriError, GetConnectionUriErrors, GetConnectionUriResponse, GetConnectionUriResponses, GetConsumptionHistoryPerBranchV2Data, GetConsumptionHistoryPerBranchV2Error, GetConsumptionHistoryPerBranchV2Errors, GetConsumptionHistoryPerBranchV2Response, GetConsumptionHistoryPerBranchV2Responses, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectError, GetConsumptionHistoryPerProjectErrors, GetConsumptionHistoryPerProjectResponse, GetConsumptionHistoryPerProjectResponses, GetConsumptionHistoryPerProjectV2Data, GetConsumptionHistoryPerProjectV2Error, GetConsumptionHistoryPerProjectV2Errors, GetConsumptionHistoryPerProjectV2Response, GetConsumptionHistoryPerProjectV2Responses, GetCurrentUserInfoData, GetCurrentUserInfoError, GetCurrentUserInfoErrors, GetCurrentUserInfoResponse, GetCurrentUserInfoResponses, GetCurrentUserOrganizationsData, GetCurrentUserOrganizationsError, GetCurrentUserOrganizationsErrors, GetCurrentUserOrganizationsResponse, GetCurrentUserOrganizationsResponses, GetMaskingRulesData, GetMaskingRulesError, GetMaskingRulesErrors, GetMaskingRulesResponse, GetMaskingRulesResponses, GetNeonAuthAllowLocalhostData, GetNeonAuthAllowLocalhostError, GetNeonAuthAllowLocalhostErrors, GetNeonAuthAllowLocalhostResponse, GetNeonAuthAllowLocalhostResponses, GetNeonAuthData, GetNeonAuthEmailAndPasswordConfigData, GetNeonAuthEmailAndPasswordConfigError, GetNeonAuthEmailAndPasswordConfigErrors, GetNeonAuthEmailAndPasswordConfigResponse, GetNeonAuthEmailAndPasswordConfigResponses, GetNeonAuthEmailProviderData, GetNeonAuthEmailProviderError, GetNeonAuthEmailProviderErrors, GetNeonAuthEmailProviderResponse, GetNeonAuthEmailProviderResponses, GetNeonAuthEmailServerData, GetNeonAuthEmailServerError, GetNeonAuthEmailServerErrors, GetNeonAuthEmailServerResponse, GetNeonAuthEmailServerResponses, GetNeonAuthError, GetNeonAuthErrors, GetNeonAuthPhoneNumberPluginData, GetNeonAuthPhoneNumberPluginError, GetNeonAuthPhoneNumberPluginErrors, GetNeonAuthPhoneNumberPluginResponse, GetNeonAuthPhoneNumberPluginResponses, GetNeonAuthPluginConfigsData, GetNeonAuthPluginConfigsError, GetNeonAuthPluginConfigsErrors, GetNeonAuthPluginConfigsResponse, GetNeonAuthPluginConfigsResponses, GetNeonAuthResponse, GetNeonAuthResponses, GetNeonAuthWebhookConfigData, GetNeonAuthWebhookConfigError, GetNeonAuthWebhookConfigErrors, GetNeonAuthWebhookConfigResponse, GetNeonAuthWebhookConfigResponses, GetOrganizationData, GetOrganizationError, GetOrganizationErrors, GetOrganizationInvitationsData, GetOrganizationInvitationsError, GetOrganizationInvitationsErrors, GetOrganizationInvitationsResponse, GetOrganizationInvitationsResponses, GetOrganizationMemberData, GetOrganizationMemberError, GetOrganizationMemberErrors, GetOrganizationMemberResponse, GetOrganizationMemberResponses, GetOrganizationMembersData, GetOrganizationMembersError, GetOrganizationMembersErrors, GetOrganizationMembersResponse, GetOrganizationMembersResponses, GetOrganizationResponse, GetOrganizationResponses, GetOrganizationSpendingLimitData, GetOrganizationSpendingLimitError, GetOrganizationSpendingLimitErrors, GetOrganizationSpendingLimitResponse, GetOrganizationSpendingLimitResponses, GetOrganizationVpcEndpointDetailsData, GetOrganizationVpcEndpointDetailsError, GetOrganizationVpcEndpointDetailsErrors, GetOrganizationVpcEndpointDetailsResponse, GetOrganizationVpcEndpointDetailsResponses, GetProjectAdvisorSecurityIssuesData, GetProjectAdvisorSecurityIssuesError, GetProjectAdvisorSecurityIssuesErrors, GetProjectAdvisorSecurityIssuesResponse, GetProjectAdvisorSecurityIssuesResponses, GetProjectBranchAiGatewayData, GetProjectBranchAiGatewayError, GetProjectBranchAiGatewayErrors, GetProjectBranchAiGatewayResponse, GetProjectBranchAiGatewayResponses, GetProjectBranchBucketObjectData, GetProjectBranchBucketObjectError, GetProjectBranchBucketObjectErrors, GetProjectBranchBucketObjectResponse, GetProjectBranchBucketObjectResponses, GetProjectBranchData, GetProjectBranchDataApiData, GetProjectBranchDataApiError, GetProjectBranchDataApiErrors, GetProjectBranchDataApiResponse, GetProjectBranchDataApiResponses, GetProjectBranchDatabaseData, GetProjectBranchDatabaseError, GetProjectBranchDatabaseErrors, GetProjectBranchDatabaseResponse, GetProjectBranchDatabaseResponses, GetProjectBranchError, GetProjectBranchErrors, GetProjectBranchFunctionData, GetProjectBranchFunctionError, GetProjectBranchFunctionErrors, GetProjectBranchFunctionResponse, GetProjectBranchFunctionResponses, GetProjectBranchResponse, GetProjectBranchResponses, GetProjectBranchRoleData, GetProjectBranchRoleError, GetProjectBranchRoleErrors, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordError, GetProjectBranchRolePasswordErrors, GetProjectBranchRolePasswordResponse, GetProjectBranchRolePasswordResponses, GetProjectBranchRoleResponse, GetProjectBranchRoleResponses, GetProjectBranchSchemaComparisonData, GetProjectBranchSchemaComparisonError, GetProjectBranchSchemaComparisonErrors, GetProjectBranchSchemaComparisonResponse, GetProjectBranchSchemaComparisonResponses, GetProjectBranchSchemaData, GetProjectBranchSchemaError, GetProjectBranchSchemaErrors, GetProjectBranchSchemaResponse, GetProjectBranchSchemaResponses, GetProjectBranchStorageData, GetProjectBranchStorageError, GetProjectBranchStorageErrors, GetProjectBranchStorageResponse, GetProjectBranchStorageResponses, GetProjectData, GetProjectEndpointData, GetProjectEndpointError, GetProjectEndpointErrors, GetProjectEndpointResponse, GetProjectEndpointResponses, GetProjectError, GetProjectErrors, GetProjectJwksData, GetProjectJwksError, GetProjectJwksErrors, GetProjectJwksResponse, GetProjectJwksResponses, GetProjectOperationData, GetProjectOperationError, GetProjectOperationErrors, GetProjectOperationResponse, GetProjectOperationResponses, GetProjectResponse, GetProjectResponses, GetSnapshotScheduleData, GetSnapshotScheduleError, GetSnapshotScheduleErrors, GetSnapshotScheduleResponse, GetSnapshotScheduleResponses, GrantPermissionToProjectData, GrantPermissionToProjectError, GrantPermissionToProjectErrors, GrantPermissionToProjectRequest, GrantPermissionToProjectResponse, GrantPermissionToProjectResponses, IdentityProviderId, Invitation, Jwks, JwksCreationOperation, JwksResponse, LimitParam, LimitsUnsatisfiedResponse, ListApiKeysData, ListApiKeysError, ListApiKeysErrors, ListApiKeysResponse, ListApiKeysResponses, ListBranchNeonAuthOauthProvidersData, ListBranchNeonAuthOauthProvidersError, ListBranchNeonAuthOauthProvidersErrors, ListBranchNeonAuthOauthProvidersResponse, ListBranchNeonAuthOauthProvidersResponses, ListBranchNeonAuthTrustedDomainsData, ListBranchNeonAuthTrustedDomainsError, ListBranchNeonAuthTrustedDomainsErrors, ListBranchNeonAuthTrustedDomainsResponse, ListBranchNeonAuthTrustedDomainsResponses, ListCredentialsData, ListCredentialsError, ListCredentialsErrors, ListCredentialsResponse, ListCredentialsResponse2, ListCredentialsResponses, ListNeonAuthIntegrationsData, ListNeonAuthIntegrationsError, ListNeonAuthIntegrationsErrors, ListNeonAuthIntegrationsResponse, ListNeonAuthIntegrationsResponse2, ListNeonAuthIntegrationsResponses, ListNeonAuthOauthProvidersData, ListNeonAuthOauthProvidersError, ListNeonAuthOauthProvidersErrors, ListNeonAuthOauthProvidersResponse, ListNeonAuthOauthProvidersResponse2, ListNeonAuthOauthProvidersResponses, ListNeonAuthRedirectUriWhitelistDomainsData, ListNeonAuthRedirectUriWhitelistDomainsError, ListNeonAuthRedirectUriWhitelistDomainsErrors, ListNeonAuthRedirectUriWhitelistDomainsResponse, ListNeonAuthRedirectUriWhitelistDomainsResponses, ListOrganizationVpcEndpointsAllRegionsData, ListOrganizationVpcEndpointsAllRegionsError, ListOrganizationVpcEndpointsAllRegionsErrors, ListOrganizationVpcEndpointsAllRegionsResponse, ListOrganizationVpcEndpointsAllRegionsResponses, ListOrganizationVpcEndpointsData, ListOrganizationVpcEndpointsError, ListOrganizationVpcEndpointsErrors, ListOrganizationVpcEndpointsResponse, ListOrganizationVpcEndpointsResponses, ListOrgApiKeysData, ListOrgApiKeysError, ListOrgApiKeysErrors, ListOrgApiKeysResponse, ListOrgApiKeysResponses, ListProjectBranchBucketObjectsData, ListProjectBranchBucketObjectsError, ListProjectBranchBucketObjectsErrors, ListProjectBranchBucketObjectsResponse, ListProjectBranchBucketObjectsResponses, ListProjectBranchBucketsData, ListProjectBranchBucketsError, ListProjectBranchBucketsErrors, ListProjectBranchBucketsResponse, ListProjectBranchBucketsResponses, ListProjectBranchDatabasesData, ListProjectBranchDatabasesError, ListProjectBranchDatabasesErrors, ListProjectBranchDatabasesResponse, ListProjectBranchDatabasesResponses, ListProjectBranchEndpointsData, ListProjectBranchEndpointsError, ListProjectBranchEndpointsErrors, ListProjectBranchEndpointsResponse, ListProjectBranchEndpointsResponses, ListProjectBranchesData, ListProjectBranchesError, ListProjectBranchesErrors, ListProjectBranchesResponse, ListProjectBranchesResponses, ListProjectBranchFunctionsData, ListProjectBranchFunctionsError, ListProjectBranchFunctionsErrors, ListProjectBranchFunctionsResponse, ListProjectBranchFunctionsResponses, ListProjectBranchRolesData, ListProjectBranchRolesError, ListProjectBranchRolesErrors, ListProjectBranchRolesResponse, ListProjectBranchRolesResponses, ListProjectEndpointsData, ListProjectEndpointsError, ListProjectEndpointsErrors, ListProjectEndpointsResponse, ListProjectEndpointsResponses, ListProjectOperationsData, ListProjectOperationsError, ListProjectOperationsErrors, ListProjectOperationsResponse, ListProjectOperationsResponses, ListProjectPermissionsData, ListProjectPermissionsError, ListProjectPermissionsErrors, ListProjectPermissionsResponse, ListProjectPermissionsResponses, ListProjectsData, ListProjectsError, ListProjectsErrors, ListProjectsResponse, ListProjectsResponses, ListProjectVpcEndpointsData, ListProjectVpcEndpointsError, ListProjectVpcEndpointsErrors, ListProjectVpcEndpointsResponse, ListProjectVpcEndpointsResponses, ListSharedProjectsData, ListSharedProjectsError, ListSharedProjectsErrors, ListSharedProjectsResponse, ListSharedProjectsResponses, ListSnapshotsData, ListSnapshotsError, ListSnapshotsErrors, ListSnapshotsResponse, ListSnapshotsResponses, MaintenanceWindow, MaskingRule, MaskingRulesResponse, MaskingRulesUpdateRequest, Member, MemberRole, MemberUserInfo, MemberWithUser, NeonAuthAddDomainToRedirectUriWhitelistRequest, NeonAuthAddOAuthProviderRequest, NeonAuthAllowLocalhostResponse, NeonAuthConfigResponse, NeonAuthConfigUpdate, NeonAuthCreateAuthProviderSdkKeysRequest, NeonAuthCreateIntegrationRequest, NeonAuthCreateIntegrationResponse, NeonAuthCreateNewUserRequest, NeonAuthCreateNewUserResponse, NeonAuthDeleteDomainFromRedirectUriWhitelistItem, NeonAuthDeleteDomainFromRedirectUriWhitelistRequest, NeonAuthEmailAndPasswordConfig, NeonAuthEmailAndPasswordConfigUpdate, NeonAuthEmailServerConfig, NeonAuthEmailVerificationMethod, NeonAuthIntegration, NeonAuthMagicLinkConfig, NeonAuthMagicLinkConfigUpdate, NeonAuthOauthProvider, NeonAuthOauthProviderId, NeonAuthOauthProviderType, NeonAuthOrganizationConfig, NeonAuthOrganizationConfigUpdate, NeonAuthPhoneNumberConfig, NeonAuthPhoneNumberConfigUpdate, NeonAuthPluginConfigs, NeonAuthProviderProjectOwnedBy, NeonAuthProviderProjectTransferStatus, NeonAuthRedirectUriWhitelistDomain, NeonAuthRedirectUriWhitelistResponse, NeonAuthSupportedAuthProvider, NeonAuthTransferAuthProviderProjectRequest, NeonAuthTransferAuthProviderProjectResponse, NeonAuthUpdateOAuthProviderRequest, NeonAuthWebhookConfig, NeonFunction, NeonFunctionDeployment, NeonFunctionDeploymentResponse, NeonFunctionResponse, NeonFunctionsListResponse, NeonFunctionUpdateRequest, Operation, OperationAction, OperationResponse, OperationsResponse, OperationStatus, Organization, OrganizationInvitationsResponse, OrganizationInviteCreateRequest, OrganizationInvitesCreateRequest, OrganizationMembersResponse, OrganizationMemberUpdateRequest, OrganizationsResponse, OrgApiKeyCreateRequest, OrgApiKeyCreateResponse, OrgApiKeyRevokeResponse, OrgApiKeysListResponseItem, Pagination, PaginationResponse, PaymentSource, PaymentSourceBankCard, PgbouncerSettingsData, PgSettingsData, PgVersion, PlanDetails, PlanVersion, PreloadLibraries, PresignProjectBranchBucketObjectData, PresignProjectBranchBucketObjectError, PresignProjectBranchBucketObjectErrors, PresignProjectBranchBucketObjectResponse, PresignProjectBranchBucketObjectResponses, PresignRequest, PresignResponse, Project, ProjectAuditLogLevel, ProjectCreateRequest, ProjectJwksResponse, ProjectListItem, ProjectOwnerData, ProjectPermission, ProjectPermissionLevel, ProjectPermissions, ProjectQuota, ProjectRecoverResponse, ProjectResponse, ProjectsApplicationsMapResponse, ProjectSettingsData, ProjectsIntegrationsMapResponse, ProjectsResponse, ProjectsWithIntegrationResponse, ProjectTransferRequestResponse, ProjectUpdateRequest, Provisioner, RecoverProjectBranchData, RecoverProjectBranchError, RecoverProjectBranchErrors, RecoverProjectBranchResponse, RecoverProjectBranchResponses, RecoverProjectData, RecoverProjectError, RecoverProjectErrors, RecoverProjectResponse, RecoverProjectResponses, RegionResponse, RemoveOrganizationMemberData, RemoveOrganizationMemberError, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponse, RemoveOrganizationMemberResponses, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordError, ResetProjectBranchRolePasswordErrors, ResetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordResponses, RestartProjectEndpointData, RestartProjectEndpointError, RestartProjectEndpointErrors, RestartProjectEndpointResponse, RestartProjectEndpointResponses, RestoreProjectBranchData, RestoreProjectBranchError, RestoreProjectBranchErrors, RestoreProjectBranchResponse, RestoreProjectBranchResponses, RestoreSnapshotData, RestoreSnapshotError, RestoreSnapshotErrors, RestoreSnapshotResponse, RestoreSnapshotResponses, RevokeApiKeyData, RevokeApiKeyError, RevokeApiKeyErrors, RevokeApiKeyResponse, RevokeApiKeyResponses, RevokeCredentialData, RevokeCredentialError, RevokeCredentialErrors, RevokeCredentialResponse, RevokeCredentialResponses, RevokeOrgApiKeyData, RevokeOrgApiKeyError, RevokeOrgApiKeyErrors, RevokeOrgApiKeyResponse, RevokeOrgApiKeyResponses, RevokePermissionFromProjectData, RevokePermissionFromProjectError, RevokePermissionFromProjectErrors, RevokePermissionFromProjectResponse, RevokePermissionFromProjectResponses, Role, RoleCreateRequest, RoleOperations, RolePasswordResponse, RoleResponse, RolesResponse, SendNeonAuthTestEmailData, SendNeonAuthTestEmailError, SendNeonAuthTestEmailErrors, SendNeonAuthTestEmailRequest, SendNeonAuthTestEmailResponse, SendNeonAuthTestEmailResponse2, SendNeonAuthTestEmailResponses, SetDefaultProjectBranchData, SetDefaultProjectBranchError, SetDefaultProjectBranchErrors, SetDefaultProjectBranchResponse, SetDefaultProjectBranchResponses, SetOrganizationSpendingLimitData, SetOrganizationSpendingLimitError, SetOrganizationSpendingLimitErrors, SetOrganizationSpendingLimitResponse, SetOrganizationSpendingLimitResponses, SetSnapshotScheduleData, SetSnapshotScheduleError, SetSnapshotScheduleErrors, SetSnapshotScheduleResponse, SetSnapshotScheduleResponses, SharedEmailServer, Snapshot, SnapshotUpdateRequest, SortOrderParam, SpendingLimitResponse, SpendingLimitUpdateRequest, StandardEmailServer, StartAnonymizationData, StartAnonymizationError, StartAnonymizationErrors, StartAnonymizationResponse, StartAnonymizationResponses, StartProjectEndpointData, StartProjectEndpointError, StartProjectEndpointErrors, StartProjectEndpointResponse, StartProjectEndpointResponses, SuspendProjectEndpointData, SuspendProjectEndpointError, SuspendProjectEndpointErrors, SuspendProjectEndpointResponse, SuspendProjectEndpointResponses, SuspendTimeoutSeconds, TimeoutParam, TransferNeonAuthProviderProjectData, TransferNeonAuthProviderProjectError, TransferNeonAuthProviderProjectErrors, TransferNeonAuthProviderProjectResponse, TransferNeonAuthProviderProjectResponses, TransferProjectsFromOrgToOrgData, TransferProjectsFromOrgToOrgError, TransferProjectsFromOrgToOrgErrors, TransferProjectsFromOrgToOrgResponse, TransferProjectsFromOrgToOrgResponses, TransferProjectsFromUserToOrgData, TransferProjectsFromUserToOrgError, TransferProjectsFromUserToOrgErrors, TransferProjectsFromUserToOrgResponse, TransferProjectsFromUserToOrgResponses, TransferProjectsToOrganizationRequest, UpdateBranchNeonAuthOauthProviderData, UpdateBranchNeonAuthOauthProviderError, UpdateBranchNeonAuthOauthProviderErrors, UpdateBranchNeonAuthOauthProviderResponse, UpdateBranchNeonAuthOauthProviderResponses, UpdateMaskingRulesData, UpdateMaskingRulesError, UpdateMaskingRulesErrors, UpdateMaskingRulesResponse, UpdateMaskingRulesResponses, UpdateNeonAuthAllowLocalhostData, UpdateNeonAuthAllowLocalhostError, UpdateNeonAuthAllowLocalhostErrors, UpdateNeonAuthAllowLocalhostRequest, UpdateNeonAuthAllowLocalhostResponse, UpdateNeonAuthAllowLocalhostResponses, UpdateNeonAuthConfigData, UpdateNeonAuthConfigError, UpdateNeonAuthConfigErrors, UpdateNeonAuthConfigResponse, UpdateNeonAuthConfigResponses, UpdateNeonAuthEmailAndPasswordConfigData, UpdateNeonAuthEmailAndPasswordConfigError, UpdateNeonAuthEmailAndPasswordConfigErrors, UpdateNeonAuthEmailAndPasswordConfigResponse, UpdateNeonAuthEmailAndPasswordConfigResponses, UpdateNeonAuthEmailProviderData, UpdateNeonAuthEmailProviderError, UpdateNeonAuthEmailProviderErrors, UpdateNeonAuthEmailProviderResponse, UpdateNeonAuthEmailProviderResponses, UpdateNeonAuthEmailServerData, UpdateNeonAuthEmailServerError, UpdateNeonAuthEmailServerErrors, UpdateNeonAuthEmailServerResponse, UpdateNeonAuthEmailServerResponses, UpdateNeonAuthMagicLinkPluginData, UpdateNeonAuthMagicLinkPluginError, UpdateNeonAuthMagicLinkPluginErrors, UpdateNeonAuthMagicLinkPluginResponse, UpdateNeonAuthMagicLinkPluginResponses, UpdateNeonAuthOauthProviderData, UpdateNeonAuthOauthProviderError, UpdateNeonAuthOauthProviderErrors, UpdateNeonAuthOauthProviderResponse, UpdateNeonAuthOauthProviderResponses, UpdateNeonAuthOrganizationPluginData, UpdateNeonAuthOrganizationPluginError, UpdateNeonAuthOrganizationPluginErrors, UpdateNeonAuthOrganizationPluginResponse, UpdateNeonAuthOrganizationPluginResponses, UpdateNeonAuthPhoneNumberPluginData, UpdateNeonAuthPhoneNumberPluginError, UpdateNeonAuthPhoneNumberPluginErrors, UpdateNeonAuthPhoneNumberPluginResponse, UpdateNeonAuthPhoneNumberPluginResponses, UpdateNeonAuthUserRoleData, UpdateNeonAuthUserRoleError, UpdateNeonAuthUserRoleErrors, UpdateNeonAuthUserRoleRequest, UpdateNeonAuthUserRoleResponse, UpdateNeonAuthUserRoleResponse2, UpdateNeonAuthUserRoleResponses, UpdateNeonAuthWebhookConfigData, UpdateNeonAuthWebhookConfigError, UpdateNeonAuthWebhookConfigErrors, UpdateNeonAuthWebhookConfigResponse, UpdateNeonAuthWebhookConfigResponses, UpdateOrganizationMemberData, UpdateOrganizationMemberError, UpdateOrganizationMemberErrors, UpdateOrganizationMemberResponse, UpdateOrganizationMemberResponses, UpdateProjectBranchData, UpdateProjectBranchDataApiData, UpdateProjectBranchDataApiError, UpdateProjectBranchDataApiErrors, UpdateProjectBranchDataApiResponse, UpdateProjectBranchDataApiResponses, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseError, UpdateProjectBranchDatabaseErrors, UpdateProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseResponses, UpdateProjectBranchError, UpdateProjectBranchErrors, UpdateProjectBranchFunctionData, UpdateProjectBranchFunctionError, UpdateProjectBranchFunctionErrors, UpdateProjectBranchFunctionResponse, UpdateProjectBranchFunctionResponses, UpdateProjectBranchResponse, UpdateProjectBranchResponses, UpdateProjectData, UpdateProjectEndpointData, UpdateProjectEndpointError, UpdateProjectEndpointErrors, UpdateProjectEndpointResponse, UpdateProjectEndpointResponses, UpdateProjectError, UpdateProjectErrors, UpdateProjectResponse, UpdateProjectResponses, UpdateSnapshotData, UpdateSnapshotError, UpdateSnapshotErrors, UpdateSnapshotResponse, UpdateSnapshotResponses, VpcEndpoint, VpcEndpointAssignment, VpcEndpointDetails, VpcEndpointsResponse, VpcEndpointsWithRegionResponse, VpcEndpointWithRegion } from './types.gen.js'; +export { acceptProjectTransferRequest, addBranchNeonAuthOauthProvider, addBranchNeonAuthTrustedDomain, addNeonAuthDomainToRedirectUriWhitelist, addNeonAuthOauthProvider, addProjectJwks, assignOrganizationVpcEndpoint, assignProjectVpcEndpoint, countProjectBranches, createApiKey, createBranchNeonAuthNewUser, createCredential, createNeonAuth, createNeonAuthIntegration, createNeonAuthNewUser, createNeonAuthProviderSdkKeys, createOrganizationInvitations, createOrgApiKey, createProject, createProjectBranch, createProjectBranchAnonymized, createProjectBranchBucket, createProjectBranchDataApi, createProjectBranchDatabase, createProjectBranchFunctionDeployment, createProjectBranchRole, createProjectEndpoint, createProjectTransferRequest, createSnapshot, deleteBranchNeonAuthOauthProvider, deleteBranchNeonAuthTrustedDomain, deleteBranchNeonAuthUser, deleteNeonAuthDomainFromRedirectUriWhitelist, deleteNeonAuthIntegration, deleteNeonAuthOauthProvider, deleteNeonAuthUser, deleteOrganizationSpendingLimit, deleteOrganizationVpcEndpoint, deleteProject, deleteProjectBranch, deleteProjectBranchBucket, deleteProjectBranchBucketObject, deleteProjectBranchBucketObjectsByPrefix, deleteProjectBranchDataApi, deleteProjectBranchDatabase, deleteProjectBranchFunction, deleteProjectBranchRole, deleteProjectEndpoint, deleteProjectJwks, deleteProjectVpcEndpoint, deleteSnapshot, disableNeonAuth, finalizeRestoreBranch, getActiveRegions, getAnonymizedBranchStatus, getAuthDetails, getAvailablePreloadLibraries, getConnectionUri, getConsumptionHistoryPerBranchV2, getConsumptionHistoryPerProject, getConsumptionHistoryPerProjectV2, getCurrentUserInfo, getCurrentUserOrganizations, getMaskingRules, getNeonAuth, getNeonAuthAllowLocalhost, getNeonAuthEmailAndPasswordConfig, getNeonAuthEmailProvider, getNeonAuthEmailServer, getNeonAuthPhoneNumberPlugin, getNeonAuthPluginConfigs, getNeonAuthWebhookConfig, getOrganization, getOrganizationInvitations, getOrganizationMember, getOrganizationMembers, getOrganizationSpendingLimit, getOrganizationVpcEndpointDetails, getProject, getProjectAdvisorSecurityIssues, getProjectBranch, getProjectBranchAiGateway, getProjectBranchBucketObject, getProjectBranchDataApi, getProjectBranchDatabase, getProjectBranchFunction, getProjectBranchRole, getProjectBranchRolePassword, getProjectBranchSchema, getProjectBranchSchemaComparison, getProjectBranchStorage, getProjectEndpoint, getProjectJwks, getProjectOperation, getSnapshotSchedule, grantPermissionToProject, listApiKeys, listBranchNeonAuthOauthProviders, listBranchNeonAuthTrustedDomains, listCredentials, listNeonAuthIntegrations, listNeonAuthOauthProviders, listNeonAuthRedirectUriWhitelistDomains, listOrganizationVpcEndpoints, listOrganizationVpcEndpointsAllRegions, listOrgApiKeys, listProjectBranchBucketObjects, listProjectBranchBuckets, listProjectBranchDatabases, listProjectBranchEndpoints, listProjectBranches, listProjectBranchFunctions, listProjectBranchLogFields, listProjectBranchLogFieldValues, listProjectBranchRoles, listProjectEndpoints, listProjectMembers, listProjectOperations, listProjectPermissions, listProjects, listProjectVpcEndpoints, listSharedProjects, listSnapshots, type Options, presignProjectBranchBucketObject, queryProjectBranchLogs, recoverProject, removeOrganizationMember, removeProjectMemberRole, resetProjectBranchRolePassword, restartProjectEndpoint, restoreProjectBranch, restoreSnapshot, revokeApiKey, revokeCredential, revokeOrgApiKey, revokePermissionFromProject, sendNeonAuthTestEmail, setDefaultProjectBranch, setOrganizationSpendingLimit, setProjectMemberRole, setSnapshotSchedule, startAnonymization, startProjectEndpoint, suspendProjectEndpoint, transferNeonAuthProviderProject, transferProjectsFromOrgToOrg, transferProjectsFromUserToOrg, updateBranchNeonAuthOauthProvider, updateMaskingRules, updateNeonAuthAllowLocalhost, updateNeonAuthConfig, updateNeonAuthEmailAndPasswordConfig, updateNeonAuthEmailProvider, updateNeonAuthEmailServer, updateNeonAuthMagicLinkPlugin, updateNeonAuthOauthProvider, updateNeonAuthOrganizationPlugin, updateNeonAuthPhoneNumberPlugin, updateNeonAuthUserRole, updateNeonAuthWebhookConfig, updateOrganizationMember, updateProject, updateProjectBranch, updateProjectBranchDataApi, updateProjectBranchDatabase, updateProjectBranchFunction, updateProjectEndpoint, updateSnapshot } from './sdk.gen.js'; +export type { AcceptProjectTransferRequestData, AcceptProjectTransferRequestError, AcceptProjectTransferRequestErrors, AcceptProjectTransferRequestResponse, AcceptProjectTransferRequestResponses, AcceptProjectTransferRequestSatisfiesPlanError, ActiveRegionsResponse, AddBranchNeonAuthOauthProviderData, AddBranchNeonAuthOauthProviderError, AddBranchNeonAuthOauthProviderErrors, AddBranchNeonAuthOauthProviderResponse, AddBranchNeonAuthOauthProviderResponses, AddBranchNeonAuthTrustedDomainData, AddBranchNeonAuthTrustedDomainError, AddBranchNeonAuthTrustedDomainErrors, AddBranchNeonAuthTrustedDomainResponses, AddNeonAuthDomainToRedirectUriWhitelistData, AddNeonAuthDomainToRedirectUriWhitelistError, AddNeonAuthDomainToRedirectUriWhitelistErrors, AddNeonAuthDomainToRedirectUriWhitelistResponses, AddNeonAuthOauthProviderData, AddNeonAuthOauthProviderError, AddNeonAuthOauthProviderErrors, AddNeonAuthOauthProviderResponse, AddNeonAuthOauthProviderResponses, AddProjectJwksData, AddProjectJwksError, AddProjectJwksErrors, AddProjectJwksRequest, AddProjectJwksResponse, AddProjectJwksResponses, AdvisorCategory, AdvisorIssue, AllowedIps, AnnotationCreateValueRequest, AnnotationData, AnnotationObjectData, AnnotationResponse, AnnotationsMapResponse, AnnotationValueData, AnonymizationRunMetadata, AnonymizedBranchStatusResponse, ApiKeyCreateRequest, ApiKeyCreateResponse, ApiKeyCreatorData, ApiKeyRevokeResponse, ApiKeysListResponseItem, ApplicationType, AssignOrganizationVpcEndpointData, AssignOrganizationVpcEndpointError, AssignOrganizationVpcEndpointErrors, AssignOrganizationVpcEndpointResponses, AssignProjectVpcEndpointData, AssignProjectVpcEndpointError, AssignProjectVpcEndpointErrors, AssignProjectVpcEndpointResponses, AuthDetailsResponse, AvailablePreloadLibraries, AvailablePreloadLibrary, BackupSchedule, BackupScheduleItem, BillingAccount, BillingAccountState, BillingPaymentMethod, BillingSubscriptionType, Branch, BranchAiGateway, BranchAiGatewayNotEnabled, BranchAnonymizedCreateRequest, BranchCreateRequest, BranchCreateRequestEndpointOptions, BranchesCountResponse, BranchesResponse, BranchOperations, BranchRecoverResponse, BranchRecoveryInfo, BranchResponse, BranchRestoreRequest, BranchRestoreStatus, BranchRestrictedAction, BranchSchemaCompareResponse, BranchSchemaJson, BranchSchemaResponse, BranchState, BranchStorage, BranchStorageNotEnabled, BranchUpdateRequest, Bucket, BucketAccessLevel, BucketCreateRequest, BucketObject, BucketObjectsDeletePrefixResponse, BucketObjectsListResponse, BucketResponse, BucketsListResponse, ClientOptions, ComputeUnit, ConnectionDetails, ConnectionParameters, ConnectionUriResponse, ConnectionUrisOptionalResponse, ConnectionUrisResponse, ConsumptionHistoryGranularity, ConsumptionHistoryPerBranchV2, ConsumptionHistoryPerBranchV2Response, ConsumptionHistoryPerPeriod, ConsumptionHistoryPerPeriodV2, ConsumptionHistoryPerProject, ConsumptionHistoryPerProjectResponse, ConsumptionHistoryPerProjectV2, ConsumptionHistoryPerProjectV2Response, ConsumptionHistoryPerTimeframe, ConsumptionHistoryPerTimeframeV2, ConsumptionHistoryQueryMetrics, ConsumptionMetricValue, CountProjectBranchesData, CountProjectBranchesError, CountProjectBranchesErrors, CountProjectBranchesResponse, CountProjectBranchesResponses, CreateApiKeyData, CreateApiKeyError, CreateApiKeyErrors, CreateApiKeyResponse, CreateApiKeyResponses, CreateBranchNeonAuthNewUserData, CreateBranchNeonAuthNewUserError, CreateBranchNeonAuthNewUserErrors, CreateBranchNeonAuthNewUserRequest, CreateBranchNeonAuthNewUserResponse, CreateBranchNeonAuthNewUserResponses, CreateCredentialData, CreateCredentialError, CreateCredentialErrors, CreateCredentialRequest, CreateCredentialResponse, CreateCredentialResponse2, CreateCredentialResponses, CreateNeonAuthData, CreateNeonAuthError, CreateNeonAuthErrors, CreateNeonAuthIntegrationData, CreateNeonAuthIntegrationError, CreateNeonAuthIntegrationErrors, CreateNeonAuthIntegrationResponse, CreateNeonAuthIntegrationResponses, CreateNeonAuthNewUserData, CreateNeonAuthNewUserError, CreateNeonAuthNewUserErrors, CreateNeonAuthNewUserResponse, CreateNeonAuthNewUserResponses, CreateNeonAuthProviderSdkKeysData, CreateNeonAuthProviderSdkKeysError, CreateNeonAuthProviderSdkKeysErrors, CreateNeonAuthProviderSdkKeysResponse, CreateNeonAuthProviderSdkKeysResponses, CreateNeonAuthResponse, CreateNeonAuthResponses, CreateOrganizationInvitationsData, CreateOrganizationInvitationsError, CreateOrganizationInvitationsErrors, CreateOrganizationInvitationsResponse, CreateOrganizationInvitationsResponses, CreateOrgApiKeyData, CreateOrgApiKeyError, CreateOrgApiKeyErrors, CreateOrgApiKeyResponse, CreateOrgApiKeyResponses, CreateProjectBranchAnonymizedData, CreateProjectBranchAnonymizedError, CreateProjectBranchAnonymizedErrors, CreateProjectBranchAnonymizedResponse, CreateProjectBranchAnonymizedResponses, CreateProjectBranchBucketData, CreateProjectBranchBucketError, CreateProjectBranchBucketErrors, CreateProjectBranchBucketResponse, CreateProjectBranchBucketResponses, CreateProjectBranchData, CreateProjectBranchDataApiData, CreateProjectBranchDataApiError, CreateProjectBranchDataApiErrors, CreateProjectBranchDataApiResponse, CreateProjectBranchDataApiResponses, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseError, CreateProjectBranchDatabaseErrors, CreateProjectBranchDatabaseResponse, CreateProjectBranchDatabaseResponses, CreateProjectBranchError, CreateProjectBranchErrors, CreateProjectBranchFunctionDeploymentData, CreateProjectBranchFunctionDeploymentError, CreateProjectBranchFunctionDeploymentErrors, CreateProjectBranchFunctionDeploymentResponse, CreateProjectBranchFunctionDeploymentResponses, CreateProjectBranchResponse, CreateProjectBranchResponses, CreateProjectBranchRoleData, CreateProjectBranchRoleError, CreateProjectBranchRoleErrors, CreateProjectBranchRoleResponse, CreateProjectBranchRoleResponses, CreateProjectData, CreateProjectEndpointData, CreateProjectEndpointError, CreateProjectEndpointErrors, CreateProjectEndpointResponse, CreateProjectEndpointResponses, CreateProjectError, CreateProjectErrors, CreateProjectResponse, CreateProjectResponses, CreateProjectTransferRequestData, CreateProjectTransferRequestError, CreateProjectTransferRequestErrors, CreateProjectTransferRequestResponse, CreateProjectTransferRequestResponses, CreateSnapshotData, CreateSnapshotError, CreateSnapshotErrors, CreateSnapshotResponse, CreateSnapshotResponses, CredentialMeta, CredentialScope, CurrentUserAuthAccount, CurrentUserInfoResponse, CursorPagination, CursorPaginationResponse, CursorParam, DataApiCreateRequest, DataApiCreateResponse, DataApiReponse, DataApiSettings, DataApiUpdateRequest, Database, DatabaseCreateRequest, DatabaseOperations, DatabaseResponse, DatabasesResponse, DatabaseUpdateRequest, DefaultEndpointSettings, DeleteBranchNeonAuthOauthProviderData, DeleteBranchNeonAuthOauthProviderError, DeleteBranchNeonAuthOauthProviderErrors, DeleteBranchNeonAuthOauthProviderResponses, DeleteBranchNeonAuthTrustedDomainData, DeleteBranchNeonAuthTrustedDomainError, DeleteBranchNeonAuthTrustedDomainErrors, DeleteBranchNeonAuthTrustedDomainResponses, DeleteBranchNeonAuthUserData, DeleteBranchNeonAuthUserError, DeleteBranchNeonAuthUserErrors, DeleteBranchNeonAuthUserResponse, DeleteBranchNeonAuthUserResponses, DeleteNeonAuthDomainFromRedirectUriWhitelistData, DeleteNeonAuthDomainFromRedirectUriWhitelistError, DeleteNeonAuthDomainFromRedirectUriWhitelistErrors, DeleteNeonAuthDomainFromRedirectUriWhitelistResponses, DeleteNeonAuthIntegrationData, DeleteNeonAuthIntegrationError, DeleteNeonAuthIntegrationErrors, DeleteNeonAuthIntegrationResponses, DeleteNeonAuthOauthProviderData, DeleteNeonAuthOauthProviderError, DeleteNeonAuthOauthProviderErrors, DeleteNeonAuthOauthProviderResponses, DeleteNeonAuthUserData, DeleteNeonAuthUserError, DeleteNeonAuthUserErrors, DeleteNeonAuthUserResponse, DeleteNeonAuthUserResponses, DeleteOrganizationSpendingLimitData, DeleteOrganizationSpendingLimitError, DeleteOrganizationSpendingLimitErrors, DeleteOrganizationSpendingLimitResponse, DeleteOrganizationSpendingLimitResponses, DeleteOrganizationVpcEndpointData, DeleteOrganizationVpcEndpointError, DeleteOrganizationVpcEndpointErrors, DeleteOrganizationVpcEndpointResponses, DeleteProjectBranchBucketData, DeleteProjectBranchBucketError, DeleteProjectBranchBucketErrors, DeleteProjectBranchBucketObjectData, DeleteProjectBranchBucketObjectError, DeleteProjectBranchBucketObjectErrors, DeleteProjectBranchBucketObjectResponse, DeleteProjectBranchBucketObjectResponses, DeleteProjectBranchBucketObjectsByPrefixData, DeleteProjectBranchBucketObjectsByPrefixError, DeleteProjectBranchBucketObjectsByPrefixErrors, DeleteProjectBranchBucketObjectsByPrefixResponse, DeleteProjectBranchBucketObjectsByPrefixResponses, DeleteProjectBranchBucketResponse, DeleteProjectBranchBucketResponses, DeleteProjectBranchData, DeleteProjectBranchDataApiData, DeleteProjectBranchDataApiError, DeleteProjectBranchDataApiErrors, DeleteProjectBranchDataApiResponse, DeleteProjectBranchDataApiResponses, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseError, DeleteProjectBranchDatabaseErrors, DeleteProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseResponses, DeleteProjectBranchError, DeleteProjectBranchErrors, DeleteProjectBranchFunctionData, DeleteProjectBranchFunctionError, DeleteProjectBranchFunctionErrors, DeleteProjectBranchFunctionResponse, DeleteProjectBranchFunctionResponses, DeleteProjectBranchResponse, DeleteProjectBranchResponses, DeleteProjectBranchRoleData, DeleteProjectBranchRoleError, DeleteProjectBranchRoleErrors, DeleteProjectBranchRoleResponse, DeleteProjectBranchRoleResponses, DeleteProjectData, DeleteProjectEndpointData, DeleteProjectEndpointError, DeleteProjectEndpointErrors, DeleteProjectEndpointResponse, DeleteProjectEndpointResponses, DeleteProjectError, DeleteProjectErrors, DeleteProjectJwksData, DeleteProjectJwksError, DeleteProjectJwksErrors, DeleteProjectJwksResponse, DeleteProjectJwksResponses, DeleteProjectResponse, DeleteProjectResponses, DeleteProjectVpcEndpointData, DeleteProjectVpcEndpointError, DeleteProjectVpcEndpointErrors, DeleteProjectVpcEndpointResponses, DeleteSnapshotData, DeleteSnapshotError, DeleteSnapshotErrors, DeleteSnapshotResponse, DeleteSnapshotResponses, DisableNeonAuthData, DisableNeonAuthError, DisableNeonAuthErrors, DisableNeonAuthResponses, EmptyResponse, EnableNeonAuthIntegrationRequest, Endpoint, EndpointCreateRequest, EndpointOperations, EndpointPoolerMode, EndpointResponse, EndpointSettingsData, EndpointsOptionalResponse, EndpointsResponse, EndpointState, EndpointType, EndpointUpdateRequest, ErrorCode, FinalizeRestoreBranchData, FinalizeRestoreBranchError, FinalizeRestoreBranchErrors, FinalizeRestoreBranchResponse, FinalizeRestoreBranchResponses, FunctionDeployRequest, GeneralError, GetActiveRegionsData, GetActiveRegionsError, GetActiveRegionsErrors, GetActiveRegionsResponse, GetActiveRegionsResponses, GetAnonymizedBranchStatusData, GetAnonymizedBranchStatusError, GetAnonymizedBranchStatusErrors, GetAnonymizedBranchStatusResponse, GetAnonymizedBranchStatusResponses, GetAuthDetailsData, GetAuthDetailsError, GetAuthDetailsErrors, GetAuthDetailsResponse, GetAuthDetailsResponses, GetAvailablePreloadLibrariesData, GetAvailablePreloadLibrariesError, GetAvailablePreloadLibrariesErrors, GetAvailablePreloadLibrariesResponse, GetAvailablePreloadLibrariesResponses, GetConnectionUriData, GetConnectionUriError, GetConnectionUriErrors, GetConnectionUriResponse, GetConnectionUriResponses, GetConsumptionHistoryPerBranchV2Data, GetConsumptionHistoryPerBranchV2Error, GetConsumptionHistoryPerBranchV2Errors, GetConsumptionHistoryPerBranchV2Response, GetConsumptionHistoryPerBranchV2Responses, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectError, GetConsumptionHistoryPerProjectErrors, GetConsumptionHistoryPerProjectResponse, GetConsumptionHistoryPerProjectResponses, GetConsumptionHistoryPerProjectV2Data, GetConsumptionHistoryPerProjectV2Error, GetConsumptionHistoryPerProjectV2Errors, GetConsumptionHistoryPerProjectV2Response, GetConsumptionHistoryPerProjectV2Responses, GetCurrentUserInfoData, GetCurrentUserInfoError, GetCurrentUserInfoErrors, GetCurrentUserInfoResponse, GetCurrentUserInfoResponses, GetCurrentUserOrganizationsData, GetCurrentUserOrganizationsError, GetCurrentUserOrganizationsErrors, GetCurrentUserOrganizationsResponse, GetCurrentUserOrganizationsResponses, GetMaskingRulesData, GetMaskingRulesError, GetMaskingRulesErrors, GetMaskingRulesResponse, GetMaskingRulesResponses, GetNeonAuthAllowLocalhostData, GetNeonAuthAllowLocalhostError, GetNeonAuthAllowLocalhostErrors, GetNeonAuthAllowLocalhostResponse, GetNeonAuthAllowLocalhostResponses, GetNeonAuthData, GetNeonAuthEmailAndPasswordConfigData, GetNeonAuthEmailAndPasswordConfigError, GetNeonAuthEmailAndPasswordConfigErrors, GetNeonAuthEmailAndPasswordConfigResponse, GetNeonAuthEmailAndPasswordConfigResponses, GetNeonAuthEmailProviderData, GetNeonAuthEmailProviderError, GetNeonAuthEmailProviderErrors, GetNeonAuthEmailProviderResponse, GetNeonAuthEmailProviderResponses, GetNeonAuthEmailServerData, GetNeonAuthEmailServerError, GetNeonAuthEmailServerErrors, GetNeonAuthEmailServerResponse, GetNeonAuthEmailServerResponses, GetNeonAuthError, GetNeonAuthErrors, GetNeonAuthPhoneNumberPluginData, GetNeonAuthPhoneNumberPluginError, GetNeonAuthPhoneNumberPluginErrors, GetNeonAuthPhoneNumberPluginResponse, GetNeonAuthPhoneNumberPluginResponses, GetNeonAuthPluginConfigsData, GetNeonAuthPluginConfigsError, GetNeonAuthPluginConfigsErrors, GetNeonAuthPluginConfigsResponse, GetNeonAuthPluginConfigsResponses, GetNeonAuthResponse, GetNeonAuthResponses, GetNeonAuthWebhookConfigData, GetNeonAuthWebhookConfigError, GetNeonAuthWebhookConfigErrors, GetNeonAuthWebhookConfigResponse, GetNeonAuthWebhookConfigResponses, GetOrganizationData, GetOrganizationError, GetOrganizationErrors, GetOrganizationInvitationsData, GetOrganizationInvitationsError, GetOrganizationInvitationsErrors, GetOrganizationInvitationsResponse, GetOrganizationInvitationsResponses, GetOrganizationMemberData, GetOrganizationMemberError, GetOrganizationMemberErrors, GetOrganizationMemberResponse, GetOrganizationMemberResponses, GetOrganizationMembersData, GetOrganizationMembersError, GetOrganizationMembersErrors, GetOrganizationMembersResponse, GetOrganizationMembersResponses, GetOrganizationResponse, GetOrganizationResponses, GetOrganizationSpendingLimitData, GetOrganizationSpendingLimitError, GetOrganizationSpendingLimitErrors, GetOrganizationSpendingLimitResponse, GetOrganizationSpendingLimitResponses, GetOrganizationVpcEndpointDetailsData, GetOrganizationVpcEndpointDetailsError, GetOrganizationVpcEndpointDetailsErrors, GetOrganizationVpcEndpointDetailsResponse, GetOrganizationVpcEndpointDetailsResponses, GetProjectAdvisorSecurityIssuesData, GetProjectAdvisorSecurityIssuesError, GetProjectAdvisorSecurityIssuesErrors, GetProjectAdvisorSecurityIssuesResponse, GetProjectAdvisorSecurityIssuesResponses, GetProjectBranchAiGatewayData, GetProjectBranchAiGatewayError, GetProjectBranchAiGatewayErrors, GetProjectBranchAiGatewayResponse, GetProjectBranchAiGatewayResponses, GetProjectBranchBucketObjectData, GetProjectBranchBucketObjectError, GetProjectBranchBucketObjectErrors, GetProjectBranchBucketObjectResponse, GetProjectBranchBucketObjectResponses, GetProjectBranchData, GetProjectBranchDataApiData, GetProjectBranchDataApiError, GetProjectBranchDataApiErrors, GetProjectBranchDataApiResponse, GetProjectBranchDataApiResponses, GetProjectBranchDatabaseData, GetProjectBranchDatabaseError, GetProjectBranchDatabaseErrors, GetProjectBranchDatabaseResponse, GetProjectBranchDatabaseResponses, GetProjectBranchError, GetProjectBranchErrors, GetProjectBranchFunctionData, GetProjectBranchFunctionError, GetProjectBranchFunctionErrors, GetProjectBranchFunctionResponse, GetProjectBranchFunctionResponses, GetProjectBranchResponse, GetProjectBranchResponses, GetProjectBranchRoleData, GetProjectBranchRoleError, GetProjectBranchRoleErrors, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordError, GetProjectBranchRolePasswordErrors, GetProjectBranchRolePasswordResponse, GetProjectBranchRolePasswordResponses, GetProjectBranchRoleResponse, GetProjectBranchRoleResponses, GetProjectBranchSchemaComparisonData, GetProjectBranchSchemaComparisonError, GetProjectBranchSchemaComparisonErrors, GetProjectBranchSchemaComparisonResponse, GetProjectBranchSchemaComparisonResponses, GetProjectBranchSchemaData, GetProjectBranchSchemaError, GetProjectBranchSchemaErrors, GetProjectBranchSchemaResponse, GetProjectBranchSchemaResponses, GetProjectBranchStorageData, GetProjectBranchStorageError, GetProjectBranchStorageErrors, GetProjectBranchStorageResponse, GetProjectBranchStorageResponses, GetProjectData, GetProjectEndpointData, GetProjectEndpointError, GetProjectEndpointErrors, GetProjectEndpointResponse, GetProjectEndpointResponses, GetProjectError, GetProjectErrors, GetProjectJwksData, GetProjectJwksError, GetProjectJwksErrors, GetProjectJwksResponse, GetProjectJwksResponses, GetProjectOperationData, GetProjectOperationError, GetProjectOperationErrors, GetProjectOperationResponse, GetProjectOperationResponses, GetProjectResponse, GetProjectResponses, GetSnapshotScheduleData, GetSnapshotScheduleError, GetSnapshotScheduleErrors, GetSnapshotScheduleResponse, GetSnapshotScheduleResponses, GrantPermissionToProjectData, GrantPermissionToProjectError, GrantPermissionToProjectErrors, GrantPermissionToProjectRequest, GrantPermissionToProjectResponse, GrantPermissionToProjectResponses, IdentityProviderId, Invitation, Jwks, JwksCreationOperation, JwksResponse, LimitParam, LimitsUnsatisfiedResponse, ListApiKeysData, ListApiKeysError, ListApiKeysErrors, ListApiKeysResponse, ListApiKeysResponses, ListBranchNeonAuthOauthProvidersData, ListBranchNeonAuthOauthProvidersError, ListBranchNeonAuthOauthProvidersErrors, ListBranchNeonAuthOauthProvidersResponse, ListBranchNeonAuthOauthProvidersResponses, ListBranchNeonAuthTrustedDomainsData, ListBranchNeonAuthTrustedDomainsError, ListBranchNeonAuthTrustedDomainsErrors, ListBranchNeonAuthTrustedDomainsResponse, ListBranchNeonAuthTrustedDomainsResponses, ListCredentialsData, ListCredentialsError, ListCredentialsErrors, ListCredentialsResponse, ListCredentialsResponse2, ListCredentialsResponses, ListNeonAuthIntegrationsData, ListNeonAuthIntegrationsError, ListNeonAuthIntegrationsErrors, ListNeonAuthIntegrationsResponse, ListNeonAuthIntegrationsResponse2, ListNeonAuthIntegrationsResponses, ListNeonAuthOauthProvidersData, ListNeonAuthOauthProvidersError, ListNeonAuthOauthProvidersErrors, ListNeonAuthOauthProvidersResponse, ListNeonAuthOauthProvidersResponse2, ListNeonAuthOauthProvidersResponses, ListNeonAuthRedirectUriWhitelistDomainsData, ListNeonAuthRedirectUriWhitelistDomainsError, ListNeonAuthRedirectUriWhitelistDomainsErrors, ListNeonAuthRedirectUriWhitelistDomainsResponse, ListNeonAuthRedirectUriWhitelistDomainsResponses, ListOrganizationVpcEndpointsAllRegionsData, ListOrganizationVpcEndpointsAllRegionsError, ListOrganizationVpcEndpointsAllRegionsErrors, ListOrganizationVpcEndpointsAllRegionsResponse, ListOrganizationVpcEndpointsAllRegionsResponses, ListOrganizationVpcEndpointsData, ListOrganizationVpcEndpointsError, ListOrganizationVpcEndpointsErrors, ListOrganizationVpcEndpointsResponse, ListOrganizationVpcEndpointsResponses, ListOrgApiKeysData, ListOrgApiKeysError, ListOrgApiKeysErrors, ListOrgApiKeysResponse, ListOrgApiKeysResponses, ListProjectBranchBucketObjectsData, ListProjectBranchBucketObjectsError, ListProjectBranchBucketObjectsErrors, ListProjectBranchBucketObjectsResponse, ListProjectBranchBucketObjectsResponses, ListProjectBranchBucketsData, ListProjectBranchBucketsError, ListProjectBranchBucketsErrors, ListProjectBranchBucketsResponse, ListProjectBranchBucketsResponses, ListProjectBranchDatabasesData, ListProjectBranchDatabasesError, ListProjectBranchDatabasesErrors, ListProjectBranchDatabasesResponse, ListProjectBranchDatabasesResponses, ListProjectBranchEndpointsData, ListProjectBranchEndpointsError, ListProjectBranchEndpointsErrors, ListProjectBranchEndpointsResponse, ListProjectBranchEndpointsResponses, ListProjectBranchesData, ListProjectBranchesError, ListProjectBranchesErrors, ListProjectBranchesResponse, ListProjectBranchesResponses, ListProjectBranchFunctionsData, ListProjectBranchFunctionsError, ListProjectBranchFunctionsErrors, ListProjectBranchFunctionsResponse, ListProjectBranchFunctionsResponses, ListProjectBranchLogFieldsData, ListProjectBranchLogFieldsError, ListProjectBranchLogFieldsErrors, ListProjectBranchLogFieldsResponse, ListProjectBranchLogFieldsResponses, ListProjectBranchLogFieldValuesData, ListProjectBranchLogFieldValuesError, ListProjectBranchLogFieldValuesErrors, ListProjectBranchLogFieldValuesResponse, ListProjectBranchLogFieldValuesResponses, ListProjectBranchRolesData, ListProjectBranchRolesError, ListProjectBranchRolesErrors, ListProjectBranchRolesResponse, ListProjectBranchRolesResponses, ListProjectEndpointsData, ListProjectEndpointsError, ListProjectEndpointsErrors, ListProjectEndpointsResponse, ListProjectEndpointsResponses, ListProjectMembersData, ListProjectMembersError, ListProjectMembersErrors, ListProjectMembersResponse, ListProjectMembersResponses, ListProjectOperationsData, ListProjectOperationsError, ListProjectOperationsErrors, ListProjectOperationsResponse, ListProjectOperationsResponses, ListProjectPermissionsData, ListProjectPermissionsError, ListProjectPermissionsErrors, ListProjectPermissionsResponse, ListProjectPermissionsResponses, ListProjectsData, ListProjectsError, ListProjectsErrors, ListProjectsResponse, ListProjectsResponses, ListProjectVpcEndpointsData, ListProjectVpcEndpointsError, ListProjectVpcEndpointsErrors, ListProjectVpcEndpointsResponse, ListProjectVpcEndpointsResponses, ListSharedProjectsData, ListSharedProjectsError, ListSharedProjectsErrors, ListSharedProjectsResponse, ListSharedProjectsResponses, ListSnapshotsData, ListSnapshotsError, ListSnapshotsErrors, ListSnapshotsResponse, ListSnapshotsResponses, MaintenanceWindow, MaskingRule, MaskingRulesResponse, MaskingRulesUpdateRequest, Member, MemberRole, MemberUserInfo, MemberWithUser, NeonAuthAddDomainToRedirectUriWhitelistRequest, NeonAuthAddOAuthProviderRequest, NeonAuthAllowLocalhostResponse, NeonAuthConfigResponse, NeonAuthConfigUpdate, NeonAuthCreateAuthProviderSdkKeysRequest, NeonAuthCreateIntegrationRequest, NeonAuthCreateIntegrationResponse, NeonAuthCreateNewUserRequest, NeonAuthCreateNewUserResponse, NeonAuthDeleteDomainFromRedirectUriWhitelistItem, NeonAuthDeleteDomainFromRedirectUriWhitelistRequest, NeonAuthEmailAndPasswordConfig, NeonAuthEmailAndPasswordConfigUpdate, NeonAuthEmailServerConfig, NeonAuthEmailVerificationMethod, NeonAuthIntegration, NeonAuthMagicLinkConfig, NeonAuthMagicLinkConfigUpdate, NeonAuthOauthProvider, NeonAuthOauthProviderId, NeonAuthOauthProviderType, NeonAuthOrganizationConfig, NeonAuthOrganizationConfigUpdate, NeonAuthPhoneNumberConfig, NeonAuthPhoneNumberConfigUpdate, NeonAuthPluginConfigs, NeonAuthProviderProjectOwnedBy, NeonAuthProviderProjectTransferStatus, NeonAuthRedirectUriWhitelistDomain, NeonAuthRedirectUriWhitelistResponse, NeonAuthSupportedAuthProvider, NeonAuthTransferAuthProviderProjectRequest, NeonAuthTransferAuthProviderProjectResponse, NeonAuthUpdateOAuthProviderRequest, NeonAuthWebhookConfig, NeonFunction, NeonFunctionDeployment, NeonFunctionDeploymentResponse, NeonFunctionResponse, NeonFunctionsListResponse, NeonFunctionUpdateRequest, Operation, OperationAction, OperationResponse, OperationsResponse, OperationStatus, Organization, OrganizationInvitationsResponse, OrganizationInviteCreateRequest, OrganizationInvitesCreateRequest, OrganizationMembersResponse, OrganizationMemberUpdateRequest, OrganizationsResponse, OrgApiKeyCreateRequest, OrgApiKeyCreateResponse, OrgApiKeyRevokeResponse, OrgApiKeysListResponseItem, Pagination, PaginationResponse, PaymentSource, PaymentSourceBankCard, PgbouncerSettingsData, PgSettingsData, PgVersion, PlanDetails, PlanVersion, PreloadLibraries, PresignProjectBranchBucketObjectData, PresignProjectBranchBucketObjectError, PresignProjectBranchBucketObjectErrors, PresignProjectBranchBucketObjectResponse, PresignProjectBranchBucketObjectResponses, PresignRequest, PresignResponse, Project, ProjectAuditLogLevel, ProjectBranchLogDuration, ProjectBranchLogFieldsResponse, ProjectBranchLogFieldValuesResponse, ProjectBranchLogRecord, ProjectBranchLogSeverity, ProjectBranchLogsInvalidQuery, ProjectBranchLogsNotAvailable, ProjectBranchLogSource, ProjectBranchLogsQueryRequest, ProjectBranchLogsQueryResponse, ProjectCreateRequest, ProjectJwksResponse, ProjectListItem, ProjectMember, ProjectMemberGrantSource, ProjectMemberOrgRole, ProjectMemberRoleResponse, ProjectMembers, ProjectOwnerData, ProjectPermission, ProjectPermissionLevel, ProjectPermissions, ProjectQuota, ProjectRecoverResponse, ProjectResponse, ProjectRole, ProjectsApplicationsMapResponse, ProjectSettingsData, ProjectsIntegrationsMapResponse, ProjectsResponse, ProjectsWithIntegrationResponse, ProjectTransferRequestResponse, ProjectUpdateRequest, Provisioner, QueryProjectBranchLogsData, QueryProjectBranchLogsError, QueryProjectBranchLogsErrors, QueryProjectBranchLogsResponse, QueryProjectBranchLogsResponses, RecoverProjectData, RecoverProjectError, RecoverProjectErrors, RecoverProjectResponse, RecoverProjectResponses, RegionResponse, RemoveOrganizationMemberData, RemoveOrganizationMemberError, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponse, RemoveOrganizationMemberResponses, RemoveProjectMemberRoleData, RemoveProjectMemberRoleError, RemoveProjectMemberRoleErrors, RemoveProjectMemberRoleResponse, RemoveProjectMemberRoleResponses, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordError, ResetProjectBranchRolePasswordErrors, ResetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordResponses, RestartProjectEndpointData, RestartProjectEndpointError, RestartProjectEndpointErrors, RestartProjectEndpointResponse, RestartProjectEndpointResponses, RestoreProjectBranchData, RestoreProjectBranchError, RestoreProjectBranchErrors, RestoreProjectBranchResponse, RestoreProjectBranchResponses, RestoreSnapshotData, RestoreSnapshotError, RestoreSnapshotErrors, RestoreSnapshotResponse, RestoreSnapshotResponses, RevokeApiKeyData, RevokeApiKeyError, RevokeApiKeyErrors, RevokeApiKeyResponse, RevokeApiKeyResponses, RevokeCredentialData, RevokeCredentialError, RevokeCredentialErrors, RevokeCredentialResponse, RevokeCredentialResponses, RevokeOrgApiKeyData, RevokeOrgApiKeyError, RevokeOrgApiKeyErrors, RevokeOrgApiKeyResponse, RevokeOrgApiKeyResponses, RevokePermissionFromProjectData, RevokePermissionFromProjectError, RevokePermissionFromProjectErrors, RevokePermissionFromProjectResponse, RevokePermissionFromProjectResponses, Role, RoleCreateRequest, RoleOperations, RolePasswordResponse, RoleResponse, RolesResponse, SendNeonAuthTestEmailData, SendNeonAuthTestEmailError, SendNeonAuthTestEmailErrors, SendNeonAuthTestEmailRequest, SendNeonAuthTestEmailResponse, SendNeonAuthTestEmailResponse2, SendNeonAuthTestEmailResponses, SetDefaultProjectBranchData, SetDefaultProjectBranchError, SetDefaultProjectBranchErrors, SetDefaultProjectBranchResponse, SetDefaultProjectBranchResponses, SetOrganizationSpendingLimitData, SetOrganizationSpendingLimitError, SetOrganizationSpendingLimitErrors, SetOrganizationSpendingLimitResponse, SetOrganizationSpendingLimitResponses, SetProjectMemberRoleData, SetProjectMemberRoleError, SetProjectMemberRoleErrors, SetProjectMemberRoleRequest, SetProjectMemberRoleResponse, SetProjectMemberRoleResponses, SetSnapshotScheduleData, SetSnapshotScheduleError, SetSnapshotScheduleErrors, SetSnapshotScheduleResponse, SetSnapshotScheduleResponses, SharedEmailServer, Snapshot, SnapshotUpdateRequest, SortOrderParam, SpendingLimitResponse, SpendingLimitUpdateRequest, StandardEmailServer, StartAnonymizationData, StartAnonymizationError, StartAnonymizationErrors, StartAnonymizationResponse, StartAnonymizationResponses, StartProjectEndpointData, StartProjectEndpointError, StartProjectEndpointErrors, StartProjectEndpointResponse, StartProjectEndpointResponses, SuspendProjectEndpointData, SuspendProjectEndpointError, SuspendProjectEndpointErrors, SuspendProjectEndpointResponse, SuspendProjectEndpointResponses, SuspendTimeoutSeconds, TimeoutParam, TransferNeonAuthProviderProjectData, TransferNeonAuthProviderProjectError, TransferNeonAuthProviderProjectErrors, TransferNeonAuthProviderProjectResponse, TransferNeonAuthProviderProjectResponses, TransferProjectsFromOrgToOrgData, TransferProjectsFromOrgToOrgError, TransferProjectsFromOrgToOrgErrors, TransferProjectsFromOrgToOrgResponse, TransferProjectsFromOrgToOrgResponses, TransferProjectsFromUserToOrgData, TransferProjectsFromUserToOrgError, TransferProjectsFromUserToOrgErrors, TransferProjectsFromUserToOrgResponse, TransferProjectsFromUserToOrgResponses, TransferProjectsToOrganizationRequest, UpdateBranchNeonAuthOauthProviderData, UpdateBranchNeonAuthOauthProviderError, UpdateBranchNeonAuthOauthProviderErrors, UpdateBranchNeonAuthOauthProviderResponse, UpdateBranchNeonAuthOauthProviderResponses, UpdateMaskingRulesData, UpdateMaskingRulesError, UpdateMaskingRulesErrors, UpdateMaskingRulesResponse, UpdateMaskingRulesResponses, UpdateNeonAuthAllowLocalhostData, UpdateNeonAuthAllowLocalhostError, UpdateNeonAuthAllowLocalhostErrors, UpdateNeonAuthAllowLocalhostRequest, UpdateNeonAuthAllowLocalhostResponse, UpdateNeonAuthAllowLocalhostResponses, UpdateNeonAuthConfigData, UpdateNeonAuthConfigError, UpdateNeonAuthConfigErrors, UpdateNeonAuthConfigResponse, UpdateNeonAuthConfigResponses, UpdateNeonAuthEmailAndPasswordConfigData, UpdateNeonAuthEmailAndPasswordConfigError, UpdateNeonAuthEmailAndPasswordConfigErrors, UpdateNeonAuthEmailAndPasswordConfigResponse, UpdateNeonAuthEmailAndPasswordConfigResponses, UpdateNeonAuthEmailProviderData, UpdateNeonAuthEmailProviderError, UpdateNeonAuthEmailProviderErrors, UpdateNeonAuthEmailProviderResponse, UpdateNeonAuthEmailProviderResponses, UpdateNeonAuthEmailServerData, UpdateNeonAuthEmailServerError, UpdateNeonAuthEmailServerErrors, UpdateNeonAuthEmailServerResponse, UpdateNeonAuthEmailServerResponses, UpdateNeonAuthMagicLinkPluginData, UpdateNeonAuthMagicLinkPluginError, UpdateNeonAuthMagicLinkPluginErrors, UpdateNeonAuthMagicLinkPluginResponse, UpdateNeonAuthMagicLinkPluginResponses, UpdateNeonAuthOauthProviderData, UpdateNeonAuthOauthProviderError, UpdateNeonAuthOauthProviderErrors, UpdateNeonAuthOauthProviderResponse, UpdateNeonAuthOauthProviderResponses, UpdateNeonAuthOrganizationPluginData, UpdateNeonAuthOrganizationPluginError, UpdateNeonAuthOrganizationPluginErrors, UpdateNeonAuthOrganizationPluginResponse, UpdateNeonAuthOrganizationPluginResponses, UpdateNeonAuthPhoneNumberPluginData, UpdateNeonAuthPhoneNumberPluginError, UpdateNeonAuthPhoneNumberPluginErrors, UpdateNeonAuthPhoneNumberPluginResponse, UpdateNeonAuthPhoneNumberPluginResponses, UpdateNeonAuthUserRoleData, UpdateNeonAuthUserRoleError, UpdateNeonAuthUserRoleErrors, UpdateNeonAuthUserRoleRequest, UpdateNeonAuthUserRoleResponse, UpdateNeonAuthUserRoleResponse2, UpdateNeonAuthUserRoleResponses, UpdateNeonAuthWebhookConfigData, UpdateNeonAuthWebhookConfigError, UpdateNeonAuthWebhookConfigErrors, UpdateNeonAuthWebhookConfigResponse, UpdateNeonAuthWebhookConfigResponses, UpdateOrganizationMemberData, UpdateOrganizationMemberError, UpdateOrganizationMemberErrors, UpdateOrganizationMemberResponse, UpdateOrganizationMemberResponses, UpdateProjectBranchData, UpdateProjectBranchDataApiData, UpdateProjectBranchDataApiError, UpdateProjectBranchDataApiErrors, UpdateProjectBranchDataApiResponse, UpdateProjectBranchDataApiResponses, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseError, UpdateProjectBranchDatabaseErrors, UpdateProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseResponses, UpdateProjectBranchError, UpdateProjectBranchErrors, UpdateProjectBranchFunctionData, UpdateProjectBranchFunctionError, UpdateProjectBranchFunctionErrors, UpdateProjectBranchFunctionResponse, UpdateProjectBranchFunctionResponses, UpdateProjectBranchResponse, UpdateProjectBranchResponses, UpdateProjectData, UpdateProjectEndpointData, UpdateProjectEndpointError, UpdateProjectEndpointErrors, UpdateProjectEndpointResponse, UpdateProjectEndpointResponses, UpdateProjectError, UpdateProjectErrors, UpdateProjectResponse, UpdateProjectResponses, UpdateSnapshotData, UpdateSnapshotError, UpdateSnapshotErrors, UpdateSnapshotResponse, UpdateSnapshotResponses, VpcEndpoint, VpcEndpointAssignment, VpcEndpointDetails, VpcEndpointsResponse, VpcEndpointsWithRegionResponse, VpcEndpointWithRegion } from './types.gen.js'; diff --git a/packages/sdk/src/client/raw.gen.ts b/packages/sdk/src/client/raw.gen.ts index 8c0b7810..64c54f68 100644 --- a/packages/sdk/src/client/raw.gen.ts +++ b/packages/sdk/src/client/raw.gen.ts @@ -115,8 +115,11 @@ import { listProjectBranchEndpoints as _listProjectBranchEndpoints, listProjectBranches as _listProjectBranches, listProjectBranchFunctions as _listProjectBranchFunctions, + listProjectBranchLogFields as _listProjectBranchLogFields, + listProjectBranchLogFieldValues as _listProjectBranchLogFieldValues, listProjectBranchRoles as _listProjectBranchRoles, listProjectEndpoints as _listProjectEndpoints, + listProjectMembers as _listProjectMembers, listProjectOperations as _listProjectOperations, listProjectPermissions as _listProjectPermissions, listProjects as _listProjects, @@ -124,9 +127,10 @@ import { listSharedProjects as _listSharedProjects, listSnapshots as _listSnapshots, presignProjectBranchBucketObject as _presignProjectBranchBucketObject, + queryProjectBranchLogs as _queryProjectBranchLogs, recoverProject as _recoverProject, - recoverProjectBranch as _recoverProjectBranch, removeOrganizationMember as _removeOrganizationMember, + removeProjectMemberRole as _removeProjectMemberRole, resetProjectBranchRolePassword as _resetProjectBranchRolePassword, restartProjectEndpoint as _restartProjectEndpoint, restoreProjectBranch as _restoreProjectBranch, @@ -138,6 +142,7 @@ import { sendNeonAuthTestEmail as _sendNeonAuthTestEmail, setDefaultProjectBranch as _setDefaultProjectBranch, setOrganizationSpendingLimit as _setOrganizationSpendingLimit, + setProjectMemberRole as _setProjectMemberRole, setSnapshotSchedule as _setSnapshotSchedule, startAnonymization as _startAnonymization, startProjectEndpoint as _startProjectEndpoint, @@ -280,8 +285,11 @@ export const listProjectBranchDatabases = wrapRaw(_listProjectBranchDatabases); export const listProjectBranchEndpoints = wrapRaw(_listProjectBranchEndpoints); export const listProjectBranches = wrapRaw(_listProjectBranches); export const listProjectBranchFunctions = wrapRaw(_listProjectBranchFunctions); +export const listProjectBranchLogFields = wrapRaw(_listProjectBranchLogFields); +export const listProjectBranchLogFieldValues = wrapRaw(_listProjectBranchLogFieldValues); export const listProjectBranchRoles = wrapRaw(_listProjectBranchRoles); export const listProjectEndpoints = wrapRaw(_listProjectEndpoints); +export const listProjectMembers = wrapRaw(_listProjectMembers); export const listProjectOperations = wrapRaw(_listProjectOperations); export const listProjectPermissions = wrapRaw(_listProjectPermissions); export const listProjects = wrapRaw(_listProjects); @@ -289,9 +297,10 @@ export const listProjectVpcEndpoints = wrapRaw(_listProjectVpcEndpoints); export const listSharedProjects = wrapRaw(_listSharedProjects); export const listSnapshots = wrapRaw(_listSnapshots); export const presignProjectBranchBucketObject = wrapRaw(_presignProjectBranchBucketObject); +export const queryProjectBranchLogs = wrapRaw(_queryProjectBranchLogs); export const recoverProject = wrapRaw(_recoverProject); -export const recoverProjectBranch = wrapRaw(_recoverProjectBranch); export const removeOrganizationMember = wrapRaw(_removeOrganizationMember); +export const removeProjectMemberRole = wrapRaw(_removeProjectMemberRole); export const resetProjectBranchRolePassword = wrapRaw(_resetProjectBranchRolePassword); export const restartProjectEndpoint = wrapRaw(_restartProjectEndpoint); export const restoreProjectBranch = wrapRaw(_restoreProjectBranch); @@ -303,6 +312,7 @@ export const revokePermissionFromProject = wrapRaw(_revokePermissionFromProject) export const sendNeonAuthTestEmail = wrapRaw(_sendNeonAuthTestEmail); export const setDefaultProjectBranch = wrapRaw(_setDefaultProjectBranch); export const setOrganizationSpendingLimit = wrapRaw(_setOrganizationSpendingLimit); +export const setProjectMemberRole = wrapRaw(_setProjectMemberRole); export const setSnapshotSchedule = wrapRaw(_setSnapshotSchedule); export const startAnonymization = wrapRaw(_startAnonymization); export const startProjectEndpoint = wrapRaw(_startProjectEndpoint); diff --git a/packages/sdk/src/client/sdk.gen.ts b/packages/sdk/src/client/sdk.gen.ts index 8936f08c..5a244504 100644 --- a/packages/sdk/src/client/sdk.gen.ts +++ b/packages/sdk/src/client/sdk.gen.ts @@ -2,7 +2,7 @@ import { client } from './client.gen.js'; import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client/index.js'; -import type { AcceptProjectTransferRequestData, AcceptProjectTransferRequestErrors, AcceptProjectTransferRequestResponses, AddBranchNeonAuthOauthProviderData, AddBranchNeonAuthOauthProviderErrors, AddBranchNeonAuthOauthProviderResponses, AddBranchNeonAuthTrustedDomainData, AddBranchNeonAuthTrustedDomainErrors, AddBranchNeonAuthTrustedDomainResponses, AddNeonAuthDomainToRedirectUriWhitelistData, AddNeonAuthDomainToRedirectUriWhitelistErrors, AddNeonAuthDomainToRedirectUriWhitelistResponses, AddNeonAuthOauthProviderData, AddNeonAuthOauthProviderErrors, AddNeonAuthOauthProviderResponses, AddProjectJwksData, AddProjectJwksErrors, AddProjectJwksResponses, AssignOrganizationVpcEndpointData, AssignOrganizationVpcEndpointErrors, AssignOrganizationVpcEndpointResponses, AssignProjectVpcEndpointData, AssignProjectVpcEndpointErrors, AssignProjectVpcEndpointResponses, CountProjectBranchesData, CountProjectBranchesErrors, CountProjectBranchesResponses, CreateApiKeyData, CreateApiKeyErrors, CreateApiKeyResponses, CreateBranchNeonAuthNewUserData, CreateBranchNeonAuthNewUserErrors, CreateBranchNeonAuthNewUserResponses, CreateCredentialData, CreateCredentialErrors, CreateCredentialResponses, CreateNeonAuthData, CreateNeonAuthErrors, CreateNeonAuthIntegrationData, CreateNeonAuthIntegrationErrors, CreateNeonAuthIntegrationResponses, CreateNeonAuthNewUserData, CreateNeonAuthNewUserErrors, CreateNeonAuthNewUserResponses, CreateNeonAuthProviderSdkKeysData, CreateNeonAuthProviderSdkKeysErrors, CreateNeonAuthProviderSdkKeysResponses, CreateNeonAuthResponses, CreateOrganizationInvitationsData, CreateOrganizationInvitationsErrors, CreateOrganizationInvitationsResponses, CreateOrgApiKeyData, CreateOrgApiKeyErrors, CreateOrgApiKeyResponses, CreateProjectBranchAnonymizedData, CreateProjectBranchAnonymizedErrors, CreateProjectBranchAnonymizedResponses, CreateProjectBranchBucketData, CreateProjectBranchBucketErrors, CreateProjectBranchBucketResponses, CreateProjectBranchData, CreateProjectBranchDataApiData, CreateProjectBranchDataApiErrors, CreateProjectBranchDataApiResponses, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseErrors, CreateProjectBranchDatabaseResponses, CreateProjectBranchErrors, CreateProjectBranchFunctionDeploymentData, CreateProjectBranchFunctionDeploymentErrors, CreateProjectBranchFunctionDeploymentResponses, CreateProjectBranchResponses, CreateProjectBranchRoleData, CreateProjectBranchRoleErrors, CreateProjectBranchRoleResponses, CreateProjectData, CreateProjectEndpointData, CreateProjectEndpointErrors, CreateProjectEndpointResponses, CreateProjectErrors, CreateProjectResponses, CreateProjectTransferRequestData, CreateProjectTransferRequestErrors, CreateProjectTransferRequestResponses, CreateSnapshotData, CreateSnapshotErrors, CreateSnapshotResponses, DeleteBranchNeonAuthOauthProviderData, DeleteBranchNeonAuthOauthProviderErrors, DeleteBranchNeonAuthOauthProviderResponses, DeleteBranchNeonAuthTrustedDomainData, DeleteBranchNeonAuthTrustedDomainErrors, DeleteBranchNeonAuthTrustedDomainResponses, DeleteBranchNeonAuthUserData, DeleteBranchNeonAuthUserErrors, DeleteBranchNeonAuthUserResponses, DeleteNeonAuthDomainFromRedirectUriWhitelistData, DeleteNeonAuthDomainFromRedirectUriWhitelistErrors, DeleteNeonAuthDomainFromRedirectUriWhitelistResponses, DeleteNeonAuthIntegrationData, DeleteNeonAuthIntegrationErrors, DeleteNeonAuthIntegrationResponses, DeleteNeonAuthOauthProviderData, DeleteNeonAuthOauthProviderErrors, DeleteNeonAuthOauthProviderResponses, DeleteNeonAuthUserData, DeleteNeonAuthUserErrors, DeleteNeonAuthUserResponses, DeleteOrganizationSpendingLimitData, DeleteOrganizationSpendingLimitErrors, DeleteOrganizationSpendingLimitResponses, DeleteOrganizationVpcEndpointData, DeleteOrganizationVpcEndpointErrors, DeleteOrganizationVpcEndpointResponses, DeleteProjectBranchBucketData, DeleteProjectBranchBucketErrors, DeleteProjectBranchBucketObjectData, DeleteProjectBranchBucketObjectErrors, DeleteProjectBranchBucketObjectResponses, DeleteProjectBranchBucketObjectsByPrefixData, DeleteProjectBranchBucketObjectsByPrefixErrors, DeleteProjectBranchBucketObjectsByPrefixResponses, DeleteProjectBranchBucketResponses, DeleteProjectBranchData, DeleteProjectBranchDataApiData, DeleteProjectBranchDataApiErrors, DeleteProjectBranchDataApiResponses, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseErrors, DeleteProjectBranchDatabaseResponses, DeleteProjectBranchErrors, DeleteProjectBranchFunctionData, DeleteProjectBranchFunctionErrors, DeleteProjectBranchFunctionResponses, DeleteProjectBranchResponses, DeleteProjectBranchRoleData, DeleteProjectBranchRoleErrors, DeleteProjectBranchRoleResponses, DeleteProjectData, DeleteProjectEndpointData, DeleteProjectEndpointErrors, DeleteProjectEndpointResponses, DeleteProjectErrors, DeleteProjectJwksData, DeleteProjectJwksErrors, DeleteProjectJwksResponses, DeleteProjectResponses, DeleteProjectVpcEndpointData, DeleteProjectVpcEndpointErrors, DeleteProjectVpcEndpointResponses, DeleteSnapshotData, DeleteSnapshotErrors, DeleteSnapshotResponses, DisableNeonAuthData, DisableNeonAuthErrors, DisableNeonAuthResponses, FinalizeRestoreBranchData, FinalizeRestoreBranchErrors, FinalizeRestoreBranchResponses, GetActiveRegionsData, GetActiveRegionsErrors, GetActiveRegionsResponses, GetAnonymizedBranchStatusData, GetAnonymizedBranchStatusErrors, GetAnonymizedBranchStatusResponses, GetAuthDetailsData, GetAuthDetailsErrors, GetAuthDetailsResponses, GetAvailablePreloadLibrariesData, GetAvailablePreloadLibrariesErrors, GetAvailablePreloadLibrariesResponses, GetConnectionUriData, GetConnectionUriErrors, GetConnectionUriResponses, GetConsumptionHistoryPerBranchV2Data, GetConsumptionHistoryPerBranchV2Errors, GetConsumptionHistoryPerBranchV2Responses, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectErrors, GetConsumptionHistoryPerProjectResponses, GetConsumptionHistoryPerProjectV2Data, GetConsumptionHistoryPerProjectV2Errors, GetConsumptionHistoryPerProjectV2Responses, GetCurrentUserInfoData, GetCurrentUserInfoErrors, GetCurrentUserInfoResponses, GetCurrentUserOrganizationsData, GetCurrentUserOrganizationsErrors, GetCurrentUserOrganizationsResponses, GetMaskingRulesData, GetMaskingRulesErrors, GetMaskingRulesResponses, GetNeonAuthAllowLocalhostData, GetNeonAuthAllowLocalhostErrors, GetNeonAuthAllowLocalhostResponses, GetNeonAuthData, GetNeonAuthEmailAndPasswordConfigData, GetNeonAuthEmailAndPasswordConfigErrors, GetNeonAuthEmailAndPasswordConfigResponses, GetNeonAuthEmailProviderData, GetNeonAuthEmailProviderErrors, GetNeonAuthEmailProviderResponses, GetNeonAuthEmailServerData, GetNeonAuthEmailServerErrors, GetNeonAuthEmailServerResponses, GetNeonAuthErrors, GetNeonAuthPhoneNumberPluginData, GetNeonAuthPhoneNumberPluginErrors, GetNeonAuthPhoneNumberPluginResponses, GetNeonAuthPluginConfigsData, GetNeonAuthPluginConfigsErrors, GetNeonAuthPluginConfigsResponses, GetNeonAuthResponses, GetNeonAuthWebhookConfigData, GetNeonAuthWebhookConfigErrors, GetNeonAuthWebhookConfigResponses, GetOrganizationData, GetOrganizationErrors, GetOrganizationInvitationsData, GetOrganizationInvitationsErrors, GetOrganizationInvitationsResponses, GetOrganizationMemberData, GetOrganizationMemberErrors, GetOrganizationMemberResponses, GetOrganizationMembersData, GetOrganizationMembersErrors, GetOrganizationMembersResponses, GetOrganizationResponses, GetOrganizationSpendingLimitData, GetOrganizationSpendingLimitErrors, GetOrganizationSpendingLimitResponses, GetOrganizationVpcEndpointDetailsData, GetOrganizationVpcEndpointDetailsErrors, GetOrganizationVpcEndpointDetailsResponses, GetProjectAdvisorSecurityIssuesData, GetProjectAdvisorSecurityIssuesErrors, GetProjectAdvisorSecurityIssuesResponses, GetProjectBranchAiGatewayData, GetProjectBranchAiGatewayErrors, GetProjectBranchAiGatewayResponses, GetProjectBranchBucketObjectData, GetProjectBranchBucketObjectErrors, GetProjectBranchBucketObjectResponses, GetProjectBranchData, GetProjectBranchDataApiData, GetProjectBranchDataApiErrors, GetProjectBranchDataApiResponses, GetProjectBranchDatabaseData, GetProjectBranchDatabaseErrors, GetProjectBranchDatabaseResponses, GetProjectBranchErrors, GetProjectBranchFunctionData, GetProjectBranchFunctionErrors, GetProjectBranchFunctionResponses, GetProjectBranchResponses, GetProjectBranchRoleData, GetProjectBranchRoleErrors, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordErrors, GetProjectBranchRolePasswordResponses, GetProjectBranchRoleResponses, GetProjectBranchSchemaComparisonData, GetProjectBranchSchemaComparisonErrors, GetProjectBranchSchemaComparisonResponses, GetProjectBranchSchemaData, GetProjectBranchSchemaErrors, GetProjectBranchSchemaResponses, GetProjectBranchStorageData, GetProjectBranchStorageErrors, GetProjectBranchStorageResponses, GetProjectData, GetProjectEndpointData, GetProjectEndpointErrors, GetProjectEndpointResponses, GetProjectErrors, GetProjectJwksData, GetProjectJwksErrors, GetProjectJwksResponses, GetProjectOperationData, GetProjectOperationErrors, GetProjectOperationResponses, GetProjectResponses, GetSnapshotScheduleData, GetSnapshotScheduleErrors, GetSnapshotScheduleResponses, GrantPermissionToProjectData, GrantPermissionToProjectErrors, GrantPermissionToProjectResponses, ListApiKeysData, ListApiKeysErrors, ListApiKeysResponses, ListBranchNeonAuthOauthProvidersData, ListBranchNeonAuthOauthProvidersErrors, ListBranchNeonAuthOauthProvidersResponses, ListBranchNeonAuthTrustedDomainsData, ListBranchNeonAuthTrustedDomainsErrors, ListBranchNeonAuthTrustedDomainsResponses, ListCredentialsData, ListCredentialsErrors, ListCredentialsResponses, ListNeonAuthIntegrationsData, ListNeonAuthIntegrationsErrors, ListNeonAuthIntegrationsResponses, ListNeonAuthOauthProvidersData, ListNeonAuthOauthProvidersErrors, ListNeonAuthOauthProvidersResponses, ListNeonAuthRedirectUriWhitelistDomainsData, ListNeonAuthRedirectUriWhitelistDomainsErrors, ListNeonAuthRedirectUriWhitelistDomainsResponses, ListOrganizationVpcEndpointsAllRegionsData, ListOrganizationVpcEndpointsAllRegionsErrors, ListOrganizationVpcEndpointsAllRegionsResponses, ListOrganizationVpcEndpointsData, ListOrganizationVpcEndpointsErrors, ListOrganizationVpcEndpointsResponses, ListOrgApiKeysData, ListOrgApiKeysErrors, ListOrgApiKeysResponses, ListProjectBranchBucketObjectsData, ListProjectBranchBucketObjectsErrors, ListProjectBranchBucketObjectsResponses, ListProjectBranchBucketsData, ListProjectBranchBucketsErrors, ListProjectBranchBucketsResponses, ListProjectBranchDatabasesData, ListProjectBranchDatabasesErrors, ListProjectBranchDatabasesResponses, ListProjectBranchEndpointsData, ListProjectBranchEndpointsErrors, ListProjectBranchEndpointsResponses, ListProjectBranchesData, ListProjectBranchesErrors, ListProjectBranchesResponses, ListProjectBranchFunctionsData, ListProjectBranchFunctionsErrors, ListProjectBranchFunctionsResponses, ListProjectBranchRolesData, ListProjectBranchRolesErrors, ListProjectBranchRolesResponses, ListProjectEndpointsData, ListProjectEndpointsErrors, ListProjectEndpointsResponses, ListProjectOperationsData, ListProjectOperationsErrors, ListProjectOperationsResponses, ListProjectPermissionsData, ListProjectPermissionsErrors, ListProjectPermissionsResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListProjectVpcEndpointsData, ListProjectVpcEndpointsErrors, ListProjectVpcEndpointsResponses, ListSharedProjectsData, ListSharedProjectsErrors, ListSharedProjectsResponses, ListSnapshotsData, ListSnapshotsErrors, ListSnapshotsResponses, PresignProjectBranchBucketObjectData, PresignProjectBranchBucketObjectErrors, PresignProjectBranchBucketObjectResponses, RecoverProjectBranchData, RecoverProjectBranchErrors, RecoverProjectBranchResponses, RecoverProjectData, RecoverProjectErrors, RecoverProjectResponses, RemoveOrganizationMemberData, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponses, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordErrors, ResetProjectBranchRolePasswordResponses, RestartProjectEndpointData, RestartProjectEndpointErrors, RestartProjectEndpointResponses, RestoreProjectBranchData, RestoreProjectBranchErrors, RestoreProjectBranchResponses, RestoreSnapshotData, RestoreSnapshotErrors, RestoreSnapshotResponses, RevokeApiKeyData, RevokeApiKeyErrors, RevokeApiKeyResponses, RevokeCredentialData, RevokeCredentialErrors, RevokeCredentialResponses, RevokeOrgApiKeyData, RevokeOrgApiKeyErrors, RevokeOrgApiKeyResponses, RevokePermissionFromProjectData, RevokePermissionFromProjectErrors, RevokePermissionFromProjectResponses, SendNeonAuthTestEmailData, SendNeonAuthTestEmailErrors, SendNeonAuthTestEmailResponses, SetDefaultProjectBranchData, SetDefaultProjectBranchErrors, SetDefaultProjectBranchResponses, SetOrganizationSpendingLimitData, SetOrganizationSpendingLimitErrors, SetOrganizationSpendingLimitResponses, SetSnapshotScheduleData, SetSnapshotScheduleErrors, SetSnapshotScheduleResponses, StartAnonymizationData, StartAnonymizationErrors, StartAnonymizationResponses, StartProjectEndpointData, StartProjectEndpointErrors, StartProjectEndpointResponses, SuspendProjectEndpointData, SuspendProjectEndpointErrors, SuspendProjectEndpointResponses, TransferNeonAuthProviderProjectData, TransferNeonAuthProviderProjectErrors, TransferNeonAuthProviderProjectResponses, TransferProjectsFromOrgToOrgData, TransferProjectsFromOrgToOrgErrors, TransferProjectsFromOrgToOrgResponses, TransferProjectsFromUserToOrgData, TransferProjectsFromUserToOrgErrors, TransferProjectsFromUserToOrgResponses, UpdateBranchNeonAuthOauthProviderData, UpdateBranchNeonAuthOauthProviderErrors, UpdateBranchNeonAuthOauthProviderResponses, UpdateMaskingRulesData, UpdateMaskingRulesErrors, UpdateMaskingRulesResponses, UpdateNeonAuthAllowLocalhostData, UpdateNeonAuthAllowLocalhostErrors, UpdateNeonAuthAllowLocalhostResponses, UpdateNeonAuthConfigData, UpdateNeonAuthConfigErrors, UpdateNeonAuthConfigResponses, UpdateNeonAuthEmailAndPasswordConfigData, UpdateNeonAuthEmailAndPasswordConfigErrors, UpdateNeonAuthEmailAndPasswordConfigResponses, UpdateNeonAuthEmailProviderData, UpdateNeonAuthEmailProviderErrors, UpdateNeonAuthEmailProviderResponses, UpdateNeonAuthEmailServerData, UpdateNeonAuthEmailServerErrors, UpdateNeonAuthEmailServerResponses, UpdateNeonAuthMagicLinkPluginData, UpdateNeonAuthMagicLinkPluginErrors, UpdateNeonAuthMagicLinkPluginResponses, UpdateNeonAuthOauthProviderData, UpdateNeonAuthOauthProviderErrors, UpdateNeonAuthOauthProviderResponses, UpdateNeonAuthOrganizationPluginData, UpdateNeonAuthOrganizationPluginErrors, UpdateNeonAuthOrganizationPluginResponses, UpdateNeonAuthPhoneNumberPluginData, UpdateNeonAuthPhoneNumberPluginErrors, UpdateNeonAuthPhoneNumberPluginResponses, UpdateNeonAuthUserRoleData, UpdateNeonAuthUserRoleErrors, UpdateNeonAuthUserRoleResponses, UpdateNeonAuthWebhookConfigData, UpdateNeonAuthWebhookConfigErrors, UpdateNeonAuthWebhookConfigResponses, UpdateOrganizationMemberData, UpdateOrganizationMemberErrors, UpdateOrganizationMemberResponses, UpdateProjectBranchData, UpdateProjectBranchDataApiData, UpdateProjectBranchDataApiErrors, UpdateProjectBranchDataApiResponses, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseErrors, UpdateProjectBranchDatabaseResponses, UpdateProjectBranchErrors, UpdateProjectBranchFunctionData, UpdateProjectBranchFunctionErrors, UpdateProjectBranchFunctionResponses, UpdateProjectBranchResponses, UpdateProjectData, UpdateProjectEndpointData, UpdateProjectEndpointErrors, UpdateProjectEndpointResponses, UpdateProjectErrors, UpdateProjectResponses, UpdateSnapshotData, UpdateSnapshotErrors, UpdateSnapshotResponses } from './types.gen.js'; +import type { AcceptProjectTransferRequestData, AcceptProjectTransferRequestErrors, AcceptProjectTransferRequestResponses, AddBranchNeonAuthOauthProviderData, AddBranchNeonAuthOauthProviderErrors, AddBranchNeonAuthOauthProviderResponses, AddBranchNeonAuthTrustedDomainData, AddBranchNeonAuthTrustedDomainErrors, AddBranchNeonAuthTrustedDomainResponses, AddNeonAuthDomainToRedirectUriWhitelistData, AddNeonAuthDomainToRedirectUriWhitelistErrors, AddNeonAuthDomainToRedirectUriWhitelistResponses, AddNeonAuthOauthProviderData, AddNeonAuthOauthProviderErrors, AddNeonAuthOauthProviderResponses, AddProjectJwksData, AddProjectJwksErrors, AddProjectJwksResponses, AssignOrganizationVpcEndpointData, AssignOrganizationVpcEndpointErrors, AssignOrganizationVpcEndpointResponses, AssignProjectVpcEndpointData, AssignProjectVpcEndpointErrors, AssignProjectVpcEndpointResponses, CountProjectBranchesData, CountProjectBranchesErrors, CountProjectBranchesResponses, CreateApiKeyData, CreateApiKeyErrors, CreateApiKeyResponses, CreateBranchNeonAuthNewUserData, CreateBranchNeonAuthNewUserErrors, CreateBranchNeonAuthNewUserResponses, CreateCredentialData, CreateCredentialErrors, CreateCredentialResponses, CreateNeonAuthData, CreateNeonAuthErrors, CreateNeonAuthIntegrationData, CreateNeonAuthIntegrationErrors, CreateNeonAuthIntegrationResponses, CreateNeonAuthNewUserData, CreateNeonAuthNewUserErrors, CreateNeonAuthNewUserResponses, CreateNeonAuthProviderSdkKeysData, CreateNeonAuthProviderSdkKeysErrors, CreateNeonAuthProviderSdkKeysResponses, CreateNeonAuthResponses, CreateOrganizationInvitationsData, CreateOrganizationInvitationsErrors, CreateOrganizationInvitationsResponses, CreateOrgApiKeyData, CreateOrgApiKeyErrors, CreateOrgApiKeyResponses, CreateProjectBranchAnonymizedData, CreateProjectBranchAnonymizedErrors, CreateProjectBranchAnonymizedResponses, CreateProjectBranchBucketData, CreateProjectBranchBucketErrors, CreateProjectBranchBucketResponses, CreateProjectBranchData, CreateProjectBranchDataApiData, CreateProjectBranchDataApiErrors, CreateProjectBranchDataApiResponses, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseErrors, CreateProjectBranchDatabaseResponses, CreateProjectBranchErrors, CreateProjectBranchFunctionDeploymentData, CreateProjectBranchFunctionDeploymentErrors, CreateProjectBranchFunctionDeploymentResponses, CreateProjectBranchResponses, CreateProjectBranchRoleData, CreateProjectBranchRoleErrors, CreateProjectBranchRoleResponses, CreateProjectData, CreateProjectEndpointData, CreateProjectEndpointErrors, CreateProjectEndpointResponses, CreateProjectErrors, CreateProjectResponses, CreateProjectTransferRequestData, CreateProjectTransferRequestErrors, CreateProjectTransferRequestResponses, CreateSnapshotData, CreateSnapshotErrors, CreateSnapshotResponses, DeleteBranchNeonAuthOauthProviderData, DeleteBranchNeonAuthOauthProviderErrors, DeleteBranchNeonAuthOauthProviderResponses, DeleteBranchNeonAuthTrustedDomainData, DeleteBranchNeonAuthTrustedDomainErrors, DeleteBranchNeonAuthTrustedDomainResponses, DeleteBranchNeonAuthUserData, DeleteBranchNeonAuthUserErrors, DeleteBranchNeonAuthUserResponses, DeleteNeonAuthDomainFromRedirectUriWhitelistData, DeleteNeonAuthDomainFromRedirectUriWhitelistErrors, DeleteNeonAuthDomainFromRedirectUriWhitelistResponses, DeleteNeonAuthIntegrationData, DeleteNeonAuthIntegrationErrors, DeleteNeonAuthIntegrationResponses, DeleteNeonAuthOauthProviderData, DeleteNeonAuthOauthProviderErrors, DeleteNeonAuthOauthProviderResponses, DeleteNeonAuthUserData, DeleteNeonAuthUserErrors, DeleteNeonAuthUserResponses, DeleteOrganizationSpendingLimitData, DeleteOrganizationSpendingLimitErrors, DeleteOrganizationSpendingLimitResponses, DeleteOrganizationVpcEndpointData, DeleteOrganizationVpcEndpointErrors, DeleteOrganizationVpcEndpointResponses, DeleteProjectBranchBucketData, DeleteProjectBranchBucketErrors, DeleteProjectBranchBucketObjectData, DeleteProjectBranchBucketObjectErrors, DeleteProjectBranchBucketObjectResponses, DeleteProjectBranchBucketObjectsByPrefixData, DeleteProjectBranchBucketObjectsByPrefixErrors, DeleteProjectBranchBucketObjectsByPrefixResponses, DeleteProjectBranchBucketResponses, DeleteProjectBranchData, DeleteProjectBranchDataApiData, DeleteProjectBranchDataApiErrors, DeleteProjectBranchDataApiResponses, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseErrors, DeleteProjectBranchDatabaseResponses, DeleteProjectBranchErrors, DeleteProjectBranchFunctionData, DeleteProjectBranchFunctionErrors, DeleteProjectBranchFunctionResponses, DeleteProjectBranchResponses, DeleteProjectBranchRoleData, DeleteProjectBranchRoleErrors, DeleteProjectBranchRoleResponses, DeleteProjectData, DeleteProjectEndpointData, DeleteProjectEndpointErrors, DeleteProjectEndpointResponses, DeleteProjectErrors, DeleteProjectJwksData, DeleteProjectJwksErrors, DeleteProjectJwksResponses, DeleteProjectResponses, DeleteProjectVpcEndpointData, DeleteProjectVpcEndpointErrors, DeleteProjectVpcEndpointResponses, DeleteSnapshotData, DeleteSnapshotErrors, DeleteSnapshotResponses, DisableNeonAuthData, DisableNeonAuthErrors, DisableNeonAuthResponses, FinalizeRestoreBranchData, FinalizeRestoreBranchErrors, FinalizeRestoreBranchResponses, GetActiveRegionsData, GetActiveRegionsErrors, GetActiveRegionsResponses, GetAnonymizedBranchStatusData, GetAnonymizedBranchStatusErrors, GetAnonymizedBranchStatusResponses, GetAuthDetailsData, GetAuthDetailsErrors, GetAuthDetailsResponses, GetAvailablePreloadLibrariesData, GetAvailablePreloadLibrariesErrors, GetAvailablePreloadLibrariesResponses, GetConnectionUriData, GetConnectionUriErrors, GetConnectionUriResponses, GetConsumptionHistoryPerBranchV2Data, GetConsumptionHistoryPerBranchV2Errors, GetConsumptionHistoryPerBranchV2Responses, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectErrors, GetConsumptionHistoryPerProjectResponses, GetConsumptionHistoryPerProjectV2Data, GetConsumptionHistoryPerProjectV2Errors, GetConsumptionHistoryPerProjectV2Responses, GetCurrentUserInfoData, GetCurrentUserInfoErrors, GetCurrentUserInfoResponses, GetCurrentUserOrganizationsData, GetCurrentUserOrganizationsErrors, GetCurrentUserOrganizationsResponses, GetMaskingRulesData, GetMaskingRulesErrors, GetMaskingRulesResponses, GetNeonAuthAllowLocalhostData, GetNeonAuthAllowLocalhostErrors, GetNeonAuthAllowLocalhostResponses, GetNeonAuthData, GetNeonAuthEmailAndPasswordConfigData, GetNeonAuthEmailAndPasswordConfigErrors, GetNeonAuthEmailAndPasswordConfigResponses, GetNeonAuthEmailProviderData, GetNeonAuthEmailProviderErrors, GetNeonAuthEmailProviderResponses, GetNeonAuthEmailServerData, GetNeonAuthEmailServerErrors, GetNeonAuthEmailServerResponses, GetNeonAuthErrors, GetNeonAuthPhoneNumberPluginData, GetNeonAuthPhoneNumberPluginErrors, GetNeonAuthPhoneNumberPluginResponses, GetNeonAuthPluginConfigsData, GetNeonAuthPluginConfigsErrors, GetNeonAuthPluginConfigsResponses, GetNeonAuthResponses, GetNeonAuthWebhookConfigData, GetNeonAuthWebhookConfigErrors, GetNeonAuthWebhookConfigResponses, GetOrganizationData, GetOrganizationErrors, GetOrganizationInvitationsData, GetOrganizationInvitationsErrors, GetOrganizationInvitationsResponses, GetOrganizationMemberData, GetOrganizationMemberErrors, GetOrganizationMemberResponses, GetOrganizationMembersData, GetOrganizationMembersErrors, GetOrganizationMembersResponses, GetOrganizationResponses, GetOrganizationSpendingLimitData, GetOrganizationSpendingLimitErrors, GetOrganizationSpendingLimitResponses, GetOrganizationVpcEndpointDetailsData, GetOrganizationVpcEndpointDetailsErrors, GetOrganizationVpcEndpointDetailsResponses, GetProjectAdvisorSecurityIssuesData, GetProjectAdvisorSecurityIssuesErrors, GetProjectAdvisorSecurityIssuesResponses, GetProjectBranchAiGatewayData, GetProjectBranchAiGatewayErrors, GetProjectBranchAiGatewayResponses, GetProjectBranchBucketObjectData, GetProjectBranchBucketObjectErrors, GetProjectBranchBucketObjectResponses, GetProjectBranchData, GetProjectBranchDataApiData, GetProjectBranchDataApiErrors, GetProjectBranchDataApiResponses, GetProjectBranchDatabaseData, GetProjectBranchDatabaseErrors, GetProjectBranchDatabaseResponses, GetProjectBranchErrors, GetProjectBranchFunctionData, GetProjectBranchFunctionErrors, GetProjectBranchFunctionResponses, GetProjectBranchResponses, GetProjectBranchRoleData, GetProjectBranchRoleErrors, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordErrors, GetProjectBranchRolePasswordResponses, GetProjectBranchRoleResponses, GetProjectBranchSchemaComparisonData, GetProjectBranchSchemaComparisonErrors, GetProjectBranchSchemaComparisonResponses, GetProjectBranchSchemaData, GetProjectBranchSchemaErrors, GetProjectBranchSchemaResponses, GetProjectBranchStorageData, GetProjectBranchStorageErrors, GetProjectBranchStorageResponses, GetProjectData, GetProjectEndpointData, GetProjectEndpointErrors, GetProjectEndpointResponses, GetProjectErrors, GetProjectJwksData, GetProjectJwksErrors, GetProjectJwksResponses, GetProjectOperationData, GetProjectOperationErrors, GetProjectOperationResponses, GetProjectResponses, GetSnapshotScheduleData, GetSnapshotScheduleErrors, GetSnapshotScheduleResponses, GrantPermissionToProjectData, GrantPermissionToProjectErrors, GrantPermissionToProjectResponses, ListApiKeysData, ListApiKeysErrors, ListApiKeysResponses, ListBranchNeonAuthOauthProvidersData, ListBranchNeonAuthOauthProvidersErrors, ListBranchNeonAuthOauthProvidersResponses, ListBranchNeonAuthTrustedDomainsData, ListBranchNeonAuthTrustedDomainsErrors, ListBranchNeonAuthTrustedDomainsResponses, ListCredentialsData, ListCredentialsErrors, ListCredentialsResponses, ListNeonAuthIntegrationsData, ListNeonAuthIntegrationsErrors, ListNeonAuthIntegrationsResponses, ListNeonAuthOauthProvidersData, ListNeonAuthOauthProvidersErrors, ListNeonAuthOauthProvidersResponses, ListNeonAuthRedirectUriWhitelistDomainsData, ListNeonAuthRedirectUriWhitelistDomainsErrors, ListNeonAuthRedirectUriWhitelistDomainsResponses, ListOrganizationVpcEndpointsAllRegionsData, ListOrganizationVpcEndpointsAllRegionsErrors, ListOrganizationVpcEndpointsAllRegionsResponses, ListOrganizationVpcEndpointsData, ListOrganizationVpcEndpointsErrors, ListOrganizationVpcEndpointsResponses, ListOrgApiKeysData, ListOrgApiKeysErrors, ListOrgApiKeysResponses, ListProjectBranchBucketObjectsData, ListProjectBranchBucketObjectsErrors, ListProjectBranchBucketObjectsResponses, ListProjectBranchBucketsData, ListProjectBranchBucketsErrors, ListProjectBranchBucketsResponses, ListProjectBranchDatabasesData, ListProjectBranchDatabasesErrors, ListProjectBranchDatabasesResponses, ListProjectBranchEndpointsData, ListProjectBranchEndpointsErrors, ListProjectBranchEndpointsResponses, ListProjectBranchesData, ListProjectBranchesErrors, ListProjectBranchesResponses, ListProjectBranchFunctionsData, ListProjectBranchFunctionsErrors, ListProjectBranchFunctionsResponses, ListProjectBranchLogFieldsData, ListProjectBranchLogFieldsErrors, ListProjectBranchLogFieldsResponses, ListProjectBranchLogFieldValuesData, ListProjectBranchLogFieldValuesErrors, ListProjectBranchLogFieldValuesResponses, ListProjectBranchRolesData, ListProjectBranchRolesErrors, ListProjectBranchRolesResponses, ListProjectEndpointsData, ListProjectEndpointsErrors, ListProjectEndpointsResponses, ListProjectMembersData, ListProjectMembersErrors, ListProjectMembersResponses, ListProjectOperationsData, ListProjectOperationsErrors, ListProjectOperationsResponses, ListProjectPermissionsData, ListProjectPermissionsErrors, ListProjectPermissionsResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListProjectVpcEndpointsData, ListProjectVpcEndpointsErrors, ListProjectVpcEndpointsResponses, ListSharedProjectsData, ListSharedProjectsErrors, ListSharedProjectsResponses, ListSnapshotsData, ListSnapshotsErrors, ListSnapshotsResponses, PresignProjectBranchBucketObjectData, PresignProjectBranchBucketObjectErrors, PresignProjectBranchBucketObjectResponses, QueryProjectBranchLogsData, QueryProjectBranchLogsErrors, QueryProjectBranchLogsResponses, RecoverProjectData, RecoverProjectErrors, RecoverProjectResponses, RemoveOrganizationMemberData, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponses, RemoveProjectMemberRoleData, RemoveProjectMemberRoleErrors, RemoveProjectMemberRoleResponses, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordErrors, ResetProjectBranchRolePasswordResponses, RestartProjectEndpointData, RestartProjectEndpointErrors, RestartProjectEndpointResponses, RestoreProjectBranchData, RestoreProjectBranchErrors, RestoreProjectBranchResponses, RestoreSnapshotData, RestoreSnapshotErrors, RestoreSnapshotResponses, RevokeApiKeyData, RevokeApiKeyErrors, RevokeApiKeyResponses, RevokeCredentialData, RevokeCredentialErrors, RevokeCredentialResponses, RevokeOrgApiKeyData, RevokeOrgApiKeyErrors, RevokeOrgApiKeyResponses, RevokePermissionFromProjectData, RevokePermissionFromProjectErrors, RevokePermissionFromProjectResponses, SendNeonAuthTestEmailData, SendNeonAuthTestEmailErrors, SendNeonAuthTestEmailResponses, SetDefaultProjectBranchData, SetDefaultProjectBranchErrors, SetDefaultProjectBranchResponses, SetOrganizationSpendingLimitData, SetOrganizationSpendingLimitErrors, SetOrganizationSpendingLimitResponses, SetProjectMemberRoleData, SetProjectMemberRoleErrors, SetProjectMemberRoleResponses, SetSnapshotScheduleData, SetSnapshotScheduleErrors, SetSnapshotScheduleResponses, StartAnonymizationData, StartAnonymizationErrors, StartAnonymizationResponses, StartProjectEndpointData, StartProjectEndpointErrors, StartProjectEndpointResponses, SuspendProjectEndpointData, SuspendProjectEndpointErrors, SuspendProjectEndpointResponses, TransferNeonAuthProviderProjectData, TransferNeonAuthProviderProjectErrors, TransferNeonAuthProviderProjectResponses, TransferProjectsFromOrgToOrgData, TransferProjectsFromOrgToOrgErrors, TransferProjectsFromOrgToOrgResponses, TransferProjectsFromUserToOrgData, TransferProjectsFromUserToOrgErrors, TransferProjectsFromUserToOrgResponses, UpdateBranchNeonAuthOauthProviderData, UpdateBranchNeonAuthOauthProviderErrors, UpdateBranchNeonAuthOauthProviderResponses, UpdateMaskingRulesData, UpdateMaskingRulesErrors, UpdateMaskingRulesResponses, UpdateNeonAuthAllowLocalhostData, UpdateNeonAuthAllowLocalhostErrors, UpdateNeonAuthAllowLocalhostResponses, UpdateNeonAuthConfigData, UpdateNeonAuthConfigErrors, UpdateNeonAuthConfigResponses, UpdateNeonAuthEmailAndPasswordConfigData, UpdateNeonAuthEmailAndPasswordConfigErrors, UpdateNeonAuthEmailAndPasswordConfigResponses, UpdateNeonAuthEmailProviderData, UpdateNeonAuthEmailProviderErrors, UpdateNeonAuthEmailProviderResponses, UpdateNeonAuthEmailServerData, UpdateNeonAuthEmailServerErrors, UpdateNeonAuthEmailServerResponses, UpdateNeonAuthMagicLinkPluginData, UpdateNeonAuthMagicLinkPluginErrors, UpdateNeonAuthMagicLinkPluginResponses, UpdateNeonAuthOauthProviderData, UpdateNeonAuthOauthProviderErrors, UpdateNeonAuthOauthProviderResponses, UpdateNeonAuthOrganizationPluginData, UpdateNeonAuthOrganizationPluginErrors, UpdateNeonAuthOrganizationPluginResponses, UpdateNeonAuthPhoneNumberPluginData, UpdateNeonAuthPhoneNumberPluginErrors, UpdateNeonAuthPhoneNumberPluginResponses, UpdateNeonAuthUserRoleData, UpdateNeonAuthUserRoleErrors, UpdateNeonAuthUserRoleResponses, UpdateNeonAuthWebhookConfigData, UpdateNeonAuthWebhookConfigErrors, UpdateNeonAuthWebhookConfigResponses, UpdateOrganizationMemberData, UpdateOrganizationMemberErrors, UpdateOrganizationMemberResponses, UpdateProjectBranchData, UpdateProjectBranchDataApiData, UpdateProjectBranchDataApiErrors, UpdateProjectBranchDataApiResponses, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseErrors, UpdateProjectBranchDatabaseResponses, UpdateProjectBranchErrors, UpdateProjectBranchFunctionData, UpdateProjectBranchFunctionErrors, UpdateProjectBranchFunctionResponses, UpdateProjectBranchResponses, UpdateProjectData, UpdateProjectEndpointData, UpdateProjectEndpointErrors, UpdateProjectEndpointResponses, UpdateProjectErrors, UpdateProjectResponses, UpdateSnapshotData, UpdateSnapshotErrors, UpdateSnapshotResponses } from './types.gen.js'; export type Options = Options2 & { /** @@ -196,7 +196,7 @@ export const listProjects = (options?: Opt * 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 currently supports PostgreSQL 14, 15, 16, 17, and 18. + * 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/). * */ @@ -434,6 +434,88 @@ export const grantPermissionToProject = (o } }); +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).get({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/members', + ...options +}); + +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).delete({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/members/{member_id}/role', + ...options +}); + +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).put({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/members/{member_id}/role', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + /** * Revoke project access * @@ -744,7 +826,7 @@ export const createProjectBranchDataApi = /** * Create Neon Auth integration * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth` instead. Creates a project on a third-party authentication provider's platform for use with Neon Auth. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth` instead. Removal scheduled for March 1, 2026. * Use this endpoint if the frontend integration flow can't be used. * * @@ -861,7 +943,7 @@ export const createNeonAuth = (options: Op /** * Delete trusted redirect URI domain * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Deletes a domain from the redirect_uri whitelist for the specified project. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/domains` instead. Removal scheduled for March 1, 2026. * * * @deprecated @@ -891,7 +973,7 @@ export const deleteNeonAuthDomainFromRedirectUriWhitelist = (opt /** * Delete auth user * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}` instead. Deletes the auth user for the specified project. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}` instead. Removal scheduled for March 1, 2026. * * * @deprecated @@ -1228,7 +1310,7 @@ export const transferNeonAuthProviderProject = (o /** * List OAuth providers * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Lists the OAuth providers for the specified project. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Removal scheduled for March 1, 2026. * * * @deprecated @@ -1279,8 +1361,7 @@ export const listNeonAuthOauthProviders = /** * Add an OAuth provider * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. - * Adds an OAuth provider to the specified project. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/oauth_providers` instead. Removal scheduled for March 1, 2026. * * * @deprecated @@ -1363,7 +1444,7 @@ export const addBranchNeonAuthOauthProvider = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -1443,7 +1524,7 @@ export const deleteBranchNeonAuthOauthProvider = (options: Options): RequestResult => (options.client ?? client).patch({ @@ -1471,7 +1552,7 @@ export const updateBranchNeonAuthOauthProvider = (opt /** * Update email server configuration * - * DEPRECATED, use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Updates the email server configuration for the specified project. + * Deprecated. Use `/projects/{project_id}/branches/{branch_id}/auth/email_provider` instead. Removal scheduled for March 1, 2026. * * * @deprecated @@ -1665,7 +1746,7 @@ export const updateNeonAuthEmailProvider = (optio /** * Retrieve database schema * - * Retrieves the schema from the specified database. The `lsn` and `timestamp` values cannot be specified at the same time. If both are omitted, the database schema is retrieved from database's head. + * 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 = (options: Options): RequestResult => (options.client ?? client).get({ security: [ @@ -2424,36 +2505,6 @@ export const setDefaultProjectBranch = (op ...options }); -/** - * Recover a deleted branch - * - * Recovers a deleted branch within the 7-day deletion recovery period. - * The branch must have been soft deleted and not yet permanently deleted. - * Recovery restores the branch and its endpoints to an idle state. - * Connection strings remain valid after recovery. - * TTL branches become non-TTL branches after recovery. - * - * To list deleted branches available for recovery, use `GET /projects/{project_id}/branches?include_deleted=true`. - * - */ -export const recoverProjectBranch = (options: Options): RequestResult => (options.client ?? client).post({ - security: [ - { scheme: 'bearer', type: 'http' }, - { - in: 'cookie', - name: 'zenith', - type: 'apiKey' - }, - { - in: 'cookie', - name: 'keycloak_token', - type: 'apiKey' - } - ], - url: '/projects/{project_id}/branches/{branch_id}/recover', - ...options -}); - /** * Finalize branch restore from snapshot * @@ -2466,8 +2517,6 @@ export const recoverProjectBranch = (optio * * This operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`. * - * **Note**: This endpoint is currently in Beta. - * */ export const finalizeRestoreBranch = (options: Options): RequestResult => (options.client ?? client).post({ security: [ @@ -3821,7 +3870,7 @@ export const getCurrentUserOrganizations = (options?: O * Creates a snapshot from the specified branch. * This operation may initiate an asynchronous process. * - * **Note**: This endpoint is currently in Beta. - * */ export const createSnapshot = (options: Options): RequestResult => (options.client ?? client).post({ security: [ @@ -3907,8 +3954,6 @@ export const createSnapshot = (options: Op * Lists the snapshots for the specified project. * Each snapshot represents a point-in-time backup of the project data. * - * **Note**: This endpoint is currently in Beta. - * */ export const listSnapshots = (options: Options): RequestResult => (options.client ?? client).get({ security: [ @@ -3933,8 +3978,6 @@ export const listSnapshots = (options: Opt * * Deletes the specified snapshot. * - * **Note**: This endpoint is currently in Beta. - * */ export const deleteSnapshot = (options: Options): RequestResult => (options.client ?? client).delete({ security: [ @@ -3959,8 +4002,6 @@ export const deleteSnapshot = (options: Op * * Updates the specified snapshot. * - * **Note**: This endpoint is currently in Beta. - * */ export const updateSnapshot = (options: Options): RequestResult => (options.client ?? client).patch({ security: [ @@ -3990,8 +4031,6 @@ export const updateSnapshot = (options: Op * Restores the specified snapshot to a new branch, * and optionally finalizes the restore operation to replace the original branch. * - * **Note**: This endpoint is currently in Beta. - * */ export const restoreSnapshot = (options: Options): RequestResult => (options.client ?? client).post({ security: [ @@ -4020,8 +4059,6 @@ export const restoreSnapshot = (options: O * * Returns the backup schedule for the specified branch, including the configured snapshot frequencies. * - * **Note**: This endpoint is currently in Beta. - * */ export const getSnapshotSchedule = (options: Options): RequestResult => (options.client ?? client).get({ security: [ @@ -4045,9 +4082,7 @@ export const getSnapshotSchedule = (option * Update backup schedule * * Updates the backup schedule for the specified branch. - * The schedule defines how often automatic snapshots are created (e.g., `daily`, `weekly`). - * - * **Note**: This endpoint is currently in Beta. + * The schedule defines how often automatic snapshots are created (for example, `daily` or `weekly`). Requires a paid plan. * */ export const setSnapshotSchedule = (options: Options): RequestResult => (options.client ?? client).put({ @@ -4075,10 +4110,10 @@ export const setSnapshotSchedule = (option /** * List buckets on the branch * - * Lists branchable object-storage buckets visible on the specified branch, + * Lists branchable object storage buckets visible on the specified branch, * including those inherited from ancestor branches. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const listProjectBranchBuckets = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4102,10 +4137,10 @@ export const listProjectBranchBuckets = (o /** * 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-storage service. + * 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 Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const createProjectBranchBucket = (options: Options): RequestResult => (options.client ?? client).post({ @@ -4135,7 +4170,7 @@ export const createProjectBranchBucket = ( * * Deletes the named bucket from the specified branch. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const deleteProjectBranchBucket = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -4157,14 +4192,14 @@ export const deleteProjectBranchBucket = ( }); /** - * Get branch storage state + * 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 storage + * 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 storage is unavailable. + * response includes a `reason` field indicating why object storage is unavailable. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const getProjectBranchStorage = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4193,7 +4228,7 @@ export const getProjectBranchStorage = (op * 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 Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const getProjectBranchAiGateway = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4214,6 +4249,123 @@ export const getProjectBranchAiGateway = ( ...options }); +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).post({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/branches/{branch_id}/logs/query', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).get({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/branches/{branch_id}/logs/fields', + ...options +}); + +/** + * 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 = (options: Options): RequestResult => (options.client ?? client).get({ + security: [ + { scheme: 'bearer', type: 'http' }, + { + in: 'cookie', + name: 'zenith', + type: 'apiKey' + }, + { + in: 'cookie', + name: 'keycloak_token', + type: 'apiKey' + } + ], + url: '/projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values', + ...options +}); + /** * List objects in a bucket * @@ -4226,7 +4378,7 @@ export const getProjectBranchAiGateway = ( * browser; keys that do not contain the delimiter after `prefix` are * returned as `objects`. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const listProjectBranchBucketObjects = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4253,7 +4405,7 @@ export const listProjectBranchBucketObjects = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -4287,12 +4439,12 @@ export const deleteProjectBranchBucketObject = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4332,7 +4484,7 @@ export const getProjectBranchBucketObject = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -4372,7 +4524,7 @@ export const deleteProjectBranchBucketObjectsByPrefix = (options: Options): RequestResult => (options.client ?? client).post({ @@ -4403,7 +4555,7 @@ export const presignProjectBranchBucketObject = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4431,7 +4583,7 @@ export const listCredentials = (options: O * 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 Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const createCredential = (options: Options): RequestResult => (options.client ?? client).post({ @@ -4461,7 +4613,7 @@ export const createCredential = (options: * * Soft-deletes the credential. Idempotent. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const revokeCredential = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -4487,7 +4639,7 @@ export const revokeCredential = (options: * * Lists functions on the specified branch. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const listProjectBranchFunctions = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4513,7 +4665,7 @@ export const listProjectBranchFunctions = * * Deletes the function identified by its slug. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const deleteProjectBranchFunction = (options: Options): RequestResult => (options.client ?? client).delete({ @@ -4539,7 +4691,7 @@ export const deleteProjectBranchFunction = (options: Options): RequestResult => (options.client ?? client).get({ @@ -4573,7 +4725,7 @@ export const getProjectBranchFunction = (o * branch: a branch forked before the rename keeps the name it had at * fork time. * - * **Note**: This endpoint is currently in Private Beta. + * **Note**: This endpoint is currently in Beta. * */ export const updateProjectBranchFunction = (options: Options): RequestResult => (options.client ?? client).patch({ @@ -4607,7 +4759,7 @@ export const updateProjectBranchFunction = (options: Options): RequestResult => (options.client ?? client).post({ diff --git a/packages/sdk/src/client/types.gen.ts b/packages/sdk/src/client/types.gen.ts index a990e58e..41baf056 100644 --- a/packages/sdk/src/client/types.gen.ts +++ b/packages/sdk/src/client/types.gen.ts @@ -6,18 +6,6 @@ export type ClientOptions = { export type ComputeUnit = number; -/** - * The Neon compute provisioner. - * Specify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling. - * - * Provisioner can be one of the following values: - * * k8s-pod - * * k8s-neonvm - * * serverless-platform - * - * Clients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too. - * - */ export type Provisioner = string; export type PaginationResponse = { @@ -25,12 +13,12 @@ export type PaginationResponse = { }; /** - * Cursor based pagination is used. The user must pass the cursor as is to the backend. - * For more information about cursor based pagination, see - * https://learn.microsoft.com/en-us/ef/core/querying/pagination#keyset-pagination - * + * Cursor-based pagination. The `cursor` value reflects the endpoint's sort field (for example, an ID or timestamp), so pass it back unchanged. */ export type Pagination = { + /** + * Cursor marking the last item in this response. Pass it unchanged as the `cursor` query parameter to fetch the next page. + */ cursor: string; }; @@ -42,6 +30,9 @@ export type EmptyResponse = { }; export type PlanDetails = { + /** + * Plan name, for example `free`, `launch`, or `scale`. + */ name: string; version?: PlanVersion; }; @@ -56,7 +47,7 @@ export type PlanVersion = { */ export type AddProjectJwksRequest = { /** - * The URL that lists the JWKS + * URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** @@ -64,40 +55,40 @@ export type AddProjectJwksRequest = { */ provider_name: string; /** - * Branch ID + * The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id?: string; /** - * The name of the required JWT Audience to be used + * 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. This field should only be used when using Neon RLS. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated` and `anonymous` roles. + * Deprecated. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated`, and `anonymous` roles. * * @deprecated */ role_names?: Array; /** - * DEPRECATED. This field should only be used when using Neon RLS. If true, the role creation will be skipped. + * Deprecated. Only used with Neon RLS. If true, role creation is skipped. */ skip_role_creation?: boolean; }; export type Jwks = { /** - * JWKS ID + * The JWKS configuration's ID. */ id: string; /** - * Project ID + * The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; /** - * Branch ID + * The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`. */ branch_id?: string; /** - * The URL that lists the JWKS + * URL of the provider's JWKS endpoint used to verify JWTs. */ jwks_url: string; /** @@ -113,9 +104,12 @@ export type Jwks = { */ updated_at: string; /** - * The name of the required JWT Audience to be used + * 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?: Array; }; @@ -123,6 +117,9 @@ export type Jwks = { * The list of configured JWKS definitions for a project */ export type ProjectJwksResponse = { + /** + * JWKS configurations associated with the project. + */ jwks: Array; }; @@ -192,7 +189,7 @@ export type OrgApiKeyCreateRequest = ApiKeyCreateRequest & { export type ApiKeyCreateResponse = { /** - * The API key ID + * The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** @@ -222,7 +219,7 @@ export type OrgApiKeyCreateResponse = ApiKeyCreateResponse & { export type ApiKeyRevokeResponse = { /** - * The API key ID + * The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** @@ -260,7 +257,7 @@ export type OrgApiKeyRevokeResponse = ApiKeyRevokeResponse & { export type ApiKeysListResponseItem = { /** - * The API key ID + * The API key's unique numeric ID. Distinct from the API key token (`key`). */ id: number; /** @@ -298,7 +295,7 @@ export type ApiKeyCreatorData = { */ id: string; /** - * The name of the user. + * Display name of the user who created the API key. */ name: string; /** @@ -307,27 +304,30 @@ export type ApiKeyCreatorData = { image: 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 type Operation = { /** * The operation ID */ id: string; /** - * The Neon project ID + * The ID of the project this operation ran on. */ project_id: string; /** - * The branch ID + * The ID of the branch this operation ran on. */ branch_id?: string; /** - * The endpoint ID + * The ID of the compute endpoint this operation ran on. */ endpoint_id?: string; action: OperationAction; status: OperationStatus; /** - * The error that occurred + * Human-readable message describing why the operation failed. */ error?: string; /** @@ -366,17 +366,17 @@ export type OperationsResponse = { 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'; /** - * The status of the operation + * 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'; /** - * Essential data about the project. Full data is available at the getProject endpoint. + * Essential data about the project. Full data is available at `GET /projects/{project_id}`. * */ export type ProjectListItem = { /** - * The project ID + * The Neon project ID. Use as the `project_id` path parameter in other endpoints. */ id: string; /** @@ -385,7 +385,7 @@ export type ProjectListItem = { */ platform_id: string; /** - * The region identifier + * 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; @@ -424,7 +424,7 @@ export type ProjectListItem = { */ active_time: number; /** - * DEPRECATED. Use data from the getProject endpoint instead. + * Deprecated. Use `compute_time_seconds` from `GET /projects/{project_id}` instead. * * * @deprecated @@ -451,18 +451,20 @@ export type ProjectListItem = { */ updated_at: string; /** - * The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project. + * 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 the getProject endpoint instead. - * A timestamp indicating when the project quota resets + * Deprecated. Use `consumption_period_end` from `GET /projects/{project_id}` instead. A timestamp indicating when the project quota resets. * * * @deprecated */ 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. @@ -472,14 +474,12 @@ export type ProjectListItem = { */ compute_last_active_at?: string; /** - * Organization id if the project belongs to an organization. - * Permissions for the project will be given to organization members as defined by the organization admins. - * The permissions of the project do not depend on the user that created the project if a project belongs to an organization. + * 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; /** - * Organization name if the project belongs to an organization. + * Name of the organization that owns the project. * */ org_name?: string; @@ -505,7 +505,7 @@ export type ProjectListItem = { export type Project = { /** - * Bytes-Hour. Project consumed that much storage hourly during the billing period. The value has some lag. + * 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. * */ @@ -517,7 +517,7 @@ export type Project = { */ data_transfer_bytes: number; /** - * Bytes. Amount of WAL that travelled through storage for given project across all branches. + * 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. * */ @@ -539,14 +539,14 @@ export type Project = { */ active_time_seconds: number; /** - * DEPRECATED, use compute_time instead. + * Deprecated. Use `compute_time_seconds` instead. * * * @deprecated */ cpu_used_sec: number; /** - * The project ID + * The Neon project ID. Use as the `project_id` path parameter in other endpoints. */ id: string; /** @@ -555,7 +555,7 @@ export type Project = { */ platform_id: string; /** - * The region identifier + * 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; @@ -614,7 +614,7 @@ export type Project = { */ updated_at: string; /** - * The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project. + * 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; @@ -629,13 +629,15 @@ export type Project = { */ consumption_period_end: string; /** - * DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead. - * A timestamp indicating when the project quota resets. + * Deprecated. Use the `consumption_period_end` field instead. A timestamp indicating when the project quota resets. * * * @deprecated */ quota_reset_at?: string; + /** + * ID of the organization that owns the project. + */ owner_id: string; owner?: ProjectOwnerData; /** @@ -645,6 +647,9 @@ export type 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. @@ -659,12 +664,18 @@ export type Project = { }; export type ProjectCreateRequest = { + /** + * Configuration for the new project, including name, region, and Postgres compute and storage settings. + */ project: { 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?: { /** * The default branch name. If not specified, the default branch name, `main`, will be used. @@ -699,14 +710,12 @@ export type ProjectCreateRequest = { */ store_passwords?: boolean; /** - * The number of seconds to retain the shared history for all branches in this project. - * The default is 1 day (86400 seconds). + * 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; /** - * Organization id in case the project created belongs to an organization. - * If not present, project is owned by a user and not by org. + * 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; @@ -722,8 +731,7 @@ export type ProjectUpdateRequest = { name?: string; default_endpoint_settings?: DefaultEndpointSettings; /** - * The number of seconds to retain the shared history for all branches in this project. - * The default is 1 day (604800 seconds). + * 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; @@ -750,6 +758,9 @@ export type ProjectTransferRequestResponse = { }; export type AcceptProjectTransferRequestSatisfiesPlanError = { + /** + * List of reasons why the target account's plan cannot satisfy the transfer requirements. Each item contains a `code` identifying the constraint and a `message` with a human-readable explanation. + */ reasons: Array<{ /** * Description of why the plan is not satisfied @@ -787,6 +798,9 @@ export type ProjectSettingsData = { */ block_vpc_connections?: boolean; audit_log_level?: ProjectAuditLogLevel; + /** + * Enables HIPAA compliance mode for the project, including audit logging. + */ hipaa?: boolean; preload_libraries?: PreloadLibraries; }; @@ -798,6 +812,9 @@ export type ProjectResponse = { export type ProjectRecoverResponse = ProjectResponse & BranchesResponse; export type ProjectsResponse = { + /** + * List of projects accessible to the caller. Projects that exist but could not be retrieved are identified in `unavailable_project_ids`. + */ projects: Array; /** * A list of project IDs indicating which projects are known to exist, but whose details could not @@ -808,9 +825,21 @@ export type ProjectsResponse = { }; export type 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; }; @@ -819,9 +848,19 @@ export type ProjectPermissions = { }; export type GrantPermissionToProjectRequest = { + /** + * Email address of the user to grant project access to. + */ email: string; }; +/** + * Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`, + * and `admin` maps to `ADMIN`. + * + */ +export type ProjectRole = 'viewer' | 'editor' | 'admin'; + /** * The caller's effective permission for a project when * per-project permissions are enabled. `VIEWER` grants read access, @@ -832,43 +871,136 @@ export type GrantPermissionToProjectRequest = { */ export type ProjectPermissionLevel = 'VIEWER' | 'EDITOR' | 'ADMIN'; +/** + * How a member's project access is granted. + * + */ +export type ProjectMemberGrantSource = 'explicit' | 'org_role_default' | 'org_admin_override' | 'unassigned'; + +/** + * Organization-level role used by project member role management. + * + */ +export type ProjectMemberOrgRole = 'admin' | 'member' | 'editor' | 'viewer' | 'collaborator'; + +export type 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 type ProjectMembers = { + project_members: Array; + pagination?: CursorPagination; +}; + +export type SetProjectMemberRoleRequest = { + role: ProjectRole; +}; + +export type 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; + 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 type ConsumptionHistoryPerProjectResponse = { + /** + * Per-project consumption history records included in the response. + */ projects: Array; }; export type ConsumptionHistoryPerProjectV2Response = { + /** + * Per-project consumption history entries for the requested time range. + */ projects: Array; }; export type ConsumptionHistoryPerProject = { /** - * The project ID + * 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: Array; }; export type ConsumptionHistoryPerProjectV2 = { /** - * The project ID + * The Neon project ID. Returned as `id` from `GET /projects`. */ project_id: string; + /** + * Consumption periods recorded for this project. + */ periods: Array; }; export type ConsumptionHistoryPerBranchV2Response = { + /** + * Per-branch consumption history records returned for the requested time range. + */ branches: Array; }; export type ConsumptionHistoryPerBranchV2 = { /** - * The project that owns the branch + * The ID of the project that owns this branch. */ project_id: string; /** - * The branch ID + * 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: Array; }; @@ -891,6 +1023,9 @@ export type ConsumptionHistoryPerPeriod = { * */ period_end?: string; + /** + * Consumption metric records for the billing period. + */ consumption: Array; }; @@ -913,6 +1048,9 @@ export type ConsumptionHistoryPerPeriodV2 = { * */ period_end?: string; + /** + * Consumption metric records for the billing period. + */ consumption: Array; }; @@ -943,12 +1081,12 @@ export type ConsumptionHistoryPerTimeframe = { */ written_data_bytes: number; /** - * Bytes. The space occupied in storage. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches. + * 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 storage consumed hourly. + * Bytes-Hour. The amount of Postgres storage consumed hourly. * */ data_storage_bytes_hour?: number; @@ -975,11 +1113,20 @@ export type ConsumptionHistoryPerTimeframeV2 = { * */ timeframe_end?: string; + /** + * Consumption metric values recorded for the timeframe. + */ metrics?: Array; }; export type 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; }; @@ -990,14 +1137,32 @@ export type ConsumptionHistoryQueryMetrics = Array; export type ProjectAuditLogLevel = 'base' | 'extended' | 'full'; export type 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 type AvailablePreloadLibraries = { + /** + * Preload libraries available for the project's Postgres version. Each entry includes `library_name`, `description`, `is_default`, `is_experimental`, and `version`. + */ libraries?: Array; }; @@ -1008,8 +1173,7 @@ export type Branch = { */ id: string; /** - * The ID of the project to which the branch belongs - * + * The ID of the project this branch belongs to. */ project_id: string; /** @@ -1055,8 +1219,7 @@ export type Branch = { */ creation_source: string; /** - * DEPRECATED. Use `default` field. - * Whether the branch is the project's primary branch + * Deprecated. Use the `default` field. Whether the branch is the project's primary branch. * * * @deprecated @@ -1068,24 +1231,32 @@ export type Branch = { */ default: boolean; /** - * Whether the branch is protected + * Whether the branch is protected. Protected branches (and their computes) cannot be deleted, archived, or reset, and block deletion of the project. * */ protected: boolean; /** - * 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. - * Examples: - * 1. A branch that uses 1 CPU for 1 second is equal to `cpu_used_sec=1`. - * 2. A branch that uses 2 CPUs simultaneously for 1 second is equal to `cpu_used_sec=2`. + * 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. * * * @deprecated */ 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 @@ -1122,7 +1293,7 @@ export type Branch = { */ created_by?: { /** - * The name of the user. + * Display name of the user who created the branch. */ name?: string; /** @@ -1131,9 +1302,7 @@ export type Branch = { image?: string; }; /** - * The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default). - * * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch. - * * `parent-data` - creates the branch with both schema and data from the parent. + * 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; @@ -1161,7 +1330,7 @@ export type Branch = { * * 'init' - the branch is being created but is not available for querying. * * 'resetting' - the branch is being reset to a specific point in time or LSN and is not yet available for querying. * * 'ready' - the branch is fully operational and ready for querying. Expect normal query response times. - * * 'archived' - the branch is stored in cost-effective archival storage. Expect slow query response times. + * * 'archived' - the branch is stored in cost-effective archival Postgres storage. Expect slow query response times. * */ export type BranchState = string; @@ -1180,7 +1349,7 @@ export type BranchRestoreStatus = string; */ export type BranchRestrictedAction = { /** - * The name of a restricted action. Possible values include `restore`, `delete-rw-endpoint`. + * 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; @@ -1241,7 +1410,13 @@ export type BranchAnonymizedCreateRequest = AnnotationCreateValueRequest & { }; export type 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?: Array; + /** + * 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?: { /** * The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's default branch. @@ -1259,26 +1434,22 @@ export type BranchCreateRequest = { */ 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. - * The timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`. + * 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 + * 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 as archived + * Whether to create the branch in the archived state. When omitted, the branch is created as a normal (non-archived) branch. * */ archived?: boolean; /** - * The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default). - * * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch. - * * `parent-data` - creates the branch with both schema and data from the parent. - * + * 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; /** @@ -1292,8 +1463,18 @@ export type BranchCreateRequest = { }; export type BranchUpdateRequest = { + /** + * Branch attributes to update. Supply only the fields you want to change, for example `name` or `protected`. + */ branch: { + /** + * 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. @@ -1314,19 +1495,18 @@ export type BranchRestoreRequest = { */ source_branch_id: string; /** - * A Log Sequence Number (LSN) on the source branch. The branch will be restored with data from this LSN. + * 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 timestamp identifying a point in time on the source branch. The branch will be restored with data starting from this point in time. - * The timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`. + * 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; /** - * If not empty, the previous state of the branch will be saved to a branch with this name. - * If the branch has children or the `source_branch_id` is equal to the branch id, this field is required. All existing child branches will be moved to the newly created branch under the name `preserve_under_name`. + * 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; @@ -1337,19 +1517,31 @@ export type BranchResponse = { }; export type BranchSchemaResponse = { + /** + * Branch schema expressed as SQL DDL statements. + */ sql?: string; json?: BranchSchemaJson; }; export type BranchSchemaCompareResponse = { + /** + * Unified diff of the SQL schema changes between the compared branches. + */ diff?: string; }; export type BranchesResponse = { + /** + * Branches in the project. Each includes `id`, `name`, `current_state`, and `created_at`. + */ branches: Array; }; export type BranchesCountResponse = { + /** + * Total number of branches in the project. + */ count: number; }; @@ -1407,17 +1599,15 @@ export type MaskingRulesUpdateRequest = { export type AnonymizedBranchStatusResponse = { /** - * The ID of the project - * + * The ID of the project this branch belongs to. */ project_id: string; /** - * The ID of the anonymized branch - * + * The ID of the anonymized branch. */ branch_id: string; /** - * The current state of the anonymized branch. Possible values: created, initialized, initialization_error, anonymizing, anonymized, error + * 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; @@ -1478,27 +1668,27 @@ export type AnonymizationRunMetadata = { export type ConnectionParameters = { /** - * Database name + * Name of the Postgres database used in the connection URI. * */ database: string; /** - * Password for the role + * Authentication password for the role, used in the connection URI. * */ password: string; /** - * Role name + * Postgres role used to authenticate the database connection. * */ role: string; /** - * Hostname + * Hostname of the compute endpoint. Use `pooler_host` for the pooled connection hostname. * */ host: string; /** - * Pooler hostname + * 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; @@ -1540,19 +1730,17 @@ export type Endpoint = { */ name?: string; /** - * The ID of the project to which the compute endpoint belongs - * + * The ID of the project this compute endpoint belongs to. */ project_id: string; /** - * The ID of the branch that the compute endpoint is associated with - * + * The ID of the branch this compute endpoint belongs to. */ branch_id: string; autoscaling_limit_min_cu: ComputeUnit; autoscaling_limit_max_cu: ComputeUnit; /** - * The region identifier + * 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; @@ -1561,9 +1749,7 @@ export type Endpoint = { pending_state?: EndpointState; settings: EndpointSettingsData; /** - * DEPRECATED. Whether to enable connection pooling for the compute endpoint. - * The recommended way to enable connection pooling is to 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) + * Deprecated. To use connection pooling, append `-pooler` to the endpoint ID in the connection string. * * * @deprecated @@ -1614,7 +1800,7 @@ export type Endpoint = { */ suspended_at?: string; /** - * DEPRECATED. Use the "host" property instead. + * Deprecated. Use the `host` property instead. * */ proxy_host: string; @@ -1628,19 +1814,17 @@ export type Endpoint = { }; /** - * The state of the compute endpoint - * + * 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'; /** - * The compute endpoint type. Either `read_write` or `read_only`. - * + * 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'; /** - * DEPRECATED. The connection pooler mode. Neon supports PgBouncer in `transaction` mode only. This schema is deprecated and will be removed after 2026-06-20. + * Deprecated. The connection pooler mode. Neon supports PgBouncer in `transaction` mode only. Removal scheduled for June 20, 2026. * * * @deprecated @@ -1705,11 +1889,20 @@ export type MaintenanceWindow = { * */ export type 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?: Array; }; export type EndpointCreateRequest = { + /** + * Configuration for the compute endpoint to create. + */ endpoint: { /** * The ID of the branch the compute endpoint will be associated with @@ -1727,8 +1920,7 @@ export type EndpointCreateRequest = { autoscaling_limit_max_cu?: ComputeUnit; provisioner?: Provisioner; /** - * DEPRECATED. Whether to enable connection pooling for the compute endpoint. - * The recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection 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) * * @@ -1760,10 +1952,12 @@ export type EndpointCreateRequest = { }; export type EndpointUpdateRequest = { + /** + * Parameters for the compute endpoint update. + */ endpoint: { /** - * DEPRECATED: This field will be removed in a future release. - * The destination branch ID. The destination branch must not have an existing read-write endpoint. + * Deprecated. The destination branch ID; must not have an existing read-write endpoint. * * * @deprecated @@ -1774,8 +1968,7 @@ export type EndpointUpdateRequest = { provisioner?: Provisioner; settings?: EndpointSettingsData; /** - * DEPRECATED. Whether to enable connection pooling for the compute endpoint. - * The recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection 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) * * @@ -1811,24 +2004,36 @@ export type EndpointResponse = { }; export type ConnectionUrisResponse = { + /** + * Connection URIs for the project. Each entry contains credentials and should be treated as sensitive. + */ connection_uris: Array; }; export type ConnectionUrisOptionalResponse = { + /** + * Connection URIs for the compute endpoint, including credentials. + */ connection_uris?: Array; }; export type VpcEndpointsResponse = { + /** + * List of VPC endpoints returned by the request. + */ endpoints: Array; }; export type VpcEndpointsWithRegionResponse = { + /** + * VPC endpoints associated with the region. + */ endpoints: Array; }; export type VpcEndpoint = { /** - * The VPC endpoint ID + * Cloud provider identifier for the VPC endpoint. */ vpc_endpoint_id: string; /** @@ -1846,7 +2051,7 @@ export type VpcEndpointWithRegion = VpcEndpoint & { export type VpcEndpointDetails = { /** - * The VPC endpoint ID + * Cloud provider identifier for the VPC endpoint. */ vpc_endpoint_id: string; /** @@ -1854,9 +2059,7 @@ export type VpcEndpointDetails = { */ label: string; /** - * The current state of the VPC endpoint. Possible values are - * `new` (just configured, pending acceptance) or `accepted` - * (VPC connection was accepted by Neon). + * 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; @@ -1874,25 +2077,33 @@ export type VpcEndpointDetails = { }; export type VpcEndpointAssignment = { + /** + * Human-readable name for the VPC endpoint assignment, used to identify it within the organization. + */ label: string; }; export type EndpointsResponse = { + /** + * Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`. + */ endpoints: Array; }; export type EndpointsOptionalResponse = { + /** + * Compute endpoints associated with the project. + */ endpoints?: Array; }; export type Role = { /** - * The ID of the branch to which the role belongs - * + * The ID of the branch this role belongs to. */ branch_id: string; /** - * The role name + * Postgres role name within the branch. * */ name: string; @@ -1907,7 +2118,7 @@ export type Role = { */ protected?: boolean; /** - * Authentication method configured for this role. Valid options: `password`, `oauth`, `no_login` + * Authentication method configured for this role: `password`, `oauth`, or `no_login`. * */ authentication_method?: string; @@ -1924,6 +2135,9 @@ export type Role = { }; export type RoleCreateRequest = { + /** + * Properties of the role to create. + */ role: { /** * The role name. Cannot exceed 63 bytes in length. @@ -1947,6 +2161,10 @@ export type JwksResponse = { }; export type RolesResponse = { + /** + * Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`. + * + */ roles: Array; }; @@ -1965,7 +2183,7 @@ export type PaymentSourceBankCard = { */ last4: string; /** - * Brand of credit card. + * Card network reported by the payment processor. Set to `unknown` when the network cannot be determined. * */ brand?: 'amex' | 'diners' | 'discover' | 'jcb' | 'mastercard' | 'unionpay' | 'unknown' | 'visa'; @@ -1996,7 +2214,7 @@ export type BillingAccount = { subscription_type: BillingSubscriptionType; payment_method: BillingPaymentMethod; /** - * The last time the quota was reset. Defaults to the date-time the account is created. + * Timestamp of the last quota reset. Set to the account creation time when the account is first created. * */ quota_reset_at_last: string; @@ -2118,8 +2336,7 @@ export type Database = { */ id: number; /** - * The ID of the branch to which the database belongs - * + * The ID of the branch this database belongs to. */ branch_id: string; /** @@ -2145,9 +2362,12 @@ export type Database = { }; export type DatabaseCreateRequest = { + /** + * Configuration for the new Postgres database. + */ database: { /** - * The name of the database + * Name of the database to create. * */ name: string; @@ -2160,9 +2380,12 @@ export type DatabaseCreateRequest = { }; export type DatabaseUpdateRequest = { + /** + * Properties to update on the database. + */ database: { /** - * The name of the database + * Name of the database to update. * */ name?: string; @@ -2179,10 +2402,16 @@ export type DatabaseResponse = { }; export type DatabasesResponse = { + /** + * Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`. + */ databases: Array; }; export type Invitation = { + /** + * The invitation ID. + */ id: string; /** * Email of the invited user @@ -2204,21 +2433,34 @@ export type Invitation = { }; /** - * The role of the organization member. Some role values may not be - * available for all organizations. - * + * 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 type 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 type MemberUserInfo = { + /** + * Email address of the organization member's user account. + */ email: string; /** * Whether the member has MFA (TOTP) enabled @@ -2239,9 +2481,21 @@ export type MemberWithUser = { }; export type 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 @@ -2270,19 +2524,31 @@ export type Organization = { }; export type OrganizationsResponse = { + /** + * Organizations returned by the request. Each includes `id`, `name`, `handle`, and `plan`. + */ organizations: Array; }; export type OrganizationInvitationsResponse = { + /** + * List of pending invitations for the organization. + */ invitations: Array; }; export type OrganizationInviteCreateRequest = { + /** + * Email address of the person to invite to the organization. + */ email: string; role: MemberRole; }; export type OrganizationInvitesCreateRequest = { + /** + * Invitations to create for the organization. + */ invitations: Array; }; @@ -2291,6 +2557,9 @@ export type OrganizationMemberUpdateRequest = { }; export type OrganizationMembersResponse = { + /** + * Members of the organization, each combining membership details (role, status) with the associated user's identity. + */ members: Array; }; @@ -2303,7 +2572,7 @@ export type ActiveRegionsResponse = { export type RegionResponse = { /** - * The region ID as used in other API endpoints + * 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; /** @@ -2311,7 +2580,7 @@ export type RegionResponse = { */ name: string; /** - * Whether this region is used by default in new projects. + * True if this region is selected by default when no region is specified during project creation. */ default: boolean; /** @@ -2325,15 +2594,24 @@ export type RegionResponse = { }; export type 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 `email` field. + * Deprecated. Use the `email` field. * * * @deprecated */ login: string; + /** + * Display name of the account as provided by the identity provider. + */ name: string; provider: IdentityProviderId; }; @@ -2345,20 +2623,44 @@ export type CurrentUserInfoResponse = { */ active_seconds_limit: number; billing_account?: BillingAccount; + /** + * Authentication provider accounts linked to the current user. + */ auth_accounts: Array; + /** + * 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 `email` field. + * Deprecated. Use the `email` field. * * * @deprecated */ 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. @@ -2366,12 +2668,30 @@ export type CurrentUserInfoResponse = { * */ 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 type 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: 'keycloak' | 'session_cookie' | 'api_key_user' | 'api_key_org' | 'oauth'; auth_data?: string; }; @@ -2472,7 +2792,7 @@ export type PgSettingsData = { }; /** - * DEPRECATED. A raw representation of PgBouncer settings. This schema is deprecated and will be removed after 2026-06-20. + * Deprecated. A raw representation of PgBouncer settings. Removal scheduled for June 20, 2026. * * * @deprecated @@ -2482,18 +2802,30 @@ export type PgbouncerSettingsData = { }; /** - * The major Postgres version number. Generally available versions are `14`, `15`, `16`, `17`, and `18`. `19` is being rolled out and is only accepted in regions where it has been enabled; requesting it in a region where it is not yet available returns an error. + * The major Postgres version number. Supported versions are `14`, `15`, `16`, `17`, and `18`. `19` is rolling out and is accepted only in regions where it is enabled; requesting it elsewhere returns an error. */ export type PgVersion = number; export type ProjectOwnerData = { + /** + * Email address of the project owner. + */ email: string; - name: 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 type LimitsUnsatisfiedResponse = { + /** + * Plan limits that were not satisfied by the request. + */ limits: Array<{ /** * Identifier of the unsatisfied limit. Possible values are: @@ -2503,14 +2835,29 @@ export type LimitsUnsatisfiedResponse = { * */ name: string; + /** + * Required value for the limit named by `name`. Compare with `actual` to determine the shortfall. + */ expected: string; + /** + * Current value of the named limit, which does not satisfy the required `expected` value. + */ actual: string; }>; }; export type ProjectsWithIntegrationResponse = { + /** + * Projects that have the requested integration, each including the project details and associated integration metadata. + */ projects: Array<{ + /** + * The Neon project ID. Use as the `project_id` path parameter in other endpoints. + */ id: string; + /** + * Name of the external integration associated with the project. + */ integration: string; }>; }; @@ -2532,7 +2879,7 @@ export type DataApiSettings = { */ db_extra_search_path?: string; /** - * Maximum number of rows that can be returned in a single request + * Hard limit on the number of rows returned in a single Data API response. No limit when unset. */ db_max_rows?: number; /** @@ -2544,7 +2891,7 @@ export type DataApiSettings = { */ jwt_role_claim_key?: string; /** - * Maximum lifetime for JWT cache in seconds + * Maximum lifetime of the Data API's JWT cache, in seconds. */ jwt_cache_max_lifetime?: number; /** @@ -2556,7 +2903,7 @@ export type DataApiSettings = { */ server_cors_allowed_origins?: string; /** - * Enable server timing headers + * 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; }; @@ -2566,21 +2913,19 @@ export type DataApiSettings = { */ export type DataApiCreateRequest = { /** - * The authentication provider to use for the Neon Data API + * 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?: 'neon_auth' | 'external'; /** - * The URL that lists the JWKS + * 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; /** - * The name of the authentication provider (e.g., Clerk, Stytch, Auth0) + * 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; /** - * WARNING - using this setting will only reject tokens with a - * different audience claim. Tokens without audience claim will still - * be accepted. + * 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; @@ -2599,6 +2944,9 @@ export type DataApiCreateRequest = { * Neon Data API created successfully */ export type DataApiCreateResponse = { + /** + * URL of the created Data API endpoint. + */ url: string; }; @@ -2631,6 +2979,9 @@ export type DataApiUpdateRequest = { settings?: DataApiSettings; }; +/** + * 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 type NeonAuthProviderProjectOwnedBy = 'user' | 'neon'; @@ -2638,34 +2989,60 @@ export type NeonAuthProviderProjectOwnedBy = 'user' | 'neon'; export type NeonAuthProviderProjectTransferStatus = 'initiated' | 'finished'; export type NeonAuthRedirectUriWhitelistDomain = { + /** + * Allowed redirect URI domain for the auth provider. + */ domain: string; auth_provider: NeonAuthSupportedAuthProvider; }; export type NeonAuthRedirectUriWhitelistResponse = { + /** + * Domains permitted as redirect URI targets in the whitelist. + */ domains: Array; }; export type NeonAuthAddDomainToRedirectUriWhitelistRequest = { + /** + * URI to add to the redirect URI allowlist for the auth provider. + */ domain: string; auth_provider: NeonAuthSupportedAuthProvider; }; export type NeonAuthDeleteDomainFromRedirectUriWhitelistRequest = { auth_provider: NeonAuthSupportedAuthProvider; + /** + * Domain names to remove from the redirect URI whitelist for the specified auth provider. + */ domains: Array; }; export type NeonAuthDeleteDomainFromRedirectUriWhitelistItem = { + /** + * URI to remove from the redirect URI whitelist. + */ domain: string; }; export type NeonAuthCreateIntegrationRequest = { auth_provider: NeonAuthSupportedAuthProvider; + /** + * 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; + /** + * Name of the database to associate with the Neon Auth integration. When omitted, the integration uses the project's default database. + */ database_name?: string; /** + * Deprecated. The database role for the auth integration. Omit this field; it is ignored. + * * @deprecated */ role_name?: string; @@ -2673,34 +3050,76 @@ export type NeonAuthCreateIntegrationRequest = { export type EnableNeonAuthIntegrationRequest = { auth_provider: NeonAuthSupportedAuthProvider; + /** + * Name of the database to enable Neon Auth on. When omitted, the integration uses the project's default database. + */ database_name?: string; }; export type 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 type NeonAuthCreateAuthProviderSdkKeysRequest = { + /** + * The Neon project ID. Returned as `id` from `GET /projects`. + */ project_id: string; auth_provider: NeonAuthSupportedAuthProvider; }; export type NeonAuthCreateNewUserRequest = { + /** + * The Neon project ID. Returned as `id` from `GET /projects`. + */ project_id: string; auth_provider: NeonAuthSupportedAuthProvider; + /** + * Email address of the new user. + */ email: string; + /** + * Display name for the new user. When omitted, the created user has no display name. + */ name?: string; }; export type CreateBranchNeonAuthNewUserRequest = { + /** + * 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; }; @@ -2713,7 +3132,7 @@ export type NeonAuthCreateNewUserResponse = { export type UpdateNeonAuthUserRoleRequest = { /** - * Array of roles to assign to the user + * 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: Array; }; @@ -2741,83 +3160,83 @@ export type UpdateNeonAuthAllowLocalhostRequest = { export type NeonAuthOrganizationConfig = { /** - * Whether the organization plugin is enabled + * Whether the organization plugin is enabled. */ enabled: boolean; /** - * Maximum number of organizations a user can create + * 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 + * Maximum number of members per organization. */ membership_limit: number; /** - * The role assigned to the user who creates an organization + * Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ creator_role: 'admin' | 'owner'; /** - * Whether to send invitation emails when inviting members to an organization + * Whether to send invitation emails when inviting members to an organization. */ send_invitation_email: boolean; }; export type NeonAuthOrganizationConfigUpdate = { /** - * Whether the organization plugin is enabled + * Controls whether the organization plugin is active for the organization. */ enabled?: boolean; /** - * Maximum number of organizations a user can create + * 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 + * Maximum members per organization. */ membership_limit?: number; /** - * The role assigned to the user who creates an organization + * Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only. */ creator_role?: 'admin' | 'owner'; /** - * Whether to send invitation emails when inviting members to an organization + * 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 type NeonAuthMagicLinkConfig = { /** - * Whether the magic link plugin is enabled + * Whether the magic link plugin is enabled. */ enabled: boolean; /** - * Time in minutes before the magic link expires + * Minutes until the magic link expires. */ expires_in: number; /** - * Whether to disable sign-up via magic link + * Whether to disable sign-up via magic link. */ disable_sign_up: boolean; }; export type NeonAuthMagicLinkConfigUpdate = { /** - * Whether the magic link plugin is enabled + * Whether to enable the magic link plugin. */ enabled?: boolean; /** - * Time in minutes before the magic link expires + * Minutes until the magic link expires. */ expires_in?: number; /** - * Whether to disable sign-up via magic link + * When true, sign-up via magic link is disabled. */ disable_sign_up?: boolean; }; export type NeonAuthPhoneNumberConfig = { /** - * Whether the phone number plugin is enabled + * Whether the phone number plugin is enabled. */ enabled: boolean; /** @@ -2828,7 +3247,7 @@ export type NeonAuthPhoneNumberConfig = { export type NeonAuthPhoneNumberConfigUpdate = { /** - * Whether the phone number plugin is enabled + * Whether the phone number plugin is enabled. */ enabled?: boolean; /** @@ -2838,6 +3257,9 @@ export type NeonAuthPhoneNumberConfigUpdate = { }; export type NeonAuthTransferAuthProviderProjectRequest = { + /** + * The Neon project ID. Returned as `id` from `GET /projects`. + */ project_id: string; auth_provider: NeonAuthSupportedAuthProvider; }; @@ -2850,10 +3272,16 @@ export type NeonAuthTransferAuthProviderProjectResponse = { }; export type ListNeonAuthIntegrationsResponse = { + /** + * Neon Auth integrations configured for the project. + */ data: Array; }; export type ListNeonAuthOauthProvidersResponse = { + /** + * OAuth providers configured for Neon Auth on the project. + */ providers: Array; }; @@ -2866,21 +3294,45 @@ export type NeonAuthPluginConfigs = { phone_number?: NeonAuthPhoneNumberConfig; email_provider?: NeonAuthEmailServerConfig; email_and_password?: NeonAuthEmailAndPasswordConfig; + /** + * OAuth provider configurations enabled for this auth setup. + */ oauth_providers?: Array; + /** + * Permits authentication requests from localhost origins when true. Intended for local development; disable in production environments. + */ allow_localhost?: boolean; }; export type 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?: Array<'user.before_create' | 'user.created' | 'send.otp' | 'send.magic_link' | 'organization.invitation.created' | 'organization.invitation.accepted' | 'phone_number.verified'>; + /** + * Maximum time, in seconds, to wait for a response from the webhook endpoint. + */ timeout_seconds?: number; }; export type NeonAuthOauthProvider = { id: NeonAuthOauthProviderId; 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; }; @@ -2890,28 +3342,70 @@ export type NeonAuthOauthProviderType = 'standard' | 'shared'; export type NeonAuthAddOAuthProviderRequest = { id: NeonAuthOauthProviderId; + /** + * 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; + /** + * 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 type NeonAuthUpdateOAuthProviderRequest = { + /** + * 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; + /** + * 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 type 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 type 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; + /** + * 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; }; @@ -2977,12 +3471,12 @@ export type NeonAuthEmailAndPasswordConfig = { export type NeonAuthEmailAndPasswordConfigUpdate = { /** - * Whether email and password authentication is enabled + * 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?: NeonAuthEmailVerificationMethod; /** - * Whether email verification is required before users can sign in + * 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; /** @@ -2990,31 +3484,49 @@ export type NeonAuthEmailAndPasswordConfigUpdate = { */ auto_sign_in_after_verification?: boolean; /** - * Whether to send a verification email when users sign up + * 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 + * 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 + * Whether to disable new user sign ups. When omitted, the current setting is not changed. */ disable_sign_up?: boolean; }; export type 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; owned_by: NeonAuthProviderProjectOwnedBy; 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; /** - * The application name used in auth emails and communications. Defaults to the Neon project name. + * Application name shown in auth emails and communications. Defaults to the project name. */ name?: string; }; @@ -3064,19 +3576,31 @@ export type JwksCreationOperation = JwksResponse & OperationsResponse; export type AnnotationData = { 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; }; /** - * Annotation properties. + * 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; }; export type AnnotationObjectData = { + /** + * Kind of resource the annotation is attached to, for example "branch" or "endpoint". + */ type: string; + /** + * The annotated object's ID. + */ id: string; }; @@ -3089,6 +3613,9 @@ export type AnnotationResponse = { }; export type AnnotationsMapResponse = { + /** + * Map of annotations keyed by resource identifier, where each value contains the annotation data for that resource. + */ annotations: { [key: string]: AnnotationData; }; @@ -3104,6 +3631,9 @@ export type ApplicationType = 'vercel' | 'github' | 'datadog' | 'opentelemetry'; * */ export type ProjectsApplicationsMapResponse = { + /** + * 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: { [key: string]: Array; }; @@ -3114,6 +3644,9 @@ export type ProjectsApplicationsMapResponse = { * */ export type ProjectsIntegrationsMapResponse = { + /** + * Map of project IDs to their associated integration details. + */ integrations: { [key: string]: Array; }; @@ -3127,19 +3660,52 @@ export type CursorPaginationResponse = { * 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 type 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 type 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. @@ -3151,7 +3717,7 @@ export type Snapshot = { */ full_size?: number; /** - * Incremental storage size in bytes since the previous scheduled snapshot, when the snapshot is billed on incremental (diff) usage. + * 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). * @@ -3160,7 +3726,13 @@ export type Snapshot = { }; export type SnapshotUpdateRequest = { + /** + * Fields to update on the snapshot. Updatable fields include `name` and `expires_at`. + */ snapshot: { + /** + * Human-readable label for the snapshot. + */ name?: string; /** * The date and time when the snapshot will expire. @@ -3176,10 +3748,7 @@ export type SnapshotUpdateRequest = { export type BackupScheduleItem = { /** - * How often to take snapshots. Must be one of the following values: - * - `daily` - * - `weekly` - * - `monthly` + * How often to take snapshots. Known values: `daily`, `weekly`, `monthly`. * */ frequency: string; @@ -3199,23 +3768,45 @@ export type BackupScheduleItem = { */ month?: number; /** - * How long to keep a snapshot (in seconds) before it's automatically deleted. - * If not set, the snapshot is kept indefinitely. + * 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 type BackupSchedule = { + /** + * List of schedule entries defining the backup frequency. At least one entry is required. + */ schedule: Array; }; export type BranchSchemaJson = { + /** + * Tables present in the branch schema. + */ tables: Array<{ + /** + * 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: Array<{ + /** + * 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 @@ -3226,6 +3817,9 @@ export type BranchSchemaJson = { */ generated?: boolean; }>; + /** + * Table constraints defined in the branch schema, such as primary key, foreign key, unique, and check constraints. + */ constraints?: Array<{ /** * Type of constraint. Possible values: `primary_key`, `unique`, `foreign_key` @@ -3310,7 +3904,7 @@ export type BranchStorage = { /** * Always `true` in 200 responses. Present for forward compatibility: a * future version may add intermediate states; callers should treat `true` - * as "storage is usable for this branch right now." + * as "object storage is usable for this branch right now." * */ enabled: boolean; @@ -3319,7 +3913,7 @@ export type BranchStorage = { */ s3_endpoint: string; /** - * The AWS region for this branch's storage. The platform normalizes + * 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). @@ -3343,10 +3937,10 @@ export type BranchStorageNotEnabled = { code: string; message: string; /** - * Machine-readable reason why storage is unavailable: + * Machine-readable reason why object storage is unavailable: * - `org_not_entitled`: the org's `PlatformBranchableStorage` feature flag is off. - * - `region_unavailable`: the project's region has no storage admin service wired. - * - `branch_directory_missing`: the branch is not registered in the storage service. + * - `region_unavailable`: the project's region has no object storage admin service wired. + * - `branch_directory_missing`: the branch is not registered in the object storage service. * - `branch_not_found`: the project or branch does not exist, or the caller does not * have access to it. * @@ -3354,6 +3948,240 @@ export type BranchStorageNotEnabled = { reason: 'org_not_entitled' | 'region_unavailable' | 'branch_directory_missing' | 'branch_not_found'; }; +/** + * The Neon service that emitted the log record. + */ +export type ProjectBranchLogSource = 'function' | 'storage' | 'pg_endpoint'; + +/** + * 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'; + +/** + * A length of time as a count and a unit, for example `30m`, `6h`, or + * `7d`. Valid units are `ms`, `s`, `m`, `h`, and `d`. + * + */ +export type ProjectBranchLogDuration = string; + +export type ProjectBranchLogsNotAvailable = { + code: string; + message: string; + /** + * Machine-readable reason why logs cannot be read: + * - `branch_not_found`: the project or branch does not exist, or the caller does not + * have access to it. + * - `telemetry_not_enabled`: the branch exists but is not collecting telemetry, so it + * has no logs to serve. + * + */ + reason: 'branch_not_found' | 'telemetry_not_enabled'; +}; + +export type ProjectBranchLogsInvalidQuery = { + code: string; + message: string; + /** + * Machine-readable reason why the request was rejected: + * - `time_range_too_large`: the requested window spans more than seven days. + * - `invalid_time_range`: `end_time` is not after `start_time`. + * - `conflicting_time_range`: both `since` and `start_time` were supplied. + * - `invalid_cursor`: the supplied `cursor` is malformed, expired, or was issued for a + * different query. + * - `unknown_field`: the requested `field_name` is not one of the fields the log fields + * endpoint reports for this branch. + * - `invalid_logql`: the supplied `logql` expression does not parse, or uses a + * construct this endpoint does not accept. + * - `conflicting_filters`: `logql` was supplied alongside one or more structured + * filters. Use one or the other. + * + */ + reason: 'time_range_too_large' | 'invalid_time_range' | 'conflicting_time_range' | 'invalid_cursor' | 'unknown_field' | 'invalid_logql' | 'conflicting_filters'; +}; + +export type ProjectBranchLogsQueryRequest = { + /** + * 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?: ProjectBranchLogDuration; + /** + * 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?: 'asc' | 'desc'; + source?: ProjectBranchLogSource; + /** + * Match the OpenTelemetry `service.name` resource attribute exactly. + */ + service_name?: string; + /** + * Match the OpenTelemetry instrumentation scope name exactly. + */ + scope_name?: string; + minimum_severity?: ProjectBranchLogSeverity; + /** + * 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 type 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: { + [key: string]: unknown; + }; +}; + +export type ProjectBranchLogsQueryResponse = { + logs: Array; + /** + * 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 type 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: Array; +}; + +export type ProjectBranchLogFieldValuesResponse = { + values: Array; + /** + * 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 type BranchAiGateway = { /** * Always `true` in 200 responses. Present for forward compatibility, @@ -4249,16 +5077,152 @@ export type UpdateProjectResponse = UpdateProjectResponses[keyof UpdateProjectRe export type RecoverProjectData = { body?: never; path: { - /** - * The Neon project ID - */ + /** + * The Neon project ID + */ + project_id: string; + }; + query?: never; + url: '/projects/{project_id}/recover'; +}; + +export type RecoverProjectErrors = { + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type RecoverProjectError = RecoverProjectErrors[keyof RecoverProjectErrors]; + +export type RecoverProjectResponses = { + /** + * Returned the recovered project + */ + 200: ProjectRecoverResponse; +}; + +export type RecoverProjectResponse = RecoverProjectResponses[keyof RecoverProjectResponses]; + +export type ListProjectOperationsData = { + body?: never; + path: { + /** + * The Neon project ID + */ + project_id: string; + }; + query?: { + /** + * 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; + }; + url: '/projects/{project_id}/operations'; +}; + +export type ListProjectOperationsErrors = { + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type ListProjectOperationsError = ListProjectOperationsErrors[keyof ListProjectOperationsErrors]; + +export type ListProjectOperationsResponses = { + /** + * Returned a list of operations + * + */ + 200: OperationsResponse & PaginationResponse; +}; + +export type ListProjectOperationsResponse = ListProjectOperationsResponses[keyof ListProjectOperationsResponses]; + +export type ListProjectPermissionsData = { + body?: never; + path: { + project_id: string; + }; + query?: never; + url: '/projects/{project_id}/permissions'; +}; + +export type ListProjectPermissionsErrors = { + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type ListProjectPermissionsError = ListProjectPermissionsErrors[keyof ListProjectPermissionsErrors]; + +export type ListProjectPermissionsResponses = { + /** + * Returned project access details + */ + 200: ProjectPermissions; +}; + +export type ListProjectPermissionsResponse = ListProjectPermissionsResponses[keyof ListProjectPermissionsResponses]; + +export type GrantPermissionToProjectData = { + body: GrantPermissionToProjectRequest; + path: { project_id: string; }; query?: never; - url: '/projects/{project_id}/recover'; + url: '/projects/{project_id}/permissions'; }; -export type RecoverProjectErrors = { +export type GrantPermissionToProjectErrors = { /** * General Error. * @@ -4279,39 +5243,36 @@ export type RecoverProjectErrors = { '4XX': GeneralError; }; -export type RecoverProjectError = RecoverProjectErrors[keyof RecoverProjectErrors]; +export type GrantPermissionToProjectError = GrantPermissionToProjectErrors[keyof GrantPermissionToProjectErrors]; -export type RecoverProjectResponses = { +export type GrantPermissionToProjectResponses = { /** - * Returned the recovered project + * Granted project access */ - 200: ProjectRecoverResponse; + 200: ProjectPermission; }; -export type RecoverProjectResponse = RecoverProjectResponses[keyof RecoverProjectResponses]; +export type GrantPermissionToProjectResponse = GrantPermissionToProjectResponses[keyof GrantPermissionToProjectResponses]; -export type ListProjectOperationsData = { +export type ListProjectMembersData = { body?: never; path: { - /** - * The Neon project ID - */ project_id: string; }; query?: { /** - * Specify the cursor value from the previous response to get the next batch of operations + * 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 operations in the response + * The maximum number of members to return in the response */ limit?: number; }; - url: '/projects/{project_id}/operations'; + url: '/projects/{project_id}/members'; }; -export type ListProjectOperationsErrors = { +export type ListProjectMembersErrors = { /** * General Error. * @@ -4332,28 +5293,30 @@ export type ListProjectOperationsErrors = { '4XX': GeneralError; }; -export type ListProjectOperationsError = ListProjectOperationsErrors[keyof ListProjectOperationsErrors]; +export type ListProjectMembersError = ListProjectMembersErrors[keyof ListProjectMembersErrors]; -export type ListProjectOperationsResponses = { +export type ListProjectMembersResponses = { /** - * Returned a list of operations - * + * Returned the org members and their project roles */ - 200: OperationsResponse & PaginationResponse; + 200: ProjectMembers; }; -export type ListProjectOperationsResponse = ListProjectOperationsResponses[keyof ListProjectOperationsResponses]; +export type ListProjectMembersResponse = ListProjectMembersResponses[keyof ListProjectMembersResponses]; -export type ListProjectPermissionsData = { +export type RemoveProjectMemberRoleData = { body?: never; path: { project_id: string; + member_id: string; }; - query?: never; - url: '/projects/{project_id}/permissions'; + query?: { + confirm_self_lockout?: boolean; + }; + url: '/projects/{project_id}/members/{member_id}/role'; }; -export type ListProjectPermissionsErrors = { +export type RemoveProjectMemberRoleErrors = { /** * General Error. * @@ -4374,27 +5337,30 @@ export type ListProjectPermissionsErrors = { '4XX': GeneralError; }; -export type ListProjectPermissionsError = ListProjectPermissionsErrors[keyof ListProjectPermissionsErrors]; +export type RemoveProjectMemberRoleError = RemoveProjectMemberRoleErrors[keyof RemoveProjectMemberRoleErrors]; -export type ListProjectPermissionsResponses = { +export type RemoveProjectMemberRoleResponses = { /** - * Returned project access details + * Role removed, or no-op if no explicit row existed */ - 200: ProjectPermissions; + 200: ProjectMemberRoleResponse; }; -export type ListProjectPermissionsResponse = ListProjectPermissionsResponses[keyof ListProjectPermissionsResponses]; +export type RemoveProjectMemberRoleResponse = RemoveProjectMemberRoleResponses[keyof RemoveProjectMemberRoleResponses]; -export type GrantPermissionToProjectData = { - body: GrantPermissionToProjectRequest; +export type SetProjectMemberRoleData = { + body: SetProjectMemberRoleRequest; path: { project_id: string; + member_id: string; }; - query?: never; - url: '/projects/{project_id}/permissions'; + query?: { + confirm_self_demotion?: boolean; + }; + url: '/projects/{project_id}/members/{member_id}/role'; }; -export type GrantPermissionToProjectErrors = { +export type SetProjectMemberRoleErrors = { /** * General Error. * @@ -4415,16 +5381,16 @@ export type GrantPermissionToProjectErrors = { '4XX': GeneralError; }; -export type GrantPermissionToProjectError = GrantPermissionToProjectErrors[keyof GrantPermissionToProjectErrors]; +export type SetProjectMemberRoleError = SetProjectMemberRoleErrors[keyof SetProjectMemberRoleErrors]; -export type GrantPermissionToProjectResponses = { +export type SetProjectMemberRoleResponses = { /** - * Granted project access + * Role set or updated */ - 200: ProjectPermission; + 200: ProjectMemberRoleResponse; }; -export type GrantPermissionToProjectResponse = GrantPermissionToProjectResponses[keyof GrantPermissionToProjectResponses]; +export type SetProjectMemberRoleResponse = SetProjectMemberRoleResponses[keyof SetProjectMemberRoleResponses]; export type RevokePermissionFromProjectData = { body?: never; @@ -4512,8 +5478,7 @@ export type GetAvailablePreloadLibrariesResponse = GetAvailablePreloadLibrariesR export type CreateProjectTransferRequestData = { body?: { /** - * Specifies the validity duration of the transfer request in seconds. If not provided, - * the request will expire after 24 hours (86,400 seconds). + * Number of seconds the transfer request stays valid before it expires. Defaults to 86400 (24 hours). * */ ttl_seconds?: number; @@ -7884,58 +8849,10 @@ export type SetDefaultProjectBranchResponses = { export type SetDefaultProjectBranchResponse = SetDefaultProjectBranchResponses[keyof SetDefaultProjectBranchResponses]; -export type RecoverProjectBranchData = { - body?: never; - path: { - /** - * The Neon project ID - */ - project_id: string; - /** - * The branch ID - */ - branch_id: string; - }; - query?: never; - url: '/projects/{project_id}/branches/{branch_id}/recover'; -}; - -export type RecoverProjectBranchErrors = { - /** - * General Error. - * - * The request may or may not be safe to retry, depending on the HTTP method, response status code, - * and whether a response was received. - * - * - If no response is returned from the API, a network error or timeout likely occurred. - * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. - * - * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. - * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. - * - * Any request that returns a `503 Service Unavailable` response is always safe to retry. - * - * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. - * - */ - '4XX': GeneralError; -}; - -export type RecoverProjectBranchError = RecoverProjectBranchErrors[keyof RecoverProjectBranchErrors]; - -export type RecoverProjectBranchResponses = { - /** - * Recovered the specified branch - */ - 200: BranchRecoverResponse; -}; - -export type RecoverProjectBranchResponse = RecoverProjectBranchResponses[keyof RecoverProjectBranchResponses]; - export type FinalizeRestoreBranchData = { body?: { /** - * used to rename the existing branch when it is replaced. if omitted, a default name is generated and used + * Name for the replaced branch. If omitted, a unique name is generated. */ name?: string; }; @@ -10163,11 +11080,11 @@ export type TransferProjectsFromOrgToOrgData = { export type TransferProjectsFromOrgToOrgErrors = { /** - * Transfer failed - the target organization has too many projects or its plan is incompatible with the source organization. Reduce projects or upgrade the organization. + * Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization. */ 406: LimitsUnsatisfiedResponse; /** - * One or more of the provided project IDs have GitHub or Vercel integrations installed. Transferring integration projects is currently not supported + * Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred. */ 422: ProjectsWithIntegrationResponse; /** @@ -10586,11 +11503,11 @@ export type TransferProjectsFromUserToOrgData = { export type TransferProjectsFromUserToOrgErrors = { /** - * Transfer failed - the target organization has too many projects or its plan is incompatible with the source account. Reduce the number of projects or upgrade the target organization to increase its capacity. + * Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization. */ 406: LimitsUnsatisfiedResponse; /** - * One or more of the provided project IDs have GitHub or Vercel integrations installed. Transferring integration projects is currently not supported + * Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred. */ 422: ProjectsWithIntegrationResponse; /** @@ -10684,8 +11601,7 @@ export type CreateSnapshotData = { */ lsn?: string; /** - * The target timestamp for the snapshot. Must fall within the restore window. - * Use ISO 8601 format (e.g. 2025-08-05T22:00:00Z). Cannot be used with `lsn`. + * The target timestamp for the snapshot. Must fall within the restore window. RFC 3339 format. Cannot be used with `lsn`. * */ timestamp?: string; @@ -10694,8 +11610,7 @@ export type CreateSnapshotData = { */ name?: string; /** - * The time at which the snapshot will be automatically deleted. - * Use ISO 8601 format (e.g. 2025-08-05T22:00:00Z). + * The time at which the snapshot will be automatically deleted. RFC 3339 format. * */ expires_at?: string; @@ -10885,15 +11800,12 @@ export type UpdateSnapshotResponse = UpdateSnapshotResponses[keyof UpdateSnapsho export type RestoreSnapshotData = { body?: { /** - * A name for the newly restored branch. - * If omitted, a default name will be generated. + * A name for the newly restored branch. If not provided, the server generates a unique name for the branch automatically. * */ name?: string; /** - * The ID of the branch to restore the snapshot into. - * If not specified, the branch from which the snapshot was originally - * created (`snapshot.source_branch_id`) will be used. + * 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; @@ -10918,7 +11830,7 @@ export type RestoreSnapshotData = { }; query?: { /** - * DEPRECATED. Use the `name` field in the request body instead. + * 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. * * @@ -11231,7 +12143,7 @@ export type GetProjectBranchStorageData = { export type GetProjectBranchStorageErrors = { /** - * Storage is not enabled for this branch, or the project/branch was not + * Object storage is not enabled for this branch, or the project/branch was not * found. The body is always `BranchStorageNotEnabled` — see `reason` for * the exact cause. * @@ -11261,7 +12173,7 @@ export type GetProjectBranchStorageError = GetProjectBranchStorageErrors[keyof G export type GetProjectBranchStorageResponses = { /** - * Storage is enabled for this branch + * Object storage is enabled for this branch */ 200: BranchStorage; }; @@ -11323,6 +12235,218 @@ export type GetProjectBranchAiGatewayResponses = { export type GetProjectBranchAiGatewayResponse = GetProjectBranchAiGatewayResponses[keyof GetProjectBranchAiGatewayResponses]; +export type QueryProjectBranchLogsData = { + body: ProjectBranchLogsQueryRequest; + path: { + /** + * The Neon project ID + */ + project_id: string; + /** + * The Neon branch ID + */ + branch_id: string; + }; + query?: never; + url: '/projects/{project_id}/branches/{branch_id}/logs/query'; +}; + +export type QueryProjectBranchLogsErrors = { + /** + * The query could not be served as written. The body is always + * `ProjectBranchLogsInvalidQuery` — see `reason` for the exact cause. + * + */ + 400: ProjectBranchLogsInvalidQuery; + /** + * Logs are not available for this branch, or the project/branch was + * not found. The body is always `ProjectBranchLogsNotAvailable` — see + * `reason` for the exact cause. + * + */ + 404: ProjectBranchLogsNotAvailable; + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type QueryProjectBranchLogsError = QueryProjectBranchLogsErrors[keyof QueryProjectBranchLogsErrors]; + +export type QueryProjectBranchLogsResponses = { + /** + * Logs matching the supplied filters + */ + 200: ProjectBranchLogsQueryResponse; +}; + +export type QueryProjectBranchLogsResponse = QueryProjectBranchLogsResponses[keyof QueryProjectBranchLogsResponses]; + +export type ListProjectBranchLogFieldsData = { + body?: never; + path: { + /** + * The Neon project ID + */ + project_id: string; + /** + * The Neon branch ID + */ + branch_id: string; + }; + query?: never; + url: '/projects/{project_id}/branches/{branch_id}/logs/fields'; +}; + +export type ListProjectBranchLogFieldsErrors = { + /** + * Logs are not available for this branch, or the project/branch was + * not found. The body is always `ProjectBranchLogsNotAvailable` — see + * `reason` for the exact cause. + * + */ + 404: ProjectBranchLogsNotAvailable; + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type ListProjectBranchLogFieldsError = ListProjectBranchLogFieldsErrors[keyof ListProjectBranchLogFieldsErrors]; + +export type ListProjectBranchLogFieldsResponses = { + /** + * Log fields available for value discovery on this branch + */ + 200: ProjectBranchLogFieldsResponse; +}; + +export type ListProjectBranchLogFieldsResponse = ListProjectBranchLogFieldsResponses[keyof ListProjectBranchLogFieldsResponses]; + +export type ListProjectBranchLogFieldValuesData = { + body?: never; + path: { + /** + * 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; + }; + query?: { + /** + * 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?: ProjectBranchLogDuration; + /** + * 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; + /** + * 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; + }; + url: '/projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values'; +}; + +export type ListProjectBranchLogFieldValuesErrors = { + /** + * The lookup could not be served as written. The body is always + * `ProjectBranchLogsInvalidQuery` — see `reason` for the exact cause. + * + */ + 400: ProjectBranchLogsInvalidQuery; + /** + * Logs are not available for this branch, or the project/branch was + * not found. The body is always `ProjectBranchLogsNotAvailable` — see + * `reason` for the exact cause. + * + */ + 404: ProjectBranchLogsNotAvailable; + /** + * General Error. + * + * The request may or may not be safe to retry, depending on the HTTP method, response status code, + * and whether a response was received. + * + * - If no response is returned from the API, a network error or timeout likely occurred. + * - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. + * + * The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. + * The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. + * + * Any request that returns a `503 Service Unavailable` response is always safe to retry. + * + * Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. + * + */ + '4XX': GeneralError; +}; + +export type ListProjectBranchLogFieldValuesError = ListProjectBranchLogFieldValuesErrors[keyof ListProjectBranchLogFieldValuesErrors]; + +export type ListProjectBranchLogFieldValuesResponses = { + /** + * Distinct values for the requested log field + */ + 200: ProjectBranchLogFieldValuesResponse; +}; + +export type ListProjectBranchLogFieldValuesResponse = ListProjectBranchLogFieldValuesResponses[keyof ListProjectBranchLogFieldValuesResponses]; + export type ListProjectBranchBucketObjectsData = { body?: never; path: { diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 6ceb7349..73f7913f 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -41,9 +41,15 @@ export type { BranchWithCompute, CreateWithComputeInput, } from "./neon/resources/branches.js"; +export type { + LogFieldValuesQuery, + LogQueryInput, +} from "./neon/resources/logs.js"; export type { ConnectionStringParams } from "./neon/resources/postgres.js"; export type { ProjectConnection, + RemoveRoleOptions, + SetRoleOptions, TransferProjectsInput, } from "./neon/resources/projects.js"; export type { diff --git a/packages/sdk/src/neon/client.ts b/packages/sdk/src/neon/client.ts index 35050cf7..cc7c5956 100644 --- a/packages/sdk/src/neon/client.ts +++ b/packages/sdk/src/neon/client.ts @@ -8,6 +8,7 @@ import { Branches } from "./resources/branches.js"; import { Consumption } from "./resources/consumption.js"; import { Credentials } from "./resources/credentials.js"; import { Functions } from "./resources/functions.js"; +import { Logs } from "./resources/logs.js"; import { Operations } from "./resources/operations.js"; import { Postgres } from "./resources/postgres.js"; import { Projects } from "./resources/projects.js"; @@ -31,6 +32,7 @@ export interface NeonClient { readonly functions: Functions; readonly credentials: Credentials; readonly aiGateway: AiGateway; + readonly logs: Logs; readonly snapshots: Snapshots; readonly operations: Operations; readonly auth: Auth; @@ -68,6 +70,7 @@ export function createNeonClient( functions: new Functions(ctx), credentials: new Credentials(ctx), aiGateway: new AiGateway(ctx), + logs: new Logs(ctx), snapshots: new Snapshots(ctx), operations: new Operations(ctx), auth: new Auth(ctx), diff --git a/packages/sdk/src/neon/coverage.ts b/packages/sdk/src/neon/coverage.ts index bae25f58..81de6004 100644 --- a/packages/sdk/src/neon/coverage.ts +++ b/packages/sdk/src/neon/coverage.ts @@ -30,6 +30,10 @@ export const WRAPPED: ReadonlySet = new Set([ "listProjectPermissions", "grantPermissionToProject", "revokePermissionFromProject", + // projects: org member roles + "listProjectMembers", + "setProjectMemberRole", + "removeProjectMemberRole", // branches "listProjectBranches", "getProjectBranch", @@ -38,7 +42,10 @@ export const WRAPPED: ReadonlySet = new Set([ "deleteProjectBranch", "setDefaultProjectBranch", "finalizeRestoreBranch", - "recoverProjectBranch", + // logs (branch-scoped) + "queryProjectBranchLogs", + "listProjectBranchLogFields", + "listProjectBranchLogFieldValues", // neon auth (branch-scoped) "getNeonAuth", "createNeonAuth", @@ -246,8 +253,11 @@ export const EXPECTED_OPERATIONS: ReadonlySet = new Set([ "listProjectBranchEndpoints", "listProjectBranchRoles", "listProjectBranchFunctions", + "listProjectBranchLogFields", + "listProjectBranchLogFieldValues", "listProjectBranches", "listProjectEndpoints", + "listProjectMembers", "listProjectOperations", "listProjectPermissions", "listProjectVpcEndpoints", @@ -255,9 +265,10 @@ export const EXPECTED_OPERATIONS: ReadonlySet = new Set([ "listSharedProjects", "listSnapshots", "presignProjectBranchBucketObject", + "queryProjectBranchLogs", "recoverProject", - "recoverProjectBranch", "removeOrganizationMember", + "removeProjectMemberRole", "resetProjectBranchRolePassword", "restartProjectEndpoint", "restoreProjectBranch", @@ -269,6 +280,7 @@ export const EXPECTED_OPERATIONS: ReadonlySet = new Set([ "sendNeonAuthTestEmail", "setDefaultProjectBranch", "setOrganizationSpendingLimit", + "setProjectMemberRole", "setSnapshotSchedule", "startAnonymization", "startProjectEndpoint", diff --git a/packages/sdk/src/neon/paginate.ts b/packages/sdk/src/neon/paginate.ts index f9b0c0fd..6c47a0b3 100644 --- a/packages/sdk/src/neon/paginate.ts +++ b/packages/sdk/src/neon/paginate.ts @@ -1,5 +1,5 @@ import { cancelled, type Deadline, runBounded } from "./deadline.js"; -import { toNeonError } from "./errors.js"; +import { NeonError, toNeonError } from "./errors.js"; import { err, type NeonResult, ok } from "./result.js"; export interface Page { @@ -67,6 +67,10 @@ class PaginatedList implements Paginated { const cancellation = cancelled(deadline); if (cancellation) return err(cancellation); if (raw === undefined || raw.error || raw.data === undefined) { + // A fetcher that already classified the failure keeps its own error. + // Re-deriving one from the response would mislabel a fault the SDK + // found in a 200 body as an API error with a 2xx status. + if (raw?.error instanceof NeonError) return err(raw.error); return err(toNeonError(raw?.error, raw?.response)); } return ok(this.#mapPage(raw.data)); diff --git a/packages/sdk/src/neon/resources/branches.ts b/packages/sdk/src/neon/resources/branches.ts index 997c6071..6c12aa6e 100644 --- a/packages/sdk/src/neon/resources/branches.ts +++ b/packages/sdk/src/neon/resources/branches.ts @@ -4,7 +4,6 @@ import { finalizeRestoreBranch, getProjectBranch, listProjectBranches, - recoverProjectBranch, setDefaultProjectBranch, updateProjectBranch, } from "../../client/sdk.gen.js"; @@ -356,36 +355,4 @@ export class Branches { () => undefined, ); } - - /** - * Recover a soft-deleted branch within the 7-day recovery window. - * - * @apiCall POST /projects/{project_id}/branches/{branch_id}/recover - */ - recover( - projectId: string, - branchId: string, - ): Promise>; - recover( - projectId: string, - branchId: string, - opts: CallOptions, - ): Promise>; - recover( - projectId: string, - branchId: string, - opts?: CallOptions, - ): Promise> { - return this.#ctx.run( - opts, - (client, signal) => - recoverProjectBranch({ - client, - path: { project_id: projectId, branch_id: branchId }, - throwOnError: false, - signal, - }), - (data) => data.branch, - ); - } } diff --git a/packages/sdk/src/neon/resources/logs.test.ts b/packages/sdk/src/neon/resources/logs.test.ts new file mode 100644 index 00000000..0d8a6c2f --- /dev/null +++ b/packages/sdk/src/neon/resources/logs.test.ts @@ -0,0 +1,184 @@ +import { describe, expect, it } from "vitest"; +import { createNeonClient } from "../client.js"; + +interface Call { + url: string; + method: string; + body: unknown; +} + +/** + * Build a client whose only stub is the network boundary, answering from a queue + * so a paginated walk can be observed page by page. An unqueued request throws + * rather than returning something plausible. + */ +function neonQueued(responses: unknown[], status = 200) { + const calls: Call[] = []; + const neon = createNeonClient({ + apiKey: "test", + retries: 0, + fetch: async (input, init) => { + const request = input instanceof Request ? input : undefined; + const url = request ? request.url : String(input); + const raw = request ? await request.clone().text() : init?.body; + calls.push({ + url, + method: request?.method ?? init?.method ?? "GET", + body: + typeof raw === "string" && raw.length > 0 + ? JSON.parse(raw) + : undefined, + }); + const body = responses[calls.length - 1]; + if (body === undefined) { + throw new Error(`unqueued request ${calls.length} to ${url}`); + } + return new Response(JSON.stringify(body), { + status, + headers: { "content-type": "application/json" }, + }); + }, + }); + return { neon, calls }; +} + +const record = (message: string) => ({ + timestamp: "2026-08-08T00:00:00Z", + message, + attributes: {}, +}); + +describe("logs.query pagination", () => { + it("walks pages and replays every filter unchanged", async () => { + const { neon, calls } = neonQueued([ + { logs: [record("a")], next_cursor: "c1", is_truncated: true }, + { logs: [record("b")], next_cursor: "", is_truncated: false }, + ]); + + const { data, error } = await neon.logs + .query("p-1", "br-1", { since: "1h", minimum_severity: "warn" }) + .all(); + + expect(error).toBeUndefined(); + expect(data?.map((r) => r.message)).toEqual(["a", "b"]); + expect(calls).toHaveLength(2); + expect(calls[0]?.method).toBe("POST"); + expect(calls[0]?.url).toContain( + "/projects/p-1/branches/br-1/logs/query", + ); + // The endpoint returns wrong results if a page changes the filters, so the + // cursor must be the only thing that differs between the two bodies. + expect(calls[0]?.body).toEqual({ + since: "1h", + minimum_severity: "warn", + }); + expect(calls[1]?.body).toEqual({ + since: "1h", + minimum_severity: "warn", + cursor: "c1", + }); + }); + + it("stops at the first untruncated page even when a cursor is echoed", async () => { + const { neon, calls } = neonQueued([ + { + logs: [record("only")], + next_cursor: "leftover", + is_truncated: false, + }, + ]); + + const { data } = await neon.logs.query("p-1", "br-1").all(); + + expect(data?.map((r) => r.message)).toEqual(["only"]); + expect(calls).toHaveLength(1); + }); + + it("sends no filters when none are given", async () => { + const { neon, calls } = neonQueued([{ logs: [], is_truncated: false }]); + + await neon.logs.query("p-1", "br-1").all(); + + expect(calls[0]?.body).toEqual({}); + }); + + it("keeps the filters it was given when the caller mutates them later", async () => { + const { neon, calls } = neonQueued([ + { logs: [record("a")], next_cursor: "c1", is_truncated: true }, + { logs: [record("b")], is_truncated: false }, + ]); + const input = { since: "1h" }; + + const page = neon.logs.query("p-1", "br-1", input); + input.since = "6h"; + await page.all(); + + expect(calls[0]?.body).toEqual({ since: "1h" }); + expect(calls[1]?.body).toEqual({ since: "1h", cursor: "c1" }); + }); + + it("errors rather than truncating silently when a page cannot be resumed", async () => { + const { neon } = neonQueued([ + { logs: [record("a")], is_truncated: true }, + ]); + + const { data, error } = await neon.logs.query("p-1", "br-1").all(); + + expect(data).toBeUndefined(); + expect(error?.message).toContain("no cursor"); + // An SDK-side fault, not a 2xx masquerading as an API error. + expect(error?.kind).toBe("client"); + }); +}); + +describe("logs field discovery", () => { + it("fields unwraps the field name array", async () => { + const { neon, calls } = neonQueued([ + { fields: ["source", "severity_text"] }, + ]); + + const { data } = await neon.logs.fields("p-1", "br-1"); + + expect(data).toEqual(["source", "severity_text"]); + expect(calls[0]?.url).toContain( + "/projects/p-1/branches/br-1/logs/fields", + ); + }); + + it("fieldValues keeps the truncation flag alongside the values", async () => { + const { neon, calls } = neonQueued([ + { values: ["function"], is_truncated: true }, + ]); + + const { data } = await neon.logs.fieldValues("p-1", "br-1", "source", { + since: "6h", + limit: 1, + }); + + // Dropping is_truncated would present an arbitrary subset as the whole set. + expect(data).toEqual({ values: ["function"], is_truncated: true }); + expect(calls[0]?.url).toContain("/logs/fields/source/values"); + expect(calls[0]?.url).toContain("since=6h"); + expect(calls[0]?.url).toContain("limit=1"); + }); +}); + +describe("logs error propagation", () => { + it("surfaces a branch without telemetry as a typed not-found error", async () => { + const { neon } = neonQueued( + [ + { + code: "LOGS_NOT_AVAILABLE", + message: "logs are not available for this branch", + reason: "telemetry_not_enabled", + }, + ], + 404, + ); + + const { data, error } = await neon.logs.fields("p-1", "br-1"); + + expect(data).toBeUndefined(); + expect(error?.kind).toBe("not_found"); + }); +}); diff --git a/packages/sdk/src/neon/resources/logs.ts b/packages/sdk/src/neon/resources/logs.ts new file mode 100644 index 00000000..98101ce7 --- /dev/null +++ b/packages/sdk/src/neon/resources/logs.ts @@ -0,0 +1,196 @@ +import { + listProjectBranchLogFields, + listProjectBranchLogFieldValues, + queryProjectBranchLogs, +} from "../../client/sdk.gen.js"; +import type { + ListProjectBranchLogFieldValuesData, + ProjectBranchLogFieldValuesResponse, + ProjectBranchLogRecord, + ProjectBranchLogsQueryRequest, + ProjectBranchLogsQueryResponse, +} from "../../client/types.gen.js"; +import type { CallOptions, RequestContext } from "../context.js"; +import { NeonError } from "../errors.js"; +import { type Paginated, paginate } from "../paginate.js"; +import type { NeonResult, Outcome } from "../result.js"; + +/** + * Filters for {@link Logs.query}. + * + * `cursor` is absent because {@link Paginated} owns paging: the endpoint requires + * every filter and the time window to be repeated unchanged on each page, and + * threading the cursor here is what guarantees that. + */ +export type LogQueryInput = Omit; + +/** Query parameters for {@link Logs.fieldValues}. */ +export type LogFieldValuesQuery = NonNullable< + ListProjectBranchLogFieldValuesData["query"] +>; + +/** + * Branch-scoped logs emitted by the services running on a branch — Neon Functions, + * object storage, and Postgres computes. Grouped under `neon.logs.*` alongside the + * other branch-scoped product surfaces. + * + * Private Beta. Telemetry is region-gated, so a branch outside an enabled region answers + * `404` with `reason: "telemetry_not_enabled"` rather than an empty result — treat that + * as an ordinary outcome. A branch that has telemetry but nothing recorded answers `200` + * with an empty array, and one whose backend is down answers `503`, which the client + * retries on by default. + * + * The spec is wider than the backend: of the three `source` values only `function` and + * `storage` were observed emitting, and `minimum_severity` can be rejected as unsupported + * by a branch's log backend, where `severity_text` still works. + */ +export class Logs { + readonly #ctx: RequestContext; + + constructor(ctx: RequestContext) { + this.#ctx = ctx; + } + + /** + * Query branch logs (cursor-paginated). Every supplied filter is combined with + * `AND`. + * + * Give the window as either `since` or `start_time` — supplying both is rejected. + * `logql` replaces the seven content filters rather than adding to them, while + * `limit`, `sort_order`, and the time window still apply alongside it. With no + * window the query covers the last hour, and seven days is the widest range served. + * + * @apiCall POST /projects/{project_id}/branches/{branch_id}/logs/query (cursor-paginated) + */ + query( + projectId: string, + branchId: string, + input?: LogQueryInput, + opts?: CallOptions, + ): Paginated { + // Snapshot the filters. The endpoint returns wrong results unless every page + // repeats them unchanged, and a `Paginated` is lazy — reading `input` per page + // would let a caller mutating it afterwards change the query mid-walk. + const filters = { ...input }; + return paginate( + async (cursor, signal) => { + const page = await queryProjectBranchLogs({ + client: this.#ctx.client, + path: { project_id: projectId, branch_id: branchId }, + body: { ...filters, cursor }, + throwOnError: false, + signal, + }); + // Truncated with nothing to resume from: the remaining records are + // unreachable. Stopping here would hand back a partial page that looks + // like the whole result. + if (page.data?.is_truncated && !page.data.next_cursor) { + return { + response: page.response, + error: new NeonError( + "Neon reported more log records than it returned but gave no cursor to reach them.", + "client", + ), + }; + } + return page; + }, + (data) => ({ + items: data?.logs ?? [], + // `next_cursor` is present but empty on the last page, so truncation is + // the flag that ends the walk. + cursor: data?.is_truncated ? data.next_cursor : undefined, + }), + () => this.#ctx.deadlineFor(opts), + ); + } + + /** + * List the log fields whose values {@link Logs.fieldValues} can enumerate on + * this branch. Computed per branch and grows as fields are observed, so read it + * rather than assuming a fixed set. + * + * @apiCall GET /projects/{project_id}/branches/{branch_id}/logs/fields + */ + fields( + projectId: string, + branchId: string, + ): Promise>; + fields( + projectId: string, + branchId: string, + opts: CallOptions, + ): Promise>; + fields( + projectId: string, + branchId: string, + opts?: CallOptions, + ): Promise> { + return this.#ctx.run( + opts, + (client, signal) => + listProjectBranchLogFields({ + client, + path: { project_id: projectId, branch_id: branchId }, + throwOnError: false, + signal, + }), + (data) => data.fields, + ); + } + + /** + * List the distinct values observed for one log field, for use as a filter. + * `fieldName` must be one of the names {@link Logs.fields} reports; anything else is + * rejected with `unknown_field`. The enumerable set and the set {@link Logs.query} can + * filter on overlap rather than nest: `source` is a filter but is not enumerable, and + * `entity_type` is enumerable but is not a filter. + * + * The whole response is returned rather than the bare values because + * `is_truncated` decides whether the list can be trusted: when it is `true` the + * values are an arbitrary subset, and the window or `source` needs narrowing + * before filtering on them. + * + * @apiCall GET /projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values + */ + fieldValues( + projectId: string, + branchId: string, + fieldName: string, + query?: LogFieldValuesQuery, + ): Promise>; + fieldValues( + projectId: string, + branchId: string, + fieldName: string, + query: LogFieldValuesQuery | undefined, + opts: CallOptions, + ): Promise>; + fieldValues( + projectId: string, + branchId: string, + fieldName: string, + query?: LogFieldValuesQuery, + opts?: CallOptions, + ): Promise< + | ProjectBranchLogFieldValuesResponse + | NeonResult + > { + return this.#ctx.run( + opts, + (client, signal) => + listProjectBranchLogFieldValues({ + client, + path: { + project_id: projectId, + branch_id: branchId, + field_name: fieldName, + }, + query, + throwOnError: false, + signal, + }), + (data) => data, + ); + } +} diff --git a/packages/sdk/src/neon/resources/members.test.ts b/packages/sdk/src/neon/resources/members.test.ts new file mode 100644 index 00000000..c9763200 --- /dev/null +++ b/packages/sdk/src/neon/resources/members.test.ts @@ -0,0 +1,149 @@ +import { describe, expect, it } from "vitest"; +import { createNeonClient } from "../client.js"; + +interface Call { + url: string; + method: string; + body: unknown; +} + +/** A client whose only stub is the network boundary, answering from a queue. */ +function neonQueued(responses: unknown[]) { + const calls: Call[] = []; + const neon = createNeonClient({ + apiKey: "test", + retries: 0, + fetch: async (input, init) => { + const request = input instanceof Request ? input : undefined; + const url = request ? request.url : String(input); + const raw = request ? await request.clone().text() : init?.body; + calls.push({ + url, + method: request?.method ?? init?.method ?? "GET", + body: + typeof raw === "string" && raw.length > 0 + ? JSON.parse(raw) + : undefined, + }); + const body = responses[calls.length - 1]; + if (body === undefined) { + throw new Error(`unqueued request ${calls.length} to ${url}`); + } + return new Response(JSON.stringify(body), { + status: 200, + headers: { "content-type": "application/json" }, + }); + }, + }); + return { neon, calls }; +} + +const member = (memberId: string) => ({ + member_id: memberId, + user_id: `user-${memberId}`, + org_role: "member", + project_role: "editor", +}); + +describe("projects.members.list", () => { + it("unwraps project_members and follows the pagination cursor", async () => { + const { neon, calls } = neonQueued([ + { + project_members: [member("m-1")], + pagination: { next: "c1" }, + }, + { project_members: [member("m-2")] }, + ]); + + const { data, error } = await neon.projects.members.list("p-1").all(); + + expect(error).toBeUndefined(); + expect(data?.map((m) => m.member_id)).toEqual(["m-1", "m-2"]); + expect(calls).toHaveLength(2); + expect(calls[0]?.url).toContain("/projects/p-1/members"); + expect(calls[1]?.url).toContain("cursor=c1"); + }); + + it("forwards the limit query parameter", async () => { + const { neon, calls } = neonQueued([{ project_members: [] }]); + + await neon.projects.members.list("p-1", { limit: 25 }).all(); + + expect(calls[0]?.url).toContain("limit=25"); + }); +}); + +describe("projects.members.setRole", () => { + const roleResponse = { + project_id: "p-1", + member_id: "m-1", + user_id: "user-m-1", + org_role: "member", + project_role: "viewer", + credential_rotation_recommended: true, + org_api_key_rotation_recommended: false, + }; + + it("sends the role and withholds the self-demotion acknowledgement", async () => { + const { neon, calls } = neonQueued([roleResponse]); + + await neon.projects.members.setRole("p-1", "m-1", "viewer"); + + expect(calls[0]?.method).toBe("PUT"); + expect(calls[0]?.url).toContain("/projects/p-1/members/m-1/role"); + expect(calls[0]?.url).not.toContain("confirm_self_demotion"); + expect(calls[0]?.body).toEqual({ role: "viewer" }); + }); + + it("adds confirm_self_demotion only when acknowledged", async () => { + const { neon, calls } = neonQueued([roleResponse]); + + await neon.projects.members.setRole("p-1", "m-1", "viewer", { + confirmSelfDemotion: true, + }); + + expect(calls[0]?.url).toContain("confirm_self_demotion=true"); + }); + + it("returns the rotation hints rather than just the role", async () => { + const { neon } = neonQueued([roleResponse]); + + const { data } = await neon.projects.members.setRole( + "p-1", + "m-1", + "viewer", + ); + + expect(data?.credential_rotation_recommended).toBe(true); + expect(data?.org_api_key_rotation_recommended).toBe(false); + }); +}); + +describe("projects.members.removeRole", () => { + const removed = { + project_id: "p-1", + member_id: "m-1", + user_id: "user-m-1", + org_role: "member", + }; + + it("withholds the self-lockout acknowledgement by default", async () => { + const { neon, calls } = neonQueued([removed]); + + await neon.projects.members.removeRole("p-1", "m-1"); + + expect(calls[0]?.method).toBe("DELETE"); + expect(calls[0]?.url).toContain("/projects/p-1/members/m-1/role"); + expect(calls[0]?.url).not.toContain("confirm_self_lockout"); + }); + + it("adds confirm_self_lockout only when acknowledged", async () => { + const { neon, calls } = neonQueued([removed]); + + await neon.projects.members.removeRole("p-1", "m-1", { + confirmSelfLockout: true, + }); + + expect(calls[0]?.url).toContain("confirm_self_lockout=true"); + }); +}); diff --git a/packages/sdk/src/neon/resources/projects.ts b/packages/sdk/src/neon/resources/projects.ts index 9e672fcd..86c734ea 100644 --- a/packages/sdk/src/neon/resources/projects.ts +++ b/packages/sdk/src/neon/resources/projects.ts @@ -3,20 +3,27 @@ import { deleteProject, getProject, grantPermissionToProject, + listProjectMembers, listProjectPermissions, listProjects, recoverProject, + removeProjectMemberRole, revokePermissionFromProject, + setProjectMemberRole, transferProjectsFromOrgToOrg, transferProjectsFromUserToOrg, updateProject, } from "../../client/sdk.gen.js"; import type { + ListProjectMembersData, ListProjectsData, Project, ProjectCreateRequest, ProjectListItem, + ProjectMember, + ProjectMemberRoleResponse, ProjectPermission, + ProjectRole, ProjectUpdateRequest, } from "../../client/types.gen.js"; import { withConnectionString } from "../connection.js"; @@ -37,6 +44,30 @@ export interface TransferProjectsInput { type ListQuery = Omit, "cursor">; type CreateInput = ProjectCreateRequest["project"]; type UpdateInput = ProjectUpdateRequest["project"]; +type MemberListQuery = Omit< + NonNullable, + "cursor" +>; + +/** Per-call options for {@link Members.setRole}. */ +export interface SetRoleOptions + extends CallOptions { + /** + * Acknowledge that the call lowers the caller's own role. The API rejects a + * self-demotion without it, so it is left off by default. + */ + confirmSelfDemotion?: boolean; +} + +/** Per-call options for {@link Members.removeRole}. */ +export interface RemoveRoleOptions + extends CallOptions { + /** + * Acknowledge that the call can cost the caller management access. The API + * rejects such a self-removal without it, so it is left off by default. + */ + confirmSelfLockout?: boolean; +} /** Per-call options for the connect workflow. */ interface WorkflowOptions extends CallOptions { @@ -142,15 +173,146 @@ export class Permissions { } } +/** + * Per-project roles for members of the owning organization. + * + * Distinct from {@link Permissions}, which shares a project with an individual by + * email address: these act on existing org members by member id, and clearing a + * grant leaves the member's organization-role default in force rather than + * removing their access. + */ +export class Members { + readonly #ctx: RequestContext; + + constructor(ctx: RequestContext) { + this.#ctx = ctx; + } + + /** + * List org members and their project roles (cursor-paginated). Org-owned + * projects only — a personal project answers `404`, as does an org with + * per-project role management disabled. + * + * @apiCall GET /projects/{project_id}/members (cursor-paginated) + */ + list( + projectId: string, + query?: MemberListQuery, + opts?: CallOptions, + ): Paginated { + return paginate( + (cursor, signal) => + listProjectMembers({ + client: this.#ctx.client, + path: { project_id: projectId }, + query: { ...query, cursor }, + throwOnError: false, + signal, + }), + (data) => ({ + items: data?.project_members ?? [], + cursor: data?.pagination?.next, + }), + () => this.#ctx.deadlineFor(opts), + ); + } + + /** + * Set a member's explicit project role, replacing any existing grant. + * Idempotent. Check `credential_rotation_recommended` and + * `org_api_key_rotation_recommended` on the result — a downgrade can leave + * credentials the member still holds. + * + * @apiCall PUT /projects/{project_id}/members/{member_id}/role + */ + setRole( + projectId: string, + memberId: string, + role: ProjectRole, + ): Promise>; + setRole( + projectId: string, + memberId: string, + role: ProjectRole, + opts: SetRoleOptions, + ): Promise>; + setRole( + projectId: string, + memberId: string, + role: ProjectRole, + opts?: SetRoleOptions, + ): Promise< + ProjectMemberRoleResponse | NeonResult + > { + return this.#ctx.run( + opts, + (client, signal) => + setProjectMemberRole({ + client, + path: { project_id: projectId, member_id: memberId }, + query: opts?.confirmSelfDemotion + ? { confirm_self_demotion: true } + : undefined, + body: { role }, + throwOnError: false, + signal, + }), + (data) => data, + ); + } + + /** + * Clear a member's explicit project grant. Idempotent, and a no-op when no + * explicit grant exists. The member keeps whatever their organization role + * grants by default, so this narrows access rather than removing it. + * + * @apiCall DELETE /projects/{project_id}/members/{member_id}/role + */ + removeRole( + projectId: string, + memberId: string, + ): Promise>; + removeRole( + projectId: string, + memberId: string, + opts: RemoveRoleOptions, + ): Promise>; + removeRole( + projectId: string, + memberId: string, + opts?: RemoveRoleOptions, + ): Promise< + ProjectMemberRoleResponse | NeonResult + > { + return this.#ctx.run( + opts, + (client, signal) => + removeProjectMemberRole({ + client, + path: { project_id: projectId, member_id: memberId }, + query: opts?.confirmSelfLockout + ? { confirm_self_lockout: true } + : undefined, + throwOnError: false, + signal, + }), + (data) => data, + ); + } +} + /** Project resource — one API call per method (`list` is cursor-paginated). */ export class Projects { readonly #ctx: RequestContext; /** Project access grants (share by email). */ readonly permissions: Permissions; + /** Per-project roles for members of the owning organization. */ + readonly members: Members; constructor(ctx: RequestContext) { this.#ctx = ctx; this.permissions = new Permissions(ctx); + this.members = new Members(ctx); } /** @@ -333,8 +495,7 @@ export class Projects { } /** - * Recover a soft-deleted project within its retention window (beta). Mirrors - * `branches.recover` at the project level. + * Recover a soft-deleted project within its retention window (beta). * * @apiCall POST /projects/{project_id}/recover */