import { TYPES } from "../bll/utils/constants" ; import { Summary } from "../bll/entities/summary" ; import { XmlParser } from "../bll/utils/xmlparser" ; import { RemoteBuildServer } from "./remotebuildserver" ; import { inject , injectable } from "inversify" ; import { Utils } from "../bll/utils/utils" ; @ injectable ( ) export class SummaryDao { private remoteBuildServer : RemoteBuildServer ; private xmlParser : XmlParser ; constructor ( @ inject ( TYPES . RemoteBuildServer ) remoteBuildServer , @ inject ( TYPES . XmlParser ) xmlParser ) { this . remoteBuildServer = remoteBuildServer ; this . xmlParser = xmlParser ; } public async get ( isSilent = false ) { const gZippedSummary = await this . remoteBuildServer . getGZippedSummary ( isSilent ) ; const summeryXmlObj = Utils . gzip2Xml ( gZippedSummary ) ; return this . xmlParser . parseSummary ( summeryXmlObj ) ; } }