feat: manage frontend auth from YAML source
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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",
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user