mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
feat: move snippets backend and tables into a plugin (B2)
This commit is contained in:
1 parent
fdedca39fd
commit
e07221eaf3
51 files changed
+28426
-3553
No files matched your search
@@ -288,7 +288,12 @@ export function createPluginContext(
|
||||
// write through them. The capability and the audit line are the record
|
||||
// that it did. See the header of this file.
|
||||
const schema = await import("../database/db/schema.js");
|
||||
return { users: schema.users, hosts: schema.hosts };
|
||||
return {
|
||||
users: schema.users,
|
||||
hosts: schema.hosts,
|
||||
roles: schema.roles,
|
||||
userRoles: schema.userRoles,
|
||||
};
|
||||
},
|
||||
{ action: "db_refs" },
|
||||
);
|
||||
@@ -353,6 +358,16 @@ export function createPluginContext(
|
||||
const dispose = syncRegistry.registerEntity(pluginId, entity);
|
||||
handle.bag.add(dispose, `sync entity ${entity.type}`);
|
||||
},
|
||||
recordTombstone: async (userId, entityType, syncId) => {
|
||||
if (!syncId) return;
|
||||
const { createCurrentSyncTombstoneRepository } =
|
||||
await import("../database/repositories/factory.js");
|
||||
await createCurrentSyncTombstoneRepository().record(
|
||||
userId,
|
||||
entityType,
|
||||
syncId,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
kv: {
|
||||
|
||||
Reference in new issue
Block a user