Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,251 changes: 2,147 additions & 104 deletions apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap

Large diffs are not rendered by default.

238 changes: 229 additions & 9 deletions apps/docs/spec/api_v1_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"x-oauth-scope": "environment:write"
},
"delete": {
"description": "Deletes the specified database branch",
"description": "Deletes the specified database branch. By default, deletes immediately. Use force=false to schedule deletion with 1-hour grace period (only when soft deletion is enabled).",
"operationId": "v1-delete-a-branch",
"parameters": [
{
Expand All @@ -107,6 +107,13 @@
{ "type": "string", "format": "uuid", "deprecated": true }
]
}
},
{
"name": "force",
"required": false,
"in": "query",
"description": "If set to false, schedule deletion with 1-hour grace period (only when soft deletion is enabled).",
"schema": { "default": "true", "type": "boolean" }
}
],
"responses": {
Expand Down Expand Up @@ -271,6 +278,48 @@
"x-oauth-scope": "environment:write"
}
},
"/v1/branches/{branch_id_or_ref}/restore": {
"post": {
"description": "Cancels scheduled deletion and restores the branch to active state",
"operationId": "v1-restore-a-branch",
"parameters": [
{
"name": "branch_id_or_ref",
"required": true,
"in": "path",
"description": "Branch ID",
"schema": {
"oneOf": [
{
"type": "string",
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"description": "Project ref"
},
{ "type": "string", "format": "uuid", "deprecated": true }
]
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/BranchRestoreResponse" }
}
}
},
"500": { "description": "Failed to restore database branch" }
},
"security": [{ "bearer": [] }],
"summary": "Restore a scheduled branch deletion",
"tags": ["Environments"],
"x-badges": [{ "name": "OAuth scope: environment:write", "position": "after" }],
"x-oauth-scope": "environment:write"
}
},
"/v1/branches/{branch_id_or_ref}/diff": {
"get": {
"description": "Diffs the specified database branch",
Expand Down Expand Up @@ -2011,7 +2060,7 @@
"requestBody": {
"required": true,
"content": {
"application/json": { "schema": { "type": "array", "items": { "type": "string" } } }
"application/json": { "schema": { "$ref": "#/components/schemas/DeleteSecretsBody" } }
}
},
"responses": {
Expand Down Expand Up @@ -3661,7 +3710,7 @@
},
"/v1/projects/{ref}/analytics/endpoints/logs.all": {
"get": {
"description": "Executes a SQL query on the project's logs.\n\nEither the 'iso_timestamp_start' and 'iso_timestamp_end' parameters must be provided.\nIf both are not provided, only the last 1 minute of logs will be queried.\nThe timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.\n",
"description": "Executes a SQL query on the project's logs.\n\nEither the `iso_timestamp_start` and `iso_timestamp_end` parameters must be provided.\nIf both are not provided, only the last 1 minute of logs will be queried.\nThe timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.\n\nNote: Unless the `sql` parameter is provided, only edge_logs will be queried. See the [log query docs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer:~:text=logs%20from%20the-,Sources,-drop%2Ddown%3A) for all available sources. \n",
"operationId": "v1-get-project-logs",
"parameters": [
{
Expand All @@ -3671,7 +3720,13 @@
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
},
{ "name": "sql", "required": false, "in": "query", "schema": { "type": "string" } },
{
"name": "sql",
"required": false,
"in": "query",
"description": "Custom SQL query to execute on the logs. See [querying logs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer) for more details.",
"schema": { "type": "string" }
},
{
"name": "iso_timestamp_start",
"required": false,
Expand Down Expand Up @@ -3992,6 +4047,117 @@
"tags": ["Database"],
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
"x-oauth-scope": "database:write"
},
"delete": {
"description": "Only available to selected partner OAuth apps",
"operationId": "v1-rollback-migrations",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
},
{
"name": "gte",
"required": true,
"in": "query",
"description": "Rollback migrations greater or equal to this version",
"schema": { "pattern": "^\\d+$", "type": "string" }
}
],
"responses": {
"200": { "description": "" },
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to rollback database migration" }
},
"security": [{ "bearer": [] }],
"summary": "[Beta] Rollback database migrations and remove them from history table",
"tags": ["Database"],
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
"x-oauth-scope": "database:write"
}
},
"/v1/projects/{ref}/database/migrations/{version}": {
"get": {
"description": "Only available to selected partner OAuth apps",
"operationId": "v1-get-a-migration",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
},
{
"name": "version",
"required": true,
"in": "path",
"schema": { "pattern": "^\\d+$", "type": "string" }
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/V1GetMigrationResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to get database migration" }
},
"security": [{ "bearer": [] }],
"summary": "[Beta] Fetch an existing entry from migration history",
"tags": ["Database"],
"x-badges": [{ "name": "OAuth scope: database:read", "position": "after" }],
"x-oauth-scope": "database:read"
},
"patch": {
"description": "Only available to selected partner OAuth apps",
"operationId": "v1-patch-a-migration",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
},
{
"name": "version",
"required": true,
"in": "path",
"schema": { "pattern": "^\\d+$", "type": "string" }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/V1PatchMigrationBody" }
}
}
},
"responses": {
"200": { "description": "" },
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to patch database migration" }
},
"security": [{ "bearer": [] }],
"summary": "[Beta] Patch an existing entry in migration history",
"tags": ["Database"],
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
"x-oauth-scope": "database:write"
}
},
"/v1/projects/{ref}/database/query": {
Expand Down Expand Up @@ -5395,7 +5561,28 @@
"updated_at": { "type": "string", "format": "date-time" },
"review_requested_at": { "type": "string", "format": "date-time" },
"with_data": { "type": "boolean" },
"notify_url": { "type": "string", "format": "uri" }
"notify_url": { "type": "string", "format": "uri" },
"deletion_scheduled_at": { "type": "string", "format": "date-time" },
"preview_project_status": {
"type": "string",
"enum": [
"INACTIVE",
"ACTIVE_HEALTHY",
"ACTIVE_UNHEALTHY",
"COMING_UP",
"UNKNOWN",
"GOING_DOWN",
"INIT_FAILED",
"REMOVED",
"RESTORING",
"UPGRADING",
"PAUSING",
"RESTORE_FAILED",
"RESTARTING",
"PAUSE_FAILED",
"RESIZING"
]
}
},
"required": [
"id",
Expand Down Expand Up @@ -5427,6 +5614,11 @@
},
"required": ["workflow_run_id", "message"]
},
"BranchRestoreResponse": {
"type": "object",
"properties": { "message": { "type": "string", "enum": ["Branch restoration initiated"] } },
"required": ["message"]
},
"V1ListProjectsPaginatedResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -6527,6 +6719,7 @@
"required": ["name", "value"]
}
},
"DeleteSecretsBody": { "type": "array", "items": { "type": "string" } },
"SslEnforcementResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -6977,9 +7170,18 @@
"type": "object",
"properties": { "upstreamTarget": { "type": "string", "enum": ["main", "canary"] } },
"required": ["upstreamTarget"]
}
},
"migrationVersion": { "type": "string" },
"databasePoolMode": { "type": "string" }
},
"required": ["fileSizeLimit", "features", "capabilities", "external"]
"required": [
"fileSizeLimit",
"features",
"capabilities",
"external",
"migrationVersion",
"databasePoolMode"
]
},
"UpdateStorageConfigBody": {
"type": "object",
Expand Down Expand Up @@ -8531,18 +8733,36 @@
"type": "object",
"properties": {
"query": { "type": "string", "minLength": 1 },
"name": { "type": "string" }
"name": { "type": "string" },
"rollback": { "type": "string" }
},
"required": ["query"]
},
"V1UpsertMigrationBody": {
"type": "object",
"properties": {
"query": { "type": "string", "minLength": 1 },
"name": { "type": "string" }
"name": { "type": "string" },
"rollback": { "type": "string" }
},
"required": ["query"]
},
"V1GetMigrationResponse": {
"type": "object",
"properties": {
"version": { "type": "string", "minLength": 1 },
"name": { "type": "string" },
"statements": { "type": "array", "items": { "type": "string" } },
"rollback": { "type": "array", "items": { "type": "string" } },
"created_by": { "type": "string" },
"idempotency_key": { "type": "string" }
},
"required": ["version"]
},
"V1PatchMigrationBody": {
"type": "object",
"properties": { "name": { "type": "string" }, "rollback": { "type": "string" } }
},
"V1RunQueryBody": {
"type": "object",
"properties": {
Expand Down
24 changes: 24 additions & 0 deletions apps/docs/spec/common-api-sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@
"slug": "v1-generate-typescript-types",
"type": "operation"
},
{
"id": "v1-get-a-migration",
"title": "Get a migration",
"slug": "v1-get-a-migration",
"type": "operation"
},
{
"id": "v1-get-a-snippet",
"title": "Get a snippet",
Expand Down Expand Up @@ -316,6 +322,12 @@
"slug": "v1-list-migration-history",
"type": "operation"
},
{
"id": "v1-patch-a-migration",
"title": "Patch a migration",
"slug": "v1-patch-a-migration",
"type": "operation"
},
{
"id": "v1-remove-a-read-replica",
"title": "Remove a read replica",
Expand All @@ -328,6 +340,12 @@
"slug": "v1-restore-pitr-backup",
"type": "operation"
},
{
"id": "v1-rollback-migrations",
"title": "Rollback migrations",
"slug": "v1-rollback-migrations",
"type": "operation"
},
{
"id": "v1-run-a-query",
"title": "Run a query",
Expand Down Expand Up @@ -568,6 +586,12 @@
"slug": "v1-reset-a-branch",
"type": "operation"
},
{
"id": "v1-restore-a-branch",
"title": "Restore a branch",
"slug": "v1-restore-a-branch",
"type": "operation"
},
{
"id": "v1-update-a-branch-config",
"title": "Update a branch config",
Expand Down
Loading
Loading