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
+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