mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
Add unified IM channel plugin
This commit is contained in:
commit
b8bd681a79
26 changed files with 7901 additions and 0 deletions
2877
lib/client.js
Normal file
2877
lib/client.js
Normal file
File diff suppressed because it is too large
Load diff
26
lib/index.js
Normal file
26
lib/index.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// plugin-src/host/index.mjs
|
||||
import { apply as applyFeishu } from "@xmanrui/dsh-feishu";
|
||||
import { apply as applyWeixin } from "@xmanrui/dsh-weixin";
|
||||
var name = "dsh-im-host";
|
||||
var inject = ["connection", "credentials", "webServer"];
|
||||
function createImHostPlugin(internals = {}) {
|
||||
const startFeishu = internals.applyFeishu ?? applyFeishu;
|
||||
const startWeixin = internals.applyWeixin ?? applyWeixin;
|
||||
return Object.freeze({
|
||||
name,
|
||||
inject,
|
||||
async apply(ctx, config = {}) {
|
||||
await startFeishu(ctx, config.feishu ?? {});
|
||||
await startWeixin(ctx, config.weixin ?? {});
|
||||
}
|
||||
});
|
||||
}
|
||||
async function apply(ctx, config = {}) {
|
||||
return createImHostPlugin().apply(ctx, config);
|
||||
}
|
||||
export {
|
||||
apply,
|
||||
createImHostPlugin,
|
||||
inject,
|
||||
name
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue