refactor: share scoped account accessor adapters

This commit is contained in:
Peter Steinberger
2026-03-22 20:04:22 +00:00
parent 8aca2fdc73
commit fa13c2960e
21 changed files with 126 additions and 57 deletions

View File

@@ -1,5 +1,6 @@
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
import {
adaptScopedAccountAccessor,
createScopedChannelConfigAdapter,
createScopedDmSecurityResolver,
} from "openclaw/plugin-sdk/channel-config-helpers";
@@ -59,7 +60,7 @@ const nextcloudTalkConfigAdapter = createScopedChannelConfigAdapter<
>({
sectionKey: "nextcloud-talk",
listAccountIds: listNextcloudTalkAccountIds,
resolveAccount: (cfg, accountId) => resolveNextcloudTalkAccount({ cfg, accountId }),
resolveAccount: adaptScopedAccountAccessor(resolveNextcloudTalkAccount),
defaultAccountId: resolveDefaultNextcloudTalkAccountId,
clearBaseFields: ["botSecret", "botSecretFile", "baseUrl", "name"],
resolveAllowFrom: (account) => account.config.allowFrom,