diff --git a/.changeset/FN-3763-cli-printing-press-wizard.md b/.changeset/FN-3763-cli-printing-press-wizard.md new file mode 100644 index 000000000..e39835980 --- /dev/null +++ b/.changeset/FN-3763-cli-printing-press-wizard.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": patch +--- + +Add a bundled `fusion-plugin-cli-printing-press` plugin with a plugin-owned Create Service wizard view and draft-save API scaffold. diff --git a/packages/dashboard/app/plugins/__tests__/pluginViewRegistry.test.tsx b/packages/dashboard/app/plugins/__tests__/pluginViewRegistry.test.tsx index a484a4a29..7be73271b 100644 --- a/packages/dashboard/app/plugins/__tests__/pluginViewRegistry.test.tsx +++ b/packages/dashboard/app/plugins/__tests__/pluginViewRegistry.test.tsx @@ -35,6 +35,12 @@ describe("pluginViewRegistry", () => { expect(getPluginViewComponent("plugin-b", "missing")).toBeNull(); }); + it("resolves cli printing press wizard entries", () => { + const View = lazy(async () => ({ default: () =>
List, edit, regenerate, run/test, and runtime exposure land in FN-3764 / FN-3765 / FN-3767.
{error}
: null}{currentStep === "basics" ?Transport
Other transports land in follow-up tasks.
OAuth support is deferred to FN-3762 / FN-3766.
+ + + + + + {credential.kind === "apiKey" ? ( + <> + onChange({ kind: "apiKey", header: e.target.value, envVar: credential.envVar })} /> + onChange({ kind: "apiKey", header: credential.header, envVar: e.target.value })} /> + > + ) : null} + {credential.kind === "bearerToken" ? onChange({ kind: "bearerToken", envVar: e.target.value })} /> : null} + {credential.kind === "basicAuth" ? ( + <> + onChange({ kind: "basicAuth", usernameEnvVar: e.target.value, passwordEnvVar: credential.passwordEnvVar })} /> + onChange({ kind: "basicAuth", usernameEnvVar: credential.usernameEnvVar, passwordEnvVar: e.target.value })} /> + > + ) : null} +{JSON.stringify(draft, null, 2)};
+}
diff --git a/plugins/fusion-plugin-cli-printing-press/src/wizard/types.ts b/plugins/fusion-plugin-cli-printing-press/src/wizard/types.ts
new file mode 100644
index 000000000..91fcc8cf8
--- /dev/null
+++ b/plugins/fusion-plugin-cli-printing-press/src/wizard/types.ts
@@ -0,0 +1,30 @@
+export type CredentialPattern =
+ | { kind: "none" }
+ | { kind: "apiKey"; header: string; envVar: string }
+ | { kind: "bearerToken"; envVar: string }
+ | { kind: "basicAuth"; usernameEnvVar: string; passwordEnvVar: string };
+// TODO(FN-3762/FN-3766): OAuth credential variants.
+
+export interface ServiceEndpoint {
+ id: string;
+ name: string;
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
+ path: string;
+ summary?: string;
+ params?: string;
+}
+
+export interface ServiceDraft {
+ id: string;
+ name: string;
+ slug: string;
+ description: string;
+ baseUrl: string;
+ transport: "http";
+ endpoints: ServiceEndpoint[];
+ credential: CredentialPattern;
+ createdAt: string;
+ updatedAt: string;
+}
+
+export type WizardStep = "basics" | "transport" | "endpoints" | "credentials" | "review";
diff --git a/plugins/fusion-plugin-cli-printing-press/src/wizard/validation.ts b/plugins/fusion-plugin-cli-printing-press/src/wizard/validation.ts
new file mode 100644
index 000000000..d65fb0bd1
--- /dev/null
+++ b/plugins/fusion-plugin-cli-printing-press/src/wizard/validation.ts
@@ -0,0 +1,63 @@
+import type { CredentialPattern, ServiceDraft, ServiceEndpoint } from "./types.js";
+
+type Ok = { ok: true };
+type Fail = { ok: false; errors: Record