@shirokuma-library/mcp-knowledge-base
Version:
MCP server for AI-powered knowledge management with semantic search, graph analysis, and automatic enrichment
23 lines (22 loc) • 686 B
JavaScript
import { SystemState } from '../entities/SystemState.js';
import { AppDataSource } from '../data-source.js';
export class SystemStateRepository {
repository;
constructor() {
this.repository = AppDataSource.getRepository(SystemState);
}
async getCurrent() {
return await this.repository.findOne({
where: {},
order: { id: 'DESC' }
});
}
async create(data) {
const state = this.repository.create(data);
return await this.repository.save(state);
}
async update(id, data) {
await this.repository.update(id, data);
return await this.repository.findOne({ where: { id } });
}
}