fix(sentinel): add YAML shortest-path validation
This commit is contained in:
@@ -12,7 +12,12 @@ export function webProbeHelp(): Record<string, unknown> {
|
||||
|
||||
export async function runWebProbeCommand(_config: Config, args: string[]): Promise<Record<string, unknown> | RenderedCliResult> {
|
||||
if (args.length === 0 || args.includes("--help") || args.includes("-h") || args[0] === "help") return webProbeHelp();
|
||||
return runNodeWebProbe(parseNodeWebProbeOptions(args));
|
||||
const format = args.includes("--json") ? "json" : args.includes("--yaml") ? "yaml" : "text";
|
||||
const parsedArgs = args.filter((item) => item !== "--json" && item !== "--yaml");
|
||||
const result = runNodeWebProbe(parseNodeWebProbeOptions(parsedArgs));
|
||||
if (format === "text" || !("projection" in result) || result.projection === undefined) return result;
|
||||
if (format === "json") return result.projection;
|
||||
return { ...result, renderedText: Bun.YAML.stringify(result.projection), contentType: "application/yaml" };
|
||||
}
|
||||
|
||||
export function legacyHwlabNodeWebProbeUnsupported(args: string[]): Record<string, unknown> {
|
||||
|
||||
Reference in New Issue
Block a user