3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-06-16 19:15:03 +00:00

fix: possible fix to log format validation

This commit is contained in:
Dragory 2025-05-31 20:57:23 +00:00
parent bd0f8140aa
commit b9713f45fc
No known key found for this signature in database

View file

@ -30,7 +30,7 @@ const MAX_BATCH_TIME = 5000;
// A bit of a workaround so we can pass LogType keys to z.enum() // A bit of a workaround so we can pass LogType keys to z.enum()
const logTypes = keys(LogType); const logTypes = keys(LogType);
const logTypeProps = logTypes.reduce((map, type) => { const logTypeProps = logTypes.reduce((map, type) => {
map[type] = zMessageContent; map[type] = zMessageContent.default(DefaultLogMessages[type] || "");
return map; return map;
}, {} as Record<keyof typeof LogType, typeof zMessageContent>); }, {} as Record<keyof typeof LogType, typeof zMessageContent>);
const zLogFormats = z.strictObject(logTypeProps); const zLogFormats = z.strictObject(logTypeProps);
@ -58,7 +58,7 @@ export type TLogChannelMap = z.infer<typeof zLogChannelMap>;
export const zLogsConfig = z.strictObject({ export const zLogsConfig = z.strictObject({
channels: zLogChannelMap.default({}), channels: zLogChannelMap.default({}),
format: zLogFormats.default(DefaultLogMessages), format: zLogFormats,
// Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true // Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true
ping_user: z.boolean().default(true), ping_user: z.boolean().default(true),
allow_user_mentions: z.boolean().default(false), allow_user_mentions: z.boolean().default(false),