import { Injectable , Inject } from '@angular/core' ; import { WsHttpService } from "./ws-http.service" ; import { QueryHelperService } from "./query-helper.service" ; import { APP_CONFIG } from "../../app.config" ; import { Observable } from "rxjs" ; import { DomainName } from "./models/domain-name.class" ; import { PresentationResponse } from "./models/responses/presentation-response.interface" ; import { WsPresentationService } from "./ws-presentation.service" ; @ Injectable ( ) export class WsDomainNameService { private _baseUrl : string ; constructor ( private wsHttp , private queryService , private presentationService , @ Inject ( APP_CONFIG ) private config ) { this . _baseUrl = config . apiUrl + 'domain-names/' ; } public deleteDomainName ( uuid ) { return this . wsHttp . delete ( this . baseUrl + uuid + '/' ) . map ( response => response . json ( ) ) ; } public getPresentation ( ) { return this . presentationService . getPresentationByUrl ( 'domainName' , this . baseUrl ) ; } public setDomainNameInclusion ( uuid , included ) { let toSend = { scanning_enabled : included } ; return this . wsHttp . patch ( this . baseUrl + uuid + '/' , toSend ) . map ( response => response . json ( ) as DomainName ) ; } public get baseUrl ( ) : string { return this . _baseUrl ; } }