Config: schema-driven channels and settings
This commit is contained in:
committed by
Peter Steinberger
parent
bcfc9bead5
commit
1ad26d6fea
12
src/channels/plugins/config-schema.ts
Normal file
12
src/channels/plugins/config-schema.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { ZodTypeAny } from "zod";
|
||||
|
||||
import type { ChannelConfigSchema } from "./types.js";
|
||||
|
||||
export function buildChannelConfigSchema(schema: ZodTypeAny): ChannelConfigSchema {
|
||||
return {
|
||||
schema: schema.toJSONSchema({
|
||||
target: "draft-07",
|
||||
unrepresentable: "any",
|
||||
}) as Record<string, unknown>,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user