25 lines
874 B
TypeScript
25 lines
874 B
TypeScript
import type { CorpConfig } from "../../core/config/types.js";
|
|
import type { createSealClient } from "../../core/http/factory.js";
|
|
import { runTool } from "../helpers.js";
|
|
import { outputOptions } from "../printer.js";
|
|
import type { ParsedArgs } from "../types.js";
|
|
|
|
export async function handlePermissionsCommand(
|
|
action: string | undefined,
|
|
client: Awaited<ReturnType<typeof createSealClient>>,
|
|
corp: CorpConfig,
|
|
args: ParsedArgs
|
|
) {
|
|
if (action === "available") {
|
|
await runTool("seal_permissions_available_list", client, corp, {}, outputOptions(args.options));
|
|
return;
|
|
}
|
|
|
|
if (action === "configs" || action === "list") {
|
|
await runTool("seal_permissions_configs_list", client, corp, {}, outputOptions(args.options));
|
|
return;
|
|
}
|
|
|
|
throw new Error(`Unknown permissions command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
|
|
}
|