{ "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 cleanup() {\n return this.http.post(this.baseUrl + 'server/cleanup', {});\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', {});\n }\n\n clearMediaAlerts() {\n return this.http.post(this.baseUrl + 'server/clear-media-alerts', {});\n }\n}\n"], "mappings": "8GAaA,IAAaA,GAAa,IAAA,CAApB,MAAOA,CAAa,CAIxBC,YAAoBC,EAAgB,CAAhB,KAAAA,KAAAA,EAFpB,KAAAC,QAAUC,EAAYC,MAEkB,CAExCC,WAAWC,EAAc,CACvB,OAAO,KAAKL,KAAKM,IAAY,KAAKL,QAAU,yBAA2BI,EAAQE,CAAW,CAC5F,CAEAC,eAAa,CACX,OAAO,KAAKR,KAAKM,IAAoB,KAAKL,QAAU,yBAAyB,CAC/E,CAEAQ,YAAU,CACR,OAAO,KAAKT,KAAKU,KAAK,KAAKT,QAAU,qBAAsB,CAAA,CAAE,CAC/D,CAEAU,mBAAiB,CACf,OAAO,KAAKX,KAAKU,KAAK,KAAKT,QAAU,8BAA+B,CAAA,CAAE,CACxE,CAEAW,SAAO,CACL,OAAO,KAAKZ,KAAKU,KAAK,KAAKT,QAAU,iBAAkB,CAAA,CAAE,CAC3D,CAEAY,gBAAc,CACZ,OAAO,KAAKb,KAAKU,KAAK,KAAKT,QAAU,mBAAoB,CAAA,CAAE,CAC7D,CAEAa,cAAY,CACV,OAAO,KAAKd,KAAKU,KAAK,KAAKT,QAAU,uBAAwB,CAAA,CAAE,CACjE,CAEAc,YAAU,CACR,OAAO,KAAKf,KAAKU,KAAK,KAAKT,QAAU,qBAAsB,CAAA,CAAE,CAC/D,CAEAe,gBAAc,CACZ,OAAO,KAAKhB,KAAKM,IAA+B,KAAKL,QAAU,qBAAqB,CACtF,CAEAgB,mBAAiB,CACf,OAAO,KAAKjB,KAAKM,IAAY,KAAKL,QAAU,2BAA4BM,CAAW,EAChFW,KAAKC,EAAIC,GAAKC,SAASD,EAAG,EAAE,CAAC,CAAC,CACnC,CAEAE,iBAAe,CACb,OAAO,KAAKtB,KAAKM,IAAwB,KAAKL,QAAU,2BAA4B,CAAA,CAAE,CACxF,CAEAsB,cAAY,CACV,OAAO,KAAKvB,KAAKM,IAA0B,KAAKL,QAAU,mBAAoB,CAAA,CAAE,CAClF,CAEAuB,kBAAgB,CACd,OAAO,KAAKxB,KAAKM,IAAW,KAAKL,QAAU,aAAa,CAC1D,CAEAwB,cAAY,CACV,OAAO,KAAKzB,KAAKU,KAAK,KAAKT,QAAU,uBAAwB,CAAA,CAAE,CACjE,CAEAyB,WAAS,CACP,OAAO,KAAK1B,KAAKU,KAAK,KAAKT,QAAU,+BAAgC,CAAA,CAAE,CACzE,CAEA0B,gBAAc,CACZ,OAAO,KAAK3B,KAAKM,IAA6B,KAAKL,QAAU,sBAAuB,CAAA,CAAE,CACxF,CAEA2B,kBAAgB,CACd,OAAO,KAAK5B,KAAKU,KAAK,KAAKT,QAAU,4BAA6B,CAAA,CAAE,CACtE,iDAzEWH,GAAa+B,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAAbhC,EAAaiC,QAAbjC,EAAakC,UAAAC,WAFZ,MAAM,CAAA,CAAA,SAEPnC,CAAa,GAAA", "names": ["ServerService", "constructor", "http", "baseUrl", "environment", "apiUrl", "getVersion", "apiKey", "get", "TextResonse", "getServerInfo", "clearCache", "post", "cleanupWantToRead", "cleanup", "backupDatabase", "analyzeFiles", "syncThemes", "checkForUpdate", "checkHowOutOfDate", "pipe", "map", "r", "parseInt", "checkForUpdates", "getChangelog", "getRecurringJobs", "convertMedia", "bustCache", "getMediaErrors", "clearMediaAlerts", "\u0275\u0275inject", "HttpClient", "factory", "\u0275fac", "providedIn"] }