diff options
| author | Shoubhit Dash <[email protected]> | 2026-03-07 01:09:50 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-06 13:39:50 -0600 |
| commit | d6e0f47361d2a5c38c012618895cbdc7a1af8960 (patch) | |
| tree | 03b47fe9a70d6a452b231aa68d472a04d4f403f0 /packages/sdk/js | |
| parent | 95385eb65249aa6def266968e75061abd0fb0f46 (diff) | |
| download | opencode-d6e0f47361d2a5c38c012618895cbdc7a1af8960.tar.gz opencode-d6e0f47361d2a5c38c012618895cbdc7a1af8960.zip | |
feat: add project git init api (#16383)
Diffstat (limited to 'packages/sdk/js')
| -rw-r--r-- | packages/sdk/js/src/v2/gen/sdk.gen.ts | 31 | ||||
| -rw-r--r-- | packages/sdk/js/src/v2/gen/types.gen.ts | 19 |
2 files changed, 50 insertions, 0 deletions
diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index 1c1b31e46..22dcfec35 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -77,6 +77,7 @@ import type { PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, + ProjectInitGitResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, @@ -426,6 +427,36 @@ export class Project extends HeyApiClient { } /** + * Initialize git repository + * + * Create a git repository for the current project and return the refreshed project info. + */ + public initGit<ThrowOnError extends boolean = false>( + parameters?: { + directory?: string + workspace?: string + }, + options?: Options<never, ThrowOnError>, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post<ProjectInitGitResponses, unknown, ThrowOnError>({ + url: "/project/git/init", + ...options, + ...params, + }) + } + + /** * Update project * * Update project properties such as name, icon, and commands. diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index afb2224a7..71e075b39 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -2087,6 +2087,25 @@ export type ProjectCurrentResponses = { export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses] +export type ProjectInitGitData = { + body?: never + path?: never + query?: { + directory?: string + workspace?: string + } + url: "/project/git/init" +} + +export type ProjectInitGitResponses = { + /** + * Project information after git initialization + */ + 200: Project +} + +export type ProjectInitGitResponse = ProjectInitGitResponses[keyof ProjectInitGitResponses] + export type ProjectUpdateData = { body?: { name?: string |
