ProjectOS / packages /knowledge-fabric /src /SnapshotService.ts
AnthropicallyHuggingFaces's picture
Sync full ProjectOS monorepo from GitHub 7f633f5
a8f4b72 verified
Raw History Blame Contribute Delete
608 Bytes
import { SnapshotRepository } from '@projectos/storage-fabric/sqlite/repositories';
import type { DatabaseSync } from 'node:sqlite';
export class SnapshotService {
readonly repository: SnapshotRepository;
constructor(db: DatabaseSync, repository = new SnapshotRepository(db)) { this.repository = repository; }
capture(projectId: string, options: Parameters<SnapshotRepository['create']>[1] = {}) { return this.repository.create(projectId, options); }
get(snapshotId: string) { return this.repository.get(snapshotId); }
restore(snapshotId: string) { return this.repository.restore(snapshotId); }
}