feat: finish the homepage plugin, move service links and canvas out of core (B19)

This commit is contained in:
LukeGus committed 2026-09-24 15:07:25 -05:00
1 parent 21937a6b02
commit d4ec444558
256 files changed
+27365 -9077

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import type { PluginContext } from "@termix/plugin-sdk/backend";
import type { HomepageRepository } from "./repository.js";
/** The "homepage.items" service, version 1. Runs as the caller's user. */
export interface HomepageItemsV1 {
list: () => Promise<
Array<{ id: number; typeId: string; title: string | null }>
>;
}
export function createHomepageItemsService(
ctx: PluginContext,
repo: HomepageRepository,
): HomepageItemsV1 {
return {
list: async () => {
const userId = ctx.currentActor();
if (!userId) return [];
const rows = await repo.listItemsByUser(userId);
return rows.map((row) => ({
id: row.id,
typeId: row.typeId,
title: row.title,
}));
},
};
}