feat(api): add command authentication attempts

This commit is contained in:
Dax Raad 2026-07-15 19:08:14 -04:00
commit b5177adb5b
18 changed files with 1138 additions and 16 deletions

View file

@ -294,6 +294,12 @@ import type {
V2HealthGetResponses,
V2HealthStopErrors,
V2HealthStopResponses,
V2IntegrationCommandCancelErrors,
V2IntegrationCommandCancelResponses,
V2IntegrationCommandConnectErrors,
V2IntegrationCommandConnectResponses,
V2IntegrationCommandStatusErrors,
V2IntegrationCommandStatusResponses,
V2IntegrationConnectKeyErrors,
V2IntegrationConnectKeyResponses,
V2IntegrationGetErrors,
@ -7005,6 +7011,132 @@ export class Oauth2 extends HeyApiClient {
}
}
export class Command2 extends HeyApiClient {
/**
* Begin command connection
*
* Start a command authentication attempt.
*/
public connect<ThrowOnError extends boolean = false>(
parameters: {
integrationID: string
location?: {
directory?: string | null
workspace?: string | null
} | null
methodID?: string
label?: string | null
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "integrationID" },
{ in: "query", key: "location" },
{ in: "body", key: "methodID" },
{ in: "body", key: "label" },
],
},
],
)
return (options?.client ?? this.client).post<
V2IntegrationCommandConnectResponses,
V2IntegrationCommandConnectErrors,
ThrowOnError
>({
url: "/api/integration/{integrationID}/connect/command",
...options,
...params,
headers: {
"Content-Type": "application/json",
...options?.headers,
...params.headers,
},
})
}
/**
* Cancel command connection
*
* Cancel a command authentication attempt and terminate its process.
*/
public cancel<ThrowOnError extends boolean = false>(
parameters: {
integrationID: string
attemptID: string
location?: {
directory?: string | null
workspace?: string | null
} | null
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "integrationID" },
{ in: "path", key: "attemptID" },
{ in: "query", key: "location" },
],
},
],
)
return (options?.client ?? this.client).delete<
V2IntegrationCommandCancelResponses,
V2IntegrationCommandCancelErrors,
ThrowOnError
>({
url: "/api/integration/{integrationID}/connect/command/{attemptID}",
...options,
...params,
})
}
/**
* Get command attempt status
*
* Poll the current status and output of a command authentication attempt.
*/
public status<ThrowOnError extends boolean = false>(
parameters: {
integrationID: string
attemptID: string
location?: {
directory?: string | null
workspace?: string | null
} | null
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "integrationID" },
{ in: "path", key: "attemptID" },
{ in: "query", key: "location" },
],
},
],
)
return (options?.client ?? this.client).get<
V2IntegrationCommandStatusResponses,
V2IntegrationCommandStatusErrors,
ThrowOnError
>({
url: "/api/integration/{integrationID}/connect/command/{attemptID}",
...options,
...params,
})
}
}
export class Integration extends HeyApiClient {
/**
* List integrations
@ -7070,6 +7202,11 @@ export class Integration extends HeyApiClient {
get oauth(): Oauth2 {
return (this._oauth ??= new Oauth2({ client: this.client }))
}
private _command?: Command2
get command(): Command2 {
return (this._command ??= new Command2({ client: this.client }))
}
}
export class Resource2 extends HeyApiClient {
@ -7492,7 +7629,7 @@ export class Fs extends HeyApiClient {
}
}
export class Command2 extends HeyApiClient {
export class Command3 extends HeyApiClient {
/**
* List commands
*
@ -8393,9 +8530,9 @@ export class V2 extends HeyApiClient {
return (this._fs ??= new Fs({ client: this.client }))
}
private _command?: Command2
get command(): Command2 {
return (this._command ??= new Command2({ client: this.client }))
private _command?: Command3
get command(): Command3 {
return (this._command ??= new Command3({ client: this.client }))
}
private _skill?: Skill

View file

@ -3195,7 +3195,11 @@ export type IntegrationInputs = {
[key: string]: string
}
export type IntegrationMethod = IntegrationOAuthMethod | IntegrationKeyMethod | IntegrationEnvMethod
export type IntegrationMethod =
| IntegrationOAuthMethod
| IntegrationCommandMethod
| IntegrationKeyMethod
| IntegrationEnvMethod
export type IntegrationRef = {
id: string
@ -5708,6 +5712,13 @@ export type IntegrationOAuthMethod = {
prompts?: Array<IntegrationTextPrompt | IntegrationSelectPrompt>
}
export type IntegrationCommandMethod = {
id: string
type: "command"
label: string
command: Array<string>
}
export type IntegrationKeyMethod = {
type: "key"
label?: string
@ -5780,6 +5791,46 @@ export type IntegrationAttemptStatus =
}
}
export type IntegrationCommandAttempt = {
attemptID: string
time: {
created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
export type IntegrationCommandAttemptStatus =
| {
status: "pending"
message?: string
time: {
created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
| {
status: "complete"
time: {
created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
| {
status: "failed"
message: string
time: {
created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
| {
status: "expired"
time: {
created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
export type McpStatusConnected2 = {
status: "connected"
}
@ -17011,6 +17062,129 @@ export type V2IntegrationOauthCompleteResponses = {
export type V2IntegrationOauthCompleteResponse =
V2IntegrationOauthCompleteResponses[keyof V2IntegrationOauthCompleteResponses]
export type V2IntegrationCommandConnectData = {
body: {
methodID: string
label?: string | null
}
path: {
integrationID: string
}
query?: {
location?: {
directory?: string | null
workspace?: string | null
} | null
}
url: "/api/integration/{integrationID}/connect/command"
}
export type V2IntegrationCommandConnectErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestError1 | InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedError
}
export type V2IntegrationCommandConnectError =
V2IntegrationCommandConnectErrors[keyof V2IntegrationCommandConnectErrors]
export type V2IntegrationCommandConnectResponses = {
/**
* Success
*/
200: {
location: LocationInfoV2
data: IntegrationCommandAttempt
}
}
export type V2IntegrationCommandConnectResponse =
V2IntegrationCommandConnectResponses[keyof V2IntegrationCommandConnectResponses]
export type V2IntegrationCommandCancelData = {
body?: never
path: {
integrationID: string
attemptID: string
}
query?: {
location?: {
directory?: string | null
workspace?: string | null
} | null
}
url: "/api/integration/{integrationID}/connect/command/{attemptID}"
}
export type V2IntegrationCommandCancelErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedError
}
export type V2IntegrationCommandCancelError = V2IntegrationCommandCancelErrors[keyof V2IntegrationCommandCancelErrors]
export type V2IntegrationCommandCancelResponses = {
/**
* <No Content>
*/
204: void
}
export type V2IntegrationCommandCancelResponse =
V2IntegrationCommandCancelResponses[keyof V2IntegrationCommandCancelResponses]
export type V2IntegrationCommandStatusData = {
body?: never
path: {
integrationID: string
attemptID: string
}
query?: {
location?: {
directory?: string | null
workspace?: string | null
} | null
}
url: "/api/integration/{integrationID}/connect/command/{attemptID}"
}
export type V2IntegrationCommandStatusErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedError
}
export type V2IntegrationCommandStatusError = V2IntegrationCommandStatusErrors[keyof V2IntegrationCommandStatusErrors]
export type V2IntegrationCommandStatusResponses = {
/**
* Success
*/
200: {
location: LocationInfoV2
data: IntegrationCommandAttemptStatus
}
}
export type V2IntegrationCommandStatusResponse =
V2IntegrationCommandStatusResponses[keyof V2IntegrationCommandStatusResponses]
export type V2McpListData = {
body?: never
path?: never