diff --git a/plugins/examples/scum-server-plugin/manifest.json b/plugins/examples/scum-server-plugin/manifest.json index 58977b5..23c85a4 100644 --- a/plugins/examples/scum-server-plugin/manifest.json +++ b/plugins/examples/scum-server-plugin/manifest.json @@ -1086,6 +1086,21 @@ "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": [ { "key": "server-files", diff --git a/plugins/tests/manifest-validation.test.ts b/plugins/tests/manifest-validation.test.ts index 4be6f77..442c8d9 100644 --- a/plugins/tests/manifest-validation.test.ts +++ b/plugins/tests/manifest-validation.test.ts @@ -429,8 +429,11 @@ describe("plugin manifest validation", () => { pages: Array<{ pageKey: string; commandTypes?: string[]; queryTemplateKeys?: 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 expectedColumnsByKey: Record = { "scum.player.profile": ["userProfileId", "steamId", "gamePlayerId", "displayName", "lastLoginIp", "registeredAt", "squadId", "squadName", "famePoints", "moneyBalance", "normalBalance", "goldBalance", "x", "y", "z", "lastLoginTime", "lastLogoutTime", "lastSaveTime"], @@ -456,7 +459,19 @@ describe("plugin manifest validation", () => { const sqliteTransport = manifest.runtimeProfiles?.transportProfiles?.find((profile) => profile.key === "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(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) { const template = templatesByKey.get(key)!; expect(template.engine).toBe("sqlite");