import{logger as o}from"../../../../tools/notifiers/logger.js";import{telemetryTraceStep as i}from"../../../../telemetry/helpers/trace-step.js";import{BaseRepository as a}from"../../../../providers/database/base-repository.js";import{createDatabaseRepositoryInstance as n}from"../../../../providers/database/instance-cache-resolver.js";import{RelationsReadRepository as c}from"./relations/relations-read-repository.js";import{RevisionRepository as p}from"./common/revision-repository.js";import{BffEntitiesReadRepository as l}from"./bffEntities/bff-entities-read-repository.js";import{EntitiesReadRepository as m}from"./entities/entities-read-repository.js";import{EntitiesWriteRepository as y}from"./entities/entities-write-repository.js";import{RelationsWriteRepository as R}from"./relations/relations-write-repository.js";import{FiltersRepository as f}from"./common/filters-repository.js";class r extends a{entitiesRead;entitiesWrite;relationsRead;relationsWrite;bffEntitiesRead;filters;revisions;get transactionsManager(){return this.databaseClient.transactionsManager}constructor(t){super(t),this.revisions=new p(t.client),this.bffEntitiesRead=new l(t.client),this.relationsRead=new c(t.client),this.entitiesRead=new m(t.client),this.entitiesWrite=new y(t.client,this.organizationId,this.projectId),this.relationsWrite=new R(t.client,this.organizationId,this.projectId),this.filters=new f(t.client)}async sync(){return i("catalog_entities.repository.sync",async()=>{await this.databaseClient.sync()})}static async create(t){return await i("catalog_entities.repository.get_instance",async s=>{try{return await n(t,"catalog entities",r)}catch(e){throw o.error("Error creating db connection for catalog entities repository",e),s?.error(e),e}})}}export{r as CatalogEntitiesRepository};
