refactor(api): scope oauth operations by integration
This commit is contained in:
parent
fd19fa89c4
commit
a772767e9b
19 changed files with 404 additions and 303 deletions
|
|
@ -294,20 +294,20 @@ import type {
|
|||
V2HealthGetResponses,
|
||||
V2HealthStopErrors,
|
||||
V2HealthStopResponses,
|
||||
V2IntegrationAttemptCancelErrors,
|
||||
V2IntegrationAttemptCancelResponses,
|
||||
V2IntegrationAttemptCompleteErrors,
|
||||
V2IntegrationAttemptCompleteResponses,
|
||||
V2IntegrationAttemptStatusErrors,
|
||||
V2IntegrationAttemptStatusResponses,
|
||||
V2IntegrationConnectKeyErrors,
|
||||
V2IntegrationConnectKeyResponses,
|
||||
V2IntegrationConnectOauthErrors,
|
||||
V2IntegrationConnectOauthResponses,
|
||||
V2IntegrationGetErrors,
|
||||
V2IntegrationGetResponses,
|
||||
V2IntegrationListErrors,
|
||||
V2IntegrationListResponses,
|
||||
V2IntegrationOauthCancelErrors,
|
||||
V2IntegrationOauthCancelResponses,
|
||||
V2IntegrationOauthCompleteErrors,
|
||||
V2IntegrationOauthCompleteResponses,
|
||||
V2IntegrationOauthConnectErrors,
|
||||
V2IntegrationOauthConnectResponses,
|
||||
V2IntegrationOauthStatusErrors,
|
||||
V2IntegrationOauthStatusResponses,
|
||||
V2LocationGetErrors,
|
||||
V2LocationGetResponses,
|
||||
V2McpListErrors,
|
||||
|
|
@ -6827,13 +6827,15 @@ export class Connect extends HeyApiClient {
|
|||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Oauth2 extends HeyApiClient {
|
||||
/**
|
||||
* Begin OAuth connection
|
||||
*
|
||||
* Start an OAuth attempt and return the authorization details.
|
||||
*/
|
||||
public oauth<ThrowOnError extends boolean = false>(
|
||||
public connect<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
integrationID: string
|
||||
location?: {
|
||||
|
|
@ -6863,8 +6865,8 @@ export class Connect extends HeyApiClient {
|
|||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2IntegrationConnectOauthResponses,
|
||||
V2IntegrationConnectOauthErrors,
|
||||
V2IntegrationOauthConnectResponses,
|
||||
V2IntegrationOauthConnectErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/integration/{integrationID}/connect/oauth",
|
||||
|
|
@ -6877,9 +6879,7 @@ export class Connect extends HeyApiClient {
|
|||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Attempt extends HeyApiClient {
|
||||
/**
|
||||
* Cancel OAuth connection
|
||||
*
|
||||
|
|
@ -6887,6 +6887,7 @@ export class Attempt extends HeyApiClient {
|
|||
*/
|
||||
public cancel<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
location?: {
|
||||
directory?: string | null
|
||||
|
|
@ -6900,6 +6901,7 @@ export class Attempt extends HeyApiClient {
|
|||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "path", key: "attemptID" },
|
||||
{ in: "query", key: "location" },
|
||||
],
|
||||
|
|
@ -6907,11 +6909,11 @@ export class Attempt extends HeyApiClient {
|
|||
],
|
||||
)
|
||||
return (options?.client ?? this.client).delete<
|
||||
V2IntegrationAttemptCancelResponses,
|
||||
V2IntegrationAttemptCancelErrors,
|
||||
V2IntegrationOauthCancelResponses,
|
||||
V2IntegrationOauthCancelErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/integration/attempt/{attemptID}",
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
|
|
@ -6924,6 +6926,7 @@ export class Attempt extends HeyApiClient {
|
|||
*/
|
||||
public status<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
location?: {
|
||||
directory?: string | null
|
||||
|
|
@ -6937,6 +6940,7 @@ export class Attempt extends HeyApiClient {
|
|||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "path", key: "attemptID" },
|
||||
{ in: "query", key: "location" },
|
||||
],
|
||||
|
|
@ -6944,11 +6948,11 @@ export class Attempt extends HeyApiClient {
|
|||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<
|
||||
V2IntegrationAttemptStatusResponses,
|
||||
V2IntegrationAttemptStatusErrors,
|
||||
V2IntegrationOauthStatusResponses,
|
||||
V2IntegrationOauthStatusErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/integration/attempt/{attemptID}",
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
|
|
@ -6961,6 +6965,7 @@ export class Attempt extends HeyApiClient {
|
|||
*/
|
||||
public complete<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
location?: {
|
||||
directory?: string | null
|
||||
|
|
@ -6975,6 +6980,7 @@ export class Attempt extends HeyApiClient {
|
|||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "path", key: "attemptID" },
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "body", key: "code" },
|
||||
|
|
@ -6983,11 +6989,11 @@ export class Attempt extends HeyApiClient {
|
|||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2IntegrationAttemptCompleteResponses,
|
||||
V2IntegrationAttemptCompleteErrors,
|
||||
V2IntegrationOauthCompleteResponses,
|
||||
V2IntegrationOauthCompleteErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/integration/attempt/{attemptID}/complete",
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
|
|
@ -7060,9 +7066,9 @@ export class Integration extends HeyApiClient {
|
|||
return (this._connect ??= new Connect({ client: this.client }))
|
||||
}
|
||||
|
||||
private _attempt?: Attempt
|
||||
get attempt(): Attempt {
|
||||
return (this._attempt ??= new Attempt({ client: this.client }))
|
||||
private _oauth?: Oauth2
|
||||
get oauth(): Oauth2 {
|
||||
return (this._oauth ??= new Oauth2({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16846,7 +16846,7 @@ export type V2IntegrationConnectKeyResponses = {
|
|||
|
||||
export type V2IntegrationConnectKeyResponse = V2IntegrationConnectKeyResponses[keyof V2IntegrationConnectKeyResponses]
|
||||
|
||||
export type V2IntegrationConnectOauthData = {
|
||||
export type V2IntegrationOauthConnectData = {
|
||||
body: {
|
||||
methodID: string
|
||||
inputs: {
|
||||
|
|
@ -16866,7 +16866,7 @@ export type V2IntegrationConnectOauthData = {
|
|||
url: "/api/integration/{integrationID}/connect/oauth"
|
||||
}
|
||||
|
||||
export type V2IntegrationConnectOauthErrors = {
|
||||
export type V2IntegrationOauthConnectErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
|
|
@ -16877,9 +16877,9 @@ export type V2IntegrationConnectOauthErrors = {
|
|||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2IntegrationConnectOauthError = V2IntegrationConnectOauthErrors[keyof V2IntegrationConnectOauthErrors]
|
||||
export type V2IntegrationOauthConnectError = V2IntegrationOauthConnectErrors[keyof V2IntegrationOauthConnectErrors]
|
||||
|
||||
export type V2IntegrationConnectOauthResponses = {
|
||||
export type V2IntegrationOauthConnectResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
|
|
@ -16889,12 +16889,13 @@ export type V2IntegrationConnectOauthResponses = {
|
|||
}
|
||||
}
|
||||
|
||||
export type V2IntegrationConnectOauthResponse =
|
||||
V2IntegrationConnectOauthResponses[keyof V2IntegrationConnectOauthResponses]
|
||||
export type V2IntegrationOauthConnectResponse =
|
||||
V2IntegrationOauthConnectResponses[keyof V2IntegrationOauthConnectResponses]
|
||||
|
||||
export type V2IntegrationAttemptCancelData = {
|
||||
export type V2IntegrationOauthCancelData = {
|
||||
body?: never
|
||||
path: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
}
|
||||
query?: {
|
||||
|
|
@ -16903,10 +16904,10 @@ export type V2IntegrationAttemptCancelData = {
|
|||
workspace?: string | null
|
||||
} | null
|
||||
}
|
||||
url: "/api/integration/attempt/{attemptID}"
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}"
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCancelErrors = {
|
||||
export type V2IntegrationOauthCancelErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
|
|
@ -16917,21 +16918,22 @@ export type V2IntegrationAttemptCancelErrors = {
|
|||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCancelError = V2IntegrationAttemptCancelErrors[keyof V2IntegrationAttemptCancelErrors]
|
||||
export type V2IntegrationOauthCancelError = V2IntegrationOauthCancelErrors[keyof V2IntegrationOauthCancelErrors]
|
||||
|
||||
export type V2IntegrationAttemptCancelResponses = {
|
||||
export type V2IntegrationOauthCancelResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCancelResponse =
|
||||
V2IntegrationAttemptCancelResponses[keyof V2IntegrationAttemptCancelResponses]
|
||||
export type V2IntegrationOauthCancelResponse =
|
||||
V2IntegrationOauthCancelResponses[keyof V2IntegrationOauthCancelResponses]
|
||||
|
||||
export type V2IntegrationAttemptStatusData = {
|
||||
export type V2IntegrationOauthStatusData = {
|
||||
body?: never
|
||||
path: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
}
|
||||
query?: {
|
||||
|
|
@ -16940,10 +16942,10 @@ export type V2IntegrationAttemptStatusData = {
|
|||
workspace?: string | null
|
||||
} | null
|
||||
}
|
||||
url: "/api/integration/attempt/{attemptID}"
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}"
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptStatusErrors = {
|
||||
export type V2IntegrationOauthStatusErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
|
|
@ -16954,9 +16956,9 @@ export type V2IntegrationAttemptStatusErrors = {
|
|||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptStatusError = V2IntegrationAttemptStatusErrors[keyof V2IntegrationAttemptStatusErrors]
|
||||
export type V2IntegrationOauthStatusError = V2IntegrationOauthStatusErrors[keyof V2IntegrationOauthStatusErrors]
|
||||
|
||||
export type V2IntegrationAttemptStatusResponses = {
|
||||
export type V2IntegrationOauthStatusResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
|
|
@ -16966,14 +16968,15 @@ export type V2IntegrationAttemptStatusResponses = {
|
|||
}
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptStatusResponse =
|
||||
V2IntegrationAttemptStatusResponses[keyof V2IntegrationAttemptStatusResponses]
|
||||
export type V2IntegrationOauthStatusResponse =
|
||||
V2IntegrationOauthStatusResponses[keyof V2IntegrationOauthStatusResponses]
|
||||
|
||||
export type V2IntegrationAttemptCompleteData = {
|
||||
export type V2IntegrationOauthCompleteData = {
|
||||
body: {
|
||||
code?: string | null
|
||||
}
|
||||
path: {
|
||||
integrationID: string
|
||||
attemptID: string
|
||||
}
|
||||
query?: {
|
||||
|
|
@ -16982,10 +16985,10 @@ export type V2IntegrationAttemptCompleteData = {
|
|||
workspace?: string | null
|
||||
} | null
|
||||
}
|
||||
url: "/api/integration/attempt/{attemptID}/complete"
|
||||
url: "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete"
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCompleteErrors = {
|
||||
export type V2IntegrationOauthCompleteErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
|
|
@ -16996,18 +16999,17 @@ export type V2IntegrationAttemptCompleteErrors = {
|
|||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCompleteError =
|
||||
V2IntegrationAttemptCompleteErrors[keyof V2IntegrationAttemptCompleteErrors]
|
||||
export type V2IntegrationOauthCompleteError = V2IntegrationOauthCompleteErrors[keyof V2IntegrationOauthCompleteErrors]
|
||||
|
||||
export type V2IntegrationAttemptCompleteResponses = {
|
||||
export type V2IntegrationOauthCompleteResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2IntegrationAttemptCompleteResponse =
|
||||
V2IntegrationAttemptCompleteResponses[keyof V2IntegrationAttemptCompleteResponses]
|
||||
export type V2IntegrationOauthCompleteResponse =
|
||||
V2IntegrationOauthCompleteResponses[keyof V2IntegrationOauthCompleteResponses]
|
||||
|
||||
export type V2McpListData = {
|
||||
body?: never
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue