feat(app): reset worktree
This commit is contained in:
@@ -165,6 +165,9 @@ import type {
|
||||
WorktreeRemoveErrors,
|
||||
WorktreeRemoveInput,
|
||||
WorktreeRemoveResponses,
|
||||
WorktreeResetErrors,
|
||||
WorktreeResetInput,
|
||||
WorktreeResetResponses,
|
||||
} from "./types.gen.js"
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<
|
||||
@@ -745,6 +748,41 @@ export class Worktree extends HeyApiClient {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset worktree
|
||||
*
|
||||
* Reset a worktree branch to the primary default branch.
|
||||
*/
|
||||
public reset<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
worktreeResetInput?: WorktreeResetInput
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ key: "worktreeResetInput", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<WorktreeResetResponses, WorktreeResetErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree/reset",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Resource extends HeyApiClient {
|
||||
|
||||
@@ -1912,6 +1912,10 @@ export type WorktreeRemoveInput = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type WorktreeResetInput = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type McpResource = {
|
||||
name: string
|
||||
uri: string
|
||||
@@ -2630,6 +2634,33 @@ export type WorktreeCreateResponses = {
|
||||
|
||||
export type WorktreeCreateResponse = WorktreeCreateResponses[keyof WorktreeCreateResponses]
|
||||
|
||||
export type WorktreeResetData = {
|
||||
body?: WorktreeResetInput
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/experimental/worktree/reset"
|
||||
}
|
||||
|
||||
export type WorktreeResetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type WorktreeResetError = WorktreeResetErrors[keyof WorktreeResetErrors]
|
||||
|
||||
export type WorktreeResetResponses = {
|
||||
/**
|
||||
* Worktree reset
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses]
|
||||
|
||||
export type ExperimentalResourceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
||||
Reference in New Issue
Block a user