chore: update api/beta.yaml from staging v1-yaml (#2906) · cameronraysmith/supabase-cli@47bcb30 · GitHub
Skip to content

Commit 47bcb30

Browse files
chore: update api/beta.yaml from staging v1-yaml (supabase#2906)
* chore: update api/beta.yaml from staging v1-yaml * chore: revert to single quote --------- Co-authored-by: Qiao Han <qiao@supabase.io>
1 parent 8dbf6b2 commit 47bcb30

12 files changed

Lines changed: 731 additions & 233 deletions

File tree

‎api/beta.yaml‎

Lines changed: 191 additions & 42 deletions
Large diffs are not rendered by default.

‎cmd/projects.go‎

Lines changed: 15 additions & 15 deletions

‎internal/bootstrap/bootstrap.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options ..
7777
return err
7878
}
7979
// 2. Create project
80-
params := api.V1CreateProjectBody{
80+
params := api.V1CreateProjectBodyDto{
8181
Name: filepath.Base(workdir),
8282
TemplateUrl: &starter.Url,
8383
}

‎internal/link/link.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ func checkRemoteProjectStatus(ctx context.Context, projectRef string, fsys afero
270270
}
271271

272272
switch resp.JSON200.Status {
273-
case api.V1ProjectResponseStatusINACTIVE:
273+
case api.V1ProjectWithDatabaseResponseStatusINACTIVE:
274274
utils.CmdSuggestion = fmt.Sprintf("An admin must unpause it from the Supabase dashboard at %s", utils.Aqua(fmt.Sprintf("%s/project/%s", utils.GetSupabaseDashboardURL(), projectRef)))
275275
return errors.New(errProjectPaused)
276-
case api.V1ProjectResponseStatusACTIVEHEALTHY:
276+
case api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY:
277277
// Project is in the desired state, do nothing
278278
default:
279279
fmt.Fprintf(os.Stderr, "%s: Project status is %s instead of Active Healthy. Some operations might fail.\n", utils.Yellow("WARNING"), resp.JSON200.Status)

‎internal/link/link_test.go‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ func TestLinkCommand(t *testing.T) {
5858
gock.New(utils.DefaultApiHost).
5959
Get("/v1/projects/" + project).
6060
Reply(200).
61-
JSON(api.V1ProjectResponse{
62-
Status: api.V1ProjectResponseStatusACTIVEHEALTHY,
63-
Database: &postgres,
61+
JSON(api.V1ProjectWithDatabaseResponse{
62+
Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY,
63+
Database: postgres,
6464
})
6565
gock.New(utils.DefaultApiHost).
6666
Get("/v1/projects/" + project + "/api-keys").
@@ -132,9 +132,9 @@ func TestLinkCommand(t *testing.T) {
132132
gock.New(utils.DefaultApiHost).
133133
Get("/v1/projects/" + project).
134134
Reply(200).
135-
JSON(api.V1ProjectResponse{
136-
Status: api.V1ProjectResponseStatusACTIVEHEALTHY,
137-
Database: &api.V1DatabaseResponse{},
135+
JSON(api.V1ProjectWithDatabaseResponse{
136+
Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY,
137+
Database: api.V1DatabaseResponse{},
138138
})
139139
gock.New(utils.DefaultApiHost).
140140
Get("/v1/projects/" + project + "/api-keys").
@@ -186,9 +186,9 @@ func TestLinkCommand(t *testing.T) {
186186
gock.New(utils.DefaultApiHost).
187187
Get("/v1/projects/" + project).
188188
Reply(200).
189-
JSON(api.V1ProjectResponse{
190-
Status: api.V1ProjectResponseStatusACTIVEHEALTHY,
191-
Database: &api.V1DatabaseResponse{},
189+
JSON(api.V1ProjectWithDatabaseResponse{
190+
Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY,
191+
Database: api.V1DatabaseResponse{},
192192
})
193193
gock.New(utils.DefaultApiHost).
194194
Get("/v1/projects/" + project + "/api-keys").
@@ -247,9 +247,9 @@ func TestStatusCheck(t *testing.T) {
247247
gock.New(utils.DefaultApiHost).
248248
Get("/v1/projects/" + project).
249249
Reply(http.StatusOK).
250-
JSON(api.V1ProjectResponse{
251-
Status: api.V1ProjectResponseStatusACTIVEHEALTHY,
252-
Database: &api.V1DatabaseResponse{Version: "15.6.1.139"},
250+
JSON(api.V1ProjectWithDatabaseResponse{
251+
Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY,
252+
Database: api.V1DatabaseResponse{Version: "15.6.1.139"},
253253
})
254254
// Run test
255255
err := checkRemoteProjectStatus(context.Background(), project, fsys)
@@ -289,7 +289,7 @@ func TestStatusCheck(t *testing.T) {
289289
gock.New(utils.DefaultApiHost).
290290
Get("/v1/projects/" + project).
291291
Reply(http.StatusOK).
292-
JSON(api.V1ProjectResponse{Status: api.V1ProjectResponseStatusINACTIVE})
292+
JSON(api.V1ProjectWithDatabaseResponse{Status: api.V1ProjectWithDatabaseResponseStatusINACTIVE})
293293
// Run test
294294
err := checkRemoteProjectStatus(context.Background(), project, fsys)
295295
// Check error

‎internal/projects/apiKeys/api_keys.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs) error {
3434
}
3535

3636
func RunGetApiKeys(ctx context.Context, projectRef string) ([]api.ApiKeyResponse, error) {
37-
resp, err := utils.GetSupabase().V1GetProjectApiKeysWithResponse(ctx, projectRef)
37+
resp, err := utils.GetSupabase().V1GetProjectApiKeysWithResponse(ctx, projectRef, &api.V1GetProjectApiKeysParams{})
3838
if err != nil {
3939
return nil, errors.Errorf("failed to get api keys: %w", err)
4040
}

‎internal/projects/create/create.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/supabase/cli/pkg/api"
1616
)
1717

18-
func Run(ctx context.Context, params api.V1CreateProjectBody, fsys afero.Fs) error {
18+
func Run(ctx context.Context, params api.V1CreateProjectBodyDto, fsys afero.Fs) error {
1919
if err := promptMissingParams(ctx, &params); err != nil {
2020
return err
2121
}
@@ -49,7 +49,7 @@ func printKeyValue(key, value string) string {
4949
return key + ":" + spaces + value
5050
}
5151

52-
func promptMissingParams(ctx context.Context, body *api.V1CreateProjectBody) error {
52+
func promptMissingParams(ctx context.Context, body *api.V1CreateProjectBodyDto) error {
5353
var err error
5454
if len(body.Name) == 0 {
5555
if body.Name, err = promptProjectName(ctx); err != nil {
@@ -106,7 +106,7 @@ func promptOrgId(ctx context.Context) (string, error) {
106106
return choice.Details, nil
107107
}
108108

109-
func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyRegion, error) {
109+
func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyDtoRegion, error) {
110110
title := "Which region do you want to host the project in?"
111111
items := make([]utils.PromptItem, len(utils.RegionMap))
112112
i := 0
@@ -118,5 +118,5 @@ func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyRegion, er
118118
if err != nil {
119119
return "", err
120120
}
121-
return api.V1CreateProjectBodyRegion(choice.Summary), nil
121+
return api.V1CreateProjectBodyDtoRegion(choice.Summary), nil
122122
}

‎internal/projects/create/create_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
)
1515

1616
func TestProjectCreateCommand(t *testing.T) {
17-
var params = api.V1CreateProjectBody{
17+
var params = api.V1CreateProjectBodyDto{
1818
Name: "Test Project",
1919
OrganizationId: "combined-fuchsia-lion",
2020
DbPass: "redacted",
21-
Region: api.V1CreateProjectBodyRegionUsWest1,
21+
Region: api.V1CreateProjectBodyDtoRegionUsWest1,
2222
}
2323

2424
t.Run("creates a new project", func(t *testing.T) {

‎internal/projects/list/list.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
)
1616

1717
type linkedProject struct {
18-
api.V1ProjectResponse `yaml:",inline"`
19-
Linked bool `json:"linked"`
18+
api.V1ProjectWithDatabaseResponse `yaml:",inline"`
19+
Linked bool `json:"linked"`
2020
}
2121

2222
func Run(ctx context.Context, fsys afero.Fs) error {
@@ -37,8 +37,8 @@ func Run(ctx context.Context, fsys afero.Fs) error {
3737
var projects []linkedProject
3838
for _, project := range *resp.JSON200 {
3939
projects = append(projects, linkedProject{
40-
V1ProjectResponse: project,
41-
Linked: project.Id == projectRef,
40+
V1ProjectWithDatabaseResponse: project,
41+
Linked: project.Id == projectRef,
4242
})
4343
}
4444

‎internal/utils/tenant/client.go‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)