Declare SCUM database data target

This commit is contained in:
npc0-hue
2026-09-09 15:35:29 +08:00
parent 892c6d843f
commit e6e38b275a
2 changed files with 33 additions and 3 deletions
@@ -1086,6 +1086,21 @@
"retentionDays": 30 "retentionDays": 30
} }
], ],
"dataTargets": [
{
"key": "scum-database",
"kind": "sqlite.snapshot",
"transportKey": "scum-database",
"sourceRootKey": "server-root",
"sourcePath": "SCUM/Saved/SaveFiles/SCUM.db",
"workspaceKey": "databases/scum-database",
"refreshPolicy": "on-demand-snapshot",
"maxBytes": 1073741824,
"platforms": [
"windows"
]
}
],
"transportProfiles": [ "transportProfiles": [
{ {
"key": "server-files", "key": "server-files",
+17 -2
View File
@@ -429,7 +429,10 @@ describe("plugin manifest validation", () => {
pages: Array<{ pageKey: string; commandTypes?: string[]; queryTemplateKeys?: string[] }>; pages: Array<{ pageKey: string; commandTypes?: string[]; queryTemplateKeys?: string[] }>;
}; };
pages: Array<{ key: string; permissions?: string[]; bridgeActions?: string[] }>; pages: Array<{ key: string; permissions?: string[]; bridgeActions?: string[] }>;
runtimeProfiles?: { transportProfiles?: Array<{ key: string; kind: string; targetKey?: string; capabilities: string[] }>; dataTargets?: unknown[] }; runtimeProfiles?: {
transportProfiles?: Array<{ key: string; kind: string; targetKey?: string; capabilities: string[] }>;
dataTargets?: Array<{ key: string; kind: string; transportKey: string; sourceRootKey: string; sourcePath: string; workspaceKey: string; refreshPolicy: string; maxBytes: number; platforms?: string[] }>;
};
}; };
const expectedKeys = ["scum.player.profile", "scum.squads", "scum.squad-members", "scum.vehicles", "scum.flags", "scum.positions", "scum.tasks", "scum.events", "scum.native-timed-gifts"]; const expectedKeys = ["scum.player.profile", "scum.squads", "scum.squad-members", "scum.vehicles", "scum.flags", "scum.positions", "scum.tasks", "scum.events", "scum.native-timed-gifts"];
const expectedColumnsByKey: Record<string, string[]> = { const expectedColumnsByKey: Record<string, string[]> = {
@@ -456,7 +459,19 @@ describe("plugin manifest validation", () => {
const sqliteTransport = manifest.runtimeProfiles?.transportProfiles?.find((profile) => profile.key === "scum-database"); const sqliteTransport = manifest.runtimeProfiles?.transportProfiles?.find((profile) => profile.key === "scum-database");
expect(sqliteTransport).toMatchObject({ kind: "sqlite", targetKey: "scum-database" }); expect(sqliteTransport).toMatchObject({ kind: "sqlite", targetKey: "scum-database" });
expect(sqliteTransport?.capabilities).toEqual(expect.arrayContaining(["remote.run.db.sqlite.query", "remote.run.db.sqlite.execute"])); expect(sqliteTransport?.capabilities).toEqual(expect.arrayContaining(["remote.run.db.sqlite.query", "remote.run.db.sqlite.execute"]));
expect(manifest.runtimeProfiles?.dataTargets).toBeUndefined(); expect(manifest.runtimeProfiles?.dataTargets).toEqual(expect.arrayContaining([
expect.objectContaining({
key: "scum-database",
kind: "sqlite.snapshot",
transportKey: "scum-database",
sourceRootKey: "server-root",
sourcePath: "SCUM/Saved/SaveFiles/SCUM.db",
workspaceKey: "databases/scum-database",
refreshPolicy: "on-demand-snapshot",
maxBytes: 1073741824,
platforms: ["windows"]
})
]));
for (const key of expectedKeys) { for (const key of expectedKeys) {
const template = templatesByKey.get(key)!; const template = templatesByKey.get(key)!;
expect(template.engine).toBe("sqlite"); expect(template.engine).toBe("sqlite");