Files
pikasTech-unidesk/scripts/src/frontend.ts
T
Codex 44b716538e
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
feat: manage frontend auth from YAML source
2026-07-09 15:34:11 +02:00

22 lines
937 B
TypeScript

import type { UniDeskConfig } from "./config";
import type { RenderedCliResult } from "./output";
import { runFrontendAuthCommand } from "./frontend-auth";
import { runFrontendPublicExposureCommand } from "./frontend-public-exposure";
export async function runFrontendCommand(config: UniDeskConfig, args: string[]): Promise<Record<string, unknown> | RenderedCliResult> {
const [scope = "public-exposure"] = args;
if (scope === "auth") return await runFrontendAuthCommand(config, args.slice(1));
if (scope === "public-exposure") return await runFrontendPublicExposureCommand(config, args);
return {
ok: false,
error: "unsupported-frontend-command",
command: "frontend",
supportedScopes: ["auth", "public-exposure"],
examples: [
"bun scripts/cli.ts frontend auth plan",
"bun scripts/cli.ts frontend auth apply --confirm",
"bun scripts/cli.ts frontend public-exposure validate",
],
};
}