chore(web): re-generate sdk and use it

This commit is contained in:
Acbox
2026-03-11 22:19:50 +08:00
parent 82c8d65a7d
commit 92aa7ee104
11 changed files with 1154 additions and 99 deletions
+25 -58
View File
@@ -692,17 +692,23 @@ import {
postBotsByBotIdMcp,
putBotsByBotIdMcpById,
deleteBotsByBotIdMcpById,
postBotsByBotIdMcpByIdProbe,
putBotsByBotIdMcpImport,
getBotsByBotIdMcpByIdOauthStatus,
postBotsByBotIdMcpByIdOauthDiscover,
postBotsByBotIdMcpByIdOauthAuthorize,
deleteBotsByBotIdMcpByIdOauthToken,
} from '@memoh/sdk'
import type {
McpUpsertRequest,
McpImportRequest,
McpToolDescriptor,
McpMcpServerEntry,
McpOAuthStatus,
} from '@memoh/sdk'
import type { McpUpsertRequest, McpImportRequest } from '@memoh/sdk'
import { client } from '@memoh/sdk/client'
import { resolveApiErrorMessage } from '@/utils/api-error'
import { useClipboard } from '@/composables/useClipboard'
interface ToolDescriptor {
name: string
description: string
}
interface McpItem {
id: string
name: string
@@ -710,29 +716,12 @@ interface McpItem {
config: Record<string, unknown>
is_active: boolean
status: string
tools_cache: ToolDescriptor[]
tools_cache: McpToolDescriptor[]
last_probed_at: string | null
status_message: string
auth_type: string
}
interface McpServerEntry {
command?: string
args?: string[]
env?: Record<string, string>
cwd?: string
url?: string
headers?: Record<string, string>
transport?: string
}
interface ProbeResponse {
status: string
tools: ToolDescriptor[]
error?: string
auth_required?: boolean
}
const DRAFT_ID = ''
const IMPORT_EXAMPLE = JSON.stringify({
@@ -764,23 +753,7 @@ const probeAuthRequired = ref(false)
const oauthDiscovering = ref(false)
const oauthAuthorizing = ref(false)
interface OAuthStatusResponse {
configured: boolean
has_token: boolean
expired: boolean
scopes?: string
expires_at?: string
auth_server?: string
callback_url?: string
}
interface OAuthDiscoveryResponse {
registration_endpoint?: string
authorization_endpoint?: string
token_endpoint?: string
}
const oauthStatus = ref<OAuthStatusResponse | null>(null)
const oauthStatus = ref<McpOAuthStatus | null>(null)
const oauthClientId = ref('')
const oauthClientSecret = ref('')
const oauthNeedsClientId = ref(false)
@@ -817,7 +790,7 @@ const filteredItems = computed(() => {
return items.value.filter((i) => i.id === DRAFT_ID || i.name.toLowerCase().includes(kw))
})
const displayTools = computed<ToolDescriptor[]>(() => {
const displayTools = computed<McpToolDescriptor[]>(() => {
if (!selectedItem.value) return []
return selectedItem.value.tools_cache ?? []
})
@@ -939,7 +912,7 @@ function handleCreateDraft() {
createDialogOpen.value = false
}
function itemToExportEntry(item: McpItem): McpServerEntry {
function itemToExportEntry(item: McpItem): McpMcpServerEntry {
const cfg = item.config ?? {}
if (item.type === 'stdio') {
return {
@@ -1020,13 +993,12 @@ async function handleProbe(item: McpItem) {
probing.value = true
probeAuthRequired.value = false
try {
const { data } = await client.post<ProbeResponse>({
url: '/bots/{bot_id}/mcp/{id}/probe',
const { data } = await postBotsByBotIdMcpByIdProbe({
path: { bot_id: props.botId, id: item.id },
throwOnError: true,
})
if (data) {
item.status = data.status
item.status = data.status ?? item.status
item.tools_cache = data.tools ?? []
item.status_message = data.error ?? ''
item.last_probed_at = new Date().toISOString()
@@ -1111,8 +1083,7 @@ async function handleImportFromDialog() {
if (!parsed.mcpServers && typeof parsed === 'object') {
parsed = { mcpServers: parsed as McpImportRequest['mcpServers'] }
}
await client.put({
url: '/bots/{bot_id}/mcp-ops/import',
await putBotsByBotIdMcpImport({
path: { bot_id: props.botId },
body: parsed,
throwOnError: true,
@@ -1130,7 +1101,7 @@ async function handleImportFromDialog() {
function handleExportSingle() {
if (!selectedItem.value || !selectedItem.value.id) return
const mcpServers: Record<string, McpServerEntry> = {
const mcpServers: Record<string, McpMcpServerEntry> = {
[selectedItem.value.name]: itemToExportEntry(selectedItem.value),
}
exportJson.value = JSON.stringify({ mcpServers }, null, 2)
@@ -1148,8 +1119,7 @@ async function loadOAuthStatus(item: McpItem) {
return
}
try {
const { data } = await client.get<OAuthStatusResponse>({
url: '/bots/{bot_id}/mcp/{id}/oauth/status',
const { data } = await getBotsByBotIdMcpByIdOauthStatus({
path: { bot_id: props.botId, id: item.id },
throwOnError: true,
})
@@ -1167,8 +1137,7 @@ async function handleOAuthDiscover() {
oauthDiscovering.value = true
oauthNeedsClientId.value = false
try {
const { data } = await client.post<OAuthDiscoveryResponse>({
url: '/bots/{bot_id}/mcp/{id}/oauth/discover',
const { data } = await postBotsByBotIdMcpByIdOauthDiscover({
path: { bot_id: props.botId, id: item.id },
throwOnError: true,
})
@@ -1200,8 +1169,7 @@ async function handleOAuthFlow() {
oauthAuthorizing.value = true
try {
const { data } = await client.post<{ authorization_url: string }>({
url: '/bots/{bot_id}/mcp/{id}/oauth/authorize',
const { data } = await postBotsByBotIdMcpByIdOauthAuthorize({
path: { bot_id: props.botId, id: item.id },
body: {
client_id: oauthClientId.value.trim() || undefined,
@@ -1250,8 +1218,7 @@ async function handleOAuthFlow() {
async function handleOAuthRevoke() {
if (!selectedItem.value?.id) return
try {
await client.delete({
url: '/bots/{bot_id}/mcp/{id}/oauth/token',
await deleteBotsByBotIdMcpByIdOauthToken({
path: { bot_id: props.botId, id: selectedItem.value.id },
throwOnError: true,
})
@@ -240,18 +240,15 @@ import { toTypedSchema } from '@vee-validate/zod'
import z from 'zod'
import { useForm } from 'vee-validate'
import { useMutation, useQuery, useQueryCache } from '@pinia/colada'
import { putEmailProvidersById, deleteEmailProvidersById, getEmailProvidersMeta } from '@memoh/sdk'
import { client } from '@memoh/sdk/client'
import type { EmailProviderResponse, EmailFieldSchema } from '@memoh/sdk'
interface EmailOAuthStatusResponse {
provider: string
configured: boolean
has_token: boolean
expired: boolean
email_address?: string
expires_at?: string
}
import {
putEmailProvidersById,
deleteEmailProvidersById,
getEmailProvidersMeta,
getEmailProvidersByIdOauthAuthorize,
getEmailProvidersByIdOauthStatus,
deleteEmailProvidersByIdOauthToken,
} from '@memoh/sdk'
import type { EmailProviderResponse, EmailFieldSchema, HandlersEmailOAuthStatusResponse } from '@memoh/sdk'
const OAUTH_PROVIDERS = ['gmail']
@@ -282,7 +279,7 @@ const isOAuthProvider = computed(() =>
OAUTH_PROVIDERS.includes(curProvider.value?.provider ?? ''),
)
const oauthStatus = ref<EmailOAuthStatusResponse | null>(null)
const oauthStatus = ref<HandlersEmailOAuthStatusResponse | null>(null)
const oauthStatusLoading = ref(false)
const revokeLoading = ref(false)
@@ -377,8 +374,8 @@ async function handleAuthorize() {
if (!curProviderId.value) return
authorizeLoading.value = true
try {
const { data, error } = await client.get<{ auth_url: string }, unknown>({
url: `/email-providers/${curProviderId.value}/oauth/authorize`,
const { data, error } = await getEmailProvidersByIdOauthAuthorize({
path: { id: curProviderId.value },
})
if (error || !data?.auth_url) {
throw new Error(t('emailProvider.oauth.authorizeFailed'))
@@ -399,8 +396,8 @@ async function fetchOAuthStatus() {
}
oauthStatusLoading.value = true
try {
const { data, error } = await client.get<EmailOAuthStatusResponse, unknown>({
url: `/email-providers/${curProviderId.value}/oauth/status`,
const { data, error } = await getEmailProvidersByIdOauthStatus({
path: { id: curProviderId.value },
})
if (error) {
throw error
@@ -418,8 +415,8 @@ async function handleRevoke() {
if (!curProviderId.value) return
revokeLoading.value = true
try {
const { error } = await client.delete({
url: `/email-providers/${curProviderId.value}/oauth/token`,
const { error } = await deleteEmailProvidersByIdOauthToken({
path: { id: curProviderId.value },
})
if (error) throw error
toast.success(t('emailProvider.oauth.logoutSuccess'))
+3 -3
View File
@@ -27,7 +27,7 @@ import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { Spinner } from '@memoh/ui'
import { client } from '@memoh/sdk/client'
import { postBotsByBotIdMcpByIdOauthExchange } from '@memoh/sdk'
const route = useRoute()
const { t } = useI18n()
@@ -66,8 +66,8 @@ onMounted(async () => {
}
try {
await client.post({
url: '/bots/-/mcp/-/oauth/exchange',
await postBotsByBotIdMcpByIdOauthExchange({
path: { bot_id: '-', id: '-' },
body: { code, state },
throwOnError: true,
})
+2 -13
View File
@@ -219,7 +219,7 @@ import PasswordSection from './components/password-section.vue'
import BindCodeSection from './components/bind-code-section.vue'
import { getUsersMe, putUsersMe, putUsersMePassword, getUsersMeIdentities } from '@memoh/sdk'
import { client } from '@memoh/sdk/client'
import type { AccountsAccount, AccountsUpdateProfileRequest, AccountsUpdatePasswordRequest } from '@memoh/sdk'
import type { AccountsAccount, AccountsUpdateProfileRequest, AccountsUpdatePasswordRequest, IdentitiesChannelIdentity } from '@memoh/sdk'
import { useUserStore } from '@/store/user'
import { useSettingsStore } from '@/store/settings'
import type { Locale } from '@/i18n'
@@ -228,17 +228,6 @@ import { formatDateTime } from '@/utils/date-time'
import { useClipboard } from '@/composables/useClipboard'
import { useAvatarInitials } from '@/composables/useAvatarInitials'
interface ChannelIdentity {
id: string
user_id?: string
channel: string
channel_subject_id: string
display_name?: string
metadata?: Record<string, unknown>
created_at: string
updated_at: string
}
interface IssueBindCodeResponse {
token: string
platform?: string
@@ -262,7 +251,7 @@ const { setLanguage, setTheme } = settingsStore
// ---- User data ----
const account = ref<UserAccount | null>(null)
const identities = ref<ChannelIdentity[]>([])
const identities = ref<IdentitiesChannelIdentity[]>([])
const bindCode = ref<IssueBindCodeResponse | null>(null)
const loadingInitial = ref(false)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+224
View File
@@ -678,6 +678,15 @@ export type HandlersTokenUsageResponse = {
heartbeat?: Array<HandlersDailyTokenUsage>;
};
export type HandlersEmailOAuthStatusResponse = {
configured?: boolean;
email_address?: string;
expired?: boolean;
expires_at?: string;
has_token?: boolean;
provider?: string;
};
export type HandlersFsOpResponse = {
ok?: boolean;
};
@@ -746,6 +755,11 @@ export type HandlersSkillsOpResponse = {
ok?: boolean;
};
export type HandlersTerminalInfoResponse = {
available?: boolean;
shell?: string;
};
export type HeartbeatListLogsResponse = {
items?: Array<HeartbeatLog>;
};
@@ -2504,6 +2518,74 @@ export type PostBotsByBotIdContainerStopResponses = {
export type PostBotsByBotIdContainerStopResponse = PostBotsByBotIdContainerStopResponses[keyof PostBotsByBotIdContainerStopResponses];
export type GetBotsByBotIdContainerTerminalData = {
body?: never;
path: {
/**
* Bot ID
*/
bot_id: string;
};
query?: never;
url: '/bots/{bot_id}/container/terminal';
};
export type GetBotsByBotIdContainerTerminalErrors = {
/**
* Not Found
*/
404: HandlersErrorResponse;
};
export type GetBotsByBotIdContainerTerminalError = GetBotsByBotIdContainerTerminalErrors[keyof GetBotsByBotIdContainerTerminalErrors];
export type GetBotsByBotIdContainerTerminalResponses = {
/**
* OK
*/
200: HandlersTerminalInfoResponse;
};
export type GetBotsByBotIdContainerTerminalResponse = GetBotsByBotIdContainerTerminalResponses[keyof GetBotsByBotIdContainerTerminalResponses];
export type GetBotsByBotIdContainerTerminalWsData = {
body?: never;
path: {
/**
* Bot ID
*/
bot_id: string;
};
query?: {
/**
* Initial terminal columns
*/
cols?: number;
/**
* Initial terminal rows
*/
rows?: number;
/**
* Auth token
*/
token?: string;
};
url: '/bots/{bot_id}/container/terminal/ws';
};
export type GetBotsByBotIdContainerTerminalWsErrors = {
/**
* Bad Request
*/
400: HandlersErrorResponse;
/**
* Internal Server Error
*/
500: HandlersErrorResponse;
};
export type GetBotsByBotIdContainerTerminalWsError = GetBotsByBotIdContainerTerminalWsErrors[keyof GetBotsByBotIdContainerTerminalWsErrors];
export type GetBotsByBotIdEmailBindingsData = {
body?: never;
path: {
@@ -5976,6 +6058,108 @@ export type PutEmailProvidersByIdResponses = {
export type PutEmailProvidersByIdResponse = PutEmailProvidersByIdResponses[keyof PutEmailProvidersByIdResponses];
export type GetEmailProvidersByIdOauthAuthorizeData = {
body?: never;
path: {
/**
* Email provider ID
*/
id: string;
};
query?: never;
url: '/email-providers/{id}/oauth/authorize';
};
export type GetEmailProvidersByIdOauthAuthorizeErrors = {
/**
* Bad Request
*/
400: HandlersErrorResponse;
/**
* Not Found
*/
404: HandlersErrorResponse;
};
export type GetEmailProvidersByIdOauthAuthorizeError = GetEmailProvidersByIdOauthAuthorizeErrors[keyof GetEmailProvidersByIdOauthAuthorizeErrors];
export type GetEmailProvidersByIdOauthAuthorizeResponses = {
/**
* OK
*/
200: {
[key: string]: string;
};
};
export type GetEmailProvidersByIdOauthAuthorizeResponse = GetEmailProvidersByIdOauthAuthorizeResponses[keyof GetEmailProvidersByIdOauthAuthorizeResponses];
export type GetEmailProvidersByIdOauthStatusData = {
body?: never;
path: {
/**
* Email provider ID
*/
id: string;
};
query?: never;
url: '/email-providers/{id}/oauth/status';
};
export type GetEmailProvidersByIdOauthStatusErrors = {
/**
* Bad Request
*/
400: HandlersErrorResponse;
/**
* Not Found
*/
404: HandlersErrorResponse;
};
export type GetEmailProvidersByIdOauthStatusError = GetEmailProvidersByIdOauthStatusErrors[keyof GetEmailProvidersByIdOauthStatusErrors];
export type GetEmailProvidersByIdOauthStatusResponses = {
/**
* OK
*/
200: HandlersEmailOAuthStatusResponse;
};
export type GetEmailProvidersByIdOauthStatusResponse = GetEmailProvidersByIdOauthStatusResponses[keyof GetEmailProvidersByIdOauthStatusResponses];
export type DeleteEmailProvidersByIdOauthTokenData = {
body?: never;
path: {
/**
* Email provider ID
*/
id: string;
};
query?: never;
url: '/email-providers/{id}/oauth/token';
};
export type DeleteEmailProvidersByIdOauthTokenErrors = {
/**
* Bad Request
*/
400: HandlersErrorResponse;
/**
* Not Found
*/
404: HandlersErrorResponse;
};
export type DeleteEmailProvidersByIdOauthTokenError = DeleteEmailProvidersByIdOauthTokenErrors[keyof DeleteEmailProvidersByIdOauthTokenErrors];
export type DeleteEmailProvidersByIdOauthTokenResponses = {
/**
* No Content
*/
204: unknown;
};
export type PostEmailMailgunWebhookByConfigIdData = {
body?: never;
path: {
@@ -6016,6 +6200,46 @@ export type PostEmailMailgunWebhookByConfigIdResponses = {
export type PostEmailMailgunWebhookByConfigIdResponse = PostEmailMailgunWebhookByConfigIdResponses[keyof PostEmailMailgunWebhookByConfigIdResponses];
export type GetEmailOauthCallbackData = {
body?: never;
path?: never;
query: {
/**
* Authorization code
*/
code: string;
/**
* State parameter
*/
state: string;
};
url: '/email/oauth/callback';
};
export type GetEmailOauthCallbackErrors = {
/**
* Bad Request
*/
400: HandlersErrorResponse;
/**
* Internal Server Error
*/
500: HandlersErrorResponse;
};
export type GetEmailOauthCallbackError = GetEmailOauthCallbackErrors[keyof GetEmailOauthCallbackErrors];
export type GetEmailOauthCallbackResponses = {
/**
* OK
*/
200: {
[key: string]: string;
};
};
export type GetEmailOauthCallbackResponse = GetEmailOauthCallbackResponses[keyof GetEmailOauthCallbackResponses];
export type GetMemoryProvidersData = {
body?: never;
path?: never;
+280 -1
View File
@@ -1420,6 +1420,91 @@ const docTemplate = `{
}
}
},
"/bots/{bot_id}/container/terminal": {
"get": {
"tags": [
"containerd"
],
"summary": "Check terminal availability for bot container",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.terminalInfoResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/terminal/ws": {
"get": {
"tags": [
"containerd"
],
"summary": "Interactive WebSocket terminal for bot container",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 80,
"description": "Initial terminal columns",
"name": "cols",
"in": "query"
},
{
"type": "integer",
"default": 24,
"description": "Initial terminal rows",
"name": "rows",
"in": "query"
},
{
"type": "string",
"description": "Auth token",
"name": "token",
"in": "query"
}
],
"responses": {
"101": {
"description": "WebSocket upgrade"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-bindings": {
"get": {
"produces": [
@@ -5677,6 +5762,118 @@ const docTemplate = `{
}
}
},
"/email-providers/{id}/oauth/authorize": {
"get": {
"description": "Returns the authorization URL to redirect the user to",
"tags": [
"email-oauth"
],
"summary": "Start OAuth2 authorization for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers/{id}/oauth/status": {
"get": {
"tags": [
"email-oauth"
],
"summary": "Get OAuth2 status for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.emailOAuthStatusResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers/{id}/oauth/token": {
"delete": {
"tags": [
"email-oauth"
],
"summary": "Revoke stored OAuth2 tokens for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email/mailgun/webhook/{config_id}": {
"post": {
"description": "Receives inbound emails from Mailgun",
@@ -5724,6 +5921,54 @@ const docTemplate = `{
}
}
},
"/email/oauth/callback": {
"get": {
"description": "Handles the OAuth2 callback, exchanges the code for tokens",
"tags": [
"email-oauth"
],
"summary": "OAuth2 callback for email providers",
"parameters": [
{
"type": "string",
"description": "Authorization code",
"name": "code",
"in": "query",
"required": true
},
{
"type": "string",
"description": "State parameter",
"name": "state",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory-providers": {
"get": {
"description": "List configured memory providers",
@@ -9276,6 +9521,29 @@ const docTemplate = `{
}
}
},
"handlers.emailOAuthStatusResponse": {
"type": "object",
"properties": {
"configured": {
"type": "boolean"
},
"email_address": {
"type": "string"
},
"expired": {
"type": "boolean"
},
"expires_at": {
"type": "string"
},
"has_token": {
"type": "boolean"
},
"provider": {
"type": "string"
}
}
},
"handlers.fsOpResponse": {
"type": "object",
"properties": {
@@ -9436,6 +9704,17 @@ const docTemplate = `{
}
}
},
"handlers.terminalInfoResponse": {
"type": "object",
"properties": {
"available": {
"type": "boolean"
},
"shell": {
"type": "string"
}
}
},
"heartbeat.ListLogsResponse": {
"type": "object",
"properties": {
@@ -10910,7 +11189,7 @@ const docTemplate = `{
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it.
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0.0",
Host: "",
+279
View File
@@ -1411,6 +1411,91 @@
}
}
},
"/bots/{bot_id}/container/terminal": {
"get": {
"tags": [
"containerd"
],
"summary": "Check terminal availability for bot container",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.terminalInfoResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/terminal/ws": {
"get": {
"tags": [
"containerd"
],
"summary": "Interactive WebSocket terminal for bot container",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 80,
"description": "Initial terminal columns",
"name": "cols",
"in": "query"
},
{
"type": "integer",
"default": 24,
"description": "Initial terminal rows",
"name": "rows",
"in": "query"
},
{
"type": "string",
"description": "Auth token",
"name": "token",
"in": "query"
}
],
"responses": {
"101": {
"description": "WebSocket upgrade"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-bindings": {
"get": {
"produces": [
@@ -5668,6 +5753,118 @@
}
}
},
"/email-providers/{id}/oauth/authorize": {
"get": {
"description": "Returns the authorization URL to redirect the user to",
"tags": [
"email-oauth"
],
"summary": "Start OAuth2 authorization for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers/{id}/oauth/status": {
"get": {
"tags": [
"email-oauth"
],
"summary": "Get OAuth2 status for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.emailOAuthStatusResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers/{id}/oauth/token": {
"delete": {
"tags": [
"email-oauth"
],
"summary": "Revoke stored OAuth2 tokens for an email provider",
"parameters": [
{
"type": "string",
"description": "Email provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email/mailgun/webhook/{config_id}": {
"post": {
"description": "Receives inbound emails from Mailgun",
@@ -5715,6 +5912,54 @@
}
}
},
"/email/oauth/callback": {
"get": {
"description": "Handles the OAuth2 callback, exchanges the code for tokens",
"tags": [
"email-oauth"
],
"summary": "OAuth2 callback for email providers",
"parameters": [
{
"type": "string",
"description": "Authorization code",
"name": "code",
"in": "query",
"required": true
},
{
"type": "string",
"description": "State parameter",
"name": "state",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory-providers": {
"get": {
"description": "List configured memory providers",
@@ -9267,6 +9512,29 @@
}
}
},
"handlers.emailOAuthStatusResponse": {
"type": "object",
"properties": {
"configured": {
"type": "boolean"
},
"email_address": {
"type": "string"
},
"expired": {
"type": "boolean"
},
"expires_at": {
"type": "string"
},
"has_token": {
"type": "boolean"
},
"provider": {
"type": "string"
}
}
},
"handlers.fsOpResponse": {
"type": "object",
"properties": {
@@ -9427,6 +9695,17 @@
}
}
},
"handlers.terminalInfoResponse": {
"type": "object",
"properties": {
"available": {
"type": "boolean"
},
"shell": {
"type": "string"
}
}
},
"heartbeat.ListLogsResponse": {
"type": "object",
"properties": {
+183
View File
@@ -1126,6 +1126,21 @@ definitions:
$ref: '#/definitions/handlers.DailyTokenUsage'
type: array
type: object
handlers.emailOAuthStatusResponse:
properties:
configured:
type: boolean
email_address:
type: string
expired:
type: boolean
expires_at:
type: string
has_token:
type: boolean
provider:
type: string
type: object
handlers.fsOpResponse:
properties:
ok:
@@ -1230,6 +1245,13 @@ definitions:
ok:
type: boolean
type: object
handlers.terminalInfoResponse:
properties:
available:
type: boolean
shell:
type: string
type: object
heartbeat.ListLogsResponse:
properties:
items:
@@ -3144,6 +3166,62 @@ paths:
summary: Stop container task for bot
tags:
- containerd
/bots/{bot_id}/container/terminal:
get:
parameters:
- description: Bot ID
in: path
name: bot_id
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.terminalInfoResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Check terminal availability for bot container
tags:
- containerd
/bots/{bot_id}/container/terminal/ws:
get:
parameters:
- description: Bot ID
in: path
name: bot_id
required: true
type: string
- default: 80
description: Initial terminal columns
in: query
name: cols
type: integer
- default: 24
description: Initial terminal rows
in: query
name: rows
type: integer
- description: Auth token
in: query
name: token
type: string
responses:
"101":
description: WebSocket upgrade
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Interactive WebSocket terminal for bot container
tags:
- containerd
/bots/{bot_id}/email-bindings:
get:
parameters:
@@ -5969,6 +6047,79 @@ paths:
summary: Update an email provider
tags:
- email-providers
/email-providers/{id}/oauth/authorize:
get:
description: Returns the authorization URL to redirect the user to
parameters:
- description: Email provider ID
in: path
name: id
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Start OAuth2 authorization for an email provider
tags:
- email-oauth
/email-providers/{id}/oauth/status:
get:
parameters:
- description: Email provider ID
in: path
name: id
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.emailOAuthStatusResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Get OAuth2 status for an email provider
tags:
- email-oauth
/email-providers/{id}/oauth/token:
delete:
parameters:
- description: Email provider ID
in: path
name: id
required: true
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Revoke stored OAuth2 tokens for an email provider
tags:
- email-oauth
/email-providers/meta:
get:
description: List available email provider types and config schemas
@@ -6013,6 +6164,38 @@ paths:
summary: Mailgun inbound email webhook
tags:
- email-webhook
/email/oauth/callback:
get:
description: Handles the OAuth2 callback, exchanges the code for tokens
parameters:
- description: Authorization code
in: query
name: code
required: true
type: string
- description: State parameter
in: query
name: state
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: OAuth2 callback for email providers
tags:
- email-oauth
/memory-providers:
get:
description: List configured memory providers