/** * Wire contract for `GET /api/connections/list` — the single shared shape * between the webapp producer (`webapp/app/routes/api/connections/list.ts`) * and the CLI consumer (`FjallApiClient.getConnectedAccounts`). Neither side * may redeclare this record: the producer conforms at compile time via * `satisfies ConnectionWire`, the consumer parses with `safeParse`. */ import { z } from "zod"; export declare const ConnectionWireSchema: z.ZodObject<{ awsAccountId: z.ZodString; accountName: z.ZodNullable; status: z.ZodString; role: z.ZodString; roleArn: z.ZodString; environment: z.ZodOptional; connectedAt: z.ZodString; externalId: z.ZodOptional; reason: z.ZodOptional; }, z.core.$strip>; export type ConnectionWire = z.infer; export declare const ConnectionsListResponseSchema: z.ZodObject<{ accounts: z.ZodArray; status: z.ZodString; role: z.ZodString; roleArn: z.ZodString; environment: z.ZodOptional; connectedAt: z.ZodString; externalId: z.ZodOptional; reason: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type ConnectionsListResponse = z.infer; /** * Connection lifecycle vocabulary shared with the webapp producer * (`GET /api/connections/status`, the wizard and the CLI's `connect` wait * loop). Coupled value across repos: the webapp mirrors these tuples at * `webapp/app/lib/connections-wire.ts` until it imports them from a minted * `@fjall/util`; a change here MUST land on both sides together, the way * `TOKEN_AUTH_FAILURE_REASONS` is kept in lockstep. The content pins in * `util/src/__tests__/connectionsWire.test.ts` are the drift tripwire. */ export declare const CONNECTION_PHASES: readonly ["awaiting_stack", "connected", "failed", "disconnected"]; export type ConnectionPhase = (typeof CONNECTION_PHASES)[number]; /** * The terminal-failure subset: phases where polling must stop and the * reason's cure be reported. `satisfies` pins every member to a real * phase; consumers derive their accept-sets from this tuple rather than * hand-listing the pair. */ export declare const CONNECTION_TERMINAL_FAILURE_PHASES: readonly ["failed", "disconnected"]; export type ConnectionTerminalFailurePhase = (typeof CONNECTION_TERMINAL_FAILURE_PHASES)[number]; export declare const CONNECTION_FAILURE_REASONS: readonly ["account_mismatch", "root_exists", "root_promotion", "name_conflict", "plan_limit", "stack_rolled_back", "stack_deleted"]; export type ConnectionFailureReason = (typeof CONNECTION_FAILURE_REASONS)[number]; /** * The connection external id: minted by the webapp as * `randomBytes(16).toString("hex")` (32 hex characters) and accepted up to 64 * so a wider mint never breaks an older client. Canonical pattern the * validators converge on: the webapp callback route enforces the equivalent * 32–64 hex chain today, the status route accepts >=32 with no upper cap * until it adopts this constant at the next `@fjall/util` mint, and the CLI * `connect status` command consumes it when that command lands. */ export declare const EXTERNAL_ID_PATTERN: RegExp;