Skip to content

Commit 8c326eb

Browse files
docs: update js client libraries (2.81.1) (supabase#40359)
Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
1 parent 1032d13 commit 8c326eb

19 files changed

+49679
-43030
lines changed

apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap

Lines changed: 2147 additions & 104 deletions
Large diffs are not rendered by default.

apps/docs/spec/api_v1_openapi.json

Lines changed: 229 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"x-oauth-scope": "environment:write"
8888
},
8989
"delete": {
90-
"description": "Deletes the specified database branch",
90+
"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).",
9191
"operationId": "v1-delete-a-branch",
9292
"parameters": [
9393
{
@@ -107,6 +107,13 @@
107107
{ "type": "string", "format": "uuid", "deprecated": true }
108108
]
109109
}
110+
},
111+
{
112+
"name": "force",
113+
"required": false,
114+
"in": "query",
115+
"description": "If set to false, schedule deletion with 1-hour grace period (only when soft deletion is enabled).",
116+
"schema": { "default": "true", "type": "boolean" }
110117
}
111118
],
112119
"responses": {
@@ -271,6 +278,48 @@
271278
"x-oauth-scope": "environment:write"
272279
}
273280
},
281+
"/v1/branches/{branch_id_or_ref}/restore": {
282+
"post": {
283+
"description": "Cancels scheduled deletion and restores the branch to active state",
284+
"operationId": "v1-restore-a-branch",
285+
"parameters": [
286+
{
287+
"name": "branch_id_or_ref",
288+
"required": true,
289+
"in": "path",
290+
"description": "Branch ID",
291+
"schema": {
292+
"oneOf": [
293+
{
294+
"type": "string",
295+
"minLength": 20,
296+
"maxLength": 20,
297+
"pattern": "^[a-z]+$",
298+
"description": "Project ref"
299+
},
300+
{ "type": "string", "format": "uuid", "deprecated": true }
301+
]
302+
}
303+
}
304+
],
305+
"responses": {
306+
"200": {
307+
"description": "",
308+
"content": {
309+
"application/json": {
310+
"schema": { "$ref": "#/components/schemas/BranchRestoreResponse" }
311+
}
312+
}
313+
},
314+
"500": { "description": "Failed to restore database branch" }
315+
},
316+
"security": [{ "bearer": [] }],
317+
"summary": "Restore a scheduled branch deletion",
318+
"tags": ["Environments"],
319+
"x-badges": [{ "name": "OAuth scope: environment:write", "position": "after" }],
320+
"x-oauth-scope": "environment:write"
321+
}
322+
},
274323
"/v1/branches/{branch_id_or_ref}/diff": {
275324
"get": {
276325
"description": "Diffs the specified database branch",
@@ -2011,7 +2060,7 @@
20112060
"requestBody": {
20122061
"required": true,
20132062
"content": {
2014-
"application/json": { "schema": { "type": "array", "items": { "type": "string" } } }
2063+
"application/json": { "schema": { "$ref": "#/components/schemas/DeleteSecretsBody" } }
20152064
}
20162065
},
20172066
"responses": {
@@ -3661,7 +3710,7 @@
36613710
},
36623711
"/v1/projects/{ref}/analytics/endpoints/logs.all": {
36633712
"get": {
3664-
"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",
3713+
"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",
36653714
"operationId": "v1-get-project-logs",
36663715
"parameters": [
36673716
{
@@ -3671,7 +3720,13 @@
36713720
"description": "Project ref",
36723721
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
36733722
},
3674-
{ "name": "sql", "required": false, "in": "query", "schema": { "type": "string" } },
3723+
{
3724+
"name": "sql",
3725+
"required": false,
3726+
"in": "query",
3727+
"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.",
3728+
"schema": { "type": "string" }
3729+
},
36753730
{
36763731
"name": "iso_timestamp_start",
36773732
"required": false,
@@ -3992,6 +4047,117 @@
39924047
"tags": ["Database"],
39934048
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
39944049
"x-oauth-scope": "database:write"
4050+
},
4051+
"delete": {
4052+
"description": "Only available to selected partner OAuth apps",
4053+
"operationId": "v1-rollback-migrations",
4054+
"parameters": [
4055+
{
4056+
"name": "ref",
4057+
"required": true,
4058+
"in": "path",
4059+
"description": "Project ref",
4060+
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
4061+
},
4062+
{
4063+
"name": "gte",
4064+
"required": true,
4065+
"in": "query",
4066+
"description": "Rollback migrations greater or equal to this version",
4067+
"schema": { "pattern": "^\\d+$", "type": "string" }
4068+
}
4069+
],
4070+
"responses": {
4071+
"200": { "description": "" },
4072+
"401": { "description": "Unauthorized" },
4073+
"403": { "description": "Forbidden action" },
4074+
"429": { "description": "Rate limit exceeded" },
4075+
"500": { "description": "Failed to rollback database migration" }
4076+
},
4077+
"security": [{ "bearer": [] }],
4078+
"summary": "[Beta] Rollback database migrations and remove them from history table",
4079+
"tags": ["Database"],
4080+
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
4081+
"x-oauth-scope": "database:write"
4082+
}
4083+
},
4084+
"/v1/projects/{ref}/database/migrations/{version}": {
4085+
"get": {
4086+
"description": "Only available to selected partner OAuth apps",
4087+
"operationId": "v1-get-a-migration",
4088+
"parameters": [
4089+
{
4090+
"name": "ref",
4091+
"required": true,
4092+
"in": "path",
4093+
"description": "Project ref",
4094+
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
4095+
},
4096+
{
4097+
"name": "version",
4098+
"required": true,
4099+
"in": "path",
4100+
"schema": { "pattern": "^\\d+$", "type": "string" }
4101+
}
4102+
],
4103+
"responses": {
4104+
"200": {
4105+
"description": "",
4106+
"content": {
4107+
"application/json": {
4108+
"schema": { "$ref": "#/components/schemas/V1GetMigrationResponse" }
4109+
}
4110+
}
4111+
},
4112+
"401": { "description": "Unauthorized" },
4113+
"403": { "description": "Forbidden action" },
4114+
"429": { "description": "Rate limit exceeded" },
4115+
"500": { "description": "Failed to get database migration" }
4116+
},
4117+
"security": [{ "bearer": [] }],
4118+
"summary": "[Beta] Fetch an existing entry from migration history",
4119+
"tags": ["Database"],
4120+
"x-badges": [{ "name": "OAuth scope: database:read", "position": "after" }],
4121+
"x-oauth-scope": "database:read"
4122+
},
4123+
"patch": {
4124+
"description": "Only available to selected partner OAuth apps",
4125+
"operationId": "v1-patch-a-migration",
4126+
"parameters": [
4127+
{
4128+
"name": "ref",
4129+
"required": true,
4130+
"in": "path",
4131+
"description": "Project ref",
4132+
"schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" }
4133+
},
4134+
{
4135+
"name": "version",
4136+
"required": true,
4137+
"in": "path",
4138+
"schema": { "pattern": "^\\d+$", "type": "string" }
4139+
}
4140+
],
4141+
"requestBody": {
4142+
"required": true,
4143+
"content": {
4144+
"application/json": {
4145+
"schema": { "$ref": "#/components/schemas/V1PatchMigrationBody" }
4146+
}
4147+
}
4148+
},
4149+
"responses": {
4150+
"200": { "description": "" },
4151+
"401": { "description": "Unauthorized" },
4152+
"403": { "description": "Forbidden action" },
4153+
"429": { "description": "Rate limit exceeded" },
4154+
"500": { "description": "Failed to patch database migration" }
4155+
},
4156+
"security": [{ "bearer": [] }],
4157+
"summary": "[Beta] Patch an existing entry in migration history",
4158+
"tags": ["Database"],
4159+
"x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }],
4160+
"x-oauth-scope": "database:write"
39954161
}
39964162
},
39974163
"/v1/projects/{ref}/database/query": {
@@ -5395,7 +5561,28 @@
53955561
"updated_at": { "type": "string", "format": "date-time" },
53965562
"review_requested_at": { "type": "string", "format": "date-time" },
53975563
"with_data": { "type": "boolean" },
5398-
"notify_url": { "type": "string", "format": "uri" }
5564+
"notify_url": { "type": "string", "format": "uri" },
5565+
"deletion_scheduled_at": { "type": "string", "format": "date-time" },
5566+
"preview_project_status": {
5567+
"type": "string",
5568+
"enum": [
5569+
"INACTIVE",
5570+
"ACTIVE_HEALTHY",
5571+
"ACTIVE_UNHEALTHY",
5572+
"COMING_UP",
5573+
"UNKNOWN",
5574+
"GOING_DOWN",
5575+
"INIT_FAILED",
5576+
"REMOVED",
5577+
"RESTORING",
5578+
"UPGRADING",
5579+
"PAUSING",
5580+
"RESTORE_FAILED",
5581+
"RESTARTING",
5582+
"PAUSE_FAILED",
5583+
"RESIZING"
5584+
]
5585+
}
53995586
},
54005587
"required": [
54015588
"id",
@@ -5427,6 +5614,11 @@
54275614
},
54285615
"required": ["workflow_run_id", "message"]
54295616
},
5617+
"BranchRestoreResponse": {
5618+
"type": "object",
5619+
"properties": { "message": { "type": "string", "enum": ["Branch restoration initiated"] } },
5620+
"required": ["message"]
5621+
},
54305622
"V1ListProjectsPaginatedResponse": {
54315623
"type": "object",
54325624
"properties": {
@@ -6527,6 +6719,7 @@
65276719
"required": ["name", "value"]
65286720
}
65296721
},
6722+
"DeleteSecretsBody": { "type": "array", "items": { "type": "string" } },
65306723
"SslEnforcementResponse": {
65316724
"type": "object",
65326725
"properties": {
@@ -6977,9 +7170,18 @@
69777170
"type": "object",
69787171
"properties": { "upstreamTarget": { "type": "string", "enum": ["main", "canary"] } },
69797172
"required": ["upstreamTarget"]
6980-
}
7173+
},
7174+
"migrationVersion": { "type": "string" },
7175+
"databasePoolMode": { "type": "string" }
69817176
},
6982-
"required": ["fileSizeLimit", "features", "capabilities", "external"]
7177+
"required": [
7178+
"fileSizeLimit",
7179+
"features",
7180+
"capabilities",
7181+
"external",
7182+
"migrationVersion",
7183+
"databasePoolMode"
7184+
]
69837185
},
69847186
"UpdateStorageConfigBody": {
69857187
"type": "object",
@@ -8531,18 +8733,36 @@
85318733
"type": "object",
85328734
"properties": {
85338735
"query": { "type": "string", "minLength": 1 },
8534-
"name": { "type": "string" }
8736+
"name": { "type": "string" },
8737+
"rollback": { "type": "string" }
85358738
},
85368739
"required": ["query"]
85378740
},
85388741
"V1UpsertMigrationBody": {
85398742
"type": "object",
85408743
"properties": {
85418744
"query": { "type": "string", "minLength": 1 },
8542-
"name": { "type": "string" }
8745+
"name": { "type": "string" },
8746+
"rollback": { "type": "string" }
85438747
},
85448748
"required": ["query"]
85458749
},
8750+
"V1GetMigrationResponse": {
8751+
"type": "object",
8752+
"properties": {
8753+
"version": { "type": "string", "minLength": 1 },
8754+
"name": { "type": "string" },
8755+
"statements": { "type": "array", "items": { "type": "string" } },
8756+
"rollback": { "type": "array", "items": { "type": "string" } },
8757+
"created_by": { "type": "string" },
8758+
"idempotency_key": { "type": "string" }
8759+
},
8760+
"required": ["version"]
8761+
},
8762+
"V1PatchMigrationBody": {
8763+
"type": "object",
8764+
"properties": { "name": { "type": "string" }, "rollback": { "type": "string" } }
8765+
},
85468766
"V1RunQueryBody": {
85478767
"type": "object",
85488768
"properties": {

apps/docs/spec/common-api-sections.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@
244244
"slug": "v1-generate-typescript-types",
245245
"type": "operation"
246246
},
247+
{
248+
"id": "v1-get-a-migration",
249+
"title": "Get a migration",
250+
"slug": "v1-get-a-migration",
251+
"type": "operation"
252+
},
247253
{
248254
"id": "v1-get-a-snippet",
249255
"title": "Get a snippet",
@@ -316,6 +322,12 @@
316322
"slug": "v1-list-migration-history",
317323
"type": "operation"
318324
},
325+
{
326+
"id": "v1-patch-a-migration",
327+
"title": "Patch a migration",
328+
"slug": "v1-patch-a-migration",
329+
"type": "operation"
330+
},
319331
{
320332
"id": "v1-remove-a-read-replica",
321333
"title": "Remove a read replica",
@@ -328,6 +340,12 @@
328340
"slug": "v1-restore-pitr-backup",
329341
"type": "operation"
330342
},
343+
{
344+
"id": "v1-rollback-migrations",
345+
"title": "Rollback migrations",
346+
"slug": "v1-rollback-migrations",
347+
"type": "operation"
348+
},
331349
{
332350
"id": "v1-run-a-query",
333351
"title": "Run a query",
@@ -568,6 +586,12 @@
568586
"slug": "v1-reset-a-branch",
569587
"type": "operation"
570588
},
589+
{
590+
"id": "v1-restore-a-branch",
591+
"title": "Restore a branch",
592+
"slug": "v1-restore-a-branch",
593+
"type": "operation"
594+
},
571595
{
572596
"id": "v1-update-a-branch-config",
573597
"title": "Update a branch config",

0 commit comments

Comments
 (0)