reveal-sdk-node
Version:
RevealBI Node.js SDK
87 lines (86 loc) • 3.22 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVMongoDBDataSource = void 0;
const RVDashboardDataSource_1 = require("../AbstractClasses/RVDashboardDataSource");
/** MongoDB data source */
class RVMongoDBDataSource extends RVDashboardDataSource_1.RVDashboardDataSource {
/** @hidden */
constructor(json) {
super(json);
this._connectionString = null;
this._database = null;
this._processDataOnServerDefaultValue = false;
this._processDataOnServerReadOnly = false;
if (json) {
var props = json.Properties;
this._connectionString = props['ConnectionString'];
this._database = props['Database'];
this._processDataOnServerDefaultValue = props["ServerAggregationDefault"];
this._processDataOnServerReadOnly = props["ServerAggregationReadOnly"];
}
else {
this.processDataOnServerDefaultValue = true;
}
}
/** @hidden */
toJson() {
var json = super.toJson();
var props = json.Properties;
props['ConnectionString'] = this._connectionString;
props['Database'] = this._database;
props["ServerAggregationDefault"] = this._processDataOnServerDefaultValue;
props["ServerAggregationReadOnly"] = this._processDataOnServerReadOnly;
return json;
}
/** @hidden */
getProviderKey() {
return 'MONGODB';
}
/** Connection string for connecting to the MongoDB host. */
get connectionString() {
return this._connectionString;
}
set connectionString(value) {
this._connectionString = value;
}
/** Database used in the MongoDB server */
get database() {
return this._database;
}
set database(value) {
this._database = value;
}
/** Sets the default value for "Process Data on Server" option for this data source, the
* end user can still change the value, unless {@link processDataOnServerReadOnly} is true.
*/
get processDataOnServerDefaultValue() {
return this._processDataOnServerDefaultValue;
}
set processDataOnServerDefaultValue(value) {
this._processDataOnServerDefaultValue = value;
}
/**
* When set to true the user will not be allowed to change the value for "Process Data on Server" option
* and the default value will be used.
*/
get processDataOnServerReadOnly() {
return this._processDataOnServerReadOnly;
}
set processDataOnServerReadOnly(value) {
this._processDataOnServerReadOnly = value;
}
/** @hidden */
getType() {
return "RVMongoDBDataSource";
}
/** @hidden */
_getWrapper() {
var wrapper = super._getWrapper();
wrapper.connectionString(this.connectionString);
wrapper.database(this.database);
wrapper.processDataOnServerDefaultValue(this.processDataOnServerDefaultValue);
wrapper.processDataOnServerReadOnly(this.processDataOnServerReadOnly);
return wrapper;
}
}
exports.RVMongoDBDataSource = RVMongoDBDataSource;