refactor: share config adapter allowFrom and defaultTo helpers

This commit is contained in:
Peter Steinberger
2026-03-07 23:02:59 +00:00
parent feac26c3b7
commit 556aa8a702
17 changed files with 100 additions and 57 deletions

View File

@@ -1,6 +1,7 @@
import {
collectOpenGroupPolicyRestrictSendersWarnings,
formatAllowFromLowercase,
mapAllowFromEntries,
} from "openclaw/plugin-sdk";
import type { ChannelMeta, ChannelPlugin, ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import {
@@ -252,7 +253,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount> = {
}),
resolveAllowFrom: ({ cfg, accountId }) => {
const account = resolveFeishuAccount({ cfg, accountId });
return (account.config?.allowFrom ?? []).map((entry) => String(entry));
return mapAllowFromEntries(account.config?.allowFrom);
},
formatAllowFrom: ({ allowFrom }) => formatAllowFromLowercase({ allowFrom }),
},