"use strict"; /** * Licensed Materials - Property of IBM * IBM Cognos Products: Cognos Analytics * Copyright IBM Corp. 2018 * US Government Users Restricted Rights - Use, duplication or disclosure * restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', 'bi/commons/ui/core/Class', 'bi/admin/common/utils/AJAXUtils'], function (_, Class, AJAXUtils) { var RoutingRulesService = Class.extend({ init: function init(options) { RoutingRulesService.inherited('init', this, arguments); _.extend(this, options); }, getRouting: function getRouting(routingType) { var ajaxURL = AJAXUtils.getPath(routingType); var options = { method: 'GET', url: ajaxURL }; return this.glassContext.getCoreSvc('.Ajax').ajax(options).then(function (response) { return response; }.bind(this)); }, getAdminFolder: function getAdminFolder() { var ajaxURL = encodeURI('v1/search/cm?filter=type|directory&hide_internal=none'); var options = { method: 'GET', url: ajaxURL }; return this.glassContext.getCoreSvc('.Ajax').ajax(options); } }); return RoutingRulesService; });