mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 15:10:23 +00:00
refactor(channels): share legacy dm allowlist paths
This commit is contained in:
@@ -11,6 +11,16 @@ type AllowlistConfigPaths = {
|
||||
cleanupPaths?: string[][];
|
||||
};
|
||||
|
||||
const LEGACY_DM_ALLOWLIST_CONFIG_PATHS: AllowlistConfigPaths = {
|
||||
readPaths: [["allowFrom"], ["dm", "allowFrom"]],
|
||||
writePath: ["allowFrom"],
|
||||
cleanupPaths: [["dm", "allowFrom"]],
|
||||
};
|
||||
|
||||
export function resolveLegacyDmAllowlistConfigPaths(scope: "dm" | "group") {
|
||||
return scope === "dm" ? LEGACY_DM_ALLOWLIST_CONFIG_PATHS : null;
|
||||
}
|
||||
|
||||
function resolveAccountScopedWriteTarget(
|
||||
parsed: Record<string, unknown>,
|
||||
channelId: ChannelId,
|
||||
|
||||
@@ -270,7 +270,10 @@ export { buildChannelSendResult } from "./channel-send-result.js";
|
||||
export type { ChannelSendRawResult } from "./channel-send-result.js";
|
||||
export { createPluginRuntimeStore } from "./runtime-store.js";
|
||||
export { createScopedChannelConfigBase } from "./channel-config-helpers.js";
|
||||
export { buildAccountScopedAllowlistConfigEditor } from "./allowlist-config-edit.js";
|
||||
export {
|
||||
buildAccountScopedAllowlistConfigEditor,
|
||||
resolveLegacyDmAllowlistConfigPaths,
|
||||
} from "./allowlist-config-edit.js";
|
||||
export {
|
||||
AllowFromEntrySchema,
|
||||
AllowFromListSchema,
|
||||
|
||||
Reference in New Issue
Block a user