{ "version": 3, "sources": ["src/app/_services/server.service.ts"], "sourcesContent": ["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { environment } from 'src/environments/environment';\nimport {ServerInfoSlim} from '../admin/_models/server-info';\nimport { UpdateVersionEvent } from '../_models/events/update-version-event';\nimport { Job } from '../_models/job/job';\nimport { KavitaMediaError } from '../admin/_models/media-error';\nimport {TextResonse} from \"../_types/text-response\";\nimport {map} from \"rxjs/operators\";\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ServerService {\n\n baseUrl = environment.apiUrl;\n\n constructor(private http: HttpClient) { }\n\n getVersion(apiKey: string) {\n return this.http.get(this.baseUrl + 'plugin/version?apiKey=' + apiKey, TextResonse);\n }\n\n getServerInfo() {\n return this.http.get(this.baseUrl + 'server/server-info-slim');\n }\n\n clearCache() {\n return this.http.post(this.baseUrl + 'server/clear-cache', {});\n }\n\n cleanupWantToRead() {\n return this.http.post(this.baseUrl + 'server/cleanup-want-to-read', {});\n }\n\n backupDatabase() {\n return this.http.post(this.baseUrl + 'server/backup-db', {});\n }\n\n analyzeFiles() {\n return this.http.post(this.baseUrl + 'server/analyze-files', {});\n }\n\n syncThemes() {\n return this.http.post(this.baseUrl + 'server/sync-themes', {});\n }\n\n checkForUpdate() {\n return this.http.get(this.baseUrl + 'server/check-update');\n }\n\n checkHowOutOfDate() {\n return this.http.get(this.baseUrl + 'server/checkHowOutOfDate', TextResonse)\n .pipe(map(r => parseInt(r, 10)));\n }\n\n checkForUpdates() {\n return this.http.get(this.baseUrl + 'server/check-for-updates', {});\n }\n\n getChangelog() {\n return this.http.get(this.baseUrl + 'server/changelog', {});\n }\n\n getRecurringJobs() {\n return this.http.get(this.baseUrl + 'server/jobs');\n }\n\n convertMedia() {\n return this.http.post(this.baseUrl + 'server/convert-media', {});\n }\n\n bustCache() {\n return this.http.post(this.baseUrl + 'server/bust-kavitaplus-cache', {});\n }\n\n getMediaErrors() {\n return this.http.get>(this.baseUrl + 'server/media-errors', {});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,CACd,OAAO,KAAKvB,KAAKM,IAAW,KAAKL,QAAU,aAAa,CAC1D,CAEAuB,cAAY,CACV,OAAO,KAAKxB,KAAKU,KAAK,KAAKT,QAAU,uBAAwB,CAAA,CAAE,CACjE,CAEAwB,WAAS,CACP,OAAO,KAAKzB,KAAKU,KAAK,KAAKT,QAAU,+BAAgC,CAAA,CAAE,CACzE,CAEAyB,gBAAc,CACZ,OAAO,KAAK1B,KAAKM,IAA6B,KAAKL,QAAU,sBAAuB,CAAA,CAAE,CACxF,CAEA0B,kBAAgB,CACd,OAAO,KAAK3B,KAAKU,KAAK,KAAKT,QAAU,4BAA6B,CAAA,CAAE,CACtE,yCArEWH,GAAa8B,EAAAC,CAAA,CAAA,CAAA,wBAAb/B,EAAagC,QAAbhC,EAAaiC,UAAAC,WAFZ,MAAM,CAAA,EAEd,IAAOlC,EAAPmC,SAAOnC,CAAa,GAAA", "names": ["ServerService", "constructor", "http", "baseUrl", "environment", "apiUrl", "getVersion", "apiKey", "get", "TextResonse", "getServerInfo", "clearCache", "post", "cleanupWantToRead", "backupDatabase", "analyzeFiles", "syncThemes", "checkForUpdate", "checkHowOutOfDate", "pipe", "map", "r", "parseInt", "checkForUpdates", "getChangelog", "getRecurringJobs", "convertMedia", "bustCache", "getMediaErrors", "clearMediaAlerts", "\u0275\u0275inject", "HttpClient", "factory", "\u0275fac", "providedIn", "_ServerService"] }