From 62c47f467f9e208740d362620ea194bf41090c7e Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Thu, 23 Jul 2026 12:06:18 +0800 Subject: [PATCH] chore(client): regenerate project API --- packages/client/src/effect/api/api.ts | 33 ++++++++++++------ .../client/src/effect/generated/client.ts | 34 +++++++++++++------ .../client/src/promise/generated/client.ts | 14 ++++++++ .../client/src/promise/generated/types.ts | 29 ++++++++++++++++ packages/client/test/promise.test.ts | 2 +- 5 files changed, 90 insertions(+), 22 deletions(-) diff --git a/packages/client/src/effect/api/api.ts b/packages/client/src/effect/api/api.ts index 3128356b5d..56ccfec94f 100644 --- a/packages/client/src/effect/api/api.ts +++ b/packages/client/src/effect/api/api.ts @@ -620,21 +620,32 @@ export interface CredentialApi { export type Endpoint13_0Output = EffectValue> export type ProjectListOperation = () => Effect.Effect -type Endpoint13_1Request = Parameters[0] -export type Endpoint13_1Input = { readonly location?: Endpoint13_1Request["query"]["location"] } -export type Endpoint13_1Output = EffectValue> -export type ProjectCurrentOperation = (input?: Endpoint13_1Input) => Effect.Effect - -type Endpoint13_2Request = Parameters[0] -export type Endpoint13_2Input = { - readonly projectID: Endpoint13_2Request["params"]["projectID"] - readonly location?: Endpoint13_2Request["query"]["location"] +type Endpoint13_1Request = Parameters[0] +export type Endpoint13_1Input = { + readonly projectID: Endpoint13_1Request["params"]["projectID"] + readonly name?: Endpoint13_1Request["payload"]["name"] + readonly icon?: Endpoint13_1Request["payload"]["icon"] + readonly commands?: Endpoint13_1Request["payload"]["commands"] } -export type Endpoint13_2Output = EffectValue> -export type ProjectDirectoriesOperation = (input: Endpoint13_2Input) => Effect.Effect +export type Endpoint13_1Output = EffectValue> +export type ProjectUpdateOperation = (input: Endpoint13_1Input) => Effect.Effect + +type Endpoint13_2Request = Parameters[0] +export type Endpoint13_2Input = { readonly location?: Endpoint13_2Request["query"]["location"] } +export type Endpoint13_2Output = EffectValue> +export type ProjectCurrentOperation = (input?: Endpoint13_2Input) => Effect.Effect + +type Endpoint13_3Request = Parameters[0] +export type Endpoint13_3Input = { + readonly projectID: Endpoint13_3Request["params"]["projectID"] + readonly location?: Endpoint13_3Request["query"]["location"] +} +export type Endpoint13_3Output = EffectValue> +export type ProjectDirectoriesOperation = (input: Endpoint13_3Input) => Effect.Effect export interface ProjectApi { readonly list: ProjectListOperation + readonly update: ProjectUpdateOperation readonly current: ProjectCurrentOperation readonly directories: ProjectDirectoriesOperation } diff --git a/packages/client/src/effect/generated/client.ts b/packages/client/src/effect/generated/client.ts index 9815edbcb1..84964c9097 100644 --- a/packages/client/src/effect/generated/client.ts +++ b/packages/client/src/effect/generated/client.ts @@ -742,17 +742,30 @@ const adaptGroup12 = (raw: RawClient["server.credential"]) => ({ update: Endpoin const Endpoint13_0 = (raw: RawClient["server.project"]) => () => raw["project.list"]({}).pipe(Effect.mapError(mapClientError)) -type Endpoint13_1Request = Parameters[0] -type Endpoint13_1Input = { readonly location?: Endpoint13_1Request["query"]["location"] } -const Endpoint13_1 = (raw: RawClient["server.project"]) => (input?: Endpoint13_1Input) => +type Endpoint13_1Request = Parameters[0] +type Endpoint13_1Input = { + readonly projectID: Endpoint13_1Request["params"]["projectID"] + readonly name?: Endpoint13_1Request["payload"]["name"] + readonly icon?: Endpoint13_1Request["payload"]["icon"] + readonly commands?: Endpoint13_1Request["payload"]["commands"] +} +const Endpoint13_1 = (raw: RawClient["server.project"]) => (input: Endpoint13_1Input) => + raw["project.update"]({ + params: { projectID: input["projectID"] }, + payload: { name: input["name"], icon: input["icon"], commands: input["commands"] }, + }).pipe(Effect.mapError(mapClientError)) + +type Endpoint13_2Request = Parameters[0] +type Endpoint13_2Input = { readonly location?: Endpoint13_2Request["query"]["location"] } +const Endpoint13_2 = (raw: RawClient["server.project"]) => (input?: Endpoint13_2Input) => raw["project.current"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)) -type Endpoint13_2Request = Parameters[0] -type Endpoint13_2Input = { - readonly projectID: Endpoint13_2Request["params"]["projectID"] - readonly location?: Endpoint13_2Request["query"]["location"] +type Endpoint13_3Request = Parameters[0] +type Endpoint13_3Input = { + readonly projectID: Endpoint13_3Request["params"]["projectID"] + readonly location?: Endpoint13_3Request["query"]["location"] } -const Endpoint13_2 = (raw: RawClient["server.project"]) => (input: Endpoint13_2Input) => +const Endpoint13_3 = (raw: RawClient["server.project"]) => (input: Endpoint13_3Input) => raw["project.directories"]({ params: { projectID: input["projectID"] }, query: { location: input["location"] }, @@ -760,8 +773,9 @@ const Endpoint13_2 = (raw: RawClient["server.project"]) => (input: Endpoint13_2I const adaptGroup13 = (raw: RawClient["server.project"]) => ({ list: Endpoint13_0(raw), - current: Endpoint13_1(raw), - directories: Endpoint13_2(raw), + update: Endpoint13_1(raw), + current: Endpoint13_2(raw), + directories: Endpoint13_3(raw), }) type Endpoint14_0Request = Parameters[0] diff --git a/packages/client/src/promise/generated/client.ts b/packages/client/src/promise/generated/client.ts index 2b77b25b75..be947d7dff 100644 --- a/packages/client/src/promise/generated/client.ts +++ b/packages/client/src/promise/generated/client.ts @@ -121,6 +121,8 @@ import type { CredentialRemoveInput, CredentialRemoveOutput, ProjectListOutput, + ProjectUpdateInput, + ProjectUpdateOutput, ProjectCurrentInput, ProjectCurrentOutput, ProjectDirectoriesInput, @@ -1170,6 +1172,18 @@ export function make(options: ClientOptions) { { method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [401, 400], empty: false }, requestOptions, ), + update: (input: ProjectUpdateInput, requestOptions?: RequestOptions) => + request( + { + method: "PATCH", + path: `/api/project/${encodeURIComponent(input.projectID)}`, + body: { name: input["name"], icon: input["icon"], commands: input["commands"] }, + successStatus: 200, + declaredStatuses: [404, 401, 400], + empty: false, + }, + requestOptions, + ), current: (input?: ProjectCurrentInput, requestOptions?: RequestOptions) => request( { diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index 00bfb4aa22..90b863b788 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -2516,6 +2516,14 @@ export type McpServerNotFoundError = { export const isMcpServerNotFoundError = (value: unknown): value is McpServerNotFoundError => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "McpServerNotFoundError" +export type ProjectNotFoundError = { + readonly _tag: "ProjectNotFoundError" + readonly projectID: string + readonly message: string +} +export const isProjectNotFoundError = (value: unknown): value is ProjectNotFoundError => + typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProjectNotFoundError" + export type FormNotFoundError = { readonly _tag: "FormNotFoundError"; readonly id: string; readonly message: string } export const isFormNotFoundError = (value: unknown): value is FormNotFoundError => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormNotFoundError" @@ -3613,6 +3621,27 @@ export type CredentialRemoveOutput = void export type ProjectListOutput = Array +export type ProjectUpdateInput = { + readonly projectID: { readonly projectID: string }["projectID"] + readonly name?: { + readonly name?: string + readonly icon?: { readonly url?: string; readonly override?: string; readonly color?: string } + readonly commands?: { readonly start?: string } + }["name"] + readonly icon?: { + readonly name?: string + readonly icon?: { readonly url?: string; readonly override?: string; readonly color?: string } + readonly commands?: { readonly start?: string } + }["icon"] + readonly commands?: { + readonly name?: string + readonly icon?: { readonly url?: string; readonly override?: string; readonly color?: string } + readonly commands?: { readonly start?: string } + }["commands"] +} + +export type ProjectUpdateOutput = Project + export type ProjectCurrentInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined diff --git a/packages/client/test/promise.test.ts b/packages/client/test/promise.test.ts index 9c43ee4951..a9d25ed1c8 100644 --- a/packages/client/test/promise.test.ts +++ b/packages/client/test/promise.test.ts @@ -46,7 +46,7 @@ test("exposes every standard HTTP API group", () => { expect(Object.keys(client.vcs)).toEqual(["get", "status", "diff"]) expect(Object.keys(client.pty)).toEqual(["shells", "list", "create", "get", "update", "remove", "connectToken"]) expect(Object.keys(client.shell)).toEqual(["list", "create", "get", "timeout", "output", "remove"]) - expect(Object.keys(client.project)).toEqual(["list", "current", "directories"]) + expect(Object.keys(client.project)).toEqual(["list", "update", "current", "directories"]) }) test("PTY connect token sends the required browser header", async () => {