var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Analytics; (function (Analytics) { let Managers; (function (Managers) { class ReportManager extends Platform.Core.BaseManager { updatecolumns(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/datalistcolumnstring/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getViewableReports() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/viewablereportgroups'; var groups; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getViewableReportsByparentgroupid(parentid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/viewablereportgroupswithparent/' + parentid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportGroupById(reportgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportgroup/reportgroupid/' + reportgroupid; var groups; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportGroupByName(groupname) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportgroupname/reportgroupname/' + groupname; var groups; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } saveReportGroup(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/savereportgroup'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } exportGroupreports(reportgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportgroupreports/reportgroupid/' + reportgroupid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } deleteReportGroup(reportgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletereportgroup/reportgroupid/' + reportgroupid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getReportGroups() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/integrations/reportgroup/getreportfolders'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportsbyGroupId(groupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/integrations/reportgroup/getreportbygroupid/reportgroupid/' + groupid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } checkReportGroupDependency(groupid, parentGroupId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/checkreportgroupdependency/groupid/' + groupid + '/parentgroupid/' + parentGroupId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } updateReportGroupStatus(groupid, statusId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/updatereportgroupstatus/reportgroupid/' + groupid + '/statusid/' + statusId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportById(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/report/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportByUniqueId(uniqueid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportbyuniqueid/' + uniqueid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReportByUniqueIdEncoded(encodedUniqueId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportbyuniqueidencoded/' + encodedUniqueId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReports() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getallreports'; var reports; return yield this.dataHelper().getAsync(url).then(function (response) { reports = JSON.parse(response.result); return reports; }); }); } getReportCategoriesByReportId(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportcategories/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getReportInfo(repObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportinfo'; return yield this.dataHelper().postAsync(url, repObj).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getFullReportInfo(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = `apis/v4/unibase/platform/analytics/getfullreportinfo/${reportid}`; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getSubReports(reportid) { return __awaiter(this, void 0, void 0, function* () { let term = null; const url = 'apis/v4/unibase/platform/analytics/subreports/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result) response.result = JSON.parse(response.result); return response; }); }); } getSubReportById(reportid) { return __awaiter(this, void 0, void 0, function* () { let term = null; const url = 'apis/v4/unibase/platform/analytics/subreportsbyid/subreportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result) response.result = JSON.parse(response.result); return response; }); }); } saveReport(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/report'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } deleteReport(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletereport/reportid/' + reportid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getColumns(reportid) { return __awaiter(this, void 0, void 0, function* () { let term = null; const url = 'apis/v4/unibase/platform/analytics/reportcolumns/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getIsContactReportColumns(reportid) { return __awaiter(this, void 0, void 0, function* () { let term = null; const url = 'apis/v4/unibase/platform/analytics/getiscontactreportcolumns/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getReportColumnsByAppId(installedAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getreportcolumnsbyappid/installedappid/' + installedAppId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getReportColumnByAliasName(reportid, aliasName) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getreportcolumnbyaliasname/reportid/' + reportid + '/aliasname/' + aliasName; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getDataLists() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/datalists/getallnoninternaldatalists'; var dataList; return yield this.dataHelper().getAsync(url).then(function (response) { dataList = JSON.parse(response.result); return dataList; }); }); } getDataListColumns(datalistid, term, parameters) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/datalistcolumns/datalistid/' + datalistid + '/term/' + term + '/parameters/' + parameters; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getTableData(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportpreviewdata'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { return response; }); }); } getTenureData(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/tenuredata'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { return JSON.parse(response.result); }); }); } getReportNamesByGroup(reportgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reports/reportgroupid/' + reportgroupid; var reportDetails; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshReports() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/refreshreports/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } getHeaderColumns(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/headers/reportid/' + reportid; var headers; return yield this.dataHelper().getAsync(url).then(function (response) { headers = JSON.parse(response.result); return headers; }); }); } getDynamicFilterData(reportid, columnname) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/dynamicfilterdata/reportid/' + reportid + '/columnname/' + columnname; var dynamicfilters; return yield this.dataHelper().getAsync(url).then(function (response) { dynamicfilters = JSON.parse(response.result); return dynamicfilters; }); }); } getDynamicFilterCascadingData(dynamicFilObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/dynamicfiltercascadingdata'; return yield this.dataHelper().postAsync(url, dynamicFilObj).then(function (response) { return response; }); }); } getDynamicFilters(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/dynamicfilters/reportid/' + reportid; var commonfilters; return yield this.dataHelper().getAsync(url).then(function (response) { commonfilters = JSON.parse(response.result); return commonfilters; }); }); } getReportViewerData(repObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/tabledata'; return yield this.dataHelper().postAsync(url, repObj).then(function (response) { return response; }); }); } getReportCount(repObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/tablecount'; return yield this.dataHelper().postAsync(url, repObj).then(function (response) { return response; }); }); } getDistinctColumnData(datalistid, columnname, aggregationtypeid, fromdate, todate) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/distinctcolumndata/datalistid/' + datalistid + '/columnname/' + columnname + '/aggregationtypeid/' + aggregationtypeid + '/fromdate/' + fromdate + '/todate/' + todate; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result) { response.result = JSON.parse(response.result); } return response.result; }); }); } startDownloadLargeFile(repObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/downloadreportlargefile'; return yield this.dataHelper().postAsync(url, repObj).then(function (response) { return response; }); }); } deleteDynamicFilter(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletedynamicfilter/reportid/' + reportid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getCommonFilters(portletid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/commonfilters/portletid/' + portletid; var commonfilters; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "") commonfilters = JSON.parse(response.result); return commonfilters; }); }); } getCommonFilterColumns(portletid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/commonfiltercolumns/portletid/' + portletid; var commonfiltercolumns; return yield this.dataHelper().getAsync(url).then(function (response) { commonfiltercolumns = JSON.parse(response.result); return commonfiltercolumns; }); }); } getCommonFilterColumnsByCommonFilterId(commonfilterid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/commonfiltercolumnsbycommonfilterid/commonfilterid/' + commonfilterid; var commonfiltercolumns; return yield this.dataHelper().getAsync(url).then(function (response) { commonfiltercolumns = JSON.parse(response.result); return commonfiltercolumns; }); }); } getCommonFiltersByWidgetId(widgetid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/commonfiltercolumnsbywidgetid/widgetid/' + widgetid; var commonfiltercolumns; return yield this.dataHelper().getAsync(url).then(function (response) { commonfiltercolumns = JSON.parse(response.result); return commonfiltercolumns; }); }); } getCommonFilterColumnData(cfObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/commonfiltercolumndata'; return yield this.dataHelper().postAsync(url, cfObj).then(function (response) { return response; }); }); } getCommonFilterTreeData(cfObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getcommonfiltertreedata'; return yield this.dataHelper().postAsync(url, cfObj).then(function (response) { return response; }); }); } deleteCommonFilterColumnId(commonfiltercolumnid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletecommonfiltercolumn/commonfiltercolumnid/' + commonfiltercolumnid; return yield this.dataHelper().postAsync(url, commonfiltercolumnid).then(function (response) { return response; }); }); } deleteCommonFilter(commonfilterid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletecommonfilter/commonfilterid/' + commonfilterid; return yield this.dataHelper().postAsync(url, commonfilterid).then(function (response) { return response; }); }); } exportCommonFilter(commonfilterid, portletId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportcommonfilters/commonfilterid/' + commonfilterid + "/portletid/" + portletId; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } exportReports() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportreports/'; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } exportreport(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportreport/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getReportRoles(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/reportroles/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } addReportRole(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/savereportrole'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } removeReportRole(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/removereportrole'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } setViewable(reportId, viewAll) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/setasviewable/reportid/' + reportId + '/viewall/' + viewAll; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } saveReportRoleSettings(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/savereportrolesetting'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshStaticObj(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/refreshstaticreportobj/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } saveDynamicFilter(reportid, array) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/savedynamicfilter/' + reportid + "/List"; return yield this.dataHelper().postAsync(url, array).then(function (response) { return response; }); }); } updateReportStatus(reportid, statusid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/updatereportstatus/reportid/' + reportid + "/statusid/" + statusid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } duplicateReport(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/duplicatereport'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } exportDynamicFilters(reportId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportdynamicfilters/reportid/' + reportId; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new ReportManager(); return this._instance; } } Managers.ReportManager = ReportManager; })(Managers = Analytics.Managers || (Analytics.Managers = {})); })(Analytics = Platform.Analytics || (Platform.Analytics = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));