import { Injectable } from "@angular/core"; import { BaseService } from "@common/base/base.service"; import { Observable, throwError } from "rxjs"; import { catchError } from "rxjs/operators"; import { ConfigurationService } from "../configuration/configuration.service"; import { BaseHttpV2Service } from "../http/base-http-v2.service"; @Injectable() export class MaintenanceService extends BaseService { constructor( private http: BaseHttpV2Service, private installationConfiguration: ConfigurationService, ) { super(); } private get apiBase(): string { return `${this.installationConfiguration.server}maintenance`; } generateElasticIndex(): Observable { const url = `${this.apiBase}/index/elastic`; return this.http .post(url, null).pipe( catchError((error: any) => throwError(error))); } clearElasticIndex(): Observable { const url = `${this.apiBase}/index/elastic`; return this.http .delete(url).pipe( catchError((error: any) => throwError(error))); } sendUserTouchEvents(): Observable { const url = `${this.apiBase}/events/users/touch`; return this.http .delete(url).pipe( catchError((error: any) => throwError(error))); } sendTenantTouchEvents(): Observable { const url = `${this.apiBase}/events/tenant/touch`; return this.http .delete(url).pipe( catchError((error: any) => throwError(error))); } }