mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-26 02:59:33 +00:00
refactor(config): drop duplicate account schema aliases
This commit is contained in:
@@ -1173,14 +1173,11 @@ export const SignalAccountSchemaBase = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
// Account-level schemas skip allowFrom validation because accounts inherit
|
||||
// allowFrom from the parent channel config at runtime.
|
||||
// Validation is enforced at the top-level SignalConfigSchema instead.
|
||||
export const SignalAccountSchema = SignalAccountSchemaBase;
|
||||
|
||||
export const SignalConfigSchema = SignalAccountSchemaBase.extend({
|
||||
apiMode: z.enum(["auto", "native", "container"]).optional(),
|
||||
accounts: z.record(z.string(), SignalAccountSchema.optional()).optional(),
|
||||
// Account-level schemas skip allowFrom validation because accounts inherit
|
||||
// allowFrom from the parent channel config at runtime.
|
||||
accounts: z.record(z.string(), SignalAccountSchemaBase.optional()).optional(),
|
||||
defaultAccount: z.string().optional(),
|
||||
}).superRefine((value, ctx) => {
|
||||
requireOpenAllowFrom({
|
||||
@@ -1453,13 +1450,10 @@ export const IMessageAccountSchemaBase = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
// Account-level schemas skip allowFrom validation because accounts inherit
|
||||
// allowFrom from the parent channel config at runtime.
|
||||
// Validation is enforced at the top-level IMessageConfigSchema instead.
|
||||
export const IMessageAccountSchema = IMessageAccountSchemaBase;
|
||||
|
||||
export const IMessageConfigSchema = IMessageAccountSchemaBase.extend({
|
||||
accounts: z.record(z.string(), IMessageAccountSchema.optional()).optional(),
|
||||
// Account-level schemas skip allowFrom validation because accounts inherit
|
||||
// allowFrom from the parent channel config at runtime.
|
||||
accounts: z.record(z.string(), IMessageAccountSchemaBase.optional()).optional(),
|
||||
defaultAccount: z.string().optional(),
|
||||
}).superRefine((value, ctx) => {
|
||||
requireOpenAllowFrom({
|
||||
|
||||
Reference in New Issue
Block a user