'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Licensed Materials - Property of IBM * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['../../lib/@waca/dashboard-common/dist/core/APIFactory', '../../dashboard/api/controllers/DashboardController', '../DashboardAPI', '../../features/dashboard/internalAPI/api/InternalAPI', '../../features/dashboard/internalAPI/api/impl/Internal', '../../features/dashboard/internalAPI/api/deprecated/InternalAPI'], function (APIFactory, Controller, DashboardAPI, InternalAPI, InternalImpl, InternalDeprecatedAPI) { var DashboardAPIImpl = function (_Controller) { _inherits(DashboardAPIImpl, _Controller); function DashboardAPIImpl(options) { _classCallCheck(this, DashboardAPIImpl); var _this = _possibleConstructorReturn(this, _Controller.call(this, options)); _this.getType = _this.getApplicationName.bind(_this); _this.getName = _this.getApplicationLabel.bind(_this); _this.getService = _this.getGlassCoreSvc.bind(_this); _this.getServiceWhenReady = _this.getGlassSvc.bind(_this); _this.getPluginExtension = _this.findGlassPlugin.bind(_this); _this.getCollectionExtension = _this.findGlassCollection.bind(_this); _this.getConfiguration = _this.getAppConfig.bind(_this); _this.openApplication = _this.openGlassApplication.bind(_this); _this.closeApplication = _this.closeGlassApplication.bind(_this); _this.internalImpl = new InternalImpl(options); return _this; } DashboardAPIImpl.prototype.destroy = function destroy() { _Controller.prototype.destroy.call(this); this.internalImpl.destroy(); }; DashboardAPIImpl.prototype.getAPI = function getAPI() { return APIFactory.createAPI(this, [DashboardAPI, InternalAPI]); }; DashboardAPIImpl.prototype.getInternalAPI = function getInternalAPI() { return APIFactory.createAPIFromSpec([{ implementation: this, interface: InternalAPI }, { implementation: this.internalImpl, interface: InternalDeprecatedAPI }]); }; DashboardAPIImpl.prototype.getCanvas = function getCanvas() { if (this.view) { return this.view.getDeprecatedCanvas(); } }; DashboardAPIImpl.prototype.getCanvasWhenReady = function getCanvasWhenReady() { return this.view.getDeprecatedCanvasWhenReady(); }; DashboardAPIImpl.prototype.getDataSourceList = function getDataSourceList() { return Promise.resolve(this.getFeature('DataSources').getDataSourceList()); }; DashboardAPIImpl.prototype.getSources = function getSources() { return this.getFeature('DataSources').getSourcesInfo(); }; DashboardAPIImpl.prototype.addSources = function addSources(sources, options) { return this.getFeature('DataSources').addDataSources(sources, options); }; DashboardAPIImpl.prototype.getActiveDataSourceId = function getActiveDataSourceId() { return this.getFeature('DataSources').getActiveDataSourceId(); }; DashboardAPIImpl.prototype.setActiveDataSourceId = function setActiveDataSourceId(activeDataSourceId) { this.getFeature('DataSources').setActiveDataSourceId(activeDataSourceId); }; return DashboardAPIImpl; }(Controller); return DashboardAPIImpl; }); //# sourceMappingURL=Dashboard.js.map