import{logger as r}from"../../../../tools/notifiers/logger.js";import{entityRelationDatabaseSchema as o}from"../../schemas/database-schemas.js";import{validateWithResult as i}from"../../utils/ajv-validator.js";function l(a){const e=i(o,a);if(!e.success)return r.warn(`Invalid database catalog entity relation, error: ${e.error}`),null;const t=e.data||{};return{id:t.id,organizationId:t.organization_id,projectId:t.project_id,sourceKey:t.source_key,targetKey:t.target_key,sourceId:t.source_id??"",targetId:t.target_id??"",type:t.source_to_target_relation,createdAt:t.created_at??null,updatedAt:t.updated_at??null,object:"catalogEntityRelation"}}export{l as createEntityRelation};
