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 ViewerManager extends Platform.Core.BaseManager { getTemplateViews() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/templateviews'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getTemplateView(templateviewid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/templateview/' + templateviewid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getReportTemplate(ReportId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/templateview/reportid/' + ReportId; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getSubTemplate(templateviewid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/subtemplates/templateviewid/' + templateviewid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } saveTemplateView(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/templateview'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } deleteTemplate(templateviewid, reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deletetemplateview/templateviewid/' + templateviewid + '/reportid/' + reportid; return yield this.dataHelper().postAsync(url, templateviewid).then(function (response) { return response; }); }); } getTemplates(templateNames) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/gettempates/tempatenames/' + templateNames; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getCalendarView(calendarviewid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/calendarview/' + calendarviewid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } saveCalendarView(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/calendarview'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } getMapView(mapviewid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/mapview/' + mapviewid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } saveMapView(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/mapview'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } getCardView(CardViewId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/cardview/' + CardViewId; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getCardViewerData(repObj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/kanban'; return yield this.dataHelper().postAsync(url, repObj).then(function (response) { return JSON.parse(response.result); }); }); } saveCardView(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/cardview'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } getReportViewerTypes(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/viewertypes/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } deleteViewer(reportid, viewerid, viewertypeid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/deleteviewer/reportid/' + reportid + "/viewerid/" + viewerid + "/viewertypeid/" + viewertypeid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } updateViewerStatus(viewerid, viewertypeid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/updateviewerstatus/viewerid/' + viewerid + "/viewertypeid/" + viewertypeid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getViewer(viewerid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getviewer/viewerid/' + viewerid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getViewerRoles(viewerid, reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getviewerroles/viewerid/' + viewerid + '/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } addViewerRole(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/saveviewerrole'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } removeViewerRole(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/removeviewerrole'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } setViewable(viewerid, viewAll, viewerTypeId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/setasviewerviewable/viewerid/' + viewerid + '/viewall/' + viewAll + '/viewerTypeId/' + viewerTypeId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } exportViewers(viewerId, reportId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/exportreportviewers/reportid/' + reportId + '/viewerid/' + viewerId; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new ViewerManager(); return this._instance; } } Managers.ViewerManager = ViewerManager; })(Managers = Analytics.Managers || (Analytics.Managers = {})); })(Analytics = Platform.Analytics || (Platform.Analytics = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));