'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 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, 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /** * @class DataSourceAPI * @hideconstructor * * @classdesc implementation of the DataSourceAPI interface. */ define([], function () { var DataSourceAPI = function () { function DataSourceAPI() { _classCallCheck(this, DataSourceAPI); } /** * @function DataSourceAPI#destroy * @description Used to destroy the SourceModelAPI object */ DataSourceAPI.prototype.destroy = function destroy() {}; /** * @function DataSourceAPI#getId * @description Get the ID used to reference this data source internally. * @public * * @return {String} The ID to use internally to reference this data source */ DataSourceAPI.prototype.getId = function getId() {}; /** * @function DataSourceAPI#getAssetId * @description Get the asset ID (Content Store ID) for the data source. * @public * * @return {String} Content store ID of the data source */ DataSourceAPI.prototype.getAssetId = function getAssetId() {}; /** * @function DataSourceAPI#getType * @description Get the type of the data source. * @public * * @return {String} The type of the data source (uploadedFile, dataSet2, package, ...) */ DataSourceAPI.prototype.getType = function getType() {}; /** * @public * @function DataSourceAPI.getProtocol * @description Get the the protocol of the datasource which determines the platform of the data source and query engine * @return {String} The protocol of the datasource */ DataSourceAPI.prototype.getProtocol = function getProtocol() {}; /** * @function DataSourceAPI#getLocalizedName * @description Get the localized name of the data source. * @public * * @return {String} the localized name of the data source * @deprecated Should use the synchronous call {@link DataSourceAPI#getName} */ DataSourceAPI.prototype.getLocalizedName = function getLocalizedName() {}; /** * @function DataSourceAPI#getSearchPath * @description Get the search path of the data source. * @public * * @return {String} the search path of the data source */ DataSourceAPI.prototype.getSearchPath = function getSearchPath() {}; /** * @function DataSourceAPI#getName * @description Get the localized name of the data source. * @public * * @return {String} the localized name of the data source * @todo Needs to be implemented synchronously */ DataSourceAPI.prototype.getName = function getName() {}; /** * @function DataSourceAPI#getState * @description Get the state of the data source. * @public * * @return {String} 'ready', 'error' otherwise 'loaded' */ DataSourceAPI.prototype.getState = function getState() {}; /** * @function DataSourceAPI#loadMetadata * @description Makes the necessary server calls to make metadata available on the client * @return {Promise} Promise that will resolve once the data source has been loaded */ DataSourceAPI.prototype.loadMetadata = function loadMetadata() {}; /** * @function DataSourceAPI#getMetadataColumn * @description Returns a {@link MetadataColumnAPI} object. Note, you must call {@link DataSourceAPI#loadMetadata} before making this call. * @public * * @param {String} columnId The columnId to get the metadata column * * @return {MetadataColumnAPI} Returns a MetadataColumnAPI object. Throws an exception if called before {@link DataSourceAPI#loadMetadata} is called */ DataSourceAPI.prototype.getMetadataColumn = function getMetadataColumn() {}; /** * @function DataSourceAPI#relink * @description relink to new datasource. * @public * @async * * @param {DataSourceInfo} newSourceInfo Information (assetId, name, type, searchPath, ..) of the new source * * @return {Promise} Promise that resolved once the dataSource has been relinked and the dashboard has been reloaded. */ DataSourceAPI.prototype.relink = function relink() {}; /** * @function DataSourceAPI#registerUsage * @description Widgets should call this method registering themselves to the dataSource. This is to enforce. * that a dataSource that's still in use cannot be deleted. * @public * * @param {String} widgetId The id of the widget which will be using this module. Used to keep track of usage. */ DataSourceAPI.prototype.registerUsage = function registerUsage() {}; /** * @function DataSourceAPI#deregisterUsage * @description Should be called when a widget is deleted or no longer references a dataSource. * @public * * @param {String} widgetId The id of the widget which will be using this module. Used to keep track of usage. */ DataSourceAPI.prototype.deregisterUsage = function deregisterUsage() {}; /** * @function DataSourceAPI#isDataSourceUsed * @description Check to see if the dataSource is referenced by a widget in the dashboard. * @public * * @return {Boolean} true if the dataSource is being used by a widget otherwise false */ DataSourceAPI.prototype.isDataSourceUsed = function isDataSourceUsed() {}; /** * @function DataSourceAPI#isDataSourceUsedByWidget * @description Check to see if the dataSource is being referenced by a given widget. * @public * * @param {String} widgetId The id of the widget we want to check * * @return {Boolean} True if the dataSource used by widget otherwise false */ DataSourceAPI.prototype.isUsedBy = function isUsedBy() {}; /** * @function DataSourceAPI#isOlapPackage * @description Check to see if the current data source references an OLAP package * @return {Boolen} True if the data source references an OLAP package */ DataSourceAPI.prototype.isOlapPackage = function isOlapPackage() {}; /** * @function DataSourceAPI#getModule * @description Get the data source module * @return {Object} Data module */ DataSourceAPI.prototype.getModule = function getModule() {}; /** * @function DataSourceAPI#getModificationTime * @description Get the data source modification time * @return {Promise} Promise which resolves a string whose value is the last modification time of the datasource */ DataSourceAPI.prototype.getModificationTime = function getModificationTime() {}; /** * @function DataSourceAPI#hasJoinedTables * @description verifies if the given table names have a joined relationship within the data source * @public * * @param {string} tableName1 * @param {String} tableName2 * * @return {Boolean} True if the table names have a joined relationship */ DataSourceAPI.prototype.hasJoinedTables = function hasJoinedTables() /* tableName1, tableName2 */{}; /** * @function DataSourceAPI#getMetadataColumnList * @description Returns all the metadataColumns from a dataSource that have the type specified by the selector * @public * @deprecated Please use findMetadataColumns * @param {string} [selector] type of the metadataColumn. e.g. 'fact', 'attribute', or all columns if undefined. * * @return {Array} List of metadataColumn objects */ DataSourceAPI.prototype.getMetadataColumnList = function getMetadataColumnList() /* selector */{}; /** * @function DataSourceAPI#findMetadataColumns * @description Returns all the metadataColumns from a dataSource that have the name and type specified by the selector * @public * * @param {string} searchTerm - the search term that name of metadata column contains * @param {string} type - type of the metadataColumn to search. e.g. 'fact', 'attribute', or all columns if undefined. * * @return {Array} List of metadataColumn objects */ DataSourceAPI.prototype.findMetadataColumns = function findMetadataColumns() /* searchTerm , type */{}; _createClass(DataSourceAPI, null, [{ key: 'STATE', get: function get() { return { LOADING: 'loading', READY: 'ready', ERROR: 'error' }; } }]); return DataSourceAPI; }(); return DataSourceAPI; }); //# sourceMappingURL=DataSourceAPI.js.map