openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
39 lines (38 loc) • 1.5 kB
JavaScript
import { E as hasLegacyAccountStreamingAliases, k as normalizeChannelConfigEntries, n as defineKeyMoveMigration } from "./runtime-doctor-migrations-JGL9tD-z.js";
//#region extensions/zalouser/src/doctor-contract.ts
const groupAllowMigration = defineKeyMoveMigration({
scope: ["groups", "*"],
from: ["allow"],
to: ["enabled"],
sourceOwn: false,
match: (e) => typeof e === "boolean",
targetIsSet: (e) => typeof e === "boolean",
movedMessage: ({ sourcePath: e, targetPath: t, mappedValue: n }) => `Moved ${e} → ${t} (${String(n)}).`,
existingMessage: ({ sourcePath: e, targetPath: t, targetValue: n }) => `Moved ${e} → ${t} (${String(n)}).`
});
const legacyConfigRules = [{
path: [
"channels",
"zalouser",
"groups"
],
message: "channels.zalouser.groups.<id>.allow is legacy; use channels.zalouser.groups.<id>.enabled instead. Run \"openclaw doctor --fix\".",
match: (e) => groupAllowMigration.hasLegacy({ groups: e })
}, {
path: [
"channels",
"zalouser",
"accounts"
],
message: "channels.zalouser.accounts.<id>.groups.<id>.allow is legacy; use channels.zalouser.accounts.<id>.groups.<id>.enabled instead. Run \"openclaw doctor --fix\".",
match: (e) => hasLegacyAccountStreamingAliases(e, groupAllowMigration.hasLegacy)
}];
function normalizeCompatibilityConfig(e) {
return normalizeChannelConfigEntries({
cfg: e.cfg,
channelId: "zalouser",
normalizeEntry: groupAllowMigration.normalize
});
}
//#endregion
export { legacyConfigRules, normalizeCompatibilityConfig };