AnnotationService.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. 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; }
  4. 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; }
  5. /**
  6. * Licensed Materials - Property of IBM
  7. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2019
  8. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. */
  10. define(['./SmartsService'], function (SmartsService) {
  11. 'use strict';
  12. var AnnotationService = function (_SmartsService) {
  13. _inherits(AnnotationService, _SmartsService);
  14. function AnnotationService() {
  15. _classCallCheck(this, AnnotationService);
  16. return _possibleConstructorReturn(this, _SmartsService.apply(this, arguments));
  17. }
  18. /**
  19. * @public api to excute query against Smart annotation service.
  20. *
  21. * @param {Object} options target and querySpec Mandatory: the query specification to be sent to annotation service
  22. * @returns a promise.
  23. */
  24. AnnotationService.prototype.runQuery = function runQuery(options /*, originalDeferred*/) {
  25. options.url = 'v1/predict/annotations/' + options.target;
  26. return this._runQuery(options);
  27. };
  28. return AnnotationService;
  29. }(SmartsService);
  30. return AnnotationService;
  31. });
  32. //# sourceMappingURL=AnnotationService.js.map