refactor(core): simplify integration credentials (#31968)
This commit is contained in:
@@ -265,20 +265,10 @@ import type {
|
||||
V2AgentListResponses,
|
||||
V2CommandListErrors,
|
||||
V2CommandListResponses,
|
||||
V2ConnectorConnectKeyErrors,
|
||||
V2ConnectorConnectKeyResponses,
|
||||
V2ConnectorConnectOauthBeginErrors,
|
||||
V2ConnectorConnectOauthBeginResponses,
|
||||
V2ConnectorConnectOauthCancelErrors,
|
||||
V2ConnectorConnectOauthCancelResponses,
|
||||
V2ConnectorConnectOauthCompleteErrors,
|
||||
V2ConnectorConnectOauthCompleteResponses,
|
||||
V2ConnectorConnectOauthStatusErrors,
|
||||
V2ConnectorConnectOauthStatusResponses,
|
||||
V2ConnectorGetErrors,
|
||||
V2ConnectorGetResponses,
|
||||
V2ConnectorListErrors,
|
||||
V2ConnectorListResponses,
|
||||
V2CredentialRemoveErrors,
|
||||
V2CredentialRemoveResponses,
|
||||
V2CredentialUpdateErrors,
|
||||
V2CredentialUpdateResponses,
|
||||
V2EventSubscribeErrors,
|
||||
V2EventSubscribeResponses,
|
||||
V2FsFindErrors,
|
||||
@@ -289,6 +279,20 @@ import type {
|
||||
V2FsReadResponses,
|
||||
V2HealthGetErrors,
|
||||
V2HealthGetResponses,
|
||||
V2IntegrationAttemptCancelErrors,
|
||||
V2IntegrationAttemptCancelResponses,
|
||||
V2IntegrationAttemptCompleteErrors,
|
||||
V2IntegrationAttemptCompleteResponses,
|
||||
V2IntegrationAttemptStatusErrors,
|
||||
V2IntegrationAttemptStatusResponses,
|
||||
V2IntegrationConnectKeyErrors,
|
||||
V2IntegrationConnectKeyResponses,
|
||||
V2IntegrationConnectOauthErrors,
|
||||
V2IntegrationConnectOauthResponses,
|
||||
V2IntegrationGetErrors,
|
||||
V2IntegrationGetResponses,
|
||||
V2IntegrationListErrors,
|
||||
V2IntegrationListResponses,
|
||||
V2LocationGetErrors,
|
||||
V2LocationGetResponses,
|
||||
V2ModelListErrors,
|
||||
@@ -5581,15 +5585,61 @@ export class Provider2 extends HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
export class Oauth2 extends HeyApiClient {
|
||||
export class Connect extends HeyApiClient {
|
||||
/**
|
||||
* Connect with key
|
||||
*
|
||||
* Run a key authentication method and store the resulting credential.
|
||||
*/
|
||||
public key<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
integrationID: string
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
key?: string
|
||||
label?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "body", key: "key" },
|
||||
{ in: "body", key: "label" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2IntegrationConnectKeyResponses,
|
||||
V2IntegrationConnectKeyErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/integration/{integrationID}/connect/key",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Begin OAuth connection
|
||||
*
|
||||
* Start an OAuth attempt and return the authorization details.
|
||||
*/
|
||||
public begin<ThrowOnError extends boolean = false>(
|
||||
public oauth<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
connectorID: string
|
||||
integrationID: string
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
@@ -5607,7 +5657,7 @@ export class Oauth2 extends HeyApiClient {
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "connectorID" },
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "body", key: "methodID" },
|
||||
{ in: "body", key: "inputs" },
|
||||
@@ -5617,11 +5667,11 @@ export class Oauth2 extends HeyApiClient {
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2ConnectorConnectOauthBeginResponses,
|
||||
V2ConnectorConnectOauthBeginErrors,
|
||||
V2IntegrationConnectOauthResponses,
|
||||
V2IntegrationConnectOauthErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/connector/{connectorID}/connect/oauth",
|
||||
url: "/api/integration/{integrationID}/connect/oauth",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
@@ -5631,7 +5681,9 @@ export class Oauth2 extends HeyApiClient {
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Attempt extends HeyApiClient {
|
||||
/**
|
||||
* Cancel OAuth connection
|
||||
*
|
||||
@@ -5659,11 +5711,11 @@ export class Oauth2 extends HeyApiClient {
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).delete<
|
||||
V2ConnectorConnectOauthCancelResponses,
|
||||
V2ConnectorConnectOauthCancelErrors,
|
||||
V2IntegrationAttemptCancelResponses,
|
||||
V2IntegrationAttemptCancelErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/connector/oauth/{attemptID}",
|
||||
url: "/api/integration/attempt/{attemptID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
@@ -5696,11 +5748,11 @@ export class Oauth2 extends HeyApiClient {
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<
|
||||
V2ConnectorConnectOauthStatusResponses,
|
||||
V2ConnectorConnectOauthStatusErrors,
|
||||
V2IntegrationAttemptStatusResponses,
|
||||
V2IntegrationAttemptStatusErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/connector/oauth/{attemptID}",
|
||||
url: "/api/integration/attempt/{attemptID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
@@ -5735,11 +5787,11 @@ export class Oauth2 extends HeyApiClient {
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2ConnectorConnectOauthCompleteResponses,
|
||||
V2ConnectorConnectOauthCompleteErrors,
|
||||
V2IntegrationAttemptCompleteResponses,
|
||||
V2IntegrationAttemptCompleteErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/connector/oauth/{attemptID}/complete",
|
||||
url: "/api/integration/attempt/{attemptID}/complete",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
@@ -5751,70 +5803,11 @@ export class Oauth2 extends HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
export class Connect extends HeyApiClient {
|
||||
export class Integration extends HeyApiClient {
|
||||
/**
|
||||
* Connect with key
|
||||
* List integrations
|
||||
*
|
||||
* Run a key authentication method and store the resulting credential.
|
||||
*/
|
||||
public key<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
connectorID: string
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
methodID?: string
|
||||
key?: string
|
||||
inputs?: {
|
||||
[key: string]: string
|
||||
}
|
||||
label?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "connectorID" },
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "body", key: "methodID" },
|
||||
{ in: "body", key: "key" },
|
||||
{ in: "body", key: "inputs" },
|
||||
{ in: "body", key: "label" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
V2ConnectorConnectKeyResponses,
|
||||
V2ConnectorConnectKeyErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/connector/{connectorID}/connect/key",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _oauth?: Oauth2
|
||||
get oauth(): Oauth2 {
|
||||
return (this._oauth ??= new Oauth2({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Connector extends HeyApiClient {
|
||||
/**
|
||||
* List connectors
|
||||
*
|
||||
* Retrieve available connectors and their authentication methods.
|
||||
* Retrieve available integrations and their authentication methods.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
@@ -5826,21 +5819,21 @@ export class Connector extends HeyApiClient {
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
|
||||
return (options?.client ?? this.client).get<V2ConnectorListResponses, V2ConnectorListErrors, ThrowOnError>({
|
||||
url: "/api/connector",
|
||||
return (options?.client ?? this.client).get<V2IntegrationListResponses, V2IntegrationListErrors, ThrowOnError>({
|
||||
url: "/api/integration",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get connector
|
||||
* Get integration
|
||||
*
|
||||
* Retrieve one connector and its authentication methods.
|
||||
* Retrieve one integration and its authentication methods.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
connectorID: string
|
||||
integrationID: string
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
@@ -5853,14 +5846,14 @@ export class Connector extends HeyApiClient {
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "connectorID" },
|
||||
{ in: "path", key: "integrationID" },
|
||||
{ in: "query", key: "location" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<V2ConnectorGetResponses, V2ConnectorGetErrors, ThrowOnError>({
|
||||
url: "/api/connector/{connectorID}",
|
||||
return (options?.client ?? this.client).get<V2IntegrationGetResponses, V2IntegrationGetErrors, ThrowOnError>({
|
||||
url: "/api/integration/{integrationID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
@@ -5870,6 +5863,69 @@ export class Connector extends HeyApiClient {
|
||||
get connect(): Connect {
|
||||
return (this._connect ??= new Connect({ client: this.client }))
|
||||
}
|
||||
|
||||
private _attempt?: Attempt
|
||||
get attempt(): Attempt {
|
||||
return (this._attempt ??= new Attempt({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Credential extends HeyApiClient {
|
||||
/**
|
||||
* Remove credential
|
||||
*
|
||||
* Remove a stored integration credential.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
credentialID: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "credentialID" }] }])
|
||||
return (options?.client ?? this.client).delete<V2CredentialRemoveResponses, V2CredentialRemoveErrors, ThrowOnError>(
|
||||
{
|
||||
url: "/api/credential/{credentialID}",
|
||||
...options,
|
||||
...params,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Update credential
|
||||
*
|
||||
* Update a stored credential label.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
credentialID: string
|
||||
label?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "credentialID" },
|
||||
{ in: "body", key: "label" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).patch<V2CredentialUpdateResponses, V2CredentialUpdateErrors, ThrowOnError>({
|
||||
url: "/api/credential/{credentialID}",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Request extends HeyApiClient {
|
||||
@@ -6216,9 +6272,14 @@ export class V2 extends HeyApiClient {
|
||||
return (this._provider ??= new Provider2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _connector?: Connector
|
||||
get connector(): Connector {
|
||||
return (this._connector ??= new Connector({ client: this.client }))
|
||||
private _integration?: Integration
|
||||
get integration(): Integration {
|
||||
return (this._integration ??= new Integration({ client: this.client }))
|
||||
}
|
||||
|
||||
private _credential?: Credential
|
||||
get credential(): Credential {
|
||||
return (this._credential ??= new Credential({ client: this.client }))
|
||||
}
|
||||
|
||||
private _permission?: Permission3
|
||||
|
||||
@@ -6,9 +6,6 @@ export type ClientOptions = {
|
||||
|
||||
export type Event =
|
||||
| EventModelsDevRefreshed
|
||||
| EventCredentialAdded
|
||||
| EventCredentialRemoved
|
||||
| EventCredentialSwitched
|
||||
| EventPluginAdded
|
||||
| EventCatalogModelUpdated
|
||||
| EventSessionCreated
|
||||
@@ -55,7 +52,7 @@ export type Event =
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventFileEdited
|
||||
| EventConnectorUpdated
|
||||
| EventIntegrationUpdated
|
||||
| EventPermissionV2Asked
|
||||
| EventPermissionV2Replied
|
||||
| EventReferenceUpdated
|
||||
@@ -739,29 +736,6 @@ export type GlobalEvent = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "credential.added"
|
||||
properties: {
|
||||
credential: CredentialInfo
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "credential.removed"
|
||||
properties: {
|
||||
credential: CredentialInfo
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "credential.switched"
|
||||
properties: {
|
||||
connectorID: string
|
||||
from?: string
|
||||
to?: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "plugin.added"
|
||||
@@ -1284,7 +1258,7 @@ export type GlobalEvent = {
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "connector.updated"
|
||||
type: "integration.updated"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
@@ -2856,34 +2830,6 @@ export type MoveSessionDestination = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type CredentialOAuth = {
|
||||
type: "oauth"
|
||||
refresh: string
|
||||
access: string
|
||||
expires: number
|
||||
metadata?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
|
||||
export type CredentialKey = {
|
||||
type: "key"
|
||||
key: string
|
||||
metadata?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
|
||||
export type CredentialValue = CredentialOAuth | CredentialKey
|
||||
|
||||
export type CredentialInfo = {
|
||||
id: string
|
||||
connectorID: string
|
||||
methodID: string
|
||||
label: string
|
||||
value: CredentialValue
|
||||
}
|
||||
|
||||
export type ModelV2Info = {
|
||||
id: string
|
||||
providerID: string
|
||||
@@ -4120,21 +4066,21 @@ export type ProviderV2Info = {
|
||||
}
|
||||
}
|
||||
|
||||
export type ConnectorWhen = {
|
||||
export type IntegrationWhen = {
|
||||
key: string
|
||||
op: "eq" | "neq"
|
||||
value: string
|
||||
}
|
||||
|
||||
export type ConnectorTextPrompt = {
|
||||
export type IntegrationTextPrompt = {
|
||||
type: "text"
|
||||
key: string
|
||||
message: string
|
||||
placeholder?: string
|
||||
when?: ConnectorWhen
|
||||
when?: IntegrationWhen
|
||||
}
|
||||
|
||||
export type ConnectorSelectPrompt = {
|
||||
export type IntegrationSelectPrompt = {
|
||||
type: "select"
|
||||
key: string
|
||||
message: string
|
||||
@@ -4143,30 +4089,47 @@ export type ConnectorSelectPrompt = {
|
||||
value: string
|
||||
hint?: string
|
||||
}>
|
||||
when?: ConnectorWhen
|
||||
when?: IntegrationWhen
|
||||
}
|
||||
|
||||
export type ConnectorOAuthMethod = {
|
||||
export type IntegrationOAuthMethod = {
|
||||
id: string
|
||||
type: "oauth"
|
||||
label: string
|
||||
prompts?: Array<ConnectorTextPrompt | ConnectorSelectPrompt>
|
||||
prompts?: Array<IntegrationTextPrompt | IntegrationSelectPrompt>
|
||||
}
|
||||
|
||||
export type ConnectorKeyMethod = {
|
||||
id: string
|
||||
export type IntegrationKeyMethod = {
|
||||
type: "key"
|
||||
label: string
|
||||
prompts?: Array<ConnectorTextPrompt | ConnectorSelectPrompt>
|
||||
label?: string
|
||||
}
|
||||
|
||||
export type ConnectorInfo = {
|
||||
export type IntegrationEnvMethod = {
|
||||
type: "env"
|
||||
names: Array<string>
|
||||
}
|
||||
|
||||
export type ConnectionCredentialInfo = {
|
||||
type: "credential"
|
||||
id: string
|
||||
label: string
|
||||
}
|
||||
|
||||
export type ConnectionEnvInfo = {
|
||||
type: "env"
|
||||
name: string
|
||||
}
|
||||
|
||||
export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo
|
||||
|
||||
export type IntegrationInfo = {
|
||||
id: string
|
||||
name: string
|
||||
methods: Array<ConnectorOAuthMethod | ConnectorKeyMethod>
|
||||
methods: Array<IntegrationOAuthMethod | IntegrationKeyMethod | IntegrationEnvMethod>
|
||||
connections: Array<ConnectionInfo>
|
||||
}
|
||||
|
||||
export type ConnectorAttempt = {
|
||||
export type IntegrationAttempt = {
|
||||
attemptID: string
|
||||
url: string
|
||||
instructions: string
|
||||
@@ -4271,32 +4234,6 @@ export type EventModelsDevRefreshed = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCredentialAdded = {
|
||||
id: string
|
||||
type: "credential.added"
|
||||
properties: {
|
||||
credential: CredentialInfo
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCredentialRemoved = {
|
||||
id: string
|
||||
type: "credential.removed"
|
||||
properties: {
|
||||
credential: CredentialInfo
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCredentialSwitched = {
|
||||
id: string
|
||||
type: "credential.switched"
|
||||
properties: {
|
||||
connectorID: string
|
||||
from?: string
|
||||
to?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPluginAdded = {
|
||||
id: string
|
||||
type: "plugin.added"
|
||||
@@ -4959,9 +4896,9 @@ export type EventFileEdited = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventConnectorUpdated = {
|
||||
export type EventIntegrationUpdated = {
|
||||
id: string
|
||||
type: "connector.updated"
|
||||
type: "integration.updated"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
@@ -10062,7 +9999,7 @@ export type V2ProviderGetResponses = {
|
||||
|
||||
export type V2ProviderGetResponse = V2ProviderGetResponses[keyof V2ProviderGetResponses]
|
||||
|
||||
export type V2ConnectorListData = {
|
||||
export type V2IntegrationListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
@@ -10071,10 +10008,10 @@ export type V2ConnectorListData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector"
|
||||
url: "/api/integration"
|
||||
}
|
||||
|
||||
export type V2ConnectorListErrors = {
|
||||
export type V2IntegrationListErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10085,24 +10022,24 @@ export type V2ConnectorListErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorListError = V2ConnectorListErrors[keyof V2ConnectorListErrors]
|
||||
export type V2IntegrationListError = V2IntegrationListErrors[keyof V2IntegrationListErrors]
|
||||
|
||||
export type V2ConnectorListResponses = {
|
||||
export type V2IntegrationListResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
location: LocationInfo
|
||||
data: Array<ConnectorInfo>
|
||||
data: Array<IntegrationInfo>
|
||||
}
|
||||
}
|
||||
|
||||
export type V2ConnectorListResponse = V2ConnectorListResponses[keyof V2ConnectorListResponses]
|
||||
export type V2IntegrationListResponse = V2IntegrationListResponses[keyof V2IntegrationListResponses]
|
||||
|
||||
export type V2ConnectorGetData = {
|
||||
export type V2IntegrationGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
connectorID: string
|
||||
integrationID: string
|
||||
}
|
||||
query?: {
|
||||
location?: {
|
||||
@@ -10110,10 +10047,10 @@ export type V2ConnectorGetData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/{connectorID}"
|
||||
url: "/api/integration/{integrationID}"
|
||||
}
|
||||
|
||||
export type V2ConnectorGetErrors = {
|
||||
export type V2IntegrationGetErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10124,31 +10061,27 @@ export type V2ConnectorGetErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorGetError = V2ConnectorGetErrors[keyof V2ConnectorGetErrors]
|
||||
export type V2IntegrationGetError = V2IntegrationGetErrors[keyof V2IntegrationGetErrors]
|
||||
|
||||
export type V2ConnectorGetResponses = {
|
||||
export type V2IntegrationGetResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
location: LocationInfo
|
||||
data: ConnectorInfo
|
||||
data: IntegrationInfo
|
||||
}
|
||||
}
|
||||
|
||||
export type V2ConnectorGetResponse = V2ConnectorGetResponses[keyof V2ConnectorGetResponses]
|
||||
export type V2IntegrationGetResponse = V2IntegrationGetResponses[keyof V2IntegrationGetResponses]
|
||||
|
||||
export type V2ConnectorConnectKeyData = {
|
||||
export type V2IntegrationConnectKeyData = {
|
||||
body: {
|
||||
methodID: string
|
||||
key: string
|
||||
inputs: {
|
||||
[key: string]: string
|
||||
}
|
||||
label?: string
|
||||
}
|
||||
path: {
|
||||
connectorID: string
|
||||
integrationID: string
|
||||
}
|
||||
query?: {
|
||||
location?: {
|
||||
@@ -10156,10 +10089,10 @@ export type V2ConnectorConnectKeyData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/{connectorID}/connect/key"
|
||||
url: "/api/integration/{integrationID}/connect/key"
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectKeyErrors = {
|
||||
export type V2IntegrationConnectKeyErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10170,18 +10103,18 @@ export type V2ConnectorConnectKeyErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectKeyError = V2ConnectorConnectKeyErrors[keyof V2ConnectorConnectKeyErrors]
|
||||
export type V2IntegrationConnectKeyError = V2IntegrationConnectKeyErrors[keyof V2IntegrationConnectKeyErrors]
|
||||
|
||||
export type V2ConnectorConnectKeyResponses = {
|
||||
export type V2IntegrationConnectKeyResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectKeyResponse = V2ConnectorConnectKeyResponses[keyof V2ConnectorConnectKeyResponses]
|
||||
export type V2IntegrationConnectKeyResponse = V2IntegrationConnectKeyResponses[keyof V2IntegrationConnectKeyResponses]
|
||||
|
||||
export type V2ConnectorConnectOauthBeginData = {
|
||||
export type V2IntegrationConnectOauthData = {
|
||||
body: {
|
||||
methodID: string
|
||||
inputs: {
|
||||
@@ -10190,7 +10123,7 @@ export type V2ConnectorConnectOauthBeginData = {
|
||||
label?: string
|
||||
}
|
||||
path: {
|
||||
connectorID: string
|
||||
integrationID: string
|
||||
}
|
||||
query?: {
|
||||
location?: {
|
||||
@@ -10198,10 +10131,10 @@ export type V2ConnectorConnectOauthBeginData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/{connectorID}/connect/oauth"
|
||||
url: "/api/integration/{integrationID}/connect/oauth"
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthBeginErrors = {
|
||||
export type V2IntegrationConnectOauthErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10212,23 +10145,22 @@ export type V2ConnectorConnectOauthBeginErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthBeginError =
|
||||
V2ConnectorConnectOauthBeginErrors[keyof V2ConnectorConnectOauthBeginErrors]
|
||||
export type V2IntegrationConnectOauthError = V2IntegrationConnectOauthErrors[keyof V2IntegrationConnectOauthErrors]
|
||||
|
||||
export type V2ConnectorConnectOauthBeginResponses = {
|
||||
export type V2IntegrationConnectOauthResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
location: LocationInfo
|
||||
data: ConnectorAttempt
|
||||
data: IntegrationAttempt
|
||||
}
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthBeginResponse =
|
||||
V2ConnectorConnectOauthBeginResponses[keyof V2ConnectorConnectOauthBeginResponses]
|
||||
export type V2IntegrationConnectOauthResponse =
|
||||
V2IntegrationConnectOauthResponses[keyof V2IntegrationConnectOauthResponses]
|
||||
|
||||
export type V2ConnectorConnectOauthCancelData = {
|
||||
export type V2IntegrationAttemptCancelData = {
|
||||
body?: never
|
||||
path: {
|
||||
attemptID: string
|
||||
@@ -10239,10 +10171,10 @@ export type V2ConnectorConnectOauthCancelData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/oauth/{attemptID}"
|
||||
url: "/api/integration/attempt/{attemptID}"
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCancelErrors = {
|
||||
export type V2IntegrationAttemptCancelErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10253,20 +10185,19 @@ export type V2ConnectorConnectOauthCancelErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCancelError =
|
||||
V2ConnectorConnectOauthCancelErrors[keyof V2ConnectorConnectOauthCancelErrors]
|
||||
export type V2IntegrationAttemptCancelError = V2IntegrationAttemptCancelErrors[keyof V2IntegrationAttemptCancelErrors]
|
||||
|
||||
export type V2ConnectorConnectOauthCancelResponses = {
|
||||
export type V2IntegrationAttemptCancelResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCancelResponse =
|
||||
V2ConnectorConnectOauthCancelResponses[keyof V2ConnectorConnectOauthCancelResponses]
|
||||
export type V2IntegrationAttemptCancelResponse =
|
||||
V2IntegrationAttemptCancelResponses[keyof V2IntegrationAttemptCancelResponses]
|
||||
|
||||
export type V2ConnectorConnectOauthStatusData = {
|
||||
export type V2IntegrationAttemptStatusData = {
|
||||
body?: never
|
||||
path: {
|
||||
attemptID: string
|
||||
@@ -10277,10 +10208,10 @@ export type V2ConnectorConnectOauthStatusData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/oauth/{attemptID}"
|
||||
url: "/api/integration/attempt/{attemptID}"
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthStatusErrors = {
|
||||
export type V2IntegrationAttemptStatusErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10291,10 +10222,9 @@ export type V2ConnectorConnectOauthStatusErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthStatusError =
|
||||
V2ConnectorConnectOauthStatusErrors[keyof V2ConnectorConnectOauthStatusErrors]
|
||||
export type V2IntegrationAttemptStatusError = V2IntegrationAttemptStatusErrors[keyof V2IntegrationAttemptStatusErrors]
|
||||
|
||||
export type V2ConnectorConnectOauthStatusResponses = {
|
||||
export type V2IntegrationAttemptStatusResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
@@ -10333,10 +10263,10 @@ export type V2ConnectorConnectOauthStatusResponses = {
|
||||
}
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthStatusResponse =
|
||||
V2ConnectorConnectOauthStatusResponses[keyof V2ConnectorConnectOauthStatusResponses]
|
||||
export type V2IntegrationAttemptStatusResponse =
|
||||
V2IntegrationAttemptStatusResponses[keyof V2IntegrationAttemptStatusResponses]
|
||||
|
||||
export type V2ConnectorConnectOauthCompleteData = {
|
||||
export type V2IntegrationAttemptCompleteData = {
|
||||
body: {
|
||||
code?: string
|
||||
}
|
||||
@@ -10349,10 +10279,10 @@ export type V2ConnectorConnectOauthCompleteData = {
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/connector/oauth/{attemptID}/complete"
|
||||
url: "/api/integration/attempt/{attemptID}/complete"
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCompleteErrors = {
|
||||
export type V2IntegrationAttemptCompleteErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
@@ -10363,18 +10293,82 @@ export type V2ConnectorConnectOauthCompleteErrors = {
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCompleteError =
|
||||
V2ConnectorConnectOauthCompleteErrors[keyof V2ConnectorConnectOauthCompleteErrors]
|
||||
export type V2IntegrationAttemptCompleteError =
|
||||
V2IntegrationAttemptCompleteErrors[keyof V2IntegrationAttemptCompleteErrors]
|
||||
|
||||
export type V2ConnectorConnectOauthCompleteResponses = {
|
||||
export type V2IntegrationAttemptCompleteResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2ConnectorConnectOauthCompleteResponse =
|
||||
V2ConnectorConnectOauthCompleteResponses[keyof V2ConnectorConnectOauthCompleteResponses]
|
||||
export type V2IntegrationAttemptCompleteResponse =
|
||||
V2IntegrationAttemptCompleteResponses[keyof V2IntegrationAttemptCompleteResponses]
|
||||
|
||||
export type V2CredentialRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
credentialID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/credential/{credentialID}"
|
||||
}
|
||||
|
||||
export type V2CredentialRemoveErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2CredentialRemoveError = V2CredentialRemoveErrors[keyof V2CredentialRemoveErrors]
|
||||
|
||||
export type V2CredentialRemoveResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2CredentialRemoveResponse = V2CredentialRemoveResponses[keyof V2CredentialRemoveResponses]
|
||||
|
||||
export type V2CredentialUpdateData = {
|
||||
body: {
|
||||
label: string
|
||||
}
|
||||
path: {
|
||||
credentialID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/credential/{credentialID}"
|
||||
}
|
||||
|
||||
export type V2CredentialUpdateErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2CredentialUpdateError = V2CredentialUpdateErrors[keyof V2CredentialUpdateErrors]
|
||||
|
||||
export type V2CredentialUpdateResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2CredentialUpdateResponse = V2CredentialUpdateResponses[keyof V2CredentialUpdateResponses]
|
||||
|
||||
export type V2PermissionRequestListData = {
|
||||
body?: never
|
||||
|
||||
+241
-330
@@ -11184,10 +11184,10 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector": {
|
||||
"/api/integration": {
|
||||
"get": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.list",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.list",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "location",
|
||||
@@ -11224,7 +11224,7 @@
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ConnectorInfo"
|
||||
"$ref": "#/components/schemas/IntegrationInfo"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -11255,23 +11255,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Retrieve available connectors and their authentication methods.",
|
||||
"summary": "List connectors",
|
||||
"description": "Retrieve available integrations and their authentication methods.",
|
||||
"summary": "List integrations",
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.list({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.list({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector/{connectorID}": {
|
||||
"/api/integration/{integrationID}": {
|
||||
"get": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.get",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.get",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "connectorID",
|
||||
"name": "integrationID",
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
@@ -11311,7 +11311,7 @@
|
||||
"$ref": "#/components/schemas/LocationInfo"
|
||||
},
|
||||
"data": {
|
||||
"$ref": "#/components/schemas/ConnectorInfo"
|
||||
"$ref": "#/components/schemas/IntegrationInfo"
|
||||
}
|
||||
},
|
||||
"required": ["location", "data"],
|
||||
@@ -11341,23 +11341,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Retrieve one connector and its authentication methods.",
|
||||
"summary": "Get connector",
|
||||
"description": "Retrieve one integration and its authentication methods.",
|
||||
"summary": "Get integration",
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.get({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.get({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector/{connectorID}/connect/key": {
|
||||
"/api/integration/{integrationID}/connect/key": {
|
||||
"post": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.connect.key",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.connect.key",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "connectorID",
|
||||
"name": "integrationID",
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
@@ -11425,23 +11425,14 @@
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"methodID": {
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
},
|
||||
"inputs": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["methodID", "key", "inputs"],
|
||||
"required": ["key"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
@@ -11451,18 +11442,18 @@
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.connect.key({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.key({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector/{connectorID}/connect/oauth": {
|
||||
"/api/integration/{integrationID}/connect/oauth": {
|
||||
"post": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.connect.oauth.begin",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.connect.oauth",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "connectorID",
|
||||
"name": "integrationID",
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
@@ -11502,7 +11493,7 @@
|
||||
"$ref": "#/components/schemas/LocationInfo"
|
||||
},
|
||||
"data": {
|
||||
"$ref": "#/components/schemas/ConnectorAttempt"
|
||||
"$ref": "#/components/schemas/IntegrationAttempt"
|
||||
}
|
||||
},
|
||||
"required": ["location", "data"],
|
||||
@@ -11570,15 +11561,15 @@
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.connect.oauth.begin({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.oauth({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector/oauth/{attemptID}": {
|
||||
"/api/integration/attempt/{attemptID}": {
|
||||
"get": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.connect.oauth.status",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.attempt.status",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "attemptID",
|
||||
@@ -11916,13 +11907,13 @@
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.connect.oauth.status({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.status({\n ...\n})"
|
||||
}
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.connect.oauth.cancel",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.attempt.cancel",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "attemptID",
|
||||
@@ -11983,15 +11974,15 @@
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.connect.oauth.cancel({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.cancel({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/connector/oauth/{attemptID}/complete": {
|
||||
"/api/integration/attempt/{attemptID}/complete": {
|
||||
"post": {
|
||||
"tags": ["connectors"],
|
||||
"operationId": "v2.connector.connect.oauth.complete",
|
||||
"tags": ["integrations"],
|
||||
"operationId": "v2.integration.attempt.complete",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "attemptID",
|
||||
@@ -12075,7 +12066,122 @@
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.connector.connect.oauth.complete({\n ...\n})"
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.complete({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/credential/{credentialID}": {
|
||||
"patch": {
|
||||
"tags": ["opencode HttpApi"],
|
||||
"operationId": "v2.credential.update",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "credentialID",
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"security": [],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "<No Content>"
|
||||
},
|
||||
"400": {
|
||||
"description": "InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "UnauthorizedError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UnauthorizedError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Update a stored credential label.",
|
||||
"summary": "Update credential",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["label"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.update({\n ...\n})"
|
||||
}
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"tags": ["opencode HttpApi"],
|
||||
"operationId": "v2.credential.remove",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "credentialID",
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"security": [],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "<No Content>"
|
||||
},
|
||||
"400": {
|
||||
"description": "InvalidRequestError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/InvalidRequestError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "UnauthorizedError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UnauthorizedError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Remove a stored integration credential.",
|
||||
"summary": "Remove credential",
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "js",
|
||||
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.remove({\n ...\n})"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13468,15 +13574,6 @@
|
||||
{
|
||||
"$ref": "#/components/schemas/EventModels-devRefreshed"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventCredentialAdded"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventCredentialRemoved"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventCredentialSwitched"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventPluginAdded"
|
||||
},
|
||||
@@ -13616,7 +13713,7 @@
|
||||
"$ref": "#/components/schemas/EventFileEdited"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventConnectorUpdated"
|
||||
"$ref": "#/components/schemas/EventIntegrationUpdated"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/EventPermissionV2Asked"
|
||||
@@ -15637,87 +15734,6 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.added"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"credential": {
|
||||
"$ref": "#/components/schemas/CredentialInfo"
|
||||
}
|
||||
},
|
||||
"required": ["credential"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.removed"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"credential": {
|
||||
"$ref": "#/components/schemas/CredentialInfo"
|
||||
}
|
||||
},
|
||||
"required": ["credential"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.switched"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"connectorID": {
|
||||
"type": "string"
|
||||
},
|
||||
"from": {
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["connectorID"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -17522,7 +17538,7 @@
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["connector.updated"]
|
||||
"enum": ["integration.updated"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
@@ -22150,85 +22166,6 @@
|
||||
"required": ["directory"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"CredentialOAuth": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["oauth"]
|
||||
},
|
||||
"refresh": {
|
||||
"type": "string"
|
||||
},
|
||||
"access": {
|
||||
"type": "string"
|
||||
},
|
||||
"expires": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["type", "refresh", "access", "expires"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"CredentialKey": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["key"]
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["type", "key"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"CredentialValue": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/CredentialOAuth"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/CredentialKey"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CredentialInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"connectorID": {
|
||||
"type": "string"
|
||||
},
|
||||
"methodID": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"$ref": "#/components/schemas/CredentialValue"
|
||||
}
|
||||
},
|
||||
"required": ["id", "connectorID", "methodID", "label", "value"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ModelV2Info": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -26280,7 +26217,7 @@
|
||||
"required": ["id", "name", "enabled", "env", "api", "request"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorWhen": {
|
||||
"IntegrationWhen": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
@@ -26297,7 +26234,7 @@
|
||||
"required": ["key", "op", "value"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorTextPrompt": {
|
||||
"IntegrationTextPrompt": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
@@ -26314,13 +26251,13 @@
|
||||
"type": "string"
|
||||
},
|
||||
"when": {
|
||||
"$ref": "#/components/schemas/ConnectorWhen"
|
||||
"$ref": "#/components/schemas/IntegrationWhen"
|
||||
}
|
||||
},
|
||||
"required": ["type", "key", "message"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorSelectPrompt": {
|
||||
"IntegrationSelectPrompt": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
@@ -26353,13 +26290,13 @@
|
||||
}
|
||||
},
|
||||
"when": {
|
||||
"$ref": "#/components/schemas/ConnectorWhen"
|
||||
"$ref": "#/components/schemas/IntegrationWhen"
|
||||
}
|
||||
},
|
||||
"required": ["type", "key", "message", "options"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorOAuthMethod": {
|
||||
"IntegrationOAuthMethod": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -26377,10 +26314,10 @@
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorTextPrompt"
|
||||
"$ref": "#/components/schemas/IntegrationTextPrompt"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorSelectPrompt"
|
||||
"$ref": "#/components/schemas/IntegrationSelectPrompt"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -26389,37 +26326,79 @@
|
||||
"required": ["id", "type", "label"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorKeyMethod": {
|
||||
"IntegrationKeyMethod": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["key"]
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"IntegrationEnvMethod": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["env"]
|
||||
},
|
||||
"prompts": {
|
||||
"names": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorTextPrompt"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorSelectPrompt"
|
||||
}
|
||||
]
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "label"],
|
||||
"required": ["type", "names"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorInfo": {
|
||||
"ConnectionCredentialInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential"]
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type", "id", "label"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectionEnvInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["env"]
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["type", "name"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectionInfo": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectionCredentialInfo"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectionEnvInfo"
|
||||
}
|
||||
]
|
||||
},
|
||||
"IntegrationInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -26433,19 +26412,28 @@
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorOAuthMethod"
|
||||
"$ref": "#/components/schemas/IntegrationOAuthMethod"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ConnectorKeyMethod"
|
||||
"$ref": "#/components/schemas/IntegrationKeyMethod"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/IntegrationEnvMethod"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"connections": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ConnectionInfo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "methods"],
|
||||
"required": ["id", "name", "methods", "connections"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ConnectorAttempt": {
|
||||
"IntegrationAttempt": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"attemptID": {
|
||||
@@ -26780,87 +26768,6 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventCredentialAdded": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.added"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"credential": {
|
||||
"$ref": "#/components/schemas/CredentialInfo"
|
||||
}
|
||||
},
|
||||
"required": ["credential"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventCredentialRemoved": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.removed"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"credential": {
|
||||
"$ref": "#/components/schemas/CredentialInfo"
|
||||
}
|
||||
},
|
||||
"required": ["credential"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventCredentialSwitched": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^evt_"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["credential.switched"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"connectorID": {
|
||||
"type": "string"
|
||||
},
|
||||
"from": {
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["connectorID"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventPluginAdded": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -29178,7 +29085,7 @@
|
||||
"required": ["id", "type", "properties"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"EventConnectorUpdated": {
|
||||
"EventIntegrationUpdated": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -29187,7 +29094,7 @@
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["connector.updated"]
|
||||
"enum": ["integration.updated"]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
@@ -30400,8 +30307,12 @@
|
||||
"description": "Experimental provider routes."
|
||||
},
|
||||
{
|
||||
"name": "connectors",
|
||||
"description": "Connector discovery and authentication routes."
|
||||
"name": "integrations",
|
||||
"description": "Integration discovery and authentication routes."
|
||||
},
|
||||
{
|
||||
"name": "opencode HttpApi",
|
||||
"description": "Experimental HttpApi surface for selected instance routes."
|
||||
},
|
||||
{
|
||||
"name": "permissions",
|
||||
|
||||
Reference in New Issue
Block a user