feat(channels): add DingTalk via bundled plugin mirror and pure Node deploy (#215)

This commit is contained in:
paisley
2026-02-28 11:36:40 +08:00
committed by GitHub
Unverified
parent d4f77a442c
commit d63810f54b
13 changed files with 482 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
*/
export type ChannelType =
| 'whatsapp'
| 'dingtalk'
| 'telegram'
| 'discord'
| 'signal'
@@ -78,6 +79,7 @@ export interface ChannelMeta {
*/
export const CHANNEL_ICONS: Record<ChannelType, string> = {
whatsapp: '📱',
dingtalk: '💬',
telegram: '✈️',
discord: '🎮',
signal: '🔒',
@@ -95,6 +97,7 @@ export const CHANNEL_ICONS: Record<ChannelType, string> = {
*/
export const CHANNEL_NAMES: Record<ChannelType, string> = {
whatsapp: 'WhatsApp',
dingtalk: 'DingTalk',
telegram: 'Telegram',
discord: 'Discord',
signal: 'Signal',
@@ -111,6 +114,58 @@ export const CHANNEL_NAMES: Record<ChannelType, string> = {
* Channel metadata with configuration information
*/
export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
dingtalk: {
id: 'dingtalk',
name: 'DingTalk',
icon: '💬',
description: 'channels:meta.dingtalk.description',
connectionType: 'token',
docsUrl: 'channels:meta.dingtalk.docsUrl',
configFields: [
{
key: 'clientId',
label: 'channels:meta.dingtalk.fields.clientId.label',
type: 'text',
placeholder: 'channels:meta.dingtalk.fields.clientId.placeholder',
required: true,
},
{
key: 'clientSecret',
label: 'channels:meta.dingtalk.fields.clientSecret.label',
type: 'password',
placeholder: 'channels:meta.dingtalk.fields.clientSecret.placeholder',
required: true,
},
{
key: 'robotCode',
label: 'channels:meta.dingtalk.fields.robotCode.label',
type: 'text',
placeholder: 'channels:meta.dingtalk.fields.robotCode.placeholder',
required: false,
},
{
key: 'corpId',
label: 'channels:meta.dingtalk.fields.corpId.label',
type: 'text',
placeholder: 'channels:meta.dingtalk.fields.corpId.placeholder',
required: false,
},
{
key: 'agentId',
label: 'channels:meta.dingtalk.fields.agentId.label',
type: 'text',
placeholder: 'channels:meta.dingtalk.fields.agentId.placeholder',
required: false,
},
],
instructions: [
'channels:meta.dingtalk.instructions.0',
'channels:meta.dingtalk.instructions.1',
'channels:meta.dingtalk.instructions.2',
'channels:meta.dingtalk.instructions.3',
],
isPlugin: true,
},
telegram: {
id: 'telegram',
name: 'Telegram',
@@ -441,7 +496,7 @@ export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
* Get primary supported channels (non-plugin, commonly used)
*/
export function getPrimaryChannels(): ChannelType[] {
return ['telegram', 'discord', 'whatsapp', 'feishu'];
return ['telegram', 'discord', 'whatsapp', 'dingtalk', 'feishu'];
}
/**