{ "version": 3, "sources": ["../ui/app/mn.settings.alerts.service.js"], "sourcesContent": ["/*\nCopyright 2021-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {switchMap, shareReplay} from 'rxjs/operators';\nimport {BehaviorSubject} from 'rxjs';\n\nimport {MnHttpRequest} from './mn.http.request.js';\nimport {singletonGuard} from './mn.core.js';\n\nexport {MnSettingsAlertsService}\n\nclass MnSettingsAlertsService {\n static get annotations() { return [\n new Injectable()\n ]}\n\n static get parameters() { return [\n HttpClient\n ]}\n\n constructor(http) {\n singletonGuard(MnSettingsAlertsService);\n\n this.http = http;\n this.stream = {};\n\n this.stream.getAlerts =\n (new BehaviorSubject()).pipe(\n switchMap(this.getAlerts.bind(this)),\n shareReplay({refCount: true, bufferSize: 1}));\n\n this.stream.saveAlerts =\n new MnHttpRequest(this.saveAlerts.bind(this))\n .addSuccess()\n .addError();\n\n this.stream.testMail =\n new MnHttpRequest(this.testMail.bind(this))\n .addSuccess()\n .addError();\n\n }\n\n getAlerts() {\n return this.http.get('/settings/alerts');\n }\n\n saveAlerts(params) {\n return this.http.post('/settings/alerts', params);\n }\n\n testMail(params) {\n return this.http.post('/settings/alerts/testEmail', params);\n }\n\n}\n"], "mappings": "qQAoBA,iCAA8B,WACjB,cAAc,CAAE,MAAO,CAChC,GAAI,uBAGK,aAAa,CAAE,MAAO,CAC/B,YAGF,YAAY,KAAM,CAChB,eAAe,yBAEf,KAAK,KAAO,KACZ,KAAK,OAAS,GAEd,KAAK,OAAO,UACT,GAAI,mBAAmB,KACtB,UAAU,KAAK,UAAU,KAAK,OAC9B,YAAY,CAAC,SAAU,GAAM,WAAY,KAE7C,KAAK,OAAO,WACV,GAAI,eAAc,KAAK,WAAW,KAAK,OACtC,aACA,WAEH,KAAK,OAAO,SACV,GAAI,eAAc,KAAK,SAAS,KAAK,OACpC,aACA,WAIL,WAAY,CACV,MAAO,MAAK,KAAK,IAAI,oBAGvB,WAAW,OAAQ,CACjB,MAAO,MAAK,KAAK,KAAK,mBAAoB,QAG5C,SAAS,OAAQ,CACf,MAAO,MAAK,KAAK,KAAK,6BAA8B,UAzCxD", "names": [] }