refactor(config): drop duplicate account schema aliases

This commit is contained in:
Vincent Koc
2026-06-19 21:59:34 +08:00
parent b9dadb9f66
commit 2ddebf3897

View File

@@ -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({