{ "version": 3, "sources": ["src/app/_services/server.service.ts"], "sourcesContent": ["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { environment } from 'src/environments/environment';\r\nimport {ServerInfoSlim} from '../admin/_models/server-info';\r\nimport { UpdateVersionEvent } from '../_models/events/update-version-event';\r\nimport { Job } from '../_models/job/job';\r\nimport { KavitaMediaError } from '../admin/_models/media-error';\r\nimport {TextResonse} from \"../_types/text-response\";\r\nimport {map} from \"rxjs/operators\";\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ServerService {\r\n\r\n baseUrl = environment.apiUrl;\r\n\r\n constructor(private http: HttpClient) { }\r\n\r\n getVersion(apiKey: string) {\r\n return this.http.get(this.baseUrl + 'plugin/version?apiKey=' + apiKey, TextResonse);\r\n }\r\n\r\n getServerInfo() {\r\n return this.http.get(this.baseUrl + 'server/server-info-slim');\r\n }\r\n\r\n clearCache() {\r\n return this.http.post(this.baseUrl + 'server/clear-cache', {});\r\n }\r\n\r\n cleanupWantToRead() {\r\n return this.http.post(this.baseUrl + 'server/cleanup-want-to-read', {});\r\n }\r\n\r\n cleanup() {\r\n return this.http.post(this.baseUrl + 'server/cleanup', {});\r\n }\r\n\r\n backupDatabase() {\r\n return this.http.post(this.baseUrl + 'server/backup-db', {});\r\n }\r\n\r\n analyzeFiles() {\r\n return this.http.post(this.baseUrl + 'server/analyze-files', {});\r\n }\r\n\r\n syncThemes() {\r\n return this.http.post(this.baseUrl + 'server/sync-themes', {});\r\n }\r\n\r\n checkForUpdate() {\r\n return this.http.get(this.baseUrl + 'server/check-update');\r\n }\r\n\r\n checkHowOutOfDate() {\r\n return this.http.get(this.baseUrl + 'server/checkHowOutOfDate', TextResonse)\r\n .pipe(map(r => parseInt(r, 10)));\r\n }\r\n\r\n checkForUpdates() {\r\n return this.http.get(this.baseUrl + 'server/check-for-updates', {});\r\n }\r\n\r\n getChangelog() {\r\n return this.http.get(this.baseUrl + 'server/changelog', {});\r\n }\r\n\r\n getRecurringJobs() {\r\n return this.http.get(this.baseUrl + 'server/jobs');\r\n }\r\n\r\n convertMedia() {\r\n return this.http.post(this.baseUrl + 'server/convert-media', {});\r\n }\r\n\r\n bustCache() {\r\n return this.http.post(this.baseUrl + 'server/bust-kavitaplus-cache', {});\r\n }\r\n\r\n getMediaErrors() {\r\n return this.http.get>(this.baseUrl + 'server/media-errors', {});\r\n }\r\n\r\n clearMediaAlerts() {\r\n return this.http.post(this.baseUrl + 'server/clear-media-alerts', {});\r\n }\r\n}\r\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"] }