feat: synced blocks (transclusion) (#2163)

* feat: synced blocks (transclusion)

* fix:remove name

* make placeholders smaller

* feat: enforce strict transclusion schema

* fix: scope synced blocks to workspace, gate unsync on edit permission

* fix collab module error
This commit is contained in:
Philip Okugbe
2026-05-08 13:23:16 +01:00
committed by GitHub
parent c9fa6e20b3
commit de60aa7e61
64 changed files with 4388 additions and 105 deletions
@@ -100,6 +100,30 @@ export class PageRepo {
return query.executeTakeFirst();
}
async findManyByIds(
pageIds: string[],
opts?: {
trx?: KyselyTransaction;
workspaceId?: string;
},
): Promise<Page[]> {
if (pageIds.length === 0) return [];
const db = dbOrTx(this.db, opts?.trx);
let query = db
.selectFrom('pages')
.select(this.baseFields)
.where('id', 'in', pageIds);
if (opts?.workspaceId) {
query = query
.where('workspaceId', '=', opts.workspaceId)
.where('deletedAt', 'is', null);
}
return query.execute();
}
async updatePage(
updatablePage: UpdatablePage,
pageId: string,