30 lines
991 B
TypeScript
30 lines
991 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 handleBillingCommand(
|
|
action: string | undefined,
|
|
client: Awaited<ReturnType<typeof createSealClient>>,
|
|
corp: CorpConfig,
|
|
args: ParsedArgs
|
|
) {
|
|
if (action === "status" || action === "get") {
|
|
await runTool("seal_billing_status_get", client, corp, {}, outputOptions(args.options));
|
|
return;
|
|
}
|
|
|
|
if (action === "plans") {
|
|
await runTool("seal_billing_plans_list", client, corp, {}, outputOptions(args.options));
|
|
return;
|
|
}
|
|
|
|
if (action === "features") {
|
|
await runTool("seal_billing_features_list", client, corp, {}, outputOptions(args.options));
|
|
return;
|
|
}
|
|
|
|
throw new Error(`Unknown billing command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
|
|
}
|