Add DingTalk to unified IM plugin

This commit is contained in:
xmanrui 2026-08-15 06:09:19 +08:00
parent c7b573a7aa
commit af7e6a2296
14 changed files with 1809 additions and 578 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
// plugin-src/host/index.mjs
import { apply as applyDingtalk } from "@xmanrui/dsh-dingtalk";
import { apply as applyFeishu } from "@xmanrui/dsh-feishu";
import { apply as applyWeixin } from "@xmanrui/dsh-weixin";
var name = "dsh-im-host";
@ -6,12 +7,14 @@ var inject = ["connection", "credentials", "webServer"];
function createImHostPlugin(internals = {}) {
const startFeishu = internals.applyFeishu ?? applyFeishu;
const startWeixin = internals.applyWeixin ?? applyWeixin;
const startDingtalk = internals.applyDingtalk ?? applyDingtalk;
return Object.freeze({
name,
inject,
async apply(ctx, config = {}) {
await startFeishu(ctx, config.feishu ?? {});
await startWeixin(ctx, config.weixin ?? {});
await startDingtalk(ctx, config.dingtalk ?? {});
}
});
}