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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"body": [
{
"connection_string": "postgresql://postgres:password@my-branch.supabase.co:5432/postgres",
"connectionString": "postgresql://postgres:password@my-branch.supabase.co:5432/postgres",
"database_type": "PRIMARY",
"db_host": "my-branch.supabase.co",
"db_name": "postgres",
Expand Down
16 changes: 8 additions & 8 deletions apps/cli/docs/go-cli-porting-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ Legend:
| `projects create` | `wrapped` | [`../src/legacy/commands/projects/create/create.command.ts`](../src/legacy/commands/projects/create/create.command.ts) |
| `projects delete` | `wrapped` | [`../src/legacy/commands/projects/delete/delete.command.ts`](../src/legacy/commands/projects/delete/delete.command.ts) |
| `projects api-keys` | `wrapped` | [`../src/legacy/commands/projects/api-keys/api-keys.command.ts`](../src/legacy/commands/projects/api-keys/api-keys.command.ts) |
| `branches list` | `wrapped` | [`../src/legacy/commands/branches/list/list.command.ts`](../src/legacy/commands/branches/list/list.command.ts) |
| `branches create` | `wrapped` | [`../src/legacy/commands/branches/create/create.command.ts`](../src/legacy/commands/branches/create/create.command.ts) |
| `branches get` | `wrapped` | [`../src/legacy/commands/branches/get/get.command.ts`](../src/legacy/commands/branches/get/get.command.ts) |
| `branches update` | `wrapped` | [`../src/legacy/commands/branches/update/update.command.ts`](../src/legacy/commands/branches/update/update.command.ts) |
| `branches pause` | `wrapped` | [`../src/legacy/commands/branches/pause/pause.command.ts`](../src/legacy/commands/branches/pause/pause.command.ts) |
| `branches unpause` | `wrapped` | [`../src/legacy/commands/branches/unpause/unpause.command.ts`](../src/legacy/commands/branches/unpause/unpause.command.ts) |
| `branches delete` | `wrapped` | [`../src/legacy/commands/branches/delete/delete.command.ts`](../src/legacy/commands/branches/delete/delete.command.ts) |
| `branches disable` | `wrapped` | [`../src/legacy/commands/branches/disable/disable.command.ts`](../src/legacy/commands/branches/disable/disable.command.ts) |
| `branches list` | `ported` | [`../src/legacy/commands/branches/list/list.command.ts`](../src/legacy/commands/branches/list/list.command.ts) |
| `branches create` | `ported` | [`../src/legacy/commands/branches/create/create.command.ts`](../src/legacy/commands/branches/create/create.command.ts) |
| `branches get` | `ported` | [`../src/legacy/commands/branches/get/get.command.ts`](../src/legacy/commands/branches/get/get.command.ts) |
| `branches update` | `ported` | [`../src/legacy/commands/branches/update/update.command.ts`](../src/legacy/commands/branches/update/update.command.ts) |
| `branches pause` | `ported` | [`../src/legacy/commands/branches/pause/pause.command.ts`](../src/legacy/commands/branches/pause/pause.command.ts) |
| `branches unpause` | `ported` | [`../src/legacy/commands/branches/unpause/unpause.command.ts`](../src/legacy/commands/branches/unpause/unpause.command.ts) |
| `branches delete` | `ported` | [`../src/legacy/commands/branches/delete/delete.command.ts`](../src/legacy/commands/branches/delete/delete.command.ts) |
| `branches disable` | `ported` | [`../src/legacy/commands/branches/disable/disable.command.ts`](../src/legacy/commands/branches/disable/disable.command.ts) |
| `secrets list` | `ported` | [`../src/legacy/commands/secrets/list/list.command.ts`](../src/legacy/commands/secrets/list/list.command.ts) |
| `secrets set` | `ported` | [`../src/legacy/commands/secrets/set/set.command.ts`](../src/legacy/commands/secrets/set/set.command.ts) |
| `secrets unset` | `ported` | [`../src/legacy/commands/secrets/unset/unset.command.ts`](../src/legacy/commands/secrets/unset/unset.command.ts) |
Expand Down
204 changes: 204 additions & 0 deletions apps/cli/src/legacy/commands/branches/branches.errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
import { Data } from "effect";

// ---------------------------------------------------------------------------
// HTTP-bound errors — one (Network + UnexpectedStatus) pair per Go errorf site.
// Names trace back to `apps/cli-go/internal/branches/<sub>/` for grepability.
// Templates match Go's `errors.Errorf(...)` phrasing byte-for-byte.
// ---------------------------------------------------------------------------

export class LegacyBranchesListNetworkError extends Data.TaggedError(
"LegacyBranchesListNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesListUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesListUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesCreateNetworkError extends Data.TaggedError(
"LegacyBranchesCreateNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesCreateUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesCreateUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

// Lookup phase of `branches get` (only runs when input is not UUID / not ref).
export class LegacyBranchesFindNetworkError extends Data.TaggedError(
"LegacyBranchesFindNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesFindUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesFindUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

// `branches get` detail phase + the resolver's UUID branch (both use
// V1GetABranchConfig; Go shares the same error template).
export class LegacyBranchesGetNetworkError extends Data.TaggedError(
"LegacyBranchesGetNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesGetUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesGetUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesApiKeysNetworkError extends Data.TaggedError(
"LegacyBranchesApiKeysNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesApiKeysUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesApiKeysUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesPoolerNetworkError extends Data.TaggedError(
"LegacyBranchesPoolerNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesPoolerUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesPoolerUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesPrimaryNotFoundError extends Data.TaggedError(
"LegacyBranchesPrimaryNotFoundError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesUpdateNetworkError extends Data.TaggedError(
"LegacyBranchesUpdateNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesUpdateUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesUpdateUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesPauseNetworkError extends Data.TaggedError(
"LegacyBranchesPauseNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesPauseUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesPauseUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesUnpauseNetworkError extends Data.TaggedError(
"LegacyBranchesUnpauseNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesUnpauseUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesUnpauseUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesDeleteNetworkError extends Data.TaggedError(
"LegacyBranchesDeleteNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesDeleteUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesDeleteUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

export class LegacyBranchesDisableNetworkError extends Data.TaggedError(
"LegacyBranchesDisableNetworkError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesDisableUnexpectedStatusError extends Data.TaggedError(
"LegacyBranchesDisableUnexpectedStatusError",
)<{
readonly status: number;
readonly body: string;
readonly message: string;
}> {}

// ---------------------------------------------------------------------------
// Pure-path errors (validation, prompt-time semantics, user cancellation).
// ---------------------------------------------------------------------------

export class LegacyBranchesEnvNotSupportedError extends Data.TaggedError(
"LegacyBranchesEnvNotSupportedError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesCreateCancelledError extends Data.TaggedError(
"LegacyBranchesCreateCancelledError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesBranchNameEmptyError extends Data.TaggedError(
"LegacyBranchesBranchNameEmptyError",
)<{
readonly message: string;
}> {}

export class LegacyBranchesBranchingDisabledError extends Data.TaggedError(
"LegacyBranchesBranchingDisabledError",
)<{
readonly message: string;
/**
* Mirrors Go's `utils.CmdSuggestion = "Create your first branch with: supabase
* branches create"` (`apps/cli-go/cmd/branches.go:252`). Picked up by
* `normalizeCliError` and printed after the error message in text mode.
*/
readonly suggestion: string;
}> {}
Loading
Loading