refactor(scum): retire projection event sources

This commit is contained in:
npc0-hue
2026-08-11 16:52:52 +08:00
parent d77068ce78
commit ab8711da5c
6 changed files with 15 additions and 6 deletions
+10 -1
View File
@@ -595,7 +595,7 @@ describe("plugin manifest validation", () => {
}
});
it("declares bounded SCUM snapshot schemas for operations projections", () => {
it("declares bounded SCUM snapshot schemas for local management reads", () => {
const manifestPath = path.join(pluginsRoot, "examples/scum-server-plugin/manifest.json");
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8")) as {
gameClientBridge: {
@@ -631,6 +631,15 @@ describe("plugin manifest validation", () => {
expect(manifest.gameClientBridge.pages.find((page) => page.pageKey === "live-map")?.snapshotTypes).toEqual(expect.arrayContaining(["players", "vehicles", "flags"]));
});
it("rejects the retired SCUM log-projection source in map event schemas", () => {
const schemaDir = path.join(pluginsRoot, "examples/scum-server-plugin/schemas/log-events");
for (const filename of ["player-position.event.schema.json", "vehicle-position.event.schema.json", "player-vehicle-enter.event.schema.json", "player-vehicle-leave.event.schema.json"]) {
const schema = JSON.parse(fs.readFileSync(path.join(schemaDir, filename), "utf8")) as { properties?: { source?: { const?: string; enum?: string[] } } };
expect(schema.properties?.source).toEqual({ const: "companion" });
expect(schema.properties?.source?.enum).toBeUndefined();
}
});
it("keeps SCUM.db query templates absent until current-service evidence exists", () => {
const pluginDir = path.join(pluginsRoot, "examples/scum-server-plugin");
const manifest = JSON.parse(fs.readFileSync(path.join(pluginDir, "manifest.json"), "utf8")) as {