feat: type the plugin host record, move plugin strings out of core and add lint checks

This commit is contained in:
LukeGus committed 2026-09-29 13:08:39 -05:00
1 parent bba06f7ff6
commit b8bbcd2196
626 files changed
+23884 -4590

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import { describe, expect, it } from "vitest";
import { toHostRecord } from "@/plugin-host/bridge";
describe("toHostRecord", () => {
it("copies only the fields the SDK types", () => {
const record = toHostRecord({
id: 7,
name: "web",
ip: "10.0.0.7",
port: 22,
username: "root",
parentHostId: 3,
jumpHosts: [{ hostId: 2 }],
pluginSettings: { docker: { enableDocker: true } },
authOverrides: { ssh: { required: true, ownerAuthShared: false } },
password: "secret",
terminalConfig: { fontSize: 14 },
enableDocker: true,
} as never);
expect(record).toMatchObject({
id: "7",
name: "web",
parentHostId: "3",
jumpHosts: [{ hostId: 2 }],
pluginSettings: { docker: { enableDocker: true } },
authOverrides: { ssh: { required: true, ownerAuthShared: false } },
});
const loose = record as unknown as Record<string, unknown>;
expect(loose).not.toHaveProperty("password");
expect(loose).not.toHaveProperty("terminalConfig");
expect(loose).not.toHaveProperty("enableDocker");
});
});