feat(FN-3763): add cli printing press wizard plugin

Implements a new `fusion-plugin-cli-printing-press` plugin with a multi-step wizard UI for authoring CLI commands, including draft storage, route registration, and validation — plus integration wiring in the dashboard's plugin view registry. Includes TypeScript build and ESM import fixes for the plu

Fusion-Task-Id: FN-3763
This commit is contained in:
Fusion
2026-05-10 15:01:54 -07:00
committed by gsxdsm
parent cedf07c1fe
commit 6769b836f6
24 changed files with 627 additions and 23 deletions

View File

@@ -0,0 +1,30 @@
import { describe, expect, it } from "vitest";
import type { ServiceDraft } from "../wizard/types";
import { validateBasics, validateCredentials, validateDraft, validateEndpoints, validateTransport } from "../wizard/validation";
function makeDraft(): ServiceDraft {
const now = new Date().toISOString();
return { id: "", name: "GitHub", slug: "github", description: "", baseUrl: "https://api.github.com", transport: "http", endpoints: [{ id: "e1", name: "List Repos", method: "GET", path: "/user/repos" }], credential: { kind: "apiKey", header: "Authorization", envVar: "GITHUB_TOKEN" }, createdAt: now, updatedAt: now };
}
describe("wizard validation", () => {
it("validates basics", () => {
expect(validateBasics(makeDraft()).ok).toBe(true);
expect(validateBasics({ ...makeDraft(), slug: "Bad Slug" }).ok).toBe(false);
});
it("validates transport", () => {
expect(validateTransport(makeDraft()).ok).toBe(true);
});
it("validates endpoints", () => {
expect(validateEndpoints(makeDraft()).ok).toBe(true);
expect(validateEndpoints({ ...makeDraft(), endpoints: [] }).ok).toBe(false);
});
it("validates credentials", () => {
expect(validateCredentials({ kind: "bearerToken", envVar: "TOKEN" }).ok).toBe(true);
expect(validateCredentials({ kind: "bearerToken", envVar: "" }).ok).toBe(false);
});
it("validates full draft", () => {
expect(validateDraft(makeDraft()).ok).toBe(true);
expect(validateDraft({ ...makeDraft(), baseUrl: "not-url" }).ok).toBe(false);
});
});