summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sdk/js/src')
-rw-r--r--packages/sdk/js/src/v2/gen/sdk.gen.ts43
-rw-r--r--packages/sdk/js/src/v2/gen/types.gen.ts41
2 files changed, 83 insertions, 1 deletions
diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts
index 38f39b2a9..56167f6f3 100644
--- a/packages/sdk/js/src/v2/gen/sdk.gen.ts
+++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts
@@ -51,6 +51,8 @@ import type {
PermissionRespondResponses,
ProjectCurrentResponses,
ProjectListResponses,
+ ProjectUpdateErrors,
+ ProjectUpdateResponses,
ProviderAuthResponses,
ProviderListResponses,
ProviderOauthAuthorizeErrors,
@@ -231,6 +233,47 @@ export class Project extends HeyApiClient {
...params,
})
}
+
+ /**
+ * Update project
+ *
+ * Update project properties such as name, icon and color.
+ */
+ public update<ThrowOnError extends boolean = false>(
+ parameters: {
+ projectID: string
+ directory?: string
+ name?: string
+ icon?: string
+ color?: string
+ },
+ options?: Options<never, ThrowOnError>,
+ ) {
+ const params = buildClientParams(
+ [parameters],
+ [
+ {
+ args: [
+ { in: "path", key: "projectID" },
+ { in: "query", key: "directory" },
+ { in: "body", key: "name" },
+ { in: "body", key: "icon" },
+ { in: "body", key: "color" },
+ ],
+ },
+ ],
+ )
+ return (options?.client ?? this.client).patch<ProjectUpdateResponses, ProjectUpdateErrors, ThrowOnError>({
+ url: "/project/{projectID}",
+ ...options,
+ ...params,
+ headers: {
+ "Content-Type": "application/json",
+ ...options?.headers,
+ ...params.headers,
+ },
+ })
+ }
}
export class Pty extends HeyApiClient {
diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts
index 82765e283..a3364fe5e 100644
--- a/packages/sdk/js/src/v2/gen/types.gen.ts
+++ b/packages/sdk/js/src/v2/gen/types.gen.ts
@@ -745,8 +745,10 @@ export type GlobalEvent = {
export type Project = {
id: string
worktree: string
- vcsDir?: string
vcs?: "git"
+ name?: string
+ icon?: string
+ color?: string
time: {
created: number
updated?: number
@@ -1716,6 +1718,43 @@ export type ProjectCurrentResponses = {
export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses]
+export type ProjectUpdateData = {
+ body?: {
+ name?: string
+ icon?: string
+ color?: string
+ }
+ path: {
+ projectID: string
+ }
+ query?: {
+ directory?: string
+ }
+ url: "/project/{projectID}"
+}
+
+export type ProjectUpdateErrors = {
+ /**
+ * Bad request
+ */
+ 400: BadRequestError
+ /**
+ * Not found
+ */
+ 404: NotFoundError
+}
+
+export type ProjectUpdateError = ProjectUpdateErrors[keyof ProjectUpdateErrors]
+
+export type ProjectUpdateResponses = {
+ /**
+ * Updated project information
+ */
+ 200: Project
+}
+
+export type ProjectUpdateResponse = ProjectUpdateResponses[keyof ProjectUpdateResponses]
+
export type PtyListData = {
body?: never
path?: never