reveal-sdk-node
Version:
RevealBI Node.js SDK
89 lines (88 loc) • 3.35 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVElasticsearchDataSource = void 0;
const rvDataSourceExports_1 = require("../rvDataSourceExports");
/**
* Elasticsearch data source
*/
class RVElasticsearchDataSource extends rvDataSourceExports_1.RVDashboardDataSource {
/** @hidden */
constructor(json) {
super(json);
this._processDataOnServerReadOnly = false;
this._certificateFingerprint = null;
this._nodes = null;
this._fieldMultiValueLeniency = null;
this._processDataOnServerDefaultValue = false;
if (json) {
let props = json.Properties;
this._certificateFingerprint = props['CertificateFingerprint'];
this._nodes = props['Nodes'];
this._fieldMultiValueLeniency = props['FieldMultiValueLeniency'];
this._processDataOnServerDefaultValue = props["ServerAggregationDefault"];
this._processDataOnServerReadOnly = props["ServerAggregationReadOnly"];
}
else {
this.processDataOnServerDefaultValue = true;
}
}
/**
* (Optional) The hex-encoded SHA-256 fingerprint of the Elasticsearch CA certificate used to establish trust for SSL/TLS connections.
*/
get certificateFingerprint() {
return this._certificateFingerprint;
}
set certificateFingerprint(value) {
this._certificateFingerprint = value;
}
/**
* List of Elasticsearch node endpoints to connect to in the cluster.
*/
get nodes() {
return this._nodes;
}
set nodes(value) {
this._nodes = value;
}
/**
* (Optional) Controls behavior when SQL queries encounter fields with multiple values.
* If false, an error is returned for fields containing array values.
* If true, returns the first value from the array with no guarantee of consistent ordering.
* Defaults to `false`.
*/
get fieldMultiValueLeniency() {
return this._fieldMultiValueLeniency;
}
set fieldMultiValueLeniency(value) {
this._fieldMultiValueLeniency = 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;
}
/** @hidden */
toJson() {
let json = super.toJson();
let props = json.Properties;
props['CertificateFingerprint'] = this._certificateFingerprint;
props['Nodes'] = this._nodes;
props['FieldMultiValueLeniency'] = this._fieldMultiValueLeniency;
props["ServerAggregationDefault"] = this._processDataOnServerDefaultValue;
props["ServerAggregationReadOnly"] = this._processDataOnServerReadOnly;
return json;
}
/** @hidden */
getProviderKey() {
return 'ELASTICSEARCH';
}
/** @hidden */
getType() {
return "RVElasticsearchDataSource";
}
}
exports.RVElasticsearchDataSource = RVElasticsearchDataSource;