Skip to content

Commit b754720

Browse files
pull[bot]github-actions[bot]
authored andcommitted
feat: update mgmt api docs
1 parent 972eba3 commit b754720

File tree

3 files changed

+271
-43
lines changed

3 files changed

+271
-43
lines changed

apps/docs/spec/api_v1_openapi.json

Lines changed: 88 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,35 @@
8888
"security": [{ "bearer": [] }]
8989
}
9090
},
91+
"/v1/branches/{branch_id}/push": {
92+
"post": {
93+
"operationId": "v1-push-a-branch",
94+
"summary": "Pushes a database branch",
95+
"description": "Pushes the specified database branch",
96+
"parameters": [
97+
{
98+
"name": "branch_id",
99+
"required": true,
100+
"in": "path",
101+
"description": "Branch ID",
102+
"schema": { "type": "string" }
103+
}
104+
],
105+
"responses": {
106+
"201": {
107+
"description": "",
108+
"content": {
109+
"application/json": {
110+
"schema": { "$ref": "#/components/schemas/BranchUpdateResponse" }
111+
}
112+
}
113+
},
114+
"500": { "description": "Failed to push database branch" }
115+
},
116+
"tags": ["Environments"],
117+
"security": [{ "bearer": [] }]
118+
}
119+
},
91120
"/v1/branches/{branch_id}/reset": {
92121
"post": {
93122
"operationId": "v1-reset-a-branch",
@@ -107,7 +136,7 @@
107136
"description": "",
108137
"content": {
109138
"application/json": {
110-
"schema": { "$ref": "#/components/schemas/BranchResetResponse" }
139+
"schema": { "$ref": "#/components/schemas/BranchUpdateResponse" }
111140
}
112141
}
113142
},
@@ -284,6 +313,24 @@
284313
"security": [{ "oauth2": ["write"] }]
285314
}
286315
},
316+
"/v1/oauth/revoke": {
317+
"post": {
318+
"operationId": "v1-revoke-token",
319+
"summary": "[Beta] Revoke oauth app authorization and it's corresponding tokens",
320+
"parameters": [],
321+
"requestBody": {
322+
"required": true,
323+
"content": {
324+
"application/json": {
325+
"schema": { "$ref": "#/components/schemas/OAuthRevokeTokenBodyDto" }
326+
}
327+
}
328+
},
329+
"responses": { "204": { "description": "" } },
330+
"tags": ["OAuth"],
331+
"security": [{ "oauth2": ["write"] }]
332+
}
333+
},
287334
"/v1/snippets": {
288335
"get": {
289336
"operationId": "v1-list-all-snippets",
@@ -1977,6 +2024,24 @@
19772024
"security": [{ "bearer": [] }]
19782025
}
19792026
},
2027+
"/v1/projects/{ref}/pause": {
2028+
"post": {
2029+
"operationId": "v1-pause-a-project",
2030+
"summary": "Pauses the given project",
2031+
"parameters": [
2032+
{
2033+
"name": "ref",
2034+
"required": true,
2035+
"in": "path",
2036+
"description": "Project ref",
2037+
"schema": { "minLength": 20, "maxLength": 20, "type": "string" }
2038+
}
2039+
],
2040+
"responses": { "200": { "description": "" }, "403": { "description": "" } },
2041+
"tags": ["Projects"],
2042+
"security": [{ "bearer": [] }]
2043+
}
2044+
},
19802045
"/v1/projects/{ref}/database/query": {
19812046
"post": {
19822047
"operationId": "v1-run-a-query",
@@ -2670,9 +2735,13 @@
26702735
"UpdateBranchBody": {
26712736
"type": "object",
26722737
"properties": {
2738+
"reset_on_push": {
2739+
"type": "boolean",
2740+
"deprecated": true,
2741+
"description": "This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead."
2742+
},
26732743
"branch_name": { "type": "string" },
26742744
"git_branch": { "type": "string" },
2675-
"reset_on_push": { "type": "boolean" },
26762745
"persistent": { "type": "boolean" },
26772746
"status": {
26782747
"enum": [
@@ -2691,14 +2760,17 @@
26912760
"type": "object",
26922761
"properties": {
26932762
"pr_number": { "type": "integer", "format": "int32" },
2694-
"latest_check_run_id": { "type": "integer", "format": "int64" },
2763+
"latest_check_run_id": {
2764+
"type": "number",
2765+
"deprecated": true,
2766+
"description": "This field is deprecated and will not be populated."
2767+
},
26952768
"id": { "type": "string" },
26962769
"name": { "type": "string" },
26972770
"project_ref": { "type": "string" },
26982771
"parent_project_ref": { "type": "string" },
26992772
"is_default": { "type": "boolean" },
27002773
"git_branch": { "type": "string" },
2701-
"reset_on_push": { "type": "boolean" },
27022774
"persistent": { "type": "boolean" },
27032775
"status": {
27042776
"enum": [
@@ -2720,7 +2792,6 @@
27202792
"project_ref",
27212793
"parent_project_ref",
27222794
"is_default",
2723-
"reset_on_push",
27242795
"persistent",
27252796
"status",
27262797
"created_at",
@@ -2732,7 +2803,7 @@
27322803
"properties": { "message": { "type": "string" } },
27332804
"required": ["message"]
27342805
},
2735-
"BranchResetResponse": {
2806+
"BranchUpdateResponse": {
27362807
"type": "object",
27372808
"properties": { "workflow_run_id": { "type": "string" }, "message": { "type": "string" } },
27382809
"required": ["workflow_run_id", "message"]
@@ -2791,10 +2862,7 @@
27912862
"type": "object",
27922863
"properties": {
27932864
"db_pass": { "type": "string", "description": "Database password" },
2794-
"name": {
2795-
"type": "string",
2796-
"description": "Name of your project, should not contain dots"
2797-
},
2865+
"name": { "type": "string", "description": "Name of your project" },
27982866
"organization_id": { "type": "string", "description": "Slug of your organization" },
27992867
"plan": {
28002868
"type": "string",
@@ -2939,6 +3007,16 @@
29393007
},
29403008
"required": ["expires_in", "token_type", "access_token", "refresh_token"]
29413009
},
3010+
"OAuthRevokeTokenBodyDto": {
3011+
"type": "object",
3012+
"properties": {
3013+
"client_id": { "type": "string", "format": "uuid" },
3014+
"client_secret": { "type": "string" },
3015+
"refresh_token": { "type": "string" }
3016+
},
3017+
"required": ["client_id", "client_secret", "refresh_token"],
3018+
"additionalProperties": false
3019+
},
29423020
"SnippetProject": {
29433021
"type": "object",
29443022
"properties": {

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@
297297
"slug": "v1-list-all-branches",
298298
"type": "operation"
299299
},
300+
{
301+
"id": "v1-push-a-branch",
302+
"title": "Push a branch",
303+
"slug": "v1-push-a-branch",
304+
"type": "operation"
305+
},
300306
{
301307
"id": "v1-reset-a-branch",
302308
"title": "Reset a branch",
@@ -326,6 +332,12 @@
326332
"title": "Exchange oauth token",
327333
"slug": "v1-exchange-oauth-token",
328334
"type": "operation"
335+
},
336+
{
337+
"id": "v1-revoke-token",
338+
"title": "Revoke token",
339+
"slug": "v1-revoke-token",
340+
"type": "operation"
329341
}
330342
]
331343
},
@@ -423,6 +435,12 @@
423435
"slug": "v1-list-all-projects",
424436
"type": "operation"
425437
},
438+
{
439+
"id": "v1-pause-a-project",
440+
"title": "Pause a project",
441+
"slug": "v1-pause-a-project",
442+
"type": "operation"
443+
},
426444
{
427445
"id": "v1-update-network-restrictions",
428446
"title": "Update network restrictions",

0 commit comments

Comments
 (0)