mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
fix: configSchema in /docs endpoint
This commit is contained in:
parent
3b0a0b311d
commit
f3d64e2adc
1 changed files with 3 additions and 4 deletions
|
@ -121,8 +121,8 @@ export function initDocs(router: express.Router) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const plugin = guildPlugins.find((p) => p.name === name)!;
|
const plugin = guildPlugins.find((p) => p.name === name)!;
|
||||||
const info = { ...baseInfo };
|
const { configSchema, ...info } = baseInfo;
|
||||||
delete info.configSchema;
|
const formattedConfigSchema = formatZodConfigSchema(configSchema);
|
||||||
|
|
||||||
const messageCommands = (plugin.messageCommands || []).map((cmd) => ({
|
const messageCommands = (plugin.messageCommands || []).map((cmd) => ({
|
||||||
trigger: cmd.trigger,
|
trigger: cmd.trigger,
|
||||||
|
@ -134,12 +134,11 @@ export function initDocs(router: express.Router) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const defaultOptions = plugin.defaultOptions || {};
|
const defaultOptions = plugin.defaultOptions || {};
|
||||||
const configSchema = info.configSchema && formatZodConfigSchema(info.configSchema);
|
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
name,
|
name,
|
||||||
info,
|
info,
|
||||||
configSchema,
|
configSchema: formattedConfigSchema,
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
messageCommands,
|
messageCommands,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue