UNPKG

grafo-client

Version:

Grafo Client API Library

1 lines 616 B
const format=require("string-format"),InfoTypes=require("./mapping_types");function MappingStatus(e,t,s,i,r){this.level=t,s&&Object.values(InfoTypes.MappingLevelDetail).includes(s)?(this.code=s.code,this.message=format(s.messageTemplate,e)):this.message=i,this.error=r,this.element=e}module.exports=MappingStatus,MappingStatus.prototype.toObject=function(){var e={level:this.level,iri:this.element.iri};return this.code&&(e.code=this.code),this.message&&(e.message=this.message),this.level===InfoTypes.MappingStatusLevel.SEVERE&&(e.error=this.error),e},MappingStatus.prototype.getLevel=function(){return this.level};