feat(channel): add WeChat (weixin) adapter with QR code (#278)

* feat(channel): add WeChat (weixin) adapter with QR code

* fix(channel): fix weixin block streaming

* chore(channel): update weixin logo
This commit is contained in:
晨苒
2026-03-22 23:28:57 +08:00
committed by GitHub
parent 897cc32194
commit e2e3b69acf
31 changed files with 3712 additions and 49 deletions
+156
View File
@@ -4949,6 +4949,111 @@ const docTemplate = `{
}
}
},
"/bots/{id}/channel/weixin/qr/poll": {
"post": {
"description": "Long-poll the QR code scan status. On confirmed, auto-saves credentials.",
"tags": [
"bots"
],
"summary": "Poll WeChat QR login status",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "QR code to poll",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/weixin.QRPollRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/weixin.QRPollResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/bots/{id}/channel/weixin/qr/start": {
"post": {
"description": "Fetch a QR code from WeChat for scanning",
"tags": [
"bots"
],
"summary": "Start WeChat QR login",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Optional base URL override",
"name": "payload",
"in": "body",
"schema": {
"$ref": "#/definitions/weixin.QRStartRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/weixin.QRStartResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/bots/{id}/channel/{platform}": {
"get": {
"description": "Get bot channel configuration",
@@ -12398,6 +12503,57 @@ const docTemplate = `{
"type": "string"
}
}
},
"weixin.QRPollRequest": {
"type": "object",
"properties": {
"baseUrl": {
"type": "string"
},
"qr_code": {
"type": "string"
},
"routeTag": {
"type": "string"
}
}
},
"weixin.QRPollResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"description": "wait, scaned, confirmed, expired",
"type": "string"
}
}
},
"weixin.QRStartRequest": {
"type": "object",
"properties": {
"baseUrl": {
"type": "string"
},
"routeTag": {
"type": "string"
}
}
},
"weixin.QRStartResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"qr_code": {
"type": "string"
},
"qr_code_url": {
"type": "string"
}
}
}
}
}`