{ "version": 3, "sources": ["../ui/app/mn.keyspace.selector.module.js", "../ui/app/mn.stats.service.js", "../ui/app/mn.xdcr.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 {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {MnSharedModule} from './mn.shared.module.js';\n\nimport {MnInputFilterModule} from './mn.input.filter.module.js';\nimport {MnKeyspaceSelectorComponent} from './mn.keyspace.selector.component.js';\n\nexport {MnKeyspaceSelectorModule};\n\nclass MnKeyspaceSelectorModule {\n static get annotations() { return [\n new NgModule({\n entryComponents: [\n MnKeyspaceSelectorComponent\n ],\n declarations: [\n MnKeyspaceSelectorComponent\n ],\n exports: [\n MnKeyspaceSelectorComponent\n ],\n imports: [\n CommonModule,\n MnInputFilterModule,\n ReactiveFormsModule,\n MnSharedModule\n ],\n })\n ]}\n}\n", "/*\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 {map} from 'rxjs/operators';\n\nimport {singletonGuard} from './mn.core.js';\n\nexport {MnStatsService};\n\nclass MnStatsService {\n static get annotations() { return [\n new Injectable()\n ]}\n\n static get parameters() { return [\n HttpClient\n ]}\n\n constructor(http) {\n singletonGuard(MnStatsService);\n this.http = http;\n\n this.stream = {};\n }\n\n postStatsRange(configs) {\n return this.http.post(\"/pools/default/stats/range/\", configs)\n .pipe(map(resp => JSON.parse(resp)));\n }\n}\n", "/*\nCopyright 2020-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 {BehaviorSubject, combineLatest, timer, of, NEVER} from 'rxjs';\nimport {map, shareReplay, switchMap, throttleTime,\n pluck, distinctUntilChanged} from 'rxjs/operators';\nimport {pipe, filter, propEq, sortBy, prop, groupBy} from 'ramda';\n\nimport {MnStatsService} from \"./mn.stats.service.js\"\nimport {MnTasksService} from './mn.tasks.service.js';\nimport {MnHttpRequest} from './mn.http.request.js';\nimport {MnPermissions} from './ajs.upgraded.providers.js';\n\nimport {singletonGuard} from './mn.core.js';\n\nlet collectionDelimiter = \".\";\n\nexport {MnXDCRService, collectionDelimiter};\n\nclass MnXDCRService {\n static get annotations() { return [\n new Injectable()\n ]}\n\n static get parameters() { return [\n HttpClient,\n MnStatsService,\n MnTasksService,\n MnPermissions\n ]}\n\n constructor(http, mnStatsService, mnTasksService, mnPermissions) {\n singletonGuard(MnXDCRService);\n\n this.http = http;\n\n this.stream = {};\n\n this.stream.updateRemoteClusters =\n new BehaviorSubject();\n\n this.stream.deleteRemoteClusters =\n new MnHttpRequest(this.deleteRemoteClusters.bind(this))\n .addSuccess()\n .addError();\n\n this.stream.deleteCancelXDCR =\n new MnHttpRequest(this.deleteCancelXDCR.bind(this))\n .addSuccess()\n .addError();\n\n this.stream.getSettingsReplications = this.createGetSettingsReplicationsPipe();\n\n this.stream.postSettingsReplications =\n new MnHttpRequest(this.postSettingsReplications(false).bind(this))\n .addSuccess()\n .addError();\n\n this.stream.postPausePlayReplication =\n new MnHttpRequest(this.postSettingsReplications(false).bind(this))\n .addSuccess()\n .addError();\n\n this.stream.postSettingsReplicationsValidation =\n new MnHttpRequest(this.postSettingsReplications(true).bind(this))\n .addSuccess(map(parsePostCreateReplicationSuccess))\n .addError();\n\n function parsePostCreateReplicationSuccess(data) {\n //we should parse success response since XDCR\n //warnings returns here\n return JSON.parse(data);\n }\n\n function extractPostCreateReplicationError(error) {\n return (error && error.errors) || ({_: (error && error.error) || error});\n }\n\n this.stream.postCreateReplication =\n new MnHttpRequest(this.postCreateReplication.bind(this, false))\n .addSuccess(map(parsePostCreateReplicationSuccess))\n .addError(map(extractPostCreateReplicationError));\n\n this.stream.postCreateReplicationValidation =\n new MnHttpRequest(this.postCreateReplication.bind(this, true))\n .addSuccess(map(parsePostCreateReplicationSuccess))\n .addError(map(extractPostCreateReplicationError));\n\n this.stream.postRemoteClusters =\n new MnHttpRequest(this.postRemoteClusters.bind(this))\n .addSuccess()\n .addError();\n\n this.stream.postRegexpValidation =\n new MnHttpRequest(this.postRegexpValidation.bind(this))\n .addSuccess(map(data => JSON.parse(data)))\n .addError(map(error => ({error: error.error || error})));\n\n this.stream.postRegexpValidationExpression =\n new MnHttpRequest(this.postRegexpValidation.bind(this))\n .addSuccess(map(data => JSON.parse(data)))\n .addError(map(error => ({error: error.error || error})));\n\n let doGetRemoteClusters =\n combineLatest(timer(0, 10000),\n this.stream.updateRemoteClusters)\n .pipe(switchMap(this.getRemoteClusters.bind(this)),\n shareReplay({refCount: true, bufferSize: 1}));\n\n this.stream.getRemoteClusters = mnPermissions.stream\n .pipe(pluck(\"cluster\", \"xdcr\", \"remote_clusters\", \"read\"),\n distinctUntilChanged(),\n switchMap((canRead) => canRead ? doGetRemoteClusters : NEVER));\n\n this.stream.getRemoteClustersFiltered = this.stream.getRemoteClusters\n .pipe(map(pipe(filter(propEq('deleted', false)),\n sortBy(prop('name')))),\n shareReplay({refCount: true, bufferSize: 1}));\n\n this.stream.getRemoteClustersByUUID = this.stream.getRemoteClusters\n .pipe(map(groupBy(prop(\"uuid\"))),\n shareReplay({refCount: true, bufferSize: 1}));\n\n\n this.stream.getChangesLeftTotal = mnTasksService.stream.tasksXDCR\n .pipe(throttleTime(1000, undefined, {leading: true, trailing: true}),\n map(tasks => tasks && tasks.map(task => ({\n nodesAggregation: \"sum\",\n applyFunctions: [\"sum\"],\n start: -5,\n step: 10,\n metric: [\n {label: \"name\", value: \"xdcr_changes_left_total\"},\n {label: \"sourceBucketName\", value: task.source}\n ]\n }))),\n switchMap(configs => {\n if (configs) {\n return mnStatsService.postStatsRange(configs)\n .pipe(map(stats =>\n stats.reduce((acc, stat) =>\n acc + Number(stat.data[0] &&\n stat.data[0].values[0][1]) || 0, 0)));\n } else {\n return of(0);\n }\n }),\n shareReplay({refCount: true, bufferSize: 1}));\n\n }\n\n prepareReplicationSettigns([, isEnterprise, compatVersion55]) {\n //this points to the component view instance\n var settings = Object.assign({}, this.form.group.value, this.filterRegexpGroup.value);\n delete settings.docId;\n if (isEnterprise) {\n settings.filterSkipRestream = (settings.filterSkipRestream === \"true\");\n } else {\n delete settings.filterExpression;\n delete settings.filterSkipRestream;\n delete settings.priority;\n }\n\n if (!this.isEditMode) {\n delete settings.filterSkipRestream;\n }\n if (!isEnterprise || !compatVersion55) {\n delete settings.compressionType;\n }\n if (!isEnterprise) {\n delete settings.networkUsageLimit;\n }\n if (settings.collectionsExplicitMapping) {\n let rules = this.explicitMappingRules.getValue();\n settings.collectionsMigrationMode = false;\n if (Object.keys(rules).length) {\n settings.colMappingRules = JSON.stringify(rules);\n } else {\n settings.collectionsExplicitMapping = false;\n }\n }\n if (settings.collectionsMigrationMode) {\n let rules = this.explicitMappingMigrationRules.getValue();\n settings.collectionsExplicitMapping = false;\n if (Object.keys(rules).length) {\n settings.colMappingRules = JSON.stringify(rules);\n } else {\n settings.collectionsMigrationMode = false;\n }\n }\n settings.replicationType = \"continuous\";\n\n return settings;\n }\n\n setMappingRule(sourceFlag, source, target, rules) {\n if (sourceFlag) {\n rules[source] = target;\n } else {\n delete rules[source];\n }\n }\n\n createGetSettingsReplicationsPipe(id) {\n return (new BehaviorSubject(id)).pipe(\n switchMap(this.getSettingsReplications.bind(this)),\n shareReplay({refCount: true, bufferSize: 1}));\n }\n\n postRegexpValidation(params) {\n return this.http.post(\"/_goxdcr/regexpValidation\", params);\n }\n\n deleteRemoteClusters(name) {\n return this.http.delete('/pools/default/remoteClusters/' + encodeURIComponent(name));\n }\n\n deleteCancelXDCR(id) {\n return this.http.delete('/controller/cancelXDCR/' + encodeURIComponent(id));\n }\n\n getSettingsReplications(id) {\n return this.http.get(\"/settings/replications\" +\n (id ? (\"/\" + encodeURIComponent(id)) : \"\"));\n }\n\n postSettingsReplications(validate) {\n return source =>\n this.http.post(\"/settings/replications\" +\n (source[0] ? (\"/\" + encodeURIComponent(source[0])) : \"\"),\n source[0] ? source[1] : source,\n {params: {\"just_validate\": validate ? 1 : 0}});\n }\n\n postCreateReplication(validate, data) {\n return this.http.post(\"/controller/createReplication\", data, {\n params: {\"just_validate\": validate ? 1 : 0}\n });\n }\n\n getRemoteClusters() {\n return this.http.get(\"/pools/default/remoteClusters\");\n }\n\n postRemoteClusters(source) {\n var cluster = Object.assign({}, source[0]);\n var name = source[1];\n var requestBody = {};\n var requestBodyFields = [\"name\", \"hostname\", \"username\", \"password\"];\n\n if (cluster.hostname &&\n !(/^\\[?([^\\]]+)\\]?:(\\d+)$/).exec(cluster.hostname)) {\n // ipv4/ipv6/hostname + port\n cluster.hostname += \":8091\";\n }\n\n if (cluster.demandEncryption) {\n requestBodyFields.push(\"demandEncryption\");\n requestBodyFields.push(\"certificate\");\n requestBodyFields.push(\"encryptionType\");\n if (cluster.encryptionType === \"full\") {\n requestBodyFields.push(\"clientCertificate\");\n requestBodyFields.push(\"clientKey\");\n }\n }\n requestBodyFields.forEach(field =>\n requestBody[field] = cluster[field]);\n return this.http.post('/pools/default/remoteClusters' +\n (name ? (\"/\" + encodeURIComponent(name)) : \"\"), requestBody);\n }\n}\n"], "mappings": "isBAoBA,kCAA+B,WAClB,cAAc,CAAE,MAAO,CAChC,GAAI,UAAS,CACX,gBAAiB,CACf,6BAEF,aAAc,CACZ,6BAEF,QAA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