"use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2018, 2019 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /** * @class DataSourcesAPI * @hideconstructor * * @classdesc implementation of the DataSourcesAPI interface. */ define([], function () { var DataSourcesAPI = function () { function DataSourcesAPI() { _classCallCheck(this, DataSourcesAPI); } /** * @function DataSourcesAPI#destroy * @description Used to destroy the DataSourcesAPI object */ DataSourcesAPI.prototype.destroy = function destroy() {}; /** * @function DataSourcesAPI#addDataSource * @description Add a source that can used as data sources in the dashboard * @public * * @param {DataSourceInfo} sourceInfo Describes the data source being added. * @param {Boolean} [allowDuplicateAssetIds=false] option to enable adding multiple data sources with the same asset Id. * @param {SetOptions} options * @return {string} The id of the source that was added */ DataSourcesAPI.prototype.addDataSource = function addDataSource() {}; /** * @function DataSourcesAPI#removeDataSource * @description Remove a source from the dashboard. * @public * * @param {String} sourceId The internal ID of the source to remove */ DataSourcesAPI.prototype.removeDataSource = function removeDataSource() {}; /** * @function DataSourcesAPI#getDataSource * @description Get a data source. * @public * * @param {String} sourceId unique data source identifier * @return {DataSourceAPI} Returns a {@link DataSourceAPI} object or null if the sourceId doesn't match any sources currently ready to use */ DataSourcesAPI.prototype.getDataSource = function getDataSource() {}; /** * @function DataSourcesAPI#getDataSourceList * @description Get all the data sources that are being used by the dashboard. * @public * @async * * @return {DataSourceAPI[]} Returns an array of {@link DataSourceAPI} objects. */ DataSourcesAPI.prototype.getDataSourceList = function getDataSourceList() {}; /** * @function DataSourcesAPI#setActiveDataSourceId * @description Flags a data source as 'active'. This is used for when we invoke the conversation panel so that smarts knows which data source takes priority * @param {String} sourceId unique data source identifier */ DataSourcesAPI.prototype.setActiveDataSourceId = function setActiveDataSourceId() {}; /** * @function DataSourcesAPI#getActiveDataSourceId * @description Get the id of the active data source * @return {String} The id of the active data source or null if no data source is currently marked as active */ DataSourcesAPI.prototype.getActiveDataSourceId = function getActiveDataSourceId() {}; /** * @function DataSourcesAPI#getSourcesInfo * @description Gets the data sources that are in use in the dashboard.
* Returns a promise that resolves to an array of datasource info: * [{ name: , * assetId: , * type: }], * active: }], * @deprecated Use {@link DataSourcesAPI#getDataSourceList} to get the array of data sources and then APIs on those data sources to get the needed info */ DataSourcesAPI.prototype.getSourcesInfo = function getSourcesInfo() {}; /** * @function DataSourcesAPI#addSources * @description Add sources that can used as data sources in the dashboard.
* Once the source is successfully added, it will appear on the datasource list pane with the given name. * @param {String} sourceInfo.id Identifier for the source. Will be passed back for actions such as relink * @param {String} sourceInfo.name Name of the source * @param {String} sourceInfo.module The module definition * @example * DashboardApi.addDataSources([{ * id: 'myUniqueId', * name: 'Sample datasource', * module: {...} * }, { * id: 'myUniqueId2', * name: 'Sample datasource 2', * module: {...} * }]); * @deprecated Use {@link DataSourcesAPI#addDataSource} */ DataSourcesAPI.prototype.addDataSources = function addDataSources() {}; return DataSourcesAPI; }(); return DataSourcesAPI; }); //# sourceMappingURL=DataSourcesAPI.js.map