SegmentFeature.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2019
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['./api/SegmentAPI', './api/impl/Segment', '../../../lib/@waca/dashboard-common/dist/core/APIFactory'], function (SegmentAPI, Segment, APIFactory) {
  9. var SegmentFeature = function () {
  10. function SegmentFeature(options) {
  11. _classCallCheck(this, SegmentFeature);
  12. this._options = options;
  13. }
  14. SegmentFeature.prototype.initialize = function initialize() {
  15. this._options.instrumentationSvc = this._options.dashboardApi.getGlassCoreSvc('.Instrumentation');
  16. this._options.logger = this._options.dashboardApi.getGlassCoreSvc('.Logger');
  17. if (this._options.instrumentationSvc.enabled) {
  18. this._api = APIFactory.createAPI(new Segment(this._options), [SegmentAPI]);
  19. } else {
  20. this._api = new SegmentAPI();
  21. }
  22. return Promise.resolve();
  23. };
  24. SegmentFeature.prototype.getAPI = function getAPI() {
  25. return this._api;
  26. };
  27. return SegmentFeature;
  28. }();
  29. return SegmentFeature;
  30. });
  31. //# sourceMappingURL=SegmentFeature.js.map